Filename: checkapache
#!/bin/sh
run=`ps ax | grep httpd | grep -v grep | cut -c1-5 | paste -s -`
if [ "$run" ];
then
echo "Apache is running"
else
apachectl start
fi
Save that file and make it executable to only root. (chmod 700, with root as the owner). Then edit your crontab by typing crontab -e, and enter this line:
/10 * * * * /path/to/file/checkapache 1> /var/log/apachecheck.log 2>/dev/null
I put the output to the log just as a record; it's overwritten every 10 minutes and errors go to /dev/null. You could remove that bit and allow your cron job to notify you if there is an error. Hope this helps someone; it keeps me from being woken up at 4am!

