~ 1 min read

More Munin monitoring – track apache web server health

share this story on
Using mod_status plugin for apache and munin to track apache health

Monitoring apache

Monitoring internal apache information is useful if you’re using it to serve your web application requests. It has an internal module which you can load (and probably loaded by default already) called mod_status. To add monitoring for apache you need to enable mod_status module and uncomment the /server-status directory.

If you’re working with an .htaccess that overrides the vhost/normal configuration you probably also need to skip re-writing the url if the /server-status is request so add the following rule to the .htaccess file:

RewriteCond %{REQUEST_URI} !=/server-status

and make sure the following is in httpd.conf:

ExtendedStatus On

SetHandler server-status
Order deny,allow
Deny from all
Allow from XX.YY
Allow from 127.0.0.1

With munin and the bundled apache plugin for it, you get the following metrics for free:
apache_1

Side-note - on some installs, like on my RHEL5, there’s a bug which will spam you with emails (if you configured those to work and being processed through a mail server). The bug is fairly described here https://253965.bugs.gentoo.org/attachment.cgi?id=177568 and to amend this you will need to apply the following patch: http://phil.ro/patches/munin_1.3.4-r1_utf8.patch