= monit #apt-get install monit #vim /etc/monitrc set daemon 120 set logfile syslog facility log_daemon set mailserver 127.0.0.1 from: monit@test.com subject: $SERVICE $EVENT at $DATE message: Monit $ACTION $SERVICE at $DATE on $HOST. Yours sincerely, monit } check process apache2 with pidfile /var/run/apache2.pid group www-data start program = "/etc/init.d/apache2 start" stop program = "/etc/init.d/apache2 stop" if failed host 127.0.0.1 port 80 protocol http then restart if 5 restarts within 5 cycles then timeout #vim /etc/default/monit startup=1 #/etc/init.d/monit restart