web12

Well-Known Member
Nov 20, 2002
240
0
166
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?
 

scottaxa

Member
Jul 9, 2002
6
0
151
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
 

nitromax

Well-Known Member
Feb 12, 2002
189
0
316
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.