HSLAB HTTP Monitor

ID #1026

Install mod_status

  1. Introduction

    The "apache-status" protocol provides a way to monitor the internal performance of an Apache web server, and to take action early (i.e. while the server is still working) if something is going wrong. It does this through Apache's mod_status, which needs to be available to use these special functions.

    The original development of the Apache-Status code was in response to a failure of Apache's piped logging process which caused a server to lock up. The server was in a chroot jail, and this prevented the piped logging process from re-starting itself. The original idea was to use Monit to observe Apache from outside the chroot, and take action if it spotted a problem. However, following development of the code it became clear that many other aspects of Apache can be monitored, whether it is in a chroot jail or not.

    Important: Since these tests uses mod_status, it depends on the Apache server being able to respond. It should therefore be combined with other monitoring to cover the case of a complete server or connection failure.The tests will all work with the ExtendedStatus directive On or Off.

  2. Install mod_status

    Apache normally compiles with mod_status enabled and built in. To access the status information the apache configuration file (often at /etc/httpd/httpd.conf or /usr/apache/conf/httpd.conf) should include these lines within one of your hosts or virtual hosts:

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

    The Allow statement ensures that mod_status is only available on the local machine, since it would be insecure to let everybody read the information. If Monit is connecting from a different IP number (i.e. if it is monitoring a remote machine) you should allow the IP from which Monit will connect.

  3. Test mod_status

    You can view the machine readable version of the Apache mod_status output for your server by entering the standard URL in a browser (Monit depends on this, rather than the human readable page):

    http://www.example.co.uk/server-status?auto

    This will only work from the allowed IP numbers mentioned in the section above. If everything is working well, you should see a page in your browser like the one below:

    	Total Accesses: 26
    Total kBytes: 13
    CPULoad: .0103093
    Uptime: 970
    ReqPerSec: .0268041
    BytesPerSec: 13.7237
    BytesPerReq: 512
    BusyWorkers: 1
    IdleWorkers: 5
    Scoreboard:
    ____W_...........................................................

Tags: -

Related entries:

Last update: 2006-12-22 02:08
Author: Oleg
Revision: 1.0

Digg it! Print this record Send to a friend Show this as PDF file
Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable