Monitor Apache HTTPD server in real-time

Q I have recently started a small design business and am now hosting a number of sites for my clients on my dedicated Red Hat Enterprise Linux 3 server. As I have numerous access_log files scattered all over the filesystem, what's the easiest way to keep a real-time view of what's going on with the HTTPD web server? If I use top, I can see several HTTPD processes consuming a fair bit of CPU, but I don't know how to associate these processes with a particular website.

A The HTTPD server on RHEL 3 comes pre-packaged with mod_status, which is an Apache module for monitoring how the web server is performing. To enable it, open up /etc/httpd/conf/httpd.conf and uncomment the following lines:

<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from desktop.ip
</Location>

To obtain a full status report, also uncomment this line:

ExtendedStatus On

After restarting the HTTPD server, you can browse http://server.ip/server-status?refresh=5. This will display an HTML page that refreshes every five seconds, providing you with the following information:

(Quoted directly from http://httpd.apache.org/docs/2.0/mod/mod_status.html.) It is also good practice to keep this information restricted to specific hosts, as a lot of information is revealed about your HTTPD server through this module. Leaving the default Deny From All and then opening up access with Allow From Desktop.ip will ensure that only authorised hosts are permitted to view this information.

Back to the list