mod_status.html revision 52a4de2f02f994ab073ef65fc760bc5899012a57
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder<html><head>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<title>Apache module mod_status</title>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder</head><body>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<!--#include virtual="header.html" -->
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<h1>Module mod_status</h1>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederThe Status Module is only available in Apache 1.1 and later.<p>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<h2>Function</h2>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederThe Status module allows a server administrator to find out how well
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maedertheir server is performing. A HTML page is presented that gives
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederthe current server statistics in an easily readable form. If required
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederthis page can be made to automatically refresh (given a compatible
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederbrowser). Another page gives a simple machine-readable list of the current
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederserver state.
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<p>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederThe details given are:
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<ul>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>The number of children serving requests
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>The number of idle children
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>The status of each child, the number of requests that child has
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederperformed and the total number of bytes served by the child (*)
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>A total number of accesses and byte count served (*)
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>The time the server was started/restarted and the
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maedertime it has been running for
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>Averages giving the number of requests per second,
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederthe number of bytes served per second and the average number
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederof bytes per request (*)
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>The current percentage CPU used by each child and in total by
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederApache (*)
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<li>The current hosts and requests being processed (*)
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder</ul>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederA compile-time option must be used to display the details marked "(*)" as
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederthe instrumentation required for obtaining these statistics does not
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederexist within standard Apache.
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<h2>Enabling Status Support</h2>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederTo enable status reports only for browsers from the foo.com
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederdomain add this code to your <code>access.conf</code> configuration file
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<pre>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder &lt;Location /server-status&gt;
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder SetHandler server-status
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder order deny,allow
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder deny from all
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder allow from .foo.com
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder &lt;/Location&gt;
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder</pre>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<p>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederYou can now access server statistics by using a Web browser to access the
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maederpage <code>http://your.server.name/server-status</code>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<h3>Automatic Updates</h3>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederYou can get the status page to update itself automatically if you have
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maedera browser that supports "refresh". Access the page
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder<code>http://your.server.name/server-status?refresh=N</code> to refresh the page
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maederevery N seconds.
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder<h3>Machine Readable Status File</h3>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederA machine-readable version of the status file is available by accessing the
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maederpage <code>http://your.server.name/server-status?auto</code>. This is useful
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maederwhen automatically run, see the Perl program in the <code>/support</code>
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maederdirectory of Apache, <code>log_server_status</code>.
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder<h2>Full Instrumentation</h2>
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder
ba904a15082557e939db689fcfba0c68c9a4f740Christian MaederTo obtain full statistics you must compile Apache with a special
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederdirective. On some machines there may be a small performance loss
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederif you do this. Try full statistics and see if you notice any
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederdifference. If you do please contact <a href="mailto:mark@ukweb.com">
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maedermark@ukweb.com</a> and tell me your configuration.
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<p>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian MaederDo this by adding the following to the AUX_CFLAGS line in the
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder"Configuration" file and then recompiling as usual.
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<pre>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder AUX_CFLAGS= (something) -DSTATUS
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder</pre>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder<!--#include virtual="footer.html" -->
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder</BODY>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder</HTML>
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder