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.

Apache not restarting auto

Discussion in 'EasyApache' started by web12, Jan 18, 2003.

  1. web12

    web12 Well-Known Member

    Joined:
    Nov 20, 2002
    Messages:
    240
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    Got a funny problem here... Apache keeps going out on one of my servers during the night, with no explanation. All that is needed each time is to restart Apache, but surely it should be doing this itself?

    Woke up this morning to a few angry emails, but i can not find the problem.

    Anyone got any suggestions please?
     
  2. scottaxa

    scottaxa Member

    Joined:
    Jul 9, 2002
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    yeap, i have this too. there seems to be no pattern. i do a manual restart and it works fine, the problem is i need to sleep so can't be here to do it all day lol

    smit
     
  3. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    Sounds to me like your chkservd program is not running, and if it is you may not have the file setup to restart apache if chkservd finds that it's down.

    1) SSH into root and do this:

    ps -aux

    Look under the COMMAND heading for the word &chkservd&. If you don't see that in there then it may not be running. You can also do this:

    /etc/rc.d/init.d/chkservd status

    If it's not running then do this:

    /etc/rc.d/init.d/chkservd start


    Now check to see if you have the necessary file to restart apache automatically if it fails... Go to the following directory on your server:

    cd /etc/chkserv.d

    That directory has files in it that chkservd uses to check the various services that are supposed to be up and running. You should see a file in there named &apache&. If you don't see one that could be the problem. If you don't have it then do this:

    vi apache

    Once inside the new file insert the following:

    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND
    service[apache]=80,GET / HTTP/1.0,HTTP/1..,/scripts/checkmaxclients;killall -TERM httpd;sleep 2;killall -9 httpd;/etc/rc.d/init.d/httpd stop;/etc/rc.d/init.d/httpd start;/usr/local/apache/bin/apachectl start


    I'm not an expert at this stuff, but I had numerous problems with chkservd early on. My problem was, and still is, that chkservd stops running for some unknown reason. When the checking program stops and services go down they are not restarted. I finally created a little script that checks the status of chkservd and restarts it if it's down.

    Hope that will help.
     
Loading...

Share This Page