Remove apache2 from Ubuntu, step by step from bash
The short manual how to remove Apache 2 from Ubuntu with bash Linux command line. 4 steps. I advice you to execute all the commands with sudo.
Step 1. Stop the service
sudo service apache2 stop
Step 2. Uninstall apache2 services
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove
Step 3. Check where apache2 was installed
whereis apache2
Step 4. Apache2 by default is installed in /etc/apache2, so you should remove this directory:
sudo rm -rf /etc/apache2