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