Default Apache page shows up on localhost:80 even after "stopping" apache2 service

I'm running apache2 on Ubuntu 12.10. When I use the command "service apache2 status" and it reports that apache is NOT running, the apache default web page continues to run on port 80 for some reason. In my sites-available folder, I have a python-based app which is assigned to port 80, but when I reload & restart the Apache2 service and type localhost in the browser it continues to run the default page.

How can I get rid of whatever apache2 is running on port 80?


Solution 1:

you can double check that there are no process still running by do something like this: -

ps aux | grep apache

if apache2 is still running it will display results

kill them using

sudo killall apache2

You will need to determine why the process went rouge from the init control. this can happen if you are running a very busy apache server, it will indicate that there is some performance related issue but the reason for this are many.

check that there are no other web applications running that might be starting apache2 or even a mod version httpd manually with a /usr/sbin/apache2 -d statment. I doubt it though as you would more likely incur port locking issues especially if both using standard ports

of course what are the apache logs saying?

Solution 2:

For others who land up here from Google, try running sudo netstat -lnp to check which process is listening at port 80

I had a similar problem and found that it was actually Nginx that was running on port 80 and picking up the Apache default page! This post helped figure it out.