3 Simple steps to Apache Monitoring

If you’re reading this, you know you should be monitoring your Apache web servers. (You want to know if they are approaching limits of configured server workers; you want to know how many requests you are serving; you want to ensure availability, etc).  Fortunately, enabling Apache monitoring is quite simple.

Make sure you are loading the mod_status module.

If you are using a version of Apache that was installed by your OS’s package manager, there are OS specific ways to enable modules.

For Ubuntu/Debian:

/usr/sbin/a2enmod status

For Redhat/Centos: Just uncomment the line:

LoadModule status_module modules/mod_status.so

in /etc/httpd/conf/httpd.conf
For Suse derivatives:
add “status” to the list of modules on the line starting with APACHE_MODULES= in /etc/sysconfig/apache2

Configure the Mod_status module

You want the following to be loaded in your apache configuration files.

ExtendedStatus On
<Location /server-status>
 SetHandler server-status
 Order deny,allow
 Deny from all
#Add LogicMonitor agent addresses here
 Allow from www.logicmonitor.com 192.168.10.10
</Location>

Where you set that configuration also changes depending on your Linux distribution.
/etc/apache2/mods-available/status.conf on Ubuntu/Debian
/etc/httpd/conf/httpd.conf on Redhat/CentOs
/etc/apache2/mod_status.conf on OpenSuse/SLES
Finally, restart apache using your OS startup script ( /etc/init.d/httpd restart or /etc/init.d/apache2 restart). Note that using the OS startup script is often necessary to allow the OS specific script files to assemble the final apache config. Sending apache signals, or using apache2ctl, does not do this.

3. Watch the monitoring happen.

If you are using LogicMonitor’s Apache monitoring, then you’re done.  LogicMonitor will automatically detect the Apache web server, and apply appropriate monitoring and alerting, as well as alerting and graphing on the rest of the system, so you can correlate CPU, interface and disk load to Apache load.

One thing you may want to customize is your dashboards – add a widget that collects all Apache requests/second, from all hosts, or all production hosts, and aggregates them into a single graph.  Using LogicMonitor’s flexible graphs, the graph will automatically include new servers as you add them.

Apache Requests per second

Want to make your Apache monitoring simple? Check out LogicMonitor for monitoring that automates your monitoring setup.