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