Remove Apache2 from linux server

Here we are,

I’m leaving Apache for Nginx which is a faster asynchronous http server.
If you need more informations about it, please go here

So, to start with a clean base, I’ve had to first remove apache from my server, this is how to deal with it.

//Stop apache server
sudo service apache2 stop 

//Uninstall Apache2 and its dependent packages
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common

//By precaution
apt-get purge apache2

//remove any other dependencies that were installed with Apache2, but are no longer used by any other package
sudo apt-get autoremove

//Delete apache2 directory manually
sudo rm -rf /etc/apache2

Thank you for reading.

Remove Apache2 from linux server