Networking / Beginners

Monitoring Your Server

Apache provides tools to monitor the status of your server and logs that keep a history of how the system is used and how it performs over time.

One of these tools is the server-status monitor. To use this monitor, it must either be compiled into httpd or installed as a dynamically loadable module.

The following two lines from the Red Hat httpd.conf configuration file load the required module:

LoadModule status_module 	modules/mod_status.so
AddModule mod_status.c

To get the maximum amount of information from the server-status display, add the ExtendedStatus directive to your httpd.conf file. By default, it is commented out of the Red Hat configuration. Remove the hash mark (#) to active this directive; for example:

ExtendedStatus on

Enable the monitor by locating the Location /server-status container directive in the httpd.conf file and removing the hash marks to activate the directives in that container. Edit the Allow from directive to control access to the server status screen. For example, you might grant access to the localhost or to all hosts in your domain. Listing below shows the uncommented container after it has been configured to allow access from all hosts in the example.org domain.

The Server-Status Location Container
<Location /server-status>
SetHandler server-status
order deny,allow
deny from all
allow from example.org
</Location>

After the monitor is installed and enabled, access it from a browser at www.example.org/server-status/?refresh=20. The refresh value is not required, but when used, the status display is automatically updated. In Listing previous, we ask for a status update every 20 seconds.

Monitoring tells you about the real-time status of your server, but even more can be learned by looking at the way your server is used over time. Logging provides that information.

[Previous] [Contents] [Next]