uninstall and remove Apache2 on Ubuntu or Debian

sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove

Finally, check if there is any configuration files or manual pages belonging to Apache2, which are still not removed.

whereis apache2

Directory and any configuration files in it is no longer necessary, so go ahead and remove it manually.