mod_status.html revision 52a4de2f02f994ab073ef65fc760bc5899012a57
a8c5a86d183db25a57bf193c06b41e092ec2e151Timo Sirainen<html><head>
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen<title>Apache module mod_status</title>
08d6658a4e2ec8104cd1307f6baa75fdb07a24f8Mark Washenberger</head><body>
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen<!--#include virtual="header.html" -->
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen<h1>Module mod_status</h1>
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo SirainenThe Status Module is only available in Apache 1.1 and later.<p>
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen<h2>Function</h2>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo SirainenThe Status module allows a server administrator to find out how well
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainentheir server is performing. A HTML page is presented that gives
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainenthe current server statistics in an easily readable form. If required
91e2dc36b9c0c91f0af716be81dc2aa6cbbed6c2Timo Sirainenthis page can be made to automatically refresh (given a compatible
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainenbrowser). Another page gives a simple machine-readable list of the current
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainenserver state.
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen<p>
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo SirainenThe details given are:
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen<ul>
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen<li>The number of children serving requests
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainen<li>The number of idle children
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen<li>The status of each child, the number of requests that child has
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainenperformed and the total number of bytes served by the child (*)
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen<li>A total number of accesses and byte count served (*)
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainen<li>The time the server was started/restarted and the
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainentime it has been running for
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen<li>Averages giving the number of requests per second,
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainenthe number of bytes served per second and the average number
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainenof bytes per request (*)
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen<li>The current percentage CPU used by each child and in total by
3313a51ef9b245248d672c20f930c52a577a42f7Timo SirainenApache (*)
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen<li>The current hosts and requests being processed (*)
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen</ul>
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen
3313a51ef9b245248d672c20f930c52a577a42f7Timo SirainenA compile-time option must be used to display the details marked "(*)" as
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainenthe instrumentation required for obtaining these statistics does not
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainenexist within standard Apache.
5c253723e8ef84cb71a80ced19efe597e8a90ea6Timo Sirainen
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainen<h2>Enabling Status Support</h2>
ee6df9526e9716b3f1734d85b566e00fc41208bcTimo Sirainen
ee6df9526e9716b3f1734d85b566e00fc41208bcTimo SirainenTo enable status reports only for browsers from the foo.com
cd75c360f244c96b9ee10e01ee3a66fad13183c8Timo Sirainendomain add this code to your <code>access.conf</code> configuration file
58bc77731bb25e900498a28409337e747f622722Timo Sirainen<pre>
c2f24d55319fad0b6c03425f402f0cb0cb1a318bTimo Sirainen &lt;Location /server-status&gt;
6fabfb7bbfd88d0c1de66981e52850f26067623bTimo Sirainen SetHandler server-status
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen order deny,allow
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen deny from all
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen allow from .foo.com
e9503210d3521a6833ed62dc332fc42ffb0e7a13Timo Sirainen &lt;/Location&gt;
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainen</pre>
b0e9375a1ff97c9c7d40655922af5ccc73ecaa76Timo Sirainen<p>
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo SirainenYou can now access server statistics by using a Web browser to access the
b0e9375a1ff97c9c7d40655922af5ccc73ecaa76Timo Sirainenpage <code>http://your.server.name/server-status</code>
b0e9375a1ff97c9c7d40655922af5ccc73ecaa76Timo Sirainen<h3>Automatic Updates</h3>
b0e9375a1ff97c9c7d40655922af5ccc73ecaa76Timo SirainenYou can get the status page to update itself automatically if you have
2e29e4797a48d78d669821722bdb54fd0a1d3b94Timo Sirainena browser that supports "refresh". Access the page
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen<code>http://your.server.name/server-status?refresh=N</code> to refresh the page
f08c6da58d4cffc5b4777485ebc475dff614e491Timo Sirainenevery N seconds.
f08c6da58d4cffc5b4777485ebc475dff614e491Timo Sirainen<h3>Machine Readable Status File</h3>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo SirainenA machine-readable version of the status file is available by accessing the
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainenpage <code>http://your.server.name/server-status?auto</code>. This is useful
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainenwhen automatically run, see the Perl program in the <code>/support</code>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainendirectory of Apache, <code>log_server_status</code>.
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen<h2>Full Instrumentation</h2>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo SirainenTo obtain full statistics you must compile Apache with a special
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainendirective. On some machines there may be a small performance loss
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainenif you do this. Try full statistics and see if you notice any
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainendifference. If you do please contact <a href="mailto:mark@ukweb.com">
1aad8ad0590bee2d09d5fdb5413af72e2a8e156aTimo Sirainenmark@ukweb.com</a> and tell me your configuration.
1aad8ad0590bee2d09d5fdb5413af72e2a8e156aTimo Sirainen
1aad8ad0590bee2d09d5fdb5413af72e2a8e156aTimo Sirainen<p>
91e2dc36b9c0c91f0af716be81dc2aa6cbbed6c2Timo Sirainen
91e2dc36b9c0c91f0af716be81dc2aa6cbbed6c2Timo SirainenDo this by adding the following to the AUX_CFLAGS line in the
e9371f899a3d4207a0ffd3923ea5ec7250cf5e75Timo Sirainen"Configuration" file and then recompiling as usual.
1aad8ad0590bee2d09d5fdb5413af72e2a8e156aTimo Sirainen<pre>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen AUX_CFLAGS= (something) -DSTATUS
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen</pre>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen
e9371f899a3d4207a0ffd3923ea5ec7250cf5e75Timo Sirainen<!--#include virtual="footer.html" -->
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen</BODY>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen</HTML>
43d3ea2780b5f8557ede7b4c039e8f56cb8d357dTimo Sirainen
b0e9375a1ff97c9c7d40655922af5ccc73ecaa76Timo Sirainen