Cron Script to Restart Apache/MySQL on Crash (Centos/RHEL)

If you need to auto restart Apache and MySQL in case one or both are crashed, just schedule this SH script on Centos (RHEL) in your cron section.

Save the code section below as restart_apache_mysql.sh in your home directory.
Give the file permissions, so root can execute the script and schedule it in Cron.

 

 

In Webmin, you can schedule above script to run every minute, as follows:

Enjoy.



Facebook Comments