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

Periodically, Apache2 is becoming unresponsive (not serving pages) and when I try to restart the daemon, it fails:

[root@ar9 httpd]# service httpd reload
Reloading httpd:                                           [FAILED]
[root@ar9 httpd]# service httpd status
httpd.event is stopped
[root@ar9 httpd]# service 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]

Apache is failing to bind port 80 because some of the old processes are still running:

[root@ar9 httpd]# ps aux | grep httpd
root      1809  0.0  0.0 185304  5844 ?        Ss   01:23   0:00 /usr/sbin/httpd.event
apache    1811  0.0  0.0 184988  2896 ?        S    01:23   0:00 /usr/sbin/httpd.event
apache    1812  2.4  1.0 3003180 176952 ?      Sl   01:23   0:19 /usr/sbin/httpd.event
apache    3587  0.1  0.1 1622392 29860 ?       Sl   01:33   0:00 /usr/sbin/httpd.event
root      4155  0.0  0.0 103244   828 pts/0    S+   01:36   0:00 grep httpd

There's not much to go on in the logs: I did increase the MaxClients setting as recommended in this snippet, but I must stress that the message is atypical: similar crashes occurred several times before, without hitting the MaxClients limit. Also note that the SIGTERM is sent by Monit as it tries in vain to restart Apache.

[Tue May 28 14:26:17 2013] [notice] Apache/2.2.15 (Unix) DAV/2 mod_fcgid/2.3.7 mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
[Tue May 28 15:33:55 2013] [warn] mod_fcgid: process 3086 graceful kill fail, sending SIGKILL
[Tue May 28 15:33:55 2013] [warn] mod_fcgid: process 3250 graceful kill fail, sending SIGKILL
[Tue May 28 16:41:10 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Tue May 28 17:03:09 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue May 28 17:03:09 2013] [notice] Digest: generating secret for digest authentication ...
[Tue May 28 17:03:09 2013] [notice] Digest: done
[Tue May 28 17:03:09 2013] [notice] Apache/2.2.15 (Unix) DAV/2 mod_fcgid/2.3.7 mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
[Tue May 28 19:28:11 2013] [warn] child process 6818 still did not exit, sending a SIGTERM
[Tue May 28 19:28:13 2013] [warn] child process 6818 still did not exit, sending a SIGTERM
[Tue May 28 19:28:15 2013] [warn] child process 6818 still did not exit, sending a SIGTERM
[Tue May 28 19:28:17 2013] [error] child process 6818 still did not exit, sending a SIGKILL
[Tue May 28 19:28:18 2013] [notice] caught SIGTERM, shutting down
[Tue May 28 19:28:18 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue May 28 19:28:19 2013] [notice] Digest: generating secret for digest authentication ...
[Tue May 28 19:28:19 2013] [notice] Digest: done
[Tue May 28 19:28:19 2013] [notice] Apache/2.2.15 (Unix) DAV/2 mod_fcgid/2.3.7 mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
[Tue May 28 22:21:09 2013] [warn] mod_fcgid: cleanup zombie process 7618
[Tue May 28 23:49:49 2013] [warn] mod_fcgid: cleanup zombie process 23629

I've verified permissions on the logs, and tried changing the MPM settings even though it doesn't look like an MPM config issue. Does anyone have any ideas? Where should I start digging?

share|improve this question
    
Wild guess: mod_php and some script doing something PHP won't interrupt. –  DerfK May 29 '13 at 20:17
    
The first place to start digging is usually the log files (error log)... –  voretaq7 May 29 '13 at 20:20
    
coretaq7: D'oh, I forgot to paste that in. Apologies. –  Sudowned May 29 '13 at 23:42
    
DerfK: Afraid not. Using fcgid, not mod_php - and I've never seen PHP hang up that way in any case. –  Sudowned May 29 '13 at 23:43
    
well, the log says that mod_fcgid is hanging, in any case –  Jenny D May 30 '13 at 13:52

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.