Some times there would be a need to completely uninstall apache by removing all dependencies and deleting all configurations.
Below instructions would help you do that.
These should work on ubuntu/debian/raspberry pi or any system where apt based package manager.
sudo systemctl stop apache2
sudo systemctl disable apache2
sudo apt purge apache2 apache2-utils apache2-bin apache2.2-common -y
sudo apt autoremove --purge -y
sudo rm -rf /etc/apache2
sudo rm -rf /var/log/apache2
sudo dpkg -l | grep apache2
Leave a Reply