**NOTE: As with all Tips and Tricks we provide on the IDMWorks blog, use the following AT YOUR OWN RISK. We do not guarantee this will work in your environment and make no warranties***
Monitoring Apache Web Servers
Why?
Monitoring the status of an Apache Web Server that is hosting your web based application is very useful in the following situations:
• To determine if your Web Server is accepting requests
• The number of connected clients, status of client workers, and requests per second
• Web Server up time and CPU load
How?
To monitor the Apache server during operation a simple modification can be used (and afterwards a browser can be connected to the status page on the Apache server to quickly access the results).
Steps:
Modify the httpd.conf file adding the following lines (change foo.com to the domain name where you will connect your browser to check for status):
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from .foo.com
</Location>
Access your web browser at http://{apache.server.name}/server-status?refresh=60.
This will provide a list of:
• The number of worker serving requests
• The number of idle worker
• The status of each worker, the number of requests that worker has performed and the total number of bytes served by the worker (*)
• A total number of accesses and byte count served (*)
• The time the server was started/restarted and the time it has been running for
• Averages giving the number of requests per second, the number of bytes served per second and the average number of bytes per request (*)
• The current percentage CPU used by each worker and in total by Apache (*)
• The current hosts and requests being processed (*)
