Got Blorped?

Tech Blog

Monit configuration file for Apache2

without comments

Config file for Apache2 on Monit based

This howto is based after you have completed this install guide at SecureCentos.com

Step 1: Create /etc/monit/cfg/apache2.cfg

nano -w /etc/monit/cfg/apache2.cfg

Step 2: Paste this text into apache2.cfg

check process httpd with pidfile /var/run/httpd.pid
   group apache
   start program  "/etc/init.d/httpd start"
   stop program  "/etc/init.d/httpd stop"
   if failed host localhost port 80 protocol http
      and request "/" then alert
   if cpu is greater than 60% for 2 cycles then alert
   if cpu > 80% for 5 cycles then restart
   if children > 250 then restart
   if loadavg(5min) greater than 10 for 8 cycles then alert
   if 3 restarts within 5 cycles then timeout

* You should verify every path string, so it matches your system *

Step 3: Restart Monit to activate new config

service monit restart

Note: you need this line in your monitrc file to make the howto above to work.

include /etc/monit/cfg/*

Written by admin

August 9th, 2009 at 1:26 am

Posted in Monit

Leave a Reply