mod_status.html revision e383bf77be4a4398d407bbb6c7656984a9cdfacc
7cb128dc4cae2a03a742f63ba7afee23c78e3af0Phil Carmody<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<HTML>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen <HEAD>
bdd36cfdba3ff66d25570a9ff568d69e1eb543cfTimo Sirainen <TITLE>Apache module mod_status</TITLE>
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen </HEAD>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen<BODY
e303353998b1959d1fa914a6be2e85cb9a2615c4Timo Sirainen BGCOLOR="#FFFFFF"
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen TEXT="#000000"
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen LINK="#0000FF"
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen VLINK="#000080"
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen ALINK="#FF0000"
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen>
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen<!--#include virtual="header.html" -->
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<H1 ALIGN="CENTER">Module mod_status</H1>
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen
678d0463849ba777106eb7875f27db07a5d8e3dfTimo SirainenThe Status Module is only available in Apache 1.1 and later.<P>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen<H2>Function</H2>
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen
6303191abcb37164f435ccdc56e9dbddf1288851Timo SirainenThe Status module allows a server administrator to find out how well
2129efcd74a72d051d182171b7e07916308e386dTimo Sirainentheir server is performing. A HTML page is presented that gives
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainenthe current server statistics in an easily readable form. If required
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainenthis page can be made to automatically refresh (given a compatible
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainenbrowser). Another page gives a simple machine-readable list of the current
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainenserver state.
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen<P>
678d0463849ba777106eb7875f27db07a5d8e3dfTimo SirainenThe details given are:
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen<UL>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<LI>The number of children serving requests
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen<LI>The number of idle children
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<LI>The status of each child, the number of requests that child has
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainenperformed and the total number of bytes served by the child (*)
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen<LI>A total number of accesses and byte count served (*)
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen<LI>The time the server was started/restarted and the
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainentime it has been running for
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen<LI>Averages giving the number of requests per second,
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainenthe number of bytes served per second and the average number
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainenof bytes per request (*)
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen<LI>The current percentage CPU used by each child and in total by
088cb24027234024aff2c1ce5b6870c5a308a44bTimo SirainenApache (*)
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<LI>The current hosts and requests being processed (*)
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen</UL>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen
088cb24027234024aff2c1ce5b6870c5a308a44bTimo SirainenA compile-time option must be used to display the details marked "(*)" as
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainenthe instrumentation required for obtaining these statistics does not
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainenexist within standard Apache.
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen<H2>Enabling Status Support</H2>
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen
2129efcd74a72d051d182171b7e07916308e386dTimo SirainenTo enable status reports only for browsers from the foo.com
2129efcd74a72d051d182171b7e07916308e386dTimo Sirainendomain add this code to your <CODE>access.conf</CODE> configuration file
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<PRE>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen &lt;Location /server-status&gt;
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen SetHandler server-status
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen order deny,allow
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen deny from all
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen allow from .foo.com
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen &lt;/Location&gt;
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen</PRE>
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen<P>
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo SirainenYou can now access server statistics by using a Web browser to access the
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainenpage <CODE>http://your.server.name/server-status</CODE>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<P>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo SirainenNote that mod_status will only work when you are running Apache in
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<A HREF="core.html#servertype">standalone</A> mode and not
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo Sirainen<A HREF="core.html#servertype">inetd</A> mode.
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo Sirainen
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<H3>Automatic Updates</H3>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo SirainenYou can get the status page to update itself automatically if you have
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainena browser that supports "refresh". Access the page
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo Sirainen<CODE>http://your.server.name/server-status?refresh=N</CODE> to refresh the
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo Sirainenpage every N seconds.
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo Sirainen<H3>Machine Readable Status File</H3>
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo SirainenA machine-readable version of the status file is available by accessing the
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo Sirainenpage <CODE>http://your.server.name/server-status?auto</CODE>. This is useful
623eaaf530b2bd9cddbaeb88a211873ec9dee436Timo Sirainenwhen automatically run, see the Perl program in the <CODE>/support</CODE>
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainendirectory of Apache, <CODE>log_server_status</CODE>.
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen<H2>Full Instrumentation</H2>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen
088cb24027234024aff2c1ce5b6870c5a308a44bTimo SirainenTo obtain full statistics you must compile Apache with a special
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainendirective. On some machines there may be a small performance loss
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainenif you do this. Try full statistics and see if you notice any
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainendifference. If you do please contact <A HREF="mailto:jim@apache.org">
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainenjim@apache.org</A> and tell us your configuration.
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen
009217abb57a24a4076092e8e4e165545747839eStephan Bosch<P>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo SirainenDo this by using the following run-time directive:
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<PRE>
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen ExtendedStatus On
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen</PRE>
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<BLOCKQUOTE>
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen <STRONG>
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen It should be noted that if <SAMP>mod_status</SAMP> is compiled into
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen the server, its handler capability is available in <EM>all</EM>
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen configuration files, including <EM>per</EM>-directory files
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen (<EM>e.g.</EM>, <SAMP>.htaccess</SAMP>). This may have
7dc4bf28c0c4c673a198070edd1ed54e14ae39aeTimo Sirainen security-related ramifications for your site.
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen </STRONG>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen</BLOCKQUOTE>
088cb24027234024aff2c1ce5b6870c5a308a44bTimo Sirainen<!--#include virtual="footer.html" -->
6303191abcb37164f435ccdc56e9dbddf1288851Timo Sirainen</BODY>
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen</HTML>
c53af2efae7a3484a23412e9be2c8e81523ab65eTimo Sirainen