]> granicus.if.org Git - apache/blob - docs/manual/mod/core.html.en
update transformation
[apache] / docs / manual / mod / core.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>core - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.1</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Core Features</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
25 <a href="../en/mod/core.html" title="English">&nbsp;en&nbsp;</a> |
26 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
27 </div>
28 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Core Apache HTTP Server features that are always
29 available</td></tr>
30 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Core</td></tr></table>
31 </div>
32 <div id="quickview"><h3 class="directives">Directives</h3>
33 <ul id="toc">
34 <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
35 <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#addoutputfilterbytype">AddOutputFilterByType</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#allowencodedslashes">AllowEncodedSlashes</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#authname">AuthName</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#authtype">AuthType</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#directory">&lt;Directory&gt;</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch">&lt;DirectoryMatch&gt;</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#files">&lt;Files&gt;</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch">&lt;FilesMatch&gt;</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine">&lt;IfDefine&gt;</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule">&lt;IfModule&gt;</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#limit">&lt;Limit&gt;</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept">&lt;LimitExcept&gt;</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#location">&lt;Location&gt;</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch">&lt;LocationMatch&gt;</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#require">Require</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#satisfy">Satisfy</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
94 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost">&lt;VirtualHost&gt;</a></li>
95 </ul>
96 </div>
97
98 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
99 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
100 <table class="directive">
101 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
102 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
103 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
104 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
105 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
106 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
107 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
108 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.30 and later</td></tr>
109 </table>
110
111     <p>This directive controls whether requests that contain trailing
112     pathname information that follows an actual filename (or
113     non-existent file in an existing directory) will be accepted or
114     rejected.  The trailing pathname information can be made
115     available to scripts in the <code>PATH_INFO</code> environment
116     variable.</p>
117
118     <p>For example, assume the location <code>/test/</code> points to
119     a directory that contains only the single file
120     <code>here.html</code>.  Then requests for
121     <code>/test/here.html/more</code> and
122     <code>/test/nothere.html/more</code> both collect
123     <code>/more</code> as <code>PATH_INFO</code>.</p>
124
125     <p>The three possible arguments for the
126     <code class="directive">AcceptPathInfo</code> directive are:</p>
127     <dl>
128     <dt><code>Off</code></dt><dd>A request will only be accepted if it
129     maps to a literal path that exists.  Therefore a request with
130     trailing pathname information after the true filename such as
131     <code>/test/here.html/more</code> in the above example will return
132     a 404 NOT FOUND error.</dd>
133
134     <dt><code>On</code></dt><dd>A request will be accepted if a
135     leading path component maps to a file that exists.  The above
136     example <code>/test/here.html/more</code> will be accepted if
137     <code>/test/here.html</code> maps to a valid file.</dd>
138
139     <dt><code>Default</code></dt><dd>The treatment of requests with
140     trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
141     The core handler for normal files defaults to rejecting
142     <code>PATH_INFO</code> requests. Handlers that serve scripts, such as <a href="mod_cgi.html">cgi-script</a> and <a href="mod_isapi.html">isapi-isa</a>, generally accept
143     <code>PATH_INFO</code> by default.</dd>
144     </dl>
145
146     <p>The primary purpose of the <code>AcceptPathInfo</code>
147     directive is to allow you to override the handler's choice of
148     accepting or rejecting <code>PATH_INFO</code>. This override is required,
149     for example, when you use a <a href="../filter.html">filter</a>, such
150     as <a href="mod_include.html">INCLUDES</a>, to generate content
151     based on <code>PATH_INFO</code>.  The core handler would usually reject
152     the request, so you can use the following configuration to enable
153     such a script:</p>
154
155     <div class="example"><p><code>
156       &lt;Files "mypaths.shtml"&gt;<br />
157       <span class="indent">
158         Options +Includes<br />
159         SetOutputFilter INCLUDES<br />
160         AcceptPathInfo On<br />
161       </span>
162       &lt;/Files&gt;
163     </code></p></div>
164
165
166 </div>
167 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
168 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
169 <table class="directive">
170 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
171 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
172 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
173 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
174 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
175 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
176 </table>
177     <p>While processing a request the server looks for
178     the first existing configuration file from this list of names in
179     every directory of the path to the document, if distributed
180     configuration files are <a href="#allowoverride">enabled for that
181     directory</a>. For example:</p>
182
183     <div class="example"><p><code>
184       AccessFileName .acl
185     </code></p></div>
186
187     <p>before returning the document
188     <code>/usr/local/web/index.html</code>, the server will read
189     <code>/.acl</code>, <code>/usr/.acl</code>,
190     <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
191     for directives, unless they have been disabled with</p>
192
193     <div class="example"><p><code>
194       &lt;Directory /&gt;<br />
195       <span class="indent">
196         AllowOverride None<br />
197       </span>
198       &lt;/Directory&gt;
199     </code></p></div>
200
201 <h3>See also</h3>
202 <ul>
203 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
204 <li><a href="../configuring.html">Configuration Files</a></li>
205 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
206 </ul>
207 </div>
208 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
209 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
210 <table class="directive">
211 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default charset parameter to be added when a response
212 content-type is "text/plain" or "text/html"</td></tr>
213 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
214 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
215 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
216 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
217 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
218 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
219 </table>
220     <p>This directive specifies a default value for the media type
221     charset parameter (the name of a character encoding) to be added
222     to a response if and only if the response's content-type is either
223     "text/plain" or "text/html".  This should override any charset
224     specified in the body of the document via a <code>META</code> tag,
225     though the exact behavior is often dependent on the user's client
226     configuration. A setting of <code>AddDefaultCharset Off</code>
227     disables this functionality. <code>AddDefaultCharset On</code> enables
228     a default charset of <code>iso-8859-1</code>. Any other value is assumed
229     to be the <var>charset</var> to be used, which should be one of the
230     <a href="http://www.iana.org/assignments/character-sets">IANA registered
231     charset values</a> for use in MIME media types.
232     For example:</p>
233
234     <div class="example"><p><code>
235       AddDefaultCharset utf-8
236     </code></p></div>
237
238     <p><code>AddDefaultCharset</code> should only be used when all
239     of the text resources to which it applies are known to be in that
240     character encoding and it is too inconvenient to label their charset
241     individually. One such example is to add the charset parameter
242     to resources containing generated content, such as legacy CGI
243     scripts, that might be vulnerable to cross-site scripting attacks
244     due to user-provided data being included in the output.  Note, however,
245     that a better solution is to just fix (or delete) those scripts, since
246     setting a default charset does not protect users that have enabled
247     the "auto-detect character encoding" feature on their browser.</p>
248
249 <h3>See also</h3>
250 <ul>
251 <li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li>
252 </ul>
253 </div>
254 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
255 <div class="directive-section"><h2><a name="AddOutputFilterByType" id="AddOutputFilterByType">AddOutputFilterByType</a> <a name="addoutputfilterbytype" id="addoutputfilterbytype">Directive</a></h2>
256 <table class="directive">
257 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>assigns an output filter to a particular MIME-type</td></tr>
258 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
259 <var>MIME-type</var> [<var>MIME-type</var>] ...</code></td></tr>
260 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
261 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
262 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
263 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
264 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later</td></tr>
265 </table>
266     <p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the
267     response MIME-type.</p>
268
269     <p>The following example uses the <code>DEFLATE</code> filter, which
270     is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all
271     output (either static or dynamic) which is labeled as
272     <code>text/html</code> or <code>text/plain</code> before it is sent
273     to the client.</p>
274
275     <div class="example"><p><code>
276       AddOutputFilterByType DEFLATE text/html text/plain
277     </code></p></div>
278
279     <p>If you want the content to be processed by more than one filter, their
280     names have to be separated by semicolons. It's also possible to use one
281     <code class="directive">AddOutputFilterByType</code> directive for each of
282     these filters.</p>
283
284     <p>The configuration below causes all script output labeled as
285     <code>text/html</code> to be processed at first by the
286     <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
287     filter.</p>
288
289     <div class="example"><p><code>
290     &lt;Location /cgi-bin/&gt;<br />
291     <span class="indent">
292       Options Includes<br />
293       AddOutputFilterByType INCLUDES;DEFLATE text/html<br />
294     </span>
295     &lt;/Location&gt;
296     </code></p></div>
297
298     <div class="warning"><h3>Note</h3>
299       <p>Enabling filters with <code class="directive">AddOutputFilterByType</code>
300       may fail partially or completely in some cases. For example, no
301       filters are applied if the MIME-type could not be determined  and falls
302       back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting,
303       even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the
304       same.</p>
305
306       <p>However, if you want to make sure, that the filters will be
307       applied, assign the content type to a resource explicitly, for
308       example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or
309       <code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the
310       content type within a (non-nph) CGI script is also safe.</p>
311
312       <p>The by-type output filters are never applied on proxy requests.</p>
313     </div>
314
315 <h3>See also</h3>
316 <ul>
317 <li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li>
318 <li><code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code></li>
319 <li><a href="../filter.html">filters</a></li>
320 </ul>
321 </div>
322 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
323 <div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directive</a></h2>
324 <table class="directive">
325 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether encoded path separators in URLs are allowed to
326 be passed through</td></tr>
327 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
328 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
329 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
330 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
331 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
332 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.46 and later</td></tr>
333 </table>
334     <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
335     which contain encoded path separators (<code>%2F</code> for <code>/</code>
336     and additionally <code>%5C</code> for <code>\</code> on according systems)
337     to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
338
339     <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
340     mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
341
342     <div class="note"><h3>Note</h3>
343       <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
344       Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
345       according systems) will be left as such in the otherwise decoded URL
346       string.</p>
347     </div>
348
349 <h3>See also</h3>
350 <ul>
351 <li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
352 </ul>
353 </div>
354 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
355 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
356 <table class="directive">
357 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
358 .htaccess files</td></tr>
359 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
360 [<var>directive-type</var>] ...</code></td></tr>
361 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr>
362 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
363 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
364 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
365 </table>
366     <p>When the server finds an <code>.htaccess</code> file (as
367     specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
368     it needs to know which directives declared in that file can override
369     earlier configuration directives.</p>
370
371     <div class="note"><h3>Only available in &lt;Directory&gt; sections</h3>
372     <code class="directive">AllowOverride</code> is valid only in
373     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
374     sections specified without regular expressions, not in <code class="directive"><a href="#location">&lt;Location&gt;</a></code>, <code class="directive"><a href="#directorymatch">&lt;DirectoryMatch&gt;</a></code> or
375     <code class="directive"><a href="#files">&lt;Files&gt;</a></code> sections.
376     </div>
377
378     <p>When this directive is set to <code>None</code>, then
379     <a href="#accessfilename">.htaccess</a> files are completely ignored.
380     In this case, the server will not even attempt to read
381     <code>.htaccess</code> files in the filesystem.</p>
382
383     <p>When this directive is set to <code>All</code>, then any
384     directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
385     <code>.htaccess</code> files.</p>
386
387     <p>The <var>directive-type</var> can be one of the following
388     groupings of directives.</p>
389
390     <dl>
391       <dt>AuthConfig</dt>
392
393       <dd>
394
395       Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
396       <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
397       <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
398       <code class="directive"><a href="#authname">AuthName</a></code>,
399       <code class="directive"><a href="#authtype">AuthType</a></code>, <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>, <code class="directive"><a href="#require">Require</a></code>, <em>etc.</em>).</dd>
400
401       <dt>FileInfo</dt>
402
403       <dd>
404       Allow use of the directives controlling document types (<code class="directive"><a href="#defaulttype">DefaultType</a></code>, <code class="directive"><a href="#errordocument">ErrorDocument</a></code>, <code class="directive"><a href="#forcetype">ForceType</a></code>, <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>,
405       <code class="directive"><a href="#sethandler">SetHandler</a></code>, <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>, <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and
406       <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove*
407       directives, <em>etc.</em>).</dd>
408
409       <dt>Indexes</dt>
410
411       <dd>
412       Allow use of the directives controlling directory indexing
413       (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
414       <code class="directive"><a href="../mod/mod_autoindex.html#addicon">AddIcon</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#addiconbyencoding">AddIconByEncoding</a></code>,
415       <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
416       <code class="directive"><a href="../mod/mod_autoindex.html#defaulticon">DefaultIcon</a></code>, <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#fancyindexing">FancyIndexing</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#headername">HeaderName</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexignore">IndexIgnore</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexoptions">IndexOptions</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#readmename">ReadmeName</a></code>,
417       <em>etc.</em>).</dd>
418
419       <dt>Limit</dt>
420
421       <dd>
422       Allow use of the directives controlling host access (<code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code>, <code class="directive"><a href="../mod/mod_authz_host.html#deny">Deny</a></code> and <code class="directive"><a href="../mod/mod_authz_host.html#order">Order</a></code>).</dd>
423
424       <dt>Options[=<var>Option</var>,...]</dt>
425
426       <dd>
427       Allow use of the directives controlling specific directory
428       features (<code class="directive"><a href="#options">Options</a></code> and
429       <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).
430       An equal sign may be given followed by a comma (but no spaces)
431       separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
432     </dl>
433
434     <p>Example:</p>
435
436     <div class="example"><p><code>
437       AllowOverride AuthConfig Indexes
438     </code></p></div>
439
440     <p>In the example above all directives that are neither in the group
441     <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
442     server error.</p>
443
444 <h3>See also</h3>
445 <ul>
446 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
447 <li><a href="../configuring.html">Configuration Files</a></li>
448 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
449 </ul>
450 </div>
451 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
452 <div class="directive-section"><h2><a name="AuthName" id="AuthName">AuthName</a> <a name="authname" id="authname">Directive</a></h2>
453 <table class="directive">
454 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Authorization realm for use in HTTP
455 authentication</td></tr>
456 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthName <var>auth-domain</var></code></td></tr>
457 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
458 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
459 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
460 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
461 </table>
462     <p>This directive sets the name of the authorization realm for a
463     directory. This realm is given to the client so that the user
464     knows which username and password to send.
465     <code class="directive">AuthName</code> takes a single argument; if the
466     realm name contains spaces, it must be enclosed in quotation
467     marks.  It must be accompanied by <code class="directive"><a href="#authtype">AuthType</a></code> and <code class="directive"><a href="#require">Require</a></code> directives, and directives such
468     as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
469     <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
470     work.</p>
471
472    <p>For example:</p>
473
474    <div class="example"><p><code>
475      AuthName "Top Secret"
476    </code></p></div>
477
478     <p>The string provided for the <code>AuthName</code> is what will
479     appear in the password dialog provided by most browsers.</p>
480
481 <h3>See also</h3>
482 <ul>
483 <li><a href="../howto/auth.html">Authentication, Authorization, and
484     Access Control</a></li>
485 </ul>
486 </div>
487 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
488 <div class="directive-section"><h2><a name="AuthType" id="AuthType">AuthType</a> <a name="authtype" id="authtype">Directive</a></h2>
489 <table class="directive">
490 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Type of user authentication</td></tr>
491 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthType Basic|Digest</code></td></tr>
492 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
493 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
494 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
495 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
496 </table>
497     <p>This directive selects the type of user authentication for a
498     directory. Only <code>Basic</code> and <code>Digest</code> are
499     currently implemented.
500
501      It must be accompanied by <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#require">Require</a></code> directives, and directives such
502      as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
503      <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
504      work.</p>
505
506 <h3>See also</h3>
507 <ul>
508 <li><a href="../howto/auth.html">Authentication, Authorization,
509 and Access Control</a></li>
510 </ul>
511 </div>
512 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
513 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
514 <table class="directive">
515 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
516 scripts</td></tr>
517 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
518 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
519 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
520 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
521 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
522 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
523 </table>
524     <p>This directive is used to control how Apache finds the
525     interpreter used to run CGI scripts. For example, setting
526     <code>CGIMapExtension sys:\foo.nlm .foo</code> will
527     cause all CGI script files with a <code>.foo</code> extension to
528     be passed to the FOO interpreter.</p>
529
530 </div>
531 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
532 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
533 <table class="directive">
534 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of Content-MD5 HTTP Response
535 headers</td></tr>
536 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
537 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
538 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
539 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
540 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
541 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
542 </table>
543     <p>This directive enables the generation of
544     <code>Content-MD5</code> headers as defined in RFC1864
545     respectively RFC2068.</p>
546
547     <p>MD5 is an algorithm for computing a "message digest"
548     (sometimes called "fingerprint") of arbitrary-length data, with
549     a high degree of confidence that any alterations in the data
550     will be reflected in alterations in the message digest.</p>
551
552     <p>The <code>Content-MD5</code> header provides an end-to-end
553     message integrity check (MIC) of the entity-body. A proxy or
554     client may check this header for detecting accidental
555     modification of the entity-body in transit. Example header:</p>
556
557     <div class="example"><p><code>
558       Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
559     </code></p></div>
560
561     <p>Note that this can cause performance problems on your server
562     since the message digest is computed on every request (the
563     values are not cached).</p>
564
565     <p><code>Content-MD5</code> is only sent for documents served
566     by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
567     SSI documents, output from CGI scripts, and byte range responses
568     do not have this header.</p>
569
570 </div>
571 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
572 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
573 <table class="directive">
574 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>MIME content-type that will be sent if the
575 server cannot determine a type in any other way</td></tr>
576 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>MIME-type</var></code></td></tr>
577 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType text/plain</code></td></tr>
578 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
579 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
580 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
581 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
582 </table>
583     <p>There will be times when the server is asked to provide a
584     document whose type cannot be determined by its MIME types
585     mappings.</p>
586
587     <p>The server must inform the client of the content-type of the
588     document, so in the event of an unknown type it uses the
589     <code>DefaultType</code>. For example:</p>
590
591     <div class="example"><p><code>
592       DefaultType image/gif
593     </code></p></div>
594
595     <p>would be appropriate for a directory which contained many GIF
596     images with filenames missing the <code>.gif</code> extension.</p>
597
598     <p>Note that unlike <code class="directive"><a href="#forcetype">ForceType</a></code>, this directive only
599     provides the default mime-type. All other mime-type definitions,
600     including filename extensions, that might identify the media type
601     will override this default.</p>
602
603 </div>
604 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
605 <div class="directive-section"><h2><a name="Directory" id="Directory">&lt;Directory&gt;</a> <a name="directory" id="directory">Directive</a></h2>
606 <table class="directive">
607 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
608 named file-system directory and sub-directories</td></tr>
609 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Directory <var>directory-path</var>&gt;
610 ... &lt;/Directory&gt;</code></td></tr>
611 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
612 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
613 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
614 </table>
615     <p><code class="directive">&lt;Directory&gt;</code> and
616     <code>&lt;/Directory&gt;</code> are used to enclose a group of
617     directives that will apply only to the named directory and
618     sub-directories of that directory. Any directive that is allowed
619     in a directory context may be used. <var>Directory-path</var> is
620     either the full path to a directory, or a wild-card string using
621     Unix shell-style matching. In a wild-card string, <code>?</code> matches
622     any single character, and <code>*</code> matches any sequences of
623     characters. You may also use <code>[]</code> character ranges. None
624     of the wildcards match a `/' character, so <code>&lt;Directory
625     /*/public_html&gt;</code> will not match
626     <code>/home/user/public_html</code>, but <code>&lt;Directory
627     /home/*/public_html&gt;</code> will match. Example:</p>
628
629     <div class="example"><p><code>
630       &lt;Directory /usr/local/httpd/htdocs&gt;<br />
631       <span class="indent">
632         Options Indexes FollowSymLinks<br />
633       </span>
634       &lt;/Directory&gt;
635     </code></p></div>
636
637     <div class="note">
638       <p>Be careful with the <var>directory-path</var> arguments:
639       They have to literally match the filesystem path which Apache uses
640       to access the files. Directives applied to a particular
641       <code>&lt;Directory&gt;</code> will not apply to files accessed from
642       that same directory via a different path, such as via different symbolic
643       links.</p>
644     </div>
645
646     <p>Extended regular
647     expressions can also be used, with the addition of the
648     <code>~</code> character. For example:</p>
649
650     <div class="example"><p><code>
651       &lt;Directory ~ "^/www/.*/[0-9]{3}"&gt;
652     </code></p></div>
653
654     <p>would match directories in <code>/www/</code> that consisted of
655     three numbers.</p>
656
657     <p>If multiple (non-regular expression) <code class="directive">&lt;Directory&gt;</code> sections
658     match the directory (or one of its parents) containing a document,
659     then the directives are applied in the order of shortest match
660     first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
661     with</p>
662
663     <div class="example"><p><code>
664       &lt;Directory /&gt;<br />
665       <span class="indent">
666         AllowOverride None<br />
667       </span>
668       &lt;/Directory&gt;<br />
669       <br />
670       &lt;Directory /home/&gt;<br />
671       <span class="indent">
672         AllowOverride FileInfo<br />
673       </span>
674       &lt;/Directory&gt;
675     </code></p></div>
676
677     <p>for access to the document <code>/home/web/dir/doc.html</code>
678     the steps are:</p>
679
680     <ul>
681       <li>Apply directive <code>AllowOverride None</code>
682       (disabling <code>.htaccess</code> files).</li>
683
684       <li>Apply directive <code>AllowOverride FileInfo</code> (for
685       directory <code>/home</code>).</li>
686
687       <li>Apply any <code>FileInfo</code> directives in
688       <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
689       <code>/home/web/dir/.htaccess</code> in that order.</li>
690     </ul>
691
692     <p>Regular expressions are not considered until after all of the
693     normal sections have been applied. Then all of the regular
694     expressions are tested in the order they appeared in the
695     configuration file. For example, with</p>
696
697     <div class="example"><p><code>
698       &lt;Directory ~ abc$&gt;<br />
699       <span class="indent">
700         # ... directives here ...<br />
701       </span>
702       &lt;/Directory&gt;
703     </code></p></div>
704
705     <p>the regular expression section won't be considered until after
706     all normal <code class="directive">&lt;Directory&gt;</code>s and
707     <code>.htaccess</code> files have been applied. Then the regular
708     expression will match on <code>/home/abc/public_html/abc</code> and
709     the corresponding <code class="directive">&lt;Directory&gt;</code> will
710     be applied.</p>
711
712    <p><strong>Note that the default Apache access for
713     <code>&lt;Directory /&gt;</code> is <code>Allow from All</code>.
714     This means that Apache will serve any file mapped from an URL. It is
715     recommended that you change this with a block such
716     as</strong></p>
717
718     <div class="example"><p><code>
719       &lt;Directory /&gt;<br />
720       <span class="indent">
721         Order Deny,Allow<br />
722         Deny from All<br />
723       </span>
724       &lt;/Directory&gt;
725     </code></p></div>
726
727     <p><strong>and then override this for directories you
728     <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
729     details.</strong></p>
730
731     <p>The directory sections occur in the <code>httpd.conf</code> file.
732     <code class="directive">&lt;Directory&gt;</code> directives
733     cannot nest, and cannot appear in a <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> or <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section.</p>
734
735 <h3>See also</h3>
736 <ul>
737 <li><a href="../sections.html">How &lt;Directory&gt;,
738     &lt;Location&gt; and &lt;Files&gt; sections work</a> for an
739     explanation of how these different sections are combined when a
740     request is received</li>
741 </ul>
742 </div>
743 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
744 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch">&lt;DirectoryMatch&gt;</a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
745 <table class="directive">
746 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
747 file-system directories matching a regular expression and their
748 subdirectories</td></tr>
749 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;DirectoryMatch <var>regex</var>&gt;
750 ... &lt;/DirectoryMatch&gt;</code></td></tr>
751 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
752 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
753 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
754 </table>
755     <p><code class="directive">&lt;DirectoryMatch&gt;</code> and
756     <code>&lt;/DirectoryMatch&gt;</code> are used to enclose a group
757     of directives which will apply only to the named directory and
758     sub-directories of that directory, the same as <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>. However, it
759     takes as an argument a regular expression. For example:</p>
760
761     <div class="example"><p><code>
762       &lt;DirectoryMatch "^/www/.*/[0-9]{3}"&gt;
763     </code></p></div>
764
765     <p>would match directories in <code>/www/</code> that consisted of three
766     numbers.</p>
767
768 <h3>See also</h3>
769 <ul>
770 <li><code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> for
771 a description of how regular expressions are mixed in with normal
772 <code class="directive">&lt;Directory&gt;</code>s</li>
773 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt; and
774 &lt;Files&gt; sections work</a> for an explanation of how these different
775 sections are combined when a request is received</li>
776 </ul>
777 </div>
778 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
779 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
780 <table class="directive">
781 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
782 from the web</td></tr>
783 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
784 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
785 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
786 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
787 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
788 </table>
789     <p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
790     will serve files. Unless matched by a directive like <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code>, the server appends the
791     path from the requested URL to the document root to make the
792     path to the document. Example:</p>
793
794     <div class="example"><p><code>
795       DocumentRoot /usr/web
796     </code></p></div>
797
798     <p>then an access to
799     <code>http://www.my.host.com/index.html</code> refers to
800     <code>/usr/web/index.html</code>. If the <var>directory-path</var> is 
801     not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
802
803     <p>The <code class="directive">DocumentRoot</code> should be specified without
804     a trailing slash.</p>
805
806 <h3>See also</h3>
807 <ul>
808 <li><a href="../urlmapping.html">Mapping URLs to Filesystem
809 Location</a></li>
810 </ul>
811 </div>
812 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
813 <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
814 <table class="directive">
815 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
816 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
817 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
818 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
819 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
820 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
821 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
822 </table>
823     <p>This directive controls whether the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use
824     memory-mapping if it needs to read the contents of a file during
825     delivery.  By default, when the handling of a request requires
826     access to the data within a file -- for example, when delivering a
827     server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache
828     memory-maps the file if the OS supports it.</p>
829
830     <p>This memory-mapping sometimes yields a performance improvement.
831     But in some environments, it is better to disable the memory-mapping
832     to prevent operational problems:</p>
833
834     <ul>
835     <li>On some multiprocessor systems, memory-mapping can reduce the
836     performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
837     <li>With an NFS-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code>,
838     the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may crash due to a segmentation fault if a file
839     is deleted or truncated while the <code class="program"><a href="../programs/httpd.html">httpd</a></code> has it
840     memory-mapped.</li>
841     </ul>
842
843     <p>For server configurations that are vulnerable to these problems,
844     you should disable memory-mapping of delivered files by specifying:</p>
845
846     <div class="example"><p><code>
847       EnableMMAP Off
848     </code></p></div>
849
850     <p>For NFS mounted files, this feature may be disabled explicitly for
851     the offending files by specifying:</p>
852
853     <div class="example"><p><code>
854       &lt;Directory "/path-to-nfs-files"&gt;
855       <span class="indent">
856         EnableMMAP Off
857       </span>
858       &lt;/Directory&gt;
859     </code></p></div>
860
861 </div>
862 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
863 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
864 <table class="directive">
865 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use the kernel sendfile support to deliver files to the client</td></tr>
866 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
867 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile On</code></td></tr>
868 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
869 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
870 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
871 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
872 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later</td></tr>
873 </table>
874     <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
875     sendfile support from the kernel to transmit file contents to the client.
876     By default, when the handling of a request requires no access
877     to the data within a file -- for example, when delivering a
878     static file -- Apache uses sendfile to deliver the file contents
879     without ever reading the file if the OS supports it.</p>
880
881     <p>This sendfile mechanism avoids separate read and send operations,
882     and buffer allocations. But on some platforms or within some
883     filesystems, it is better to disable this feature to avoid
884     operational problems:</p>
885
886     <ul>
887     <li>Some platforms may have broken sendfile support that the build
888     system did not detect, especially if the binaries were built on
889     another box and moved to such a machine with broken sendfile
890     support.</li>
891     <li>On Linux the use of sendfile triggers TCP-checksum
892     offloading bugs on certain networking cards when using IPv6.</li>
893     <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS or SMB),
894     the kernel may be unable to serve the network file through
895     its own cache.</li>
896     </ul>
897
898     <p>For server configurations that are vulnerable to these problems,
899     you should disable this feature by specifying:</p>
900
901     <div class="example"><p><code>
902       EnableSendfile Off
903     </code></p></div>
904
905     <p>For NFS or SMB mounted files, this feature may be disabled explicitly
906     for the offending files by specifying:</p>
907
908     <div class="example"><p><code>
909       &lt;Directory "/path-to-nfs-files"&gt;
910       <span class="indent">
911         EnableSendfile Off
912       </span>
913       &lt;/Directory&gt;
914     </code></p></div>
915
916 </div>
917 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
918 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
919 <table class="directive">
920 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
921 in case of an error</td></tr>
922 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
923 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
924 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
925 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
926 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
927 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Quoting syntax for text messages is different in Apache
928 2.0</td></tr>
929 </table>
930     <p>In the event of a problem or error, Apache can be configured
931     to do one of four things,</p>
932
933     <ol>
934       <li>output a simple hardcoded error message</li>
935
936       <li>output a customized message</li>
937
938       <li>redirect to a local <var>URL-path</var> to handle the
939       problem/error</li>
940
941       <li>redirect to an external <var>URL</var> to handle the
942       problem/error</li>
943     </ol>
944
945     <p>The first option is the default, while options 2-4 are
946     configured using the <code class="directive">ErrorDocument</code>
947     directive, which is followed by the HTTP response code and a URL
948     or a message. Apache will sometimes offer additional information
949     regarding the problem/error.</p>
950
951     <p>URLs can begin with a slash (/) for local URLs, or be a full
952     URL which the client can resolve. Alternatively, a message can
953     be provided to be displayed by the browser. Examples:</p>
954
955     <div class="example"><p><code>
956       ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
957       ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
958       ErrorDocument 401 /subscription_info.html<br />
959       ErrorDocument 403 "Sorry can't allow you access today"
960     </code></p></div>
961
962     <p>Additionally, the special value <code>default</code> can be used
963     to specify Apache's simple hardcoded message.  While not required
964     under normal circumstances, <code>default</code> will restore
965     Apache's simple hardcoded message for configurations that would
966     otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
967
968     <div class="example"><p><code>
969       ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
970       &lt;Directory /web/docs&gt;<br />
971       <span class="indent">
972         ErrorDocument 404 default<br />
973       </span>
974       &lt;/Directory&gt;
975     </code></p></div>
976
977     <p>Note that when you specify an <code class="directive">ErrorDocument</code>
978     that points to a remote URL (ie. anything with a method such as
979     <code>http</code> in front of it), Apache will send a redirect to the
980     client to tell it where to find the document, even if the
981     document ends up being on the same server. This has several
982     implications, the most important being that the client will not
983     receive the original error status code, but instead will
984     receive a redirect status code. This in turn can confuse web
985     robots and other clients which try to determine if a URL is
986     valid using the status code. In addition, if you use a remote
987     URL in an <code>ErrorDocument 401</code>, the client will not
988     know to prompt the user for a password since it will not
989     receive the 401 status code. Therefore, <strong>if you use an
990     <code>ErrorDocument 401</code> directive then it must refer to a local
991     document.</strong></p>
992
993     <p>Microsoft Internet Explorer (MSIE) will by default ignore
994     server-generated error messages when they are "too small" and substitute
995     its own "friendly" error messages. The size threshold varies depending on
996     the type of error, but in general, if you make your error document
997     greater than 512 bytes, then MSIE will show the server-generated
998     error rather than masking it.  More information is available in
999     Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
1000
1001     <p>Prior to version 2.0, messages were indicated by prefixing
1002     them with a single unmatched double quote character.</p>
1003
1004 <h3>See also</h3>
1005 <ul>
1006 <li><a href="../custom-error.html">documentation of
1007     customizable responses</a></li>
1008 </ul>
1009 </div>
1010 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1011 <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
1012 <table class="directive">
1013 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
1014 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</code></td></tr>
1015 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</code></td></tr>
1016 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1017 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1018 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1019 </table>
1020     <p>The <code class="directive">ErrorLog</code> directive sets the name of
1021     the file to which the server will log any errors it encounters. If
1022     the <var>file-path</var> is not absolute then it is assumed to be 
1023     relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
1024
1025     <div class="example"><h3>Example</h3><p><code>
1026     ErrorLog /var/log/httpd/error_log
1027     </code></p></div>
1028
1029     <p>If the <var>file-path</var>
1030     begins with a pipe (|) then it is assumed to be a command to spawn
1031     to handle the error log.</p>
1032
1033     <div class="example"><h3>Example</h3><p><code>
1034     ErrorLog "|/usr/local/bin/httpd_errors"
1035     </code></p></div>
1036
1037     <p>Using <code>syslog</code> instead of a filename enables logging
1038     via syslogd(8) if the system supports it. The default is to use
1039     syslog facility <code>local7</code>, but you can override this by
1040     using the <code>syslog:<var>facility</var></code> syntax where
1041     <var>facility</var> can be one of the names usually documented in
1042     syslog(1).</p>
1043
1044     <div class="example"><h3>Example</h3><p><code>
1045     ErrorLog syslog:user
1046     </code></p></div>
1047
1048     <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
1049     document for details on why your security could be compromised
1050     if the directory where log files are stored is writable by
1051     anyone other than the user that starts the server.</p>
1052     <div class="warning"><h3>Note</h3>
1053       <p>When entering a file path on non-Unix platforms, care should be taken
1054       to make sure that only forward slashed are used even though the platform
1055       may allow the use of back slashes. In general it is a good idea to always 
1056       use forward slashes throughout the configuration files.</p>
1057     </div>
1058
1059 <h3>See also</h3>
1060 <ul>
1061 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1062 <li><a href="../logs.html">Apache Log Files</a></li>
1063 </ul>
1064 </div>
1065 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1066 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
1067 <table class="directive">
1068 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
1069 HTTP response header</td></tr>
1070 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
1071 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
1072 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1073 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1074 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1075 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1076 </table>
1077     <p>
1078     The <code class="directive">FileETag</code> directive configures the file
1079     attributes that are used to create the <code>ETag</code> (entity
1080     tag) response header field when the document is based on a file.
1081     (The <code>ETag</code> value is used in cache management to save
1082     network bandwidth.) In Apache 1.3.22 and earlier, the
1083     <code>ETag</code> value was <em>always</em> formed
1084     from the file's inode, size, and last-modified time (mtime). The
1085     <code class="directive">FileETag</code> directive allows you to choose
1086     which of these -- if any -- should be used. The recognized keywords are:
1087     </p>
1088
1089     <dl>
1090      <dt><strong>INode</strong></dt>
1091      <dd>The file's i-node number will be included in the calculation</dd>
1092      <dt><strong>MTime</strong></dt>
1093      <dd>The date and time the file was last modified will be included</dd>
1094      <dt><strong>Size</strong></dt>
1095      <dd>The number of bytes in the file will be included</dd>
1096      <dt><strong>All</strong></dt>
1097      <dd>All available fields will be used. This is equivalent to:
1098          <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1099      <dt><strong>None</strong></dt>
1100      <dd>If a document is file-based, no <code>ETag</code> field will be
1101        included in the response</dd>
1102     </dl>
1103
1104     <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1105     keywords may be prefixed with either <code>+</code> or <code>-</code>,
1106     which allow changes to be made to the default setting inherited
1107     from a broader scope. Any keyword appearing without such a prefix
1108     immediately and completely cancels the inherited setting.</p>
1109
1110     <p>If a directory's configuration includes
1111     <code>FileETag&nbsp;INode&nbsp;MTime&nbsp;Size</code>, and a
1112     subdirectory's includes <code>FileETag&nbsp;-INode</code>,
1113     the setting for that subdirectory (which will be inherited by
1114     any sub-subdirectories that don't override it) will be equivalent to
1115     <code>FileETag&nbsp;MTime&nbsp;Size</code>.</p>
1116
1117 </div>
1118 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1119 <div class="directive-section"><h2><a name="Files" id="Files">&lt;Files&gt;</a> <a name="files" id="files">Directive</a></h2>
1120 <table class="directive">
1121 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
1122 filenames</td></tr>
1123 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Files <var>filename</var>&gt; ... &lt;/Files&gt;</code></td></tr>
1124 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1125 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1126 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1127 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1128 </table>
1129     <p>The <code class="directive">&lt;Files&gt;</code> directive
1130     limits the scope of the enclosed directives by filename. It is comparable
1131     to the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
1132     and <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
1133     directives. It should be matched with a <code>&lt;/Files&gt;</code>
1134     directive. The directives given within this section will be applied to
1135     any object with a basename (last component of filename) matching the
1136     specified filename. <code class="directive">&lt;Files&gt;</code>
1137     sections are processed in the order they appear in the
1138     configuration file, after the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections and
1139     <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location">&lt;Location&gt;</a></code> sections. Note
1140     that <code class="directive">&lt;Files&gt;</code> can be nested
1141     inside <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections to restrict the
1142     portion of the filesystem they apply to.</p>
1143
1144     <p>The <var>filename</var> argument should include a filename, or
1145     a wild-card string, where <code>?</code> matches any single character,
1146     and <code>*</code> matches any sequences of characters. Extended regular
1147     expressions can also be used, with the addition of the
1148     <code>~</code> character. For example:</p>
1149
1150     <div class="example"><p><code>
1151       &lt;Files ~ "\.(gif|jpe?g|png)$"&gt;
1152     </code></p></div>
1153
1154     <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch">&lt;FilesMatch&gt;</a></code> is preferred,
1155     however.</p>
1156
1157     <p>Note that unlike <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> and <code class="directive"><a href="#location">&lt;Location&gt;</a></code> sections, <code class="directive">&lt;Files&gt;</code> sections can be used inside
1158     <code>.htaccess</code> files. This allows users to control access to
1159     their own files, at a file-by-file level.</p>
1160
1161
1162 <h3>See also</h3>
1163 <ul>
1164 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1165     and &lt;Files&gt; sections work</a> for an explanation of how these
1166     different sections are combined when a request is received</li>
1167 </ul>
1168 </div>
1169 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1170 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch">&lt;FilesMatch&gt;</a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
1171 <table class="directive">
1172 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
1173 filenames</td></tr>
1174 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;FilesMatch <var>regex</var>&gt; ... &lt;/FilesMatch&gt;</code></td></tr>
1175 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1176 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1177 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1178 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1179 </table>
1180     <p>The <code class="directive">&lt;FilesMatch&gt;</code> directive
1181     limits the scope of the enclosed directives by filename, just as the
1182     <code class="directive"><a href="#files">&lt;Files&gt;</a></code> directive
1183     does. However, it accepts a regular expression. For example:</p>
1184
1185     <div class="example"><p><code>
1186       &lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
1187     </code></p></div>
1188
1189     <p>would match most common Internet graphics formats.</p>
1190
1191 <h3>See also</h3>
1192 <ul>
1193 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1194     and &lt;Files&gt; sections work</a> for an explanation of how these
1195     different sections are combined when a request is received</li>
1196 </ul>
1197 </div>
1198 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1199 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
1200 <table class="directive">
1201 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
1202 MIME content-type</td></tr>
1203 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>MIME-type</var>|None</code></td></tr>
1204 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1205 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1206 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1207 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1208 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache 2.0</td></tr>
1209 </table>
1210     <p>When placed into an <code>.htaccess</code> file or a
1211     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>, or
1212     <code class="directive"><a href="#location">&lt;Location&gt;</a></code> or
1213     <code class="directive"><a href="#files">&lt;Files&gt;</a></code>
1214     section, this directive forces all matching files to be served
1215     with the content type identification given by
1216     <var>MIME-type</var>. For example, if you had a directory full of
1217     GIF files, but did not want to label them all with <code>.gif</code>,
1218     you might want to use:</p>
1219
1220     <div class="example"><p><code>
1221       ForceType image/gif
1222     </code></p></div>
1223
1224     <p>Note that unlike <code class="directive"><a href="#defaulttype">DefaultType</a></code>,
1225     this directive overrides all mime-type associations, including
1226     filename extensions, that might identify the media type.</p>
1227
1228     <p>You can override any <code class="directive">ForceType</code> setting
1229     by using the value of <code>None</code>:</p>
1230
1231     <div class="example"><p><code>
1232       # force all files to be image/gif:<br />
1233       &lt;Location /images&gt;<br />
1234         <span class="indent">
1235           ForceType image/gif<br />
1236         </span>
1237       &lt;/Location&gt;<br />
1238       <br />
1239       # but normal mime-type associations here:<br />
1240       &lt;Location /images/mixed&gt;<br />
1241       <span class="indent">
1242         ForceType None<br />
1243       </span>
1244       &lt;/Location&gt;
1245     </code></p></div>
1246
1247 </div>
1248 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1249 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
1250 <table class="directive">
1251 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1252 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1253 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
1254 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1255 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1256 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1257 </table>
1258     <p>This directive enables DNS lookups so that host names can be
1259     logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1260     The value <code>Double</code> refers to doing double-reverse
1261     DNS lookup. That is, after a reverse lookup is performed, a forward
1262     lookup is then performed on that result. At least one of the IP
1263     addresses in the forward lookup must match the original
1264     address. (In "tcpwrappers" terminology this is called
1265     <code>PARANOID</code>.)</p>
1266
1267     <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1268     used for controlling access by hostname, a double reverse lookup
1269     will be performed.  This is necessary for security. Note that the
1270     result of this double-reverse isn't generally available unless you
1271     set <code>HostnameLookups Double</code>. For example, if only
1272     <code>HostnameLookups On</code> and a request is made to an object
1273     that is protected by hostname restrictions, regardless of whether
1274     the double-reverse fails or not, CGIs will still be passed the
1275     single-reverse result in <code>REMOTE_HOST</code>.</p>
1276
1277     <p>The default is <code>Off</code> in order to save the network
1278     traffic for those sites that don't truly need the reverse
1279     lookups done. It is also better for the end users because they
1280     don't have to suffer the extra latency that a lookup entails.
1281     Heavily loaded sites should leave this directive
1282     <code>Off</code>, since DNS lookups can take considerable
1283     amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
1284     default to the <code>bin</code> subdirectory of your installation
1285     directory, can be used to look up host names from logged IP addresses
1286     offline.</p>
1287
1288 </div>
1289 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1290 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine">&lt;IfDefine&gt;</a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
1291 <table class="directive">
1292 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
1293 if a test is true at startup</td></tr>
1294 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfDefine [!]<var>parameter-name</var>&gt; ...
1295     &lt;/IfDefine&gt;</code></td></tr>
1296 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1297 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1298 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1299 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1300 </table>
1301     <p>The <code>&lt;IfDefine <var>test</var>&gt;...&lt;/IfDefine&gt;
1302     </code> section is used to mark directives that are conditional. The
1303     directives within an <code class="directive">&lt;IfDefine&gt;</code>
1304     section are only processed if the <var>test</var> is true. If <var>
1305     test</var> is false, everything between the start and end markers is
1306     ignored.</p>
1307
1308     <p>The <var>test</var> in the <code class="directive">&lt;IfDefine&gt;</code> section directive can be one of two forms:</p>
1309
1310     <ul>
1311       <li><var>parameter-name</var></li>
1312
1313       <li><code>!</code><var>parameter-name</var></li>
1314     </ul>
1315
1316     <p>In the former case, the directives between the start and end
1317     markers are only processed if the parameter named
1318     <var>parameter-name</var> is defined. The second format reverses
1319     the test, and only processes the directives if
1320     <var>parameter-name</var> is <strong>not</strong> defined.</p>
1321
1322     <p>The <var>parameter-name</var> argument is a define as given on
1323     the <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter-</var>
1324     </code>, at the time the server was started.</p>
1325
1326     <p><code class="directive">&lt;IfDefine&gt;</code> sections are
1327     nest-able, which can be used to implement simple
1328     multiple-parameter tests. Example:</p>
1329
1330     <div class="example"><p><code>
1331       httpd -DReverseProxy ...<br />
1332       <br />
1333       # httpd.conf<br />
1334       &lt;IfDefine ReverseProxy&gt;<br />
1335       <span class="indent">
1336         LoadModule rewrite_module modules/mod_rewrite.so<br />
1337         LoadModule proxy_module   modules/libproxy.so<br />
1338       </span>
1339       &lt;/IfDefine&gt;
1340     </code></p></div>
1341
1342 </div>
1343 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1344 <div class="directive-section"><h2><a name="IfModule" id="IfModule">&lt;IfModule&gt;</a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
1345 <table class="directive">
1346 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
1347 presence or absence of a specific module</td></tr>
1348 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfModule [!]<var>module-file</var>|<var>module-identifier</var>&gt; ...
1349     &lt;/IfModule&gt;</code></td></tr>
1350 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1351 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1352 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1353 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1354 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Module identifiers are available in version 2.1 and
1355 later.</td></tr>
1356 </table>
1357     <p>The <code>&lt;IfModule <var>test</var>&gt;...&lt;/IfModule&gt;</code>
1358     section is used to mark directives that are conditional on the presence of
1359     a specific module. The directives within an <code class="directive">&lt;IfModule&gt;</code> section are only processed if the <var>test</var>
1360     is true. If <var>test</var> is false, everything between the start and
1361     end markers is ignored.</p>
1362
1363     <p>The <var>test</var> in the <code class="directive">&lt;IfModule&gt;</code> section directive can be one of two forms:</p>
1364
1365     <ul>
1366       <li><var>module</var></li>
1367
1368       <li>!<var>module</var></li>
1369     </ul>
1370
1371     <p>In the former case, the directives between the start and end
1372     markers are only processed if the module named <var>module</var>
1373     is included in Apache -- either compiled in or
1374     dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1375     and only processes the directives if <var>module</var> is
1376     <strong>not</strong> included.</p>
1377
1378     <p>The <var>module</var> argument can be either the module identifier or
1379     the file name of the module, at the time it was compiled.  For example,
1380     <code>rewrite_module</code> is the identifier and
1381     <code>mod_rewrite.c</code> is the file name. If a module consists of
1382     several source files, use the name of the file containing the string
1383     <code>STANDARD20_MODULE_STUFF</code>.</p>
1384
1385     <p><code class="directive">&lt;IfModule&gt;</code> sections are
1386     nest-able, which can be used to implement simple multiple-module
1387     tests.</p>
1388
1389     <div class="note">This section should only be used if you need to have one
1390     configuration file that works whether or not a specific module
1391     is available. In normal operation, directives need not be
1392     placed in <code class="directive">&lt;IfModule&gt;</code>
1393     sections.</div>
1394
1395 </div>
1396 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1397 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
1398 <table class="directive">
1399 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
1400 the server configuration files</td></tr>
1401 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Include <var>file-path</var>|<var>directory-path</var></code></td></tr>
1402 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1403 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1404 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1405 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later</td></tr>
1406 </table>
1407     <p>This directive allows inclusion of other configuration files
1408     from within the server configuration files.</p>
1409
1410     <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used to
1411     include several files at once, in alphabetical order. In
1412     addition, if <code class="directive">Include</code> points to a directory,
1413     rather than a file, Apache will read all files in that directory
1414     and any subdirectory.  But including entire directories is not
1415     recommended, because it is easy to accidentally leave temporary
1416     files in a directory that can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
1417     fail.</p>
1418
1419     <p>The file path specified may be an absolute path, or may be relative 
1420     to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1421
1422     <p>Examples:</p>
1423
1424     <div class="example"><p><code>
1425       Include /usr/local/apache2/conf/ssl.conf<br />
1426       Include /usr/local/apache2/conf/vhosts/*.conf
1427     </code></p></div>
1428
1429     <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1430
1431     <div class="example"><p><code>
1432       Include conf/ssl.conf<br />
1433       Include conf/vhosts/*.conf
1434     </code></p></div>
1435
1436     <p>Running <code>apachectl configtest</code> will give you a list
1437     of the files that are being processed during the configuration
1438     check:</p>
1439
1440     <div class="example"><p><code>
1441       root@host# apachectl configtest<br />
1442       Processing config file: /usr/local/apache2/conf/ssl.conf<br />
1443       Processing config file: /usr/local/apache2/conf/vhosts/vhost1.conf<br />
1444       Processing config file: /usr/local/apache2/conf/vhosts/vhost2.conf<br />
1445       Syntax OK
1446     </code></p></div>
1447
1448 <h3>See also</h3>
1449 <ul>
1450 <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
1451 </ul>
1452 </div>
1453 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1454 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
1455 <table class="directive">
1456 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
1457 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1458 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
1459 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1460 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1461 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1462 </table>
1463     <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1464     connection feature of HTTP/1.1 provide long-lived HTTP sessions
1465     which allow multiple requests to be sent over the same TCP
1466     connection. In some cases this has been shown to result in an
1467     almost 50% speedup in latency times for HTML documents with
1468     many images. To enable Keep-Alive connections, set
1469     <code>KeepAlive On</code>.</p>
1470
1471     <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1472     used if they are specifically requested by a client. In
1473     addition, a Keep-Alive connection with an HTTP/1.0 client can
1474     only be used when the length of the content is known in
1475     advance. This implies that dynamic content such as CGI output,
1476     SSI pages, and server-generated directory listings will
1477     generally not use Keep-Alive connections to HTTP/1.0 clients.
1478     For HTTP/1.1 clients, persistent connections are the default
1479     unless otherwise specified. If the client requests it, chunked
1480     encoding will be used in order to send content of unknown
1481     length over persistent connections.</p>
1482
1483 <h3>See also</h3>
1484 <ul>
1485 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
1486 </ul>
1487 </div>
1488 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1489 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
1490 <table class="directive">
1491 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
1492 requests on a persistent connection</td></tr>
1493 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>seconds</var></code></td></tr>
1494 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 15</code></td></tr>
1495 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1496 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1497 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1498 </table>
1499     <p>The number of seconds Apache will wait for a subsequent
1500     request before closing the connection. Once a request has been
1501     received, the timeout value specified by the
1502     <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
1503
1504     <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
1505     may cause performance problems in heavily loaded servers. The
1506     higher the timeout, the more server processes will be kept
1507     occupied waiting on connections with idle clients.</p>
1508
1509 </div>
1510 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1511 <div class="directive-section"><h2><a name="Limit" id="Limit">&lt;Limit&gt;</a> <a name="limit" id="limit">Directive</a></h2>
1512 <table class="directive">
1513 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
1514 methods</td></tr>
1515 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Limit <var>method</var> [<var>method</var>] ... &gt; ...
1516     &lt;/Limit&gt;</code></td></tr>
1517 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1518 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1519 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1520 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1521 </table>
1522     <p>Access controls are normally effective for
1523     <strong>all</strong> access methods, and this is the usual
1524     desired behavior. <strong>In the general case, access control
1525     directives should not be placed within a
1526     <code class="directive">&lt;Limit&gt;</code> section.</strong></p>
1527
1528     <p>The purpose of the <code class="directive">&lt;Limit&gt;</code>
1529     directive is to restrict the effect of the access controls to the
1530     nominated HTTP methods. For all other methods, the access
1531     restrictions that are enclosed in the <code class="directive">&lt;Limit&gt;</code> bracket <strong>will have no
1532     effect</strong>. The following example applies the access control
1533     only to the methods <code>POST</code>, <code>PUT</code>, and
1534     <code>DELETE</code>, leaving all other methods unprotected:</p>
1535
1536     <div class="example"><p><code>
1537       &lt;Limit POST PUT DELETE&gt;<br />
1538       <span class="indent">
1539         Require valid-user<br />
1540       </span>
1541       &lt;/Limit&gt;
1542     </code></p></div>
1543
1544     <p>The method names listed can be one or more of: <code>GET</code>,
1545     <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1546     <code>CONNECT</code>, <code>OPTIONS</code>,
1547     <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1548     <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1549     <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1550     case-sensitive.</strong> If <code>GET</code> is used it will also
1551     restrict <code>HEAD</code> requests. The <code>TRACE</code> method
1552     cannot be limited.</p>
1553
1554     <div class="warning">A <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section should always be
1555     used in preference to a <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> section when restricting access,
1556     since a <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section provides protection
1557     against arbitrary methods.</div>
1558
1559
1560 </div>
1561 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1562 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept">&lt;LimitExcept&gt;</a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
1563 <table class="directive">
1564 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
1565 except the named ones</td></tr>
1566 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;LimitExcept <var>method</var> [<var>method</var>] ... &gt; ...
1567     &lt;/LimitExcept&gt;</code></td></tr>
1568 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1569 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1570 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1571 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1572 </table>
1573     <p><code class="directive">&lt;LimitExcept&gt;</code> and
1574     <code>&lt;/LimitExcept&gt;</code> are used to enclose
1575     a group of access control directives which will then apply to any
1576     HTTP access method <strong>not</strong> listed in the arguments;
1577     i.e., it is the opposite of a <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> section and can be used to control
1578     both standard and nonstandard/unrecognized methods. See the
1579     documentation for <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> for more details.</p>
1580
1581     <p>For example:</p>
1582
1583     <div class="example"><p><code>
1584       &lt;LimitExcept POST GET&gt;<br />
1585       <span class="indent">
1586         Require valid-user<br />
1587       </span>
1588       &lt;/LimitExcept&gt;
1589     </code></p></div>
1590
1591
1592 </div>
1593 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1594 <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directive</a></h2>
1595 <table class="directive">
1596 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine maximum number of internal redirects and nested
1597 subrequests</td></tr>
1598 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
1599 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
1600 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1601 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1602 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1603 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.47 and later</td></tr>
1604 </table>
1605     <p>An internal redirect happens, for example, when using the <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> directive, which internally
1606     redirects the original request to a CGI script. A subrequest is Apache's
1607     mechanism to find out what would happen for some URI if it were requested.
1608     For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
1609     files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
1610     directive.</p>
1611
1612     <p><code class="directive">LimitInternalRecursion</code> prevents the server
1613     from crashing when entering an infinite loop of internal redirects or
1614     subrequests. Such loops are usually caused by misconfigurations.</p>
1615
1616     <p>The directive stores two different limits, which are evaluated on
1617     per-request basis. The first <var>number</var> is the maximum number of
1618     internal redirects, that may follow each other. The second <var>number</var>
1619     determines, how deep subrequests may be nested. If you specify only one
1620     <var>number</var>, it will be assigned to both limits.</p>
1621
1622     <div class="example"><h3>Example</h3><p><code>
1623       LimitInternalRecursion 5
1624     </code></p></div>
1625
1626 </div>
1627 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1628 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
1629 <table class="directive">
1630 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
1631 from the client</td></tr>
1632 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
1633 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
1634 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1635 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1636 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1637 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1638 </table>
1639     <p>This directive specifies the number of <var>bytes</var> from 0
1640     (meaning unlimited) to 2147483647 (2GB) that are allowed in a
1641     request body.</p>
1642
1643     <p>The <code class="directive">LimitRequestBody</code> directive allows
1644     the user to set a limit on the allowed size of an HTTP request
1645     message body within the context in which the directive is given
1646     (server, per-directory, per-file or per-location). If the client
1647     request exceeds that limit, the server will return an error
1648     response instead of servicing the request. The size of a normal
1649     request message body will vary greatly depending on the nature of
1650     the resource and the methods allowed on that resource. CGI scripts
1651     typically use the message body for retrieving form information.
1652     Implementations of the <code>PUT</code> method will require
1653     a value at least as large as any representation that the server
1654     wishes to accept for that resource.</p>
1655
1656     <p>This directive gives the server administrator greater
1657     control over abnormal client request behavior, which may be
1658     useful for avoiding some forms of denial-of-service
1659     attacks.</p>
1660
1661     <p>If, for example, you are permitting file upload to a particular
1662     location, and wish to limit the size of the uploaded file to 100K,
1663     you might use the following directive:</p>
1664
1665     <div class="example"><p><code>
1666       LimitRequestBody 102400
1667     </code></p></div>
1668
1669
1670 </div>
1671 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1672 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
1673 <table class="directive">
1674 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
1675 will be accepted from the client</td></tr>
1676 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
1677 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
1678 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1679 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1680 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1681 </table>
1682     <p><var>Number</var> is an integer from 0 (meaning unlimited) to
1683     32767. The default value is defined by the compile-time
1684     constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
1685     distributed).</p>
1686
1687     <p>The <code class="directive">LimitRequestFields</code> directive allows
1688     the server administrator to modify the limit on the number of
1689     request header fields allowed in an HTTP request. A server needs
1690     this value to be larger than the number of fields that a normal
1691     client request might include. The number of request header fields
1692     used by a client rarely exceeds 20, but this may vary among
1693     different client implementations, often depending upon the extent
1694     to which a user has configured their browser to support detailed
1695     content negotiation. Optional HTTP extensions are often expressed
1696     using request header fields.</p>
1697
1698     <p>This directive gives the server administrator greater
1699     control over abnormal client request behavior, which may be
1700     useful for avoiding some forms of denial-of-service attacks.
1701     The value should be increased if normal clients see an error
1702     response from the server that indicates too many fields were
1703     sent in the request.</p>
1704
1705     <p>For example:</p>
1706
1707     <div class="example"><p><code>
1708       LimitRequestFields 50
1709     </code></p></div>
1710
1711
1712 </div>
1713 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1714 <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
1715 <table class="directive">
1716 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
1717 client</td></tr>
1718 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldsize <var>bytes</var></code></td></tr>
1719 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldsize 8190</code></td></tr>
1720 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1721 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1722 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1723 </table>
1724     <p>This directive specifies the number of <var>bytes</var> from 0
1725     to the value of the compile-time constant
1726     <code>DEFAULT_LIMIT_REQUEST_FIELDSIZE</code> (8190 as
1727     distributed) that will be allowed in an HTTP request
1728     header.</p>
1729
1730     <p>The <code class="directive">LimitRequestFieldSize</code> directive
1731     allows the server administrator to reduce the limit on the allowed
1732     size of an HTTP request header field below the normal input buffer
1733     size compiled with the server. A server needs this value to be
1734     large enough to hold any one header field from a normal client
1735     request. The size of a normal request header field will vary
1736     greatly among different client implementations, often depending
1737     upon the extent to which a user has configured their browser to
1738     support detailed content negotiation.</p>
1739
1740     <p>This directive gives the server administrator greater
1741     control over abnormal client request behavior, which may be
1742     useful for avoiding some forms of denial-of-service attacks.</p>
1743
1744     <p>For example:</p>
1745
1746     <div class="example"><p><code>
1747       LimitRequestFieldSize 4094
1748     </code></p></div>
1749
1750     <div class="note">Under normal conditions, the value should not be changed from
1751     the default.</div>
1752
1753
1754 </div>
1755 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1756 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
1757 <table class="directive">
1758 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
1759 from the client</td></tr>
1760 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
1761 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
1762 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1763 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1764 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1765 </table>
1766     <p>This directive sets the number of <var>bytes</var> from 0 to
1767     the value of the compile-time constant
1768     <code>DEFAULT_LIMIT_REQUEST_LINE</code> (8190 as distributed)
1769     that will be allowed on the HTTP request-line.</p>
1770
1771     <p>The <code class="directive">LimitRequestLine</code> directive allows
1772     the server administrator to reduce the limit on the allowed size
1773     of a client's HTTP request-line below the normal input buffer size
1774     compiled with the server. Since the request-line consists of the
1775     HTTP method, URI, and protocol version, the
1776     <code class="directive">LimitRequestLine</code> directive places a
1777     restriction on the length of a request-URI allowed for a request
1778     on the server. A server needs this value to be large enough to
1779     hold any of its resource names, including any information that
1780     might be passed in the query part of a <code>GET</code> request.</p>
1781
1782     <p>This directive gives the server administrator greater
1783     control over abnormal client request behavior, which may be
1784     useful for avoiding some forms of denial-of-service attacks.</p>
1785
1786     <p>For example:</p>
1787
1788     <div class="example"><p><code>
1789       LimitRequestLine 4094
1790     </code></p></div>
1791
1792     <div class="note">Under normal conditions, the value should not be changed from
1793     the default.</div>
1794
1795 </div>
1796 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1797 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
1798 <table class="directive">
1799 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
1800 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
1801 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
1802 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1803 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1804 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1805 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1806 </table>
1807     <p>Limit (in bytes) on maximum size of an XML-based request
1808     body. A value of <code>0</code> will disable any checking.</p>
1809
1810     <p>Example:</p>
1811
1812     <div class="example"><p><code>
1813       LimitXMLRequestBody 0
1814     </code></p></div>
1815
1816
1817 </div>
1818 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1819 <div class="directive-section"><h2><a name="Location" id="Location">&lt;Location&gt;</a> <a name="location" id="location">Directive</a></h2>
1820 <table class="directive">
1821 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
1822 URLs</td></tr>
1823 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Location
1824     <var>URL-path</var>|<var>URL</var>&gt; ... &lt;/Location&gt;</code></td></tr>
1825 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1826 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1827 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1828 </table>
1829     <p>The <code class="directive">&lt;Location&gt;</code> directive
1830     limits the scope of the enclosed directives by URL. It is similar to the
1831     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
1832     directive, and starts a subsection which is terminated with a
1833     <code>&lt;/Location&gt;</code> directive. <code class="directive">&lt;Location&gt;</code> sections are processed in the
1834     order they appear in the configuration file, after the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections and
1835     <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files">&lt;Files&gt;</a></code> sections.</p>
1836
1837     <p><code class="directive">&lt;Location&gt;</code> sections operate
1838     completely outside the filesystem.  This has several consequences.
1839     Most importantly, <code class="directive">&lt;Location&gt;</code>
1840     directives should not be used to control access to filesystem
1841     locations.  Since several different URLs may map to the same
1842     filesystem location, such access controls may by circumvented.</p>
1843
1844     <div class="note"><h3>When to use <code class="directive">&lt;Location&gt;</code></h3>
1845
1846     <p>Use <code class="directive">&lt;Location&gt;</code> to apply
1847     directives to content that lives outside the filesystem.  For
1848     content that lives in the filesystem, use <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> and <code class="directive"><a href="#files">&lt;Files&gt;</a></code>.  An exception is
1849     <code>&lt;Location /&gt;</code>, which is an easy way to 
1850     apply a configuration to the entire server.</p>
1851     </div>
1852
1853     <p>For all origin (non-proxy) requests, the URL to be matched is a
1854     URL-path of the form <code>/path/</code>.  No scheme, hostname,
1855     port, or query string may be included.  For proxy requests, the
1856     URL to be matched is of the form
1857     <code>scheme://servername/path</code>, and you must include the
1858     prefix.</p>
1859
1860     <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
1861     any single character, and <code>*</code> matches any sequences of
1862     characters.</p>
1863
1864     <p>Extended regular
1865     expressions can also be used, with the addition of the
1866     <code>~</code> character. For example:</p>
1867
1868     <div class="example"><p><code>
1869       &lt;Location ~ "/(extra|special)/data"&gt;
1870     </code></p></div>
1871
1872     <p>would match URLs that contained the substring <code>/extra/data</code>
1873     or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch">&lt;LocationMatch&gt;</a></code> behaves
1874     identical to the regex version of <code class="directive">&lt;Location&gt;</code>.</p>
1875
1876     <p>The <code class="directive">&lt;Location&gt;</code>
1877     functionality is especially useful when combined with the
1878     <code class="directive"><a href="#sethandler">SetHandler</a></code>
1879     directive. For example, to enable status requests, but allow them
1880     only from browsers at <code>foo.com</code>, you might use:</p>
1881
1882     <div class="example"><p><code>
1883       &lt;Location /status&gt;<br />
1884       <span class="indent">
1885         SetHandler server-status<br />
1886         Order Deny,Allow<br />
1887         Deny from all<br />
1888         Allow from .foo.com<br />
1889       </span>
1890       &lt;/Location&gt;
1891     </code></p></div>
1892
1893     <div class="note"><h3>Note about / (slash)</h3>
1894       <p>The slash character has special meaning depending on where in a
1895       URL it appears. People may be used to its behavior in the filesystem
1896       where multiple adjacent slashes are frequently collapsed to a single
1897       slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
1898       <code>/home/foo</code>). In URL-space this is not necessarily true.
1899       The <code class="directive"><a href="#locationmatch">&lt;LocationMatch&gt;</a></code>
1900       directive and the regex version of <code class="directive">&lt;Location&gt;</code> require you to explicitly specify multiple
1901       slashes if that is your intention.</p>
1902
1903       <p>For example, <code>&lt;LocationMatch ^/abc&gt;</code> would match
1904       the request URL <code>/abc</code> but not the request URL <code>
1905       //abc</code>. The (non-regex) <code class="directive">&lt;Location&gt;</code> directive behaves similarly when used for
1906       proxy requests. But when (non-regex) <code class="directive">&lt;Location&gt;</code> is used for non-proxy requests it will
1907       implicitly match multiple slashes with a single slash. For example,
1908       if you specify <code>&lt;Location /abc/def&gt;</code> and the
1909       request is to <code>/abc//def</code> then it will match.</p>
1910     </div>
1911
1912 <h3>See also</h3>
1913 <ul>
1914 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1915     and &lt;Files&gt; sections work</a> for an explanation of how these
1916     different sections are combined when a request is received</li>
1917 </ul>
1918 </div>
1919 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1920 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch">&lt;LocationMatch&gt;</a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
1921 <table class="directive">
1922 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
1923 matching URLs</td></tr>
1924 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;LocationMatch
1925     <var>regex</var>&gt; ... &lt;/LocationMatch&gt;</code></td></tr>
1926 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1927 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1928 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1929 </table>
1930     <p>The <code class="directive">&lt;LocationMatch&gt;</code> directive
1931     limits the scope of the enclosed directives by URL, in an identical manner
1932     to <code class="directive"><a href="#location">&lt;Location&gt;</a></code>. However,
1933     it takes a regular expression as an argument instead of a simple
1934     string. For example:</p>
1935
1936     <div class="example"><p><code>
1937       &lt;LocationMatch "/(extra|special)/data"&gt;
1938     </code></p></div>
1939
1940     <p>would match URLs that contained the substring <code>/extra/data</code>
1941     or <code>/special/data</code>.</p>
1942
1943 <h3>See also</h3>
1944 <ul>
1945 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1946     and &lt;Files&gt; sections work</a> for an explanation of how these
1947     different sections are combined when a request is received</li>
1948 </ul>
1949 </div>
1950 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1951 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
1952 <table class="directive">
1953 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
1954 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel <var>level</var></code></td></tr>
1955 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
1956 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1957 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1958 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1959 </table>
1960     <p><code class="directive">LogLevel</code> adjusts the verbosity of the
1961     messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
1962     <var>level</var>s are available, in order of decreasing
1963     significance:</p>
1964
1965     <table class="bordered">
1966     
1967       <tr>
1968         <th><strong>Level</strong> </th>
1969
1970         <th><strong>Description</strong> </th>
1971
1972         <th><strong>Example</strong> </th>
1973       </tr>
1974
1975       <tr>
1976         <td><code>emerg</code> </td>
1977
1978         <td>Emergencies - system is unusable.</td>
1979
1980         <td>"Child cannot open lock file. Exiting"</td>
1981       </tr>
1982
1983       <tr>
1984         <td><code>alert</code> </td>
1985
1986         <td>Action must be taken immediately.</td>
1987
1988         <td>"getpwuid: couldn't determine user name from uid"</td>
1989       </tr>
1990
1991       <tr>
1992         <td><code>crit</code> </td>
1993
1994         <td>Critical Conditions.</td>
1995
1996         <td>"socket: Failed to get a socket, exiting child"</td>
1997       </tr>
1998
1999       <tr>
2000         <td><code>error</code> </td>
2001
2002         <td>Error conditions.</td>
2003
2004         <td>"Premature end of script headers"</td>
2005       </tr>
2006
2007       <tr>
2008         <td><code>warn</code> </td>
2009
2010         <td>Warning conditions.</td>
2011
2012         <td>"child process 1234 did not exit, sending another
2013         SIGHUP"</td>
2014       </tr>
2015
2016       <tr>
2017         <td><code>notice</code> </td>
2018
2019         <td>Normal but significant condition.</td>
2020
2021         <td>"httpd: caught SIGBUS, attempting to dump core in
2022         ..."</td>
2023       </tr>
2024
2025       <tr>
2026         <td><code>info</code> </td>
2027
2028         <td>Informational.</td>
2029
2030         <td>"Server seems busy, (you may need to increase
2031         StartServers, or Min/MaxSpareServers)..."</td>
2032       </tr>
2033
2034       <tr>
2035         <td><code>debug</code> </td>
2036
2037         <td>Debug-level messages</td>
2038
2039         <td>"Opening config file ..."</td>
2040       </tr>
2041     </table>
2042
2043     <p>When a particular level is specified, messages from all
2044     other levels of higher significance will be reported as well.
2045     <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2046     then messages with log levels of <code>notice</code> and
2047     <code>warn</code> will also be posted.</p>
2048
2049     <p>Using a level of at least <code>crit</code> is
2050     recommended.</p>
2051
2052     <p>For example:</p>
2053
2054     <div class="example"><p><code>
2055       LogLevel notice
2056     </code></p></div>
2057
2058     <div class="note"><h3>Note</h3>
2059       <p>When logging to a regular file messages of the level
2060       <code>notice</code> cannot be suppressed and thus are always
2061       logged. However, this doesn't apply when logging is done
2062       using <code>syslog</code>.</p>
2063     </div>
2064
2065 </div>
2066 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2067 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
2068 <table class="directive">
2069 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
2070 connection</td></tr>
2071 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
2072 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
2073 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2074 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2075 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2076 </table>
2077     <p>The <code class="directive">MaxKeepAliveRequests</code> directive
2078     limits the number of requests allowed per connection when
2079     <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
2080     set to <code>0</code>, unlimited requests will be allowed. We
2081     recommend that this setting be kept to a high value for maximum
2082     server performance.</p>
2083
2084     <p>For example:</p>
2085
2086     <div class="example"><p><code>
2087       MaxKeepAliveRequests 500
2088     </code></p></div>
2089
2090 </div>
2091 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2092 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
2093 <table class="directive">
2094 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
2095 hosting</td></tr>
2096 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
2097 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2098 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2099 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2100 </table>
2101     <p>The <code class="directive">NameVirtualHost</code> directive is a
2102     required directive if you want to configure <a href="../vhosts/">name-based virtual hosts</a>.</p>
2103
2104     <p>Although <var>addr</var> can be hostname it is recommended
2105     that you always use an IP address, e.g.</p>
2106
2107     <div class="example"><p><code>
2108       NameVirtualHost 111.22.33.44
2109     </code></p></div>
2110
2111     <p>With the <code class="directive">NameVirtualHost</code> directive you
2112     specify the IP address on which the server will receive requests
2113     for the name-based virtual hosts. This will usually be the address
2114     to which your name-based virtual host names resolve. In cases
2115     where a firewall or other proxy receives the requests and forwards
2116     them on a different IP address to the server, you must specify the
2117     IP address of the physical interface on the machine which will be
2118     servicing the requests. If you have multiple name-based hosts on
2119     multiple addresses, repeat the directive for each address.</p>
2120
2121     <div class="note"><h3>Note</h3>
2122       <p>Note, that the "main server" and any <code>_default_</code> servers
2123       will <strong>never</strong> be served for a request to a
2124       <code class="directive">NameVirtualHost</code> IP address (unless for some
2125       reason you specify <code class="directive">NameVirtualHost</code> but then
2126       don't define any <code class="directive">VirtualHost</code>s for that
2127       address).</p>
2128     </div>
2129
2130     <p>Optionally you can specify a port number on which the
2131     name-based virtual hosts should be used, e.g.</p>
2132
2133     <div class="example"><p><code>
2134       NameVirtualHost 111.22.33.44:8080
2135     </code></p></div>
2136
2137     <p>IPv6 addresses must be enclosed in square brackets, as shown
2138     in the following example:</p>
2139
2140     <div class="example"><p><code>
2141       NameVirtualHost [fe80::a00:20ff:fea7:ccea]:8080
2142     </code></p></div>
2143
2144     <p>To receive requests on all interfaces, you can use an argument of
2145     <code>*</code></p>
2146
2147     <div class="example"><p><code>
2148       NameVirtualHost *
2149     </code></p></div>
2150
2151     <div class="note"><h3>Argument to <code class="directive">&lt;VirtualHost&gt;</code>
2152       directive</h3>
2153       <p>Note that the argument to the <code class="directive">&lt;VirtualHost&gt;</code> directive must
2154       exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
2155
2156       <div class="example"><p><code>
2157         NameVirtualHost 1.2.3.4<br />
2158         &lt;VirtualHost 1.2.3.4&gt;<br />
2159         # ...<br />
2160         &lt;/VirtualHost&gt;<br />
2161       </code></p></div>
2162     </div>
2163
2164 <h3>See also</h3>
2165 <ul>
2166 <li><a href="../vhosts/">Virtual Hosts
2167 documentation</a></li>
2168 </ul>
2169 </div>
2170 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2171 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
2172 <table class="directive">
2173 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
2174 directory</td></tr>
2175 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
2176     [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
2177 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
2178 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2179 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
2180 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2181 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2182 </table>
2183     <p>The <code class="directive">Options</code> directive controls which
2184     server features are available in a particular directory.</p>
2185
2186     <p><var>option</var> can be set to <code>None</code>, in which
2187     case none of the extra features are enabled, or one or more of
2188     the following:</p>
2189
2190     <dl>
2191       <dt><code>All</code></dt>
2192
2193       <dd>All options except for <code>MultiViews</code>. This is the default
2194       setting.</dd>
2195
2196       <dt><code>ExecCGI</code></dt>
2197
2198       <dd>
2199       Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
2200       is permitted.</dd>
2201
2202       <dt><code>FollowSymLinks</code></dt>
2203
2204       <dd>
2205
2206       The server will follow symbolic links in this directory.
2207       <div class="note">
2208       <p>Even though the server follows the symlink it does <em>not</em>
2209       change the pathname used to match against <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections.</p>
2210       <p>Note also, that this option <strong>gets ignored</strong> if set
2211       inside a <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
2212       section.</p>
2213       </div></dd>
2214
2215       <dt><code>Includes</code></dt>
2216
2217       <dd>
2218       Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
2219       are permitted.</dd>
2220
2221       <dt><code>IncludesNOEXEC</code></dt>
2222
2223       <dd>
2224
2225       Server-side includes are permitted, but the <code>#exec
2226       cmd</code> and <code>#exec cgi</code> are disabled. It is still
2227       possible to <code>#include virtual</code> CGI scripts from
2228       <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
2229       directories.</dd>
2230
2231       <dt><code>Indexes</code></dt>
2232
2233       <dd>
2234       If a URL which maps to a directory is requested, and there
2235       is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
2236       (<em>e.g.</em>, <code>index.html</code>) in that directory, then
2237       <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
2238       of the directory.</dd>
2239
2240       <dt><code>MultiViews</code></dt>
2241
2242       <dd>
2243       <a href="../content-negotiation.html">Content negotiated</a>
2244       "MultiViews" are allowed using
2245       <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.</dd>
2246
2247       <dt><code>SymLinksIfOwnerMatch</code></dt>
2248
2249       <dd>The server will only follow symbolic links for which the
2250       target file or directory is owned by the same user id as the
2251       link.
2252
2253       <div class="note"><h3>Note</h3> This option gets ignored if
2254       set inside a <code class="directive"><a href="#location">&lt;Location&gt;</a></code> section.</div>
2255       </dd>
2256     </dl>
2257
2258     <p>Normally, if multiple <code class="directive">Options</code> could
2259     apply to a directory, then the most specific one is used and
2260     others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
2261     However if <em>all</em> the options on the
2262     <code class="directive">Options</code> directive are preceded by a
2263     <code>+</code> or <code>-</code> symbol, the options are
2264     merged. Any options preceded by a <code>+</code> are added to the
2265     options currently in force, and any options preceded by a
2266     <code>-</code> are removed from the options currently in
2267     force. </p>
2268
2269     <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
2270
2271     <div class="example"><p><code>
2272       &lt;Directory /web/docs&gt;<br />
2273       <span class="indent">
2274         Options Indexes FollowSymLinks<br />
2275       </span>
2276       &lt;/Directory&gt;<br />
2277       <br />
2278       &lt;Directory /web/docs/spec&gt;<br />
2279       <span class="indent">
2280         Options Includes<br />
2281       </span>
2282       &lt;/Directory&gt;
2283     </code></p></div>
2284
2285     <p>then only <code>Includes</code> will be set for the
2286     <code>/web/docs/spec</code> directory. However if the second
2287     <code class="directive">Options</code> directive uses the <code>+</code> and
2288     <code>-</code> symbols:</p>
2289
2290     <div class="example"><p><code>
2291       &lt;Directory /web/docs&gt;<br />
2292       <span class="indent">
2293         Options Indexes FollowSymLinks<br />
2294       </span>
2295       &lt;/Directory&gt;<br />
2296       <br />
2297       &lt;Directory /web/docs/spec&gt;<br />
2298       <span class="indent">
2299         Options +Includes -Indexes<br />
2300       </span>
2301       &lt;/Directory&gt;
2302     </code></p></div>
2303
2304     <p>then the options <code>FollowSymLinks</code> and
2305     <code>Includes</code> are set for the <code>/web/docs/spec</code>
2306     directory.</p>
2307
2308     <div class="note"><h3>Note</h3>
2309       <p>Using <code>-IncludesNOEXEC</code> or
2310       <code>-Includes</code> disables server-side includes completely
2311       regardless of the previous setting.</p>
2312     </div>
2313
2314     <p>The default in the absence of any other settings is
2315     <code>All</code>.</p>
2316
2317 </div>
2318 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2319 <div class="directive-section"><h2><a name="Require" id="Require">Require</a> <a name="require" id="require">Directive</a></h2>
2320 <table class="directive">
2321 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Selects which authenticated users can access
2322 a resource</td></tr>
2323 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Require <var>entity-name</var> [<var>entity-name</var>] ...</code></td></tr>
2324 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2325 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2326 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2327 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2328 </table>
2329     <p>This directive selects which authenticated users can access
2330     a directory. The allowed syntaxes are:</p>
2331
2332     <dl>
2333       <dt><code>Require user <var>userid</var> [<var>userid</var>]
2334       ...</code></dt>
2335       <dd>Only the named users can access the resource.</dd>
2336
2337       <dt><code>Require group <var>group-name</var> [<var>group-name</var>]
2338       ...</code></dt>
2339       <dd>Only users in the named groups can access the resource.</dd>
2340
2341       <dt><code>Require valid-user</code></dt>
2342       <dd>All valid users can access the resource.</dd>
2343     </dl>
2344
2345     <p><code class="directive">Require</code> must be accompanied by
2346     <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#authtype">AuthType</a></code> directives, and directives such
2347     as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>
2348     and <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> (to
2349     define users and groups) in order to work correctly. Example:</p>
2350
2351     <div class="example"><p><code>
2352        AuthType Basic<br />
2353        AuthName "Restricted Directory"<br />
2354        AuthUserFile /web/users<br />
2355        AuthGroupFile /web/groups<br />
2356        Require group admin
2357     </code></p></div>
2358
2359     <p>Access controls which are applied in this way are effective for
2360     <strong>all</strong> methods. <strong>This is what is normally
2361     desired.</strong> If you wish to apply access controls only to
2362     specific methods, while leaving other methods unprotected, then
2363     place the <code class="directive">Require</code> statement into a
2364     <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code>
2365     section.</p>
2366
2367 <h3>See also</h3>
2368 <ul>
2369 <li><code class="directive"><a href="#satisfy">Satisfy</a></code></li>
2370 <li><code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code></li>
2371 </ul>
2372 </div>
2373 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2374 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
2375 <table class="directive">
2376 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
2377 by Apache children</td></tr>
2378 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RLimitCPU <var>seconds</var>|max [<var>seconds</var>|max]</code></td></tr>
2379 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2380 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2381 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2382 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2383 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2384 </table>
2385     <p>Takes 1 or 2 parameters. The first parameter sets the soft
2386     resource limit for all processes and the second parameter sets
2387     the maximum resource limit. Either parameter can be a number,
2388     or <code>max</code> to indicate to the server that the limit should
2389     be set to the maximum allowed by the operating system
2390     configuration. Raising the maximum resource limit requires that
2391     the server is running as <code>root</code>, or in the initial startup
2392     phase.</p>
2393
2394     <p>This applies to processes forked off from Apache children
2395     servicing requests, not the Apache children themselves. This
2396     includes CGI scripts and SSI exec commands, but not any
2397     processes forked off from the Apache parent such as piped
2398     logs.</p>
2399
2400     <p>CPU resource limits are expressed in seconds per
2401     process.</p>
2402
2403 <h3>See also</h3>
2404 <ul>
2405 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2406 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2407 </ul>
2408 </div>
2409 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2410 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
2411 <table class="directive">
2412 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
2413 by Apache children</td></tr>
2414 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RLimitMEM <var>bytes</var>|max [<var>bytes</var>|max]</code></td></tr>
2415 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2416 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2417 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2418 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2419 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2420 </table>
2421     <p>Takes 1 or 2 parameters. The first parameter sets the soft
2422     resource limit for all processes and the second parameter sets
2423     the maximum resource limit. Either parameter can be a number,
2424     or <code>max</code> to indicate to the server that the limit should
2425     be set to the maximum allowed by the operating system
2426     configuration. Raising the maximum resource limit requires that
2427     the server is running as <code>root</code>, or in the initial startup
2428     phase.</p>
2429
2430     <p>This applies to processes forked off from Apache children
2431     servicing requests, not the Apache children themselves. This
2432     includes CGI scripts and SSI exec commands, but not any
2433     processes forked off from the Apache parent such as piped
2434     logs.</p>
2435
2436     <p>Memory resource limits are expressed in bytes per
2437     process.</p>
2438
2439 <h3>See also</h3>
2440 <ul>
2441 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2442 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2443 </ul>
2444 </div>
2445 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2446 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
2447 <table class="directive">
2448 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
2449 processes launched by Apache children</td></tr>
2450 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RLimitNPROC <var>number</var>|max [<var>number</var>|max]</code></td></tr>
2451 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2452 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2453 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2454 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2455 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2456 </table>
2457     <p>Takes 1 or 2 parameters. The first parameter sets the soft
2458     resource limit for all processes and the second parameter sets
2459     the maximum resource limit. Either parameter can be a number,
2460     or <code>max</code> to indicate to the server that the limit
2461     should be set to the maximum allowed by the operating system
2462     configuration. Raising the maximum resource limit requires that
2463     the server is running as <code>root</code>, or in the initial startup
2464     phase.</p>
2465
2466     <p>This applies to processes forked off from Apache children
2467     servicing requests, not the Apache children themselves. This
2468     includes CGI scripts and SSI exec commands, but not any
2469     processes forked off from the Apache parent such as piped
2470     logs.</p>
2471
2472     <p>Process limits control the number of processes per user.</p>
2473
2474     <div class="note"><h3>Note</h3>
2475       <p>If CGI processes are <strong>not</strong> running
2476       under user ids other than the web server user id, this directive
2477       will limit the number of processes that the server itself can
2478       create. Evidence of this situation will be indicated by
2479       <strong><code>cannot fork</code></strong> messages in the
2480       <code>error_log</code>.</p>
2481     </div>
2482
2483 <h3>See also</h3>
2484 <ul>
2485 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2486 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2487 </ul>
2488 </div>
2489 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2490 <div class="directive-section"><h2><a name="Satisfy" id="Satisfy">Satisfy</a> <a name="satisfy" id="satisfy">Directive</a></h2>
2491 <table class="directive">
2492 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Interaction between host-level access control and
2493 user authentication</td></tr>
2494 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Satisfy Any|All</code></td></tr>
2495 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Satisfy All</code></td></tr>
2496 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2497 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2498 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2499 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2500 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Influenced by <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> and <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> in version 2.0.51 and
2501 later</td></tr>
2502 </table>
2503     <p>Access policy if both <code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code> and <code class="directive"><a href="#require">Require</a></code> used. The parameter can be
2504     either <code>All</code> or <code>Any</code>. This directive is only
2505     useful if access to a particular area is being restricted by both
2506     username/password <em>and</em> client host address. In this case
2507     the default behavior (<code>All</code>) is to require that the client
2508     passes the address access restriction <em>and</em> enters a valid
2509     username and password. With the <code>Any</code> option the client will be
2510     granted access if they either pass the host restriction or enter a
2511     valid username and password. This can be used to password restrict
2512     an area, but to let clients from particular addresses in without
2513     prompting for a password.</p>
2514
2515     <p>For example, if you wanted to let people on your network have
2516     unrestricted access to a portion of your website, but require that
2517     people outside of your network provide a password, you could use a
2518     configuration similar to the following:</p>
2519
2520     <div class="example"><p><code>
2521       Require valid-user<br />
2522       Allow from 192.168.1<br />
2523       Satisfy Any
2524     </code></p></div>
2525
2526     <p>Since version 2.0.51 <code class="directive">Satisfy</code> directives can
2527     be restricted to particular methods by <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> and <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> sections.</p>
2528
2529 <h3>See also</h3>
2530 <ul>
2531 <li><code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code></li>
2532 <li><code class="directive"><a href="#require">Require</a></code></li>
2533 </ul>
2534 </div>
2535 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2536 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
2537 <table class="directive">
2538 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
2539 scripts</td></tr>
2540 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
2541 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
2542 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2543 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2544 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2545 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2546 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only;
2547 option <code>Registry-Strict</code> is available in Apache 2.0 and
2548 later</td></tr>
2549 </table>
2550     <p>This directive is used to control how Apache finds the
2551     interpreter used to run CGI scripts. The default setting is
2552     <code>Script</code>. This causes Apache to use the interpreter pointed to
2553     by the shebang line (first line, starting with <code>#!</code>) in the
2554     script. On Win32 systems this line usually looks like:</p>
2555
2556     <div class="example"><p><code>
2557       #!C:/Perl/bin/perl.exe
2558     </code></p></div>
2559
2560     <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
2561
2562     <div class="example"><p><code>
2563       #!perl
2564     </code></p></div>
2565
2566     <p>Setting <code>ScriptInterpreterSource Registry</code> will
2567     cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
2568     searched using the script file extension (e.g., <code>.pl</code>) as a
2569     search key. The command defined by the registry subkey
2570     <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
2571     <code>Shell\Open\Command</code> is used to open the script file. If the
2572     registry keys cannot be found, Apache falls back to the behavior of the
2573     <code>Script</code> option.</p>
2574
2575     <div class="warning"><h3>Security</h3>
2576     <p>Be careful when using <code>ScriptInterpreterSource
2577     Registry</code> with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
2578     Apache will try to execute <strong>every</strong> file within this
2579     directory. The <code>Registry</code> setting may cause undesired
2580     program calls on files which are typically not executed. For
2581     example, the default open command on <code>.htm</code> files on
2582     most Windows systems will execute Microsoft Internet Explorer, so
2583     any HTTP request for an <code>.htm</code> file existing within the
2584     script directory would start the browser in the background on the
2585     server. This is a good way to crash your system within a minute or
2586     so.</p>
2587     </div>
2588
2589     <p>The option <code>Registry-Strict</code> which is new in Apache
2590     2.0 does the same thing as <code>Registry</code> but uses only the
2591     subkey <code>Shell\ExecCGI\Command</code>. The
2592     <code>ExecCGI</code> key is not a common one. It must be
2593     configured manually in the windows registry and hence prevents
2594     accidental program calls on your system.</p>
2595
2596 </div>
2597 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2598 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
2599 <table class="directive">
2600 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
2601 messages sent to the client</td></tr>
2602 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
2603 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2604 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2605 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2606 </table>
2607     <p>The <code class="directive">ServerAdmin</code> sets the contact address
2608     that the server includes in any error messages it returns to the
2609     client. If the <code>httpd</code> doesn't recognize the supplied argument
2610     as an URL, it
2611     assumes, that it's an <var>email-address</var> and prepends it with
2612     <code>mailto:</code> in hyperlink targets. However, it's recommended to
2613     actually use an email address, since there are a lot of CGI scripts that
2614     make that assumption. If you want to use an URL, it should point to another
2615     server under your control. Otherwise users may not be able to contact you in
2616     case of errors.</p>
2617
2618     <p>It may be worth setting up a dedicated address for this, e.g.</p>
2619
2620     <div class="example"><p><code>
2621       ServerAdmin www-admin@foo.example.com
2622     </code></p></div>
2623     <p>as users do not always mention that they are talking about the
2624     server!</p>
2625
2626 </div>
2627 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2628 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
2629 <table class="directive">
2630 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
2631 to name-virtual hosts</td></tr>
2632 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
2633 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2634 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2635 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2636 </table>
2637     <p>The <code class="directive">ServerAlias</code> directive sets the
2638     alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
2639
2640     <div class="example"><p><code>
2641       &lt;VirtualHost *&gt;<br />
2642       ServerName server.domain.com<br />
2643       ServerAlias server server2.domain.com server2<br />
2644       # ...<br />
2645       &lt;/VirtualHost&gt;
2646     </code></p></div>
2647
2648 <h3>See also</h3>
2649 <ul>
2650 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2651 </ul>
2652 </div>
2653 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2654 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
2655 <table class="directive">
2656 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
2657 itself</td></tr>
2658 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerName <var>fully-qualified-domain-name</var>[:<var>port</var>]</code></td></tr>
2659 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2660 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2661 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2662 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>In version 2.0, this
2663      directive supersedes the functionality of the <code class="directive">Port</code>
2664      directive from version 1.3.</td></tr>
2665 </table>
2666     <p>The <code class="directive">ServerName</code> directive sets the hostname and
2667     port that the server uses to identify itself.  This is used when
2668     creating redirection URLs. For example, if the name of the
2669     machine hosting the web server is <code>simple.example.com</code>,
2670     but the machine also has the DNS alias <code>www.example.com</code>
2671     and you wish the web server to be so identified, the following
2672     directive should be used:</p>
2673
2674     <div class="example"><p><code>
2675       ServerName www.example.com:80
2676     </code></p></div>
2677
2678     <p>If no <code class="directive">ServerName</code> is specified, then the
2679     server attempts to deduce the hostname by performing a reverse
2680     lookup on the IP address. If no port is specified in the
2681     <code class="directive">ServerName</code>, then the server will use the port
2682     from the incoming
2683     request. For optimal reliability and predictability, you should
2684     specify an explicit hostname and port using the
2685     <code class="directive">ServerName</code> directive.</p>
2686
2687     <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
2688     the <code class="directive">ServerName</code> inside a
2689     <code class="directive"><a href="#virtualhost">&lt;VirtualHost&gt;</a></code>
2690     section specifies what hostname must appear in the request's
2691     <code>Host:</code> header to match this virtual host.</p>
2692
2693     <p>See the description of the
2694     <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive for
2695     settings which determine whether self-referential URL's (e.g., by the
2696     <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
2697     specified port, or to the port number given in the client's request.
2698     </p>
2699
2700 <h3>See also</h3>
2701 <ul>
2702 <li><a href="../dns-caveats.html">Issues Regarding DNS and
2703     Apache</a></li>
2704 <li><a href="../vhosts/">Apache virtual host
2705     documentation</a></li>
2706 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
2707 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
2708 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
2709 </ul>
2710 </div>
2711 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2712 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
2713 <table class="directive">
2714 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
2715 is accessed by an incompatible browser</td></tr>
2716 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
2717 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2718 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2719 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2720 </table>
2721     <p>The <code class="directive">ServerPath</code> directive sets the legacy
2722     URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
2723
2724 <h3>See also</h3>
2725 <ul>
2726 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2727 </ul>
2728 </div>
2729 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2730 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
2731 <table class="directive">
2732 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
2733 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
2734 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
2735 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2736 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2737 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2738 </table>
2739     <p>The <code class="directive">ServerRoot</code> directive sets the
2740     directory in which the server lives. Typically it will contain the
2741     subdirectories <code>conf/</code> and <code>logs/</code>. Relative
2742     paths in other configuration directives (such as <code class="directive"><a href="#include">Include</a></code> or <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>, for example) are taken as 
2743     relative to this directory.</p>
2744
2745     <div class="example"><h3>Example</h3><p><code>
2746       ServerRoot /home/httpd
2747     </code></p></div>
2748
2749
2750 <h3>See also</h3>
2751 <ul>
2752 <li><a href="../invoking.html">the <code>-d</code>
2753     option to <code>httpd</code></a></li>
2754 <li><a href="../misc/security_tips.html#serverroot">the
2755     security tips</a> for information on how to properly set
2756     permissions on the <code class="directive">ServerRoot</code></li>
2757 </ul>
2758 </div>
2759 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2760 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
2761 <table class="directive">
2762 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
2763 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
2764 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
2765 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2766 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2767 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2768 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2769 </table>
2770     <p>The <code class="directive">ServerSignature</code> directive allows the
2771     configuration of a trailing footer line under server-generated
2772     documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
2773     listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
2774     would want to enable such a footer line is that in a chain of proxies,
2775     the user often has no possibility to tell which of the chained servers
2776     actually produced a returned error message.</p>
2777
2778     <p>The <code>Off</code>
2779     setting, which is the default, suppresses the footer line (and is
2780     therefore compatible with the behavior of Apache-1.2 and
2781     below). The <code>On</code> setting simply adds a line with the
2782     server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
2783     and the <code>EMail</code> setting additionally creates a
2784     "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
2785     document.</p>
2786
2787     <p>After version 2.0.44, the details of the server version number
2788     presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
2789
2790 <h3>See also</h3>
2791 <ul>
2792 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
2793 </ul>
2794 </div>
2795 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2796 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
2797 <table class="directive">
2798 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the Server HTTP response
2799 header</td></tr>
2800 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerTokens Major|Minor|Min[imal]|Prod[uctOnly]|OS|Full</code></td></tr>
2801 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
2802 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2803 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2804 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2805 </table>
2806     <p>This directive controls whether <code>Server</code> response
2807     header field which is sent back to clients includes a
2808     description of the generic OS-type of the server as well as
2809     information about compiled-in modules.</p>
2810
2811     <dl>
2812       <dt><code>ServerTokens Prod[uctOnly]</code></dt>
2813
2814       <dd>Server sends (<em>e.g.</em>): <code>Server:
2815       Apache</code></dd>
2816
2817       <dt><code>ServerTokens Major</code></dt>
2818
2819       <dd>Server sends (<em>e.g.</em>): <code>Server:
2820       Apache/2</code></dd>
2821
2822       <dt><code>ServerTokens Minor</code></dt>
2823
2824       <dd>Server sends (<em>e.g.</em>): <code>Server:
2825       Apache/2.0</code></dd>
2826
2827       <dt><code>ServerTokens Min[imal]</code></dt>
2828
2829       <dd>Server sends (<em>e.g.</em>): <code>Server:
2830       Apache/2.0.41</code></dd>
2831
2832       <dt><code>ServerTokens OS</code></dt>
2833
2834       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2835       (Unix)</code></dd>
2836
2837       <dt><code>ServerTokens Full</code> (or not specified)</dt>
2838
2839       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2840       (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
2841     </dl>
2842
2843     <p>This setting applies to the entire server, and cannot be
2844     enabled or disabled on a virtualhost-by-virtualhost basis.</p>
2845
2846     <p>After version 2.0.44, this directive also controls the
2847     information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
2848
2849 <h3>See also</h3>
2850 <ul>
2851 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
2852 </ul>
2853 </div>
2854 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2855 <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
2856 <table class="directive">
2857 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
2858 handler</td></tr>
2859 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
2860 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2861 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2862 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2863 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2864 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved into the core in Apache 2.0</td></tr>
2865 </table>
2866     <p>When placed into an <code>.htaccess</code> file or a
2867     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> or
2868     <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
2869     section, this directive forces all matching files to be parsed
2870     through the <a href="../handler.html">handler</a> given by
2871     <var>handler-name</var>. For example, if you had a directory you
2872     wanted to be parsed entirely as imagemap rule files, regardless
2873     of extension, you might put the following into an
2874     <code>.htaccess</code> file in that directory:</p>
2875
2876     <div class="example"><p><code>
2877       SetHandler imap-file
2878     </code></p></div>
2879
2880     <p>Another example: if you wanted to have the server display a
2881     status report whenever a URL of
2882     <code>http://servername/status</code> was called, you might put
2883     the following into <code>httpd.conf</code>:</p>
2884
2885     <div class="example"><p><code>
2886       &lt;Location /status&gt;<br />
2887       <span class="indent">
2888         SetHandler server-status<br />
2889       </span>
2890       &lt;/Location&gt;
2891     </code></p></div>
2892
2893     <p>You can override an earlier defined <code class="directive">SetHandler</code>
2894     directive by using the value <code>None</code>.</p>
2895
2896 <h3>See also</h3>
2897 <ul>
2898 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
2899 </ul>
2900 </div>
2901 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2902 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
2903 <table class="directive">
2904 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
2905 input</td></tr>
2906 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2907 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2908 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2909 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2910 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2911 </table>
2912     <p>The <code class="directive">SetInputFilter</code> directive sets the
2913     filter or filters which will process client requests and POST
2914     input when they are received by the server. This is in addition to
2915     any filters defined elsewhere, including the
2916     <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
2917     directive.</p>
2918
2919     <p>If more than one filter is specified, they must be separated
2920     by semicolons in the order in which they should process the
2921     content.</p>
2922
2923 <h3>See also</h3>
2924 <ul>
2925 <li><a href="../filter.html">Filters</a> documentation</li>
2926 </ul>
2927 </div>
2928 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2929 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
2930 <table class="directive">
2931 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
2932 server</td></tr>
2933 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2934 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2935 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2936 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2937 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2938 </table>
2939     <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
2940     which will process responses from the server before they are
2941     sent to the client. This is in addition to any filters defined
2942     elsewhere, including the
2943     <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
2944     directive.</p>
2945
2946     <p>For example, the following configuration will process all files
2947     in the <code>/www/data/</code> directory for server-side
2948     includes.</p>
2949
2950     <div class="example"><p><code>
2951       &lt;Directory /www/data/&gt;<br />
2952       <span class="indent">
2953         SetOutputFilter INCLUDES<br />
2954       </span>
2955       &lt;/Directory&gt;
2956     </code></p></div>
2957
2958     <p>If more than one filter is specified, they must be separated
2959     by semicolons in the order in which they should process the
2960     content.</p>
2961
2962 <h3>See also</h3>
2963 <ul>
2964 <li><a href="../filter.html">Filters</a> documentation</li>
2965 </ul>
2966 </div>
2967 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2968 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
2969 <table class="directive">
2970 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
2971 certain events before failing a request</td></tr>
2972 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
2973 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
2974 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2975 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2976 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2977 </table>
2978     <p>The <code class="directive">TimeOut</code> directive currently defines
2979     the amount of time Apache will wait for three things:</p>
2980
2981     <ol>
2982       <li>The total amount of time it takes to receive a GET
2983       request.</li>
2984
2985       <li>The amount of time between receipt of TCP packets on a
2986       POST or PUT request.</li>
2987
2988       <li>The amount of time between ACKs on transmissions of TCP
2989       packets in responses.</li>
2990     </ol>
2991
2992     <p>We plan on making these separately configurable at some point
2993     down the road. The timer used to default to 1200 before 1.2,
2994     but has been lowered to 300 which is still far more than
2995     necessary in most situations. It is not set any lower by
2996     default because there may still be odd places in the code where
2997     the timer is not reset when a packet is sent. </p>
2998
2999 </div>
3000 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3001 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
3002 <table class="directive">
3003 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
3004 port</td></tr>
3005 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
3006 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName On</code></td></tr>
3007 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
3008 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3009 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3010 </table>
3011     <p>In many situations Apache must construct a <em>self-referential</em>
3012     URL -- that is, a URL that refers back to the same server. With
3013     <code>UseCanonicalName On</code> Apache will use the hostname and port
3014     specified in the <code class="directive"><a href="#servername">ServerName</a></code>
3015     directive to construct the canonical name for the server. This name
3016     is used in all self-referential URLs, and for the values of
3017     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
3018
3019     <p>With <code>UseCanonicalName Off</code> Apache will form
3020     self-referential URLs using the hostname and port supplied by
3021     the client if any are supplied (otherwise it will use the
3022     canonical name, as defined above). These values are the same
3023     that are used to implement <a href="../vhosts/name-based.html">name based virtual hosts</a>,
3024     and are available with the same clients. The CGI variables
3025     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
3026     constructed from the client supplied values as well.</p>
3027
3028     <p>An example where this may be useful is on an intranet server
3029     where you have users connecting to the machine using short
3030     names such as <code>www</code>. You'll notice that if the users
3031     type a shortname, and a URL which is a directory, such as
3032     <code>http://www/splat</code>, <em>without the trailing
3033     slash</em> then Apache will redirect them to
3034     <code>http://www.domain.com/splat/</code>. If you have
3035     authentication enabled, this will cause the user to have to
3036     authenticate twice (once for <code>www</code> and once again
3037     for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
3038     FAQ on this subject for more information</a>). But if
3039     <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
3040     Apache will redirect to <code>http://www/splat/</code>.</p>
3041
3042     <p>There is a third option, <code>UseCanonicalName DNS</code>,
3043     which is intended for use with mass IP-based virtual hosting to
3044     support ancient clients that do not provide a
3045     <code>Host:</code> header. With this option Apache does a
3046     reverse DNS lookup on the server IP address that the client
3047     connected to in order to work out self-referential URLs.</p>
3048
3049     <div class="warning"><h3>Warning</h3>
3050     <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
3051     they may be broken by this option. The client is essentially free
3052     to give whatever value they want as a hostname. But if the CGI is
3053     only using <code>SERVER_NAME</code> to construct self-referential URLs
3054     then it should be just fine.</p>
3055     </div>
3056
3057 <h3>See also</h3>
3058 <ul>
3059 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
3060 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3061 </ul>
3062 </div>
3063 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3064 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost">&lt;VirtualHost&gt;</a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
3065 <table class="directive">
3066 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
3067 hostname or IP address</td></tr>
3068 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;VirtualHost
3069     <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
3070     ...&gt; ... &lt;/VirtualHost&gt;</code></td></tr>
3071 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3072 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3073 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3074 </table>
3075     <p><code class="directive">&lt;VirtualHost&gt;</code> and
3076     <code>&lt;/VirtualHost&gt;</code> are used to enclose a group of
3077     directives that will apply only to a particular virtual host. Any
3078     directive that is allowed in a virtual host context may be
3079     used. When the server receives a request for a document on a
3080     particular virtual host, it uses the configuration directives
3081     enclosed in the <code class="directive">&lt;VirtualHost&gt;</code>
3082     section. <var>Addr</var> can be:</p>
3083
3084     <ul>
3085       <li>The IP address of the virtual host;</li>
3086
3087       <li>A fully qualified domain name for the IP address of the
3088       virtual host;</li>
3089
3090       <li>The character <code>*</code>, which is used only in combination with
3091       <code>NameVirtualHost *</code> to match all IP addresses; or</li>
3092
3093       <li>The string <code>_default_</code>, which is used only
3094       with IP virtual hosting to catch unmatched IP addresses.</li>
3095     </ul>
3096
3097     <div class="example"><h3>Example</h3><p><code>
3098       &lt;VirtualHost 10.1.2.3&gt;<br />
3099       <span class="indent">
3100         ServerAdmin webmaster@host.foo.com<br />
3101         DocumentRoot /www/docs/host.foo.com<br />
3102         ServerName host.foo.com<br />
3103         ErrorLog logs/host.foo.com-error_log<br />
3104         TransferLog logs/host.foo.com-access_log<br />
3105       </span>
3106       &lt;/VirtualHost&gt;
3107     </code></p></div>
3108
3109
3110     <p>IPv6 addresses must be specified in square brackets because
3111     the optional port number could not be determined otherwise.  An
3112     IPv6 example is shown below:</p>
3113
3114     <div class="example"><p><code>
3115       &lt;VirtualHost [fe80::a00:20ff:fea7:ccea]&gt;<br />
3116       <span class="indent">
3117         ServerAdmin webmaster@host.example.com<br />
3118         DocumentRoot /www/docs/host.example.com<br />
3119         ServerName host.example.com<br />
3120         ErrorLog logs/host.example.com-error_log<br />
3121         TransferLog logs/host.example.com-access_log<br />
3122       </span>
3123       &lt;/VirtualHost&gt;
3124     </code></p></div>
3125
3126     <p>Each Virtual Host must correspond to a different IP address,
3127     different port number or a different host name for the server,
3128     in the former case the server machine must be configured to
3129     accept IP packets for multiple addresses. (If the machine does
3130     not have multiple network interfaces, then this can be
3131     accomplished with the <code>ifconfig alias</code> command -- if
3132     your OS supports it).</p>
3133
3134     <div class="note"><h3>Note</h3>
3135     <p>The use of <code class="directive">&lt;VirtualHost&gt;</code> does
3136     <strong>not</strong> affect what addresses Apache listens on. You
3137     may need to ensure that Apache is listening on the correct addresses
3138     using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
3139     </div>
3140
3141     <p>When using IP-based virtual hosting, the special name
3142     <code>_default_</code> can be specified in
3143     which case this virtual host will match any IP address that is
3144     not explicitly listed in another virtual host. In the absence
3145     of any <code>_default_</code> virtual host the "main" server config,
3146     consisting of all those definitions outside any VirtualHost
3147     section, is used when no IP-match occurs.  (But note that any IP
3148     address that matches a <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> directive will use neither
3149     the "main" server config nor the <code>_default_</code> virtual host.
3150     See the <a href="../vhosts/name-based.html">name-based virtual hosting</a>
3151     documentation for further details.)</p>
3152
3153     <p>You can specify a <code>:port</code> to change the port that is
3154     matched. If unspecified then it defaults to the same port as the
3155     most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
3156     statement of the main server. You may also specify <code>:*</code>
3157     to match all ports on that address. (This is recommended when used
3158     with <code>_default_</code>.)</p>
3159
3160     <div class="warning"><h3>Security</h3>
3161     <p>See the <a href="../misc/security_tips.html">security tips</a>
3162     document for details on why your security could be compromised if the
3163     directory where log files are stored is writable by anyone other
3164     than the user that starts the server.</p>
3165     </div>
3166
3167 <h3>See also</h3>
3168 <ul>
3169 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
3170 <li><a href="../dns-caveats.html">Issues Regarding DNS and
3171     Apache</a></li>
3172 <li><a href="../bind.html">Setting
3173     which addresses and ports Apache uses</a></li>
3174 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
3175     and &lt;Files&gt; sections work</a> for an explanation of how these
3176     different sections are combined when a request is received</li>
3177 </ul>
3178 </div>
3179 </div>
3180 <div class="bottomlang">
3181 <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
3182 <a href="../en/mod/core.html" title="English">&nbsp;en&nbsp;</a> |
3183 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
3184 </div><div id="footer">
3185 <p class="apache">Copyright 1999-2004 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
3186 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
3187 </body></html>