Welcome to WebmasterWorld Guest from 18.104.22.168
But, I was wondering how I should be checking apache status? Should I make a request to some dummy file, or check the processes via ps -ef, etc? What is the easiest and fastest (hence least costly) way of doing this?
(or whatever your apache start file is)
do that and you'll get a result similar to
httpd (pid 13149 13103 13102 13101 13099 13098 13097 13095 13018 13017 13015 13014 13000 12963 12928 10986) is running...
If you run that command when it is down you'll get:
httpd is stopped
You could easily run the command and pipe and grep the output to detect either running or stopped. If stopped then issue an an httpd start.
An easier alternative is Webmin System and Server Status monitor. You can set the apache status to be checked every minute, hour, day and then run a command such as start apache, email you etc.
[edited by: Frank_Rizzo at 3:00 pm (utc) on Nov. 1, 2006]