Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I got some problems restarting Apache with 2000 virtual hosts.

I use Apache 2.2.22 + PHP 5.4.6 on CentOS 5.8 64-bit.

When I try to restart it displays this:

    /etc/init.d/httpd restart
Stopping httpd:                                       [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

When I do killall -9 httpd it ok then for some time and then it happens again :/

share|improve this question
    
In CentOS, you can just use the service command to stop|start|reload|restart|graceful, etc. E.g. service httpd restart. Just FYI. –  nojak Aug 25 '12 at 19:14
add comment

2 Answers

up vote 1 down vote accepted

It looks to me as if Apache wasn't running to begin with, at least not under the PID that the init script started it under. Check (or provide here) the output of "ps auxwww".

My strongest intuition says that your apache root process is dying, leaving the children alive and listening on port 80. If so, look in your apache error log, and the system logs, to see what is killing the root process.

Other possibilities: you might have something else starting apache manually outside of the init script, or something else might be listening on port 80 (but that wouldn't explain why killall -9 httpd works).

share|improve this answer
    
So far it's ok now: /etc/init.d/httpd start Starting httpd: and so do not display anything which means it's up and running :) –  Spacedust Aug 24 '12 at 20:20
add comment

It was package issue. I've got httpd from webtactic repo. Changed to the one from Lxcenter and working very well ;)

share|improve this answer
add comment

Your Answer

 
discard

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.