How to remove apache and its dependencies the right way

In this quick tutorial, I will show you how to completely delete apache2 off of your linux box. I am using Ubuntu 12.04 and 13.04 (have to remove off both) for this tutorial.

Apache is usually installed by default when you get a new VPS or dedicated server, so we will undo that.

Stop the service

First we need to stop apache, so execute the following:

sudo service apache2 stop

There, now that it is stopped we can move on to removing it.

Removing apache and all of its dependencies

Now to remove most of the dependencies execute the following command:

sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common && sudo apt-get autoremove –purge

After that is done, we will just do a quick check to see if apache is still lingering around.

whereis apache2

You most likely will get a few results. So, the final step awaits!

Cleaning up

Now we can finally purge the rest of the demon. Execute the following:

sudo rm -Rf /etc/apache2 /usr/lib/apache2 /usr/include/apache2

…and now we should be all clean.

You can go ahead now and install your web server of choice! Nginx perhaps?

How To | Reference


QR Code
QR Code how_to_completely_remove_apache_from_your_linux_server (generated for current page)