3

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?

  • Are you sure apache is not running. What do your logs say? Is the python based app running it's own web server? More Information needed. – Drew Khoury Aug 14 '13 at 1:17
2

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?

1

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.

  • Processes listening on the ipv6 address :::80 actually listen on both ipv4 and ipv6. using the -4 parameter will NOT show these processes. – Gerald Schneider Jun 29 '17 at 12:43
0

Obviously, the apache web server is running. There init.d script is not really not all that smart and does not check that all httpd processes are NOT running after it issues its command and returning to your command prompt. You have to check to be sure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.