Here are the prerequisites for monitoring Apache with service templates:
- Apache-Data-Rate
- Apache-Requests-Rate
- Apache-Busy-Idle-Workers
On the Apache server activate the mod-status with the command :
a2enmod status
Restart or reload Apache if necessary.
To limit access to your domain (e.g. example.com), you need to add the following entry in the Apache configuration file : httpd.conf or apache2.conf :
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from .example.com
You can now access your Apache usage statistics from the URL :
http
://example.com/server-status
Resources : http://httpd.apache.org/docs/2.2/mod/mod_status.html
Here are the pre-requisites for Apache monitoring using the template:
- Apache-Slow-Requests
Modify the Apache log file configuration to add the length of time in seconds to serve the request (%T in the LogFormat directive) as the last column.
For example:
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %T" combined