4

I installed a LAMP stack with the following commands:

$sudo apt-get install apache2 php5 libapache2-mod-php5
$sudo service apache2 restart
$sudo apt-get install mysql-server mysql-client php5-mysql

Full instructions.

Anyway, I found that Apache isn't the most lightweight server out there, and I found Nginx. So, naturally, I tried uninstalling Apache:

$sudo apt-get purge apache2

I even tried stopping the service before and rebooting afterwards. It goes through the remove process fine, but the service stays there. If I run that command again, it will say that Apache is uninstalled. I've tried uninstalling all of these packages: apache2 php5 libapache2-mod-php5, but, whenever I reboot and go to my Pi's IP, I always get the Apache welcome file.

I then thought that it would be an issue of another web server was handling the Apache file. However, I can still stop the page from loading with sudo service apache2 stop. Why is this happening/how can I fix this?

Anonymous Penguin
  • 303
  • 1
  • 4
  • 19
  • should have used remove command instead of purge – lenik Jul 22 '14 at 23:31
  • 2
    @lenik That doesn't seem to be true. From the man apt-get page: purge is identical to remove except that packages are removed and purged (any configuration files are deleted too). Why would removing the configuration files not uninstall a package? Am I overlooking something? – Anonymous Penguin Jul 23 '14 at 00:07
  • 1
    Are you sure Apache is serving the Apache welcome HTML? Perhaps your new web server is. – joan Jul 23 '14 at 03:35
  • @joan read the last paragraph – Anonymous Penguin Jul 23 '14 at 11:28

2 Answers2

7

Try sudo apt-get --purge remove apache2 and then sudo apt-get autoremove. I had that same thing with emacs due to it installing other dependencies. emacs would still be there after --purge remove. Autoremove helped removing the dependencies which were installed with emacs.

Ghanima
  • 15,855
  • 15
  • 61
  • 119
-2

If these commands don't work:

$ sudo apt-get install apache2 php5 libapache2-mod-php5
$ sudo service apache2 restart
$ sudo apt-get install mysql-server mysql-client php5-mysql  

Try this:

$ sudo apt-get install apache2 php libapache2-mod-php
$ sudo service apache2 restart
$ sudo apt-get install mysql-server mysql-client php-mysql
Aurora0001
  • 6,308
  • 3
  • 23
  • 38
Dodo
  • 1