The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

httpd failed - automagic restart doesn't work.

Discussion in 'General Discussion' started by jamesbond, May 15, 2006.

  1. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    In the past months apache reached the maxclients setting (150) a couple of times (because of agressive spiders)

    Whenever that happens I get a message like this:

    httpd failed @ Mon May 14 06:42:54 2006. A restart was attempted automagicly.

    However, the attempted httpd restart doesn't seem to be working. I always end up having to restart it manually (either through ssh or whm).

    This is what I found in the chkservd.log:

    [Mon May 14 06:42:54 2006] Service check ....cpsrvd [+]...exim [+]...eximstats [+]...ftpd [+]...httpd [TIMEOUT!!!! on send
    -Notifcation => user@domain.com via EMAIL [level => 3]
    Restarting httpd....
    /etc/rc.d/init.d/httpd start: httpd (pid 27171) already running

    So the restart doesn't seem work because there is still an apache pid running, even though apache is not responding (because of the maxclients limit)

    It would be nice to get apache back online 'automagicly' in these cases as well.
     
  2. avijit

    avijit Well-Known Member

    Joined:
    Jul 26, 2004
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Try to kill all the httpd instances and then start it.


    Killall -9 httpd
    /etc/init.d/httpd start
     
  3. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    Restarting apache manually through SSH or WHM is not the problem. I was referring to the chkservd script which checks if all services are running, and tries to restart them if they are down.

    When apache reaches the maxclients limit and apache stops working, the chkservd script tries to restart apache but fails (which I outlined in the first post).
     
  4. avijit

    avijit Well-Known Member

    Joined:
    Jul 26, 2004
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    You may like to tweak the /etc/chkserv.d/httpd as per you want. May be replace the "killall -TERM httpd" with the "/bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null"
     
Loading...

Share This Page