I remove apache from my machine following these steps:
sudo apt-get remove apache2*
sudo apt-get autoremove
sudo rm -Rf /etc/apache2
I was able to remove it successfully but when I tried to install it again I got this error:
/etc/init.d/apache2: 64: .: Can't open /etc/apache2/envvars /etc/init.d/apache2: 76: .: Can't open /etc/apache2/envvars ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars invoke-rc.d: initscript apache2, action "restart" failed. I tried to fix it whit this command
sudo apt-get --purge --reinstall install apache2
but I got the same error.
