]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_info.xml
use example.com instead of other non-standard examples
[apache] / docs / manual / mod / mod_info.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_info.xml.meta">
24
25 <name>mod_info</name>
26 <description>Provides a comprehensive overview of the server
27 configuration</description>
28 <status>Extension</status>
29 <sourcefile>mod_info.c</sourcefile>
30 <identifier>info_module</identifier>
31
32 <summary>
33     <p>To configure <module>mod_info</module>, add the following to your
34     <code>httpd.conf</code> file.</p>
35
36     <example>
37       &lt;Location /server-info&gt;<br />
38       <indent>
39         SetHandler server-info<br />
40       </indent>
41       &lt;/Location&gt;
42     </example>
43
44     <p>You may wish to use <module>mod_access</module> inside the
45     <directive type="section" module="core">Location</directive>
46     directive to limit access to your server configuration
47     information:</p>
48
49     <example>
50       &lt;Location /server-info&gt;<br />
51       <indent>
52         SetHandler server-info<br />
53         Require host example.com<br />
54       </indent>
55       &lt;/Location&gt;
56     </example>
57
58     <p>Once configured, the server information is obtained by
59     accessing <code>http://your.host.example.com/server-info</code></p>
60 </summary>
61
62 <section id="security"><title>Security Issues</title>
63     <p>Once <module>mod_info</module> is loaded into the server, its
64     handler capability is available in <em>all</em> configuration
65     files, including per-directory files (<em>e.g.</em>,
66     <code>.htaccess</code>). This may have security-related
67     ramifications for your site.</p>
68
69     <p>In particular, this module can leak sensitive information
70     from the configuration directives of other Apache modules such as
71     system paths, usernames/passwords, database names, etc. Therefore,
72     this module should <strong>only</strong> be
73     used in a controlled environment and always with caution.</p>
74
75     <p>You will probably want to use <module>mod_authz_host</module> 
76     to limit access to your server configuration information.</p>
77       
78     <example><title>Access control</title>
79       &lt;Location /server-info&gt;<br />
80       <indent>
81         SetHandler server-info<br />
82         Order allow,deny<br />
83         # Allow access from server itself<br />
84         Allow from 127.0.0.1<br />
85         # Additionally, allow access from local workstation<br />
86         Allow from 192.168.1.17<br />
87       </indent>
88       &lt;/Location&gt;
89     </example>
90 </section>
91
92 <section id="queries"><title>Selecting the information shown</title>
93     <p>By default, the server information includes a list of
94     all enabled modules, and for each module, a description of
95     the directives understood by that module, the hooks implemented
96     by that module, and the relevant directives from the current
97     configuration.</p>
98     
99     <p>Other views of the configuration information are available by
100     appending a query to the <code>server-info</code> request. For
101     example, <code>http://your.host.example.com/server-info?config</code>
102     will show all configuration directives.</p>
103     
104     <dl>
105         <dt><code>?&lt;module-name&gt;</code></dt>
106             <dd>Only information relevant to the named module</dd>
107         <dt><code>?config</code></dt>
108             <dd>Just the configuration directives, not sorted by module</dd>
109         <dt><code>?hooks</code></dt>
110             <dd>Only the list of Hooks each module is attached to</dd>
111         <dt><code>?list</code></dt>
112             <dd>Only a simple list of enabled modules</dd>
113         <dt><code>?server</code></dt>
114             <dd>Only the basic server information</dd>
115     </dl>
116 </section>
117
118 <section id="limitations"><title>Known Limitations</title>
119     <p><module>mod_info</module> provides its information by reading the
120     parsed configuration, rather than reading the original configuration
121     file. There are a few limitations as a result of the way the parsed
122     configuration tree is created:</p>
123     <ul>
124       <li>Directives which are executed immediately rather than being
125           stored in the parsed configuration are not listed. These include
126           <directive module="core">ServerRoot</directive>,
127           <directive module="mod_so">LoadModule</directive>, and
128           <directive module="mod_so">LoadFile</directive>.</li>
129       <li>Directives which control the configuration file itself, such as
130           <directive module="core">Include</directive>,
131           <directive module="core">&lt;IfModule&gt;</directive> and
132           <directive module="core">&lt;IfDefine&gt;</directive> are not
133           listed, but the included configuration directives are.</li>
134       <li>Comments are not listed. (This may be considered a feature.)</li>
135       <li>Configuration directives from <code>.htaccess</code> files are
136           not listed (since they do not form part of the permanent server
137           configuration).</li>
138       <li>Container directives such as
139           <directive module="core">&lt;Directory&gt;</directive>
140           are listed normally, but <module>mod_info</module> cannot figure
141           out the line number for the closing
142           <directive module="core">&lt;/Directory&gt;</directive>.</li>
143       <li>Directives generated by third party modules such as <a href="http://perl.apache.org">mod_perl</a>
144           might not be listed.</li>
145     </ul>
146 </section>
147
148 <directivesynopsis>
149 <name>AddModuleInfo</name>
150 <description>Adds additional information to the module
151 information displayed by the server-info handler</description>
152 <syntax>AddModuleInfo <var>module-name</var> <var>string</var></syntax>
153 <contextlist><context>server config</context><context>virtual host</context>
154 </contextlist>
155
156 <usage>
157     <p>This allows the content of <var>string</var> to be shown as
158     HTML interpreted, <strong>Additional Information</strong> for
159     the module <var>module-name</var>. Example:</p>
160
161     <example>
162       AddModuleInfo mod_deflate.c 'See &lt;a \<br />
163       <indent>
164         href="http://www.apache.org/docs/&httpd.docs;/mod/mod_deflate.html"&gt;\<br />
165         http://www.apache.org/docs/&httpd.docs;/mod/mod_deflate.html&lt;/a&gt;'
166       </indent>
167     </example>
168 </usage>
169
170 </directivesynopsis>
171 </modulesynopsis>