I have removed apache from my ubuntu 18.04 including all its config files using apt purge apache2. Browser still show default page on doing localhost:80. Please explain ?

  • Try clearing temporary data like cache, cookie or try in incognito/private browsing
    – Kulfy
    Sep 30, 2018 at 21:42
  • Find out which process is serving port 80: sudo lsof -i tcp:80, and kill it.
    – waltinator
    Sep 30, 2018 at 23:29
  • Can you share the command you used to remove Apache? It's possible it wasn't removed correctly. Sep 30, 2018 at 23:59
  • @waltinator: this doesn't show any process running, but browser still serves local apache page, after restarting the browser.
    – Rahul
    Oct 1, 2018 at 0:11
  • 2
    Possible duplicate of Permanently removing apache2
    – muru
    Oct 1, 2018 at 1:36

2 Answers 2


If you run this command and it shows a running Apache2 server, you still have a web server installed:

sudo service apache2 status

It's also possible you have a different web server installed and running, such as lighttpd or nginx. Likewise you can check if they are running:

sudo service lighttpd status
sudo service nginx status

You can also try removing all of the packages associated with them this way:

sudo service apache2 stop
sudo service lighttpd stop
sudo service nginx stop
sudo apt remove apache2 apache2-bin
sudo apt remove lighttpd
sudo apt remove nginx

If for some reason you still have a HTTP server running consider looking at:

which apache2
which lighttpd
which nginx

To see if any files are located in /usr/local or /opt - in which case you have to delete them manually.

You can also find which command specifically is using port 80 using this:

sudo netstat -plnt | grep ':80'

Even after uninstalling apache2 it kept showing the default page. I tried rebooting, but nothing worked, until I cleared the cache and cookies of the Browser

So, try and clear your browser's cache & cookies.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .