Posted by: Mangesh_Linux_Administrator | August 18, 2010

Shell Script To Auto Restart HTTPD (If Goes Down)

Set con job for this script:
*/5 * * * * /path/to/ >/dev/null 2>&1
# for RHEL / CentOS / Fedora Linux restart command
RESTART="/etc/init.d/httpd restart"
#path to pgrep command
# Httpd daemon name
# find httpd pid
if [ $? -ne 0 ] # if httpd not running
 # restart httpd


  1. Hello there, just became aware of your blog through Google, and found that it is truly informative.
    I am going to watch out for brussels. I will be grateful if you continue
    this in future. Lots of people will be benefited from your
    writing. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: