Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I made an image of one of my private Amazon EC2 image that runs one website, then started installing redmine. After all the installation is done, it is about to restart Apache I encountered the following issue(sorry you might have to zoom in to see the screenshot): enter image description here

My understanding of what was happening is that apache2 is not running but it is listening to port 80. Then I tried: enter image description here which gives the same confusing but consistent conclusion, apache2 is not running, but I am sure it is process 18304 which is apache2 listening to port 80. Eventually, I had to kill the process and restart apache which worked. Could someone explain to me what might have caused this and a fix?


Following synthesizerpatel suggestion to use lsof. enter image description here This is exactly the same problem with different process as before.

share|improve this question

migrated from Jan 9 '12 at 2:28

This question came from our site for professional and enthusiast programmers.

Sometimes when you stop apache (or any other program) the script can't properly shut down the program because it waits for something (for example IO) but deletes the pid file. So the script beleives that apache is not running because there is no pid file but apache is runs, or sometimes not really rund but stuck in and sits on the port.

In these cases you have to kill the process and you can start the program. I have seen many this kind of stuck processes from apache, slapd, cirus, ... sometimes it happens.

share|improve this answer

Try running

lsof -n | grep TCP 

Also.. the apache2 controller isn't always the most reliable, it just checks for a PID file, not the actual process.

ps -aef | grep httpd

$1 says you've still got an httpd running.

share|improve this answer

As the poster says above, use

lsof -n | grep TCP


lsof -n | grep "*:www"

Also, in Ubuntu, it uses the process name "apache2" so you should be checking for it with

ps -ax |grep apache

Instead of grep httpd

share|improve this answer


ps aux|grep apache

Do you see

/usr/share/apache2/ask-for-passphrase localhost:443 RSA

If so

One of the sites containes an SSL certificate with a passphrase. So when apache was trying to start at boot time it could not continue without someone manually entering the passphrase.

So you have two options to fix this problem:

  1. Add a SSLPassPhraseDialog directive to your config.

  2. Remove your passphrase (Less secure)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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