]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_status.html
Note that mod_status only works in standalone mode, not inetd.
[apache] / docs / manual / mod / mod_status.html
1 <html><head>
2 <title>Apache module mod_status</title>
3 </head><body>
4
5 <!--#include virtual="header.html" -->
6 <h1>Module mod_status</h1>
7
8 The Status Module is only available in Apache 1.1 and later.<p>
9
10 <h2>Function</h2>
11
12 The Status module allows a server administrator to find out how well
13 their server is performing.  A HTML page is presented that gives
14 the current server statistics in an easily readable form.  If required
15 this page can be made to automatically refresh (given a compatible
16 browser).  Another page gives a simple machine-readable list of the current
17 server state.
18 <p>
19 The details given are:
20 <ul>
21 <li>The number of children serving requests
22 <li>The number of idle children
23 <li>The status of each child, the number of requests that child has
24 performed and the total number of bytes served by the child (*)
25 <li>A total number of accesses and byte count served (*)
26 <li>The time the server was started/restarted and the
27 time it has been running for
28 <li>Averages giving the number of requests per second, 
29 the number of bytes served per second and the average number
30 of bytes per request (*)
31 <li>The current percentage CPU used by each child and in total by
32 Apache (*)
33 <li>The current hosts and requests being processed (*)
34 </ul>
35
36 A compile-time option must be used to display the details marked "(*)" as
37 the instrumentation required for obtaining these statistics does not
38 exist within standard Apache.
39
40 <h2>Enabling Status Support</h2>
41
42 To enable status reports only for browsers from the foo.com
43 domain add this code to your <code>access.conf</code> configuration file
44 <pre>
45     &lt;Location /server-status&gt;
46     SetHandler server-status
47     
48     order deny,allow
49     deny from all
50     allow from .foo.com
51     &lt;/Location&gt;
52 </pre>
53 <p>
54 You can now access server statistics by using a Web browser to access the
55 page <code>http://your.server.name/server-status</code>
56 <p>
57 Note that mod_status will only work when you are running Apache in 
58 <A HREF="core.html#servertype">standalone</A> mode and not 
59 <A HREF="core.html#servertype">inetd</A> mode.
60
61 <h3>Automatic Updates</h3>
62 You can get the status page to update itself automatically if you have
63 a browser that supports "refresh".  Access the page
64 <code>http://your.server.name/server-status?refresh=N</code> to refresh the page
65 every N seconds.
66 <h3>Machine Readable Status File</h3>
67 A machine-readable version of the status file is available by accessing the
68 page <code>http://your.server.name/server-status?auto</code>.  This is useful
69 when automatically run, see the Perl program in the <code>/support</code>
70 directory of Apache, <code>log_server_status</code>.
71
72 <h2>Full Instrumentation</h2>
73
74 To obtain full statistics you must compile Apache with a special
75 directive.  On some machines there may be a small performance loss
76 if you do this.  Try full statistics and see if you notice any
77 difference.  If you do please contact <a href="mailto:mark@ukweb.com">
78 mark@ukweb.com</a> and tell me your configuration.
79
80 <p>
81
82 Do this by adding the following to the AUX_CFLAGS line in the
83 "Configuration" file and then recompiling as usual.
84 <pre>
85         AUX_CFLAGS= (something) -DSTATUS
86 </pre>
87
88 <BLOCKQUOTE>
89  <STRONG>
90   It should be noted that if <SAMP>mod_status</SAMP> is compiled into
91   the server, its handler capability is available in <EM>all</EM>
92   configuration files, including <EM>per</EM>-directory files
93   (<EM>e.g.</EM>, <SAMP>.htaccess</SAMP>).  This may have
94   security-related ramifications for your site.
95  </STRONG>
96 </BLOCKQUOTE>
97 <!--#include virtual="footer.html" -->
98 </BODY>
99 </HTML>