]> granicus.if.org Git - apache/blob - docs/manual/mod/core.html.en
./build.sh all
[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="../es/mod/core.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
27 <a href="../fr/mod/core.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
28 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
29 <a href="../tr/mod/core.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
30 </div>
31 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Core Apache HTTP Server features that are always
32 available</td></tr>
33 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Core</td></tr></table>
34 </div>
35 <div id="quickview"><h3 class="directives">Directives</h3>
36 <ul id="toc">
37 <li><img alt="" src="../images/down.gif" /> <a href="#acceptfilter">AcceptFilter</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#allowencodedslashes">AllowEncodedSlashes</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#define">Define</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#directory">&lt;Directory&gt;</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch">&lt;DirectoryMatch&gt;</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#error">Error</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#errorlogformat">ErrorLogFormat</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#extendedstatus">ExtendedStatus</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#files">&lt;Files&gt;</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch">&lt;FilesMatch&gt;</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#gprofdir">GprofDir</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#if">&lt;If&gt;</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine">&lt;IfDefine&gt;</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule">&lt;IfModule&gt;</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#limit">&lt;Limit&gt;</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept">&lt;LimitExcept&gt;</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#location">&lt;Location&gt;</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch">&lt;LocationMatch&gt;</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#mutex">Mutex</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#protocol">Protocol</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#seerequesttail">SeeRequestTail</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
94 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
95 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
96 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
97 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
98 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
99 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
100 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
101 <li><img alt="" src="../images/down.gif" /> <a href="#traceenable">TraceEnable</a></li>
102 <li><img alt="" src="../images/down.gif" /> <a href="#undefine">UnDefine</a></li>
103 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
104 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></li>
105 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost">&lt;VirtualHost&gt;</a></li>
106 </ul>
107 </div>
108
109 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
110 <div class="directive-section"><h2><a name="AcceptFilter" id="AcceptFilter">AcceptFilter</a> <a name="acceptfilter" id="acceptfilter">Directive</a></h2>
111 <table class="directive">
112 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures optimizations for a Protocol's Listener Sockets</td></tr>
113 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptFilter <var>protocol</var> <var>accept_filter</var></code></td></tr>
114 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
115 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
116 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
117 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.1.5 and later.
118 On Windows from Apache httpd 2.3.3 and later.</td></tr>
119 </table>
120     <p>This directive enables operating system specific optimizations for a
121        listening socket by the <code class="directive">Protocol</code>type.
122        The basic premise is for the kernel to not send a socket to the server
123        process until either data is received or an entire HTTP Request is buffered.
124        Only <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&amp;sektion=9">
125        FreeBSD's Accept Filters</a>, Linux's more primitive 
126        <code>TCP_DEFER_ACCEPT</code>, and Windows' optimized AcceptEx()
127        are currently supported.</p>
128
129     <p>Using <code>none</code> for an argument will disable any accept filters 
130        for that protocol.  This is useful for protocols that require a server
131        send data first, such as <code>ftp:</code> or <code>nntp</code>:</p>
132     <div class="example"><p><code>AcceptFilter nntp none</code></p></div>
133
134     <p>The default protocol names are <code>https</code> for port 443
135        and <code>http</code> for all other ports.  To specify another protocol
136        is being used with a listening port, add the <var>protocol</var>
137        argument to the <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
138        directive.</p>
139
140     <p>The default values on FreeBSD are:</p>
141     <div class="example"><p><code>
142         AcceptFilter http httpready <br />
143         AcceptFilter https dataready
144     </code></p></div>
145     
146     <p>The <code>httpready</code> accept filter buffers entire HTTP requests at
147        the kernel level.  Once an entire request is received, the kernel then 
148        sends it to the server. See the 
149        <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&amp;sektion=9">
150        accf_http(9)</a> man page for more details.  Since HTTPS requests are 
151        encrypted only the <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&amp;sektion=9">
152        accf_data(9)</a> filter is used.</p>
153
154     <p>The default values on Linux are:</p>
155     <div class="example"><p><code>
156         AcceptFilter http data <br />
157         AcceptFilter https data
158     </code></p></div>
159
160     <p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http
161        requests.  Any value besides <code>none</code> will enable 
162        <code>TCP_DEFER_ACCEPT</code> on that listener. For more details
163        see the Linux 
164        <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
165        tcp(7)</a> man page.</p>
166
167     <p>The default values on Windows are:</p>
168     <div class="example"><p><code>
169         AcceptFilter http data <br />
170         AcceptFilter https data
171     </code></p></div>
172
173     <p>Window's mpm_winnt interprets the AcceptFilter to toggle the AcceptEx()
174        API, and does not support http protocol buffering.  There are two values
175        which utilize the Windows AcceptEx() API and will recycle network
176        sockets between connections.  <code>data</code> waits until data has
177        been transmitted as documented above, and the initial data buffer and
178        network endpoint addresses are all retrieved from the single AcceptEx()
179        invocation.  <code>connect</code> will use the AcceptEx() API, also
180        retrieve the network endpoint addresses, but like <code>none</code>
181        the <code>connect</code> option does not wait for the initial data
182        transmission.</p>
183
184     <p>On Windows, <code>none</code> uses accept() rather than AcceptEx()
185        and will not recycle sockets between connections.  This is useful for
186        network adapters with broken driver support, as well as some virtual
187        network providers such as vpn drivers, or spam, virus or spyware
188        filters.</p>  
189
190
191 <h3>See also</h3>
192 <ul>
193 <li><code class="directive">Protocol</code></li>
194 </ul>
195 </div>
196 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
197 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
198 <table class="directive">
199 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
200 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
201 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
202 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
203 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
204 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
205 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
206 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.0.30 and later</td></tr>
207 </table>
208
209     <p>This directive controls whether requests that contain trailing
210     pathname information that follows an actual filename (or
211     non-existent file in an existing directory) will be accepted or
212     rejected.  The trailing pathname information can be made
213     available to scripts in the <code>PATH_INFO</code> environment
214     variable.</p>
215
216     <p>For example, assume the location <code>/test/</code> points to
217     a directory that contains only the single file
218     <code>here.html</code>.  Then requests for
219     <code>/test/here.html/more</code> and
220     <code>/test/nothere.html/more</code> both collect
221     <code>/more</code> as <code>PATH_INFO</code>.</p>
222
223     <p>The three possible arguments for the
224     <code class="directive">AcceptPathInfo</code> directive are:</p>
225     <dl>
226     <dt><code>Off</code></dt><dd>A request will only be accepted if it
227     maps to a literal path that exists.  Therefore a request with
228     trailing pathname information after the true filename such as
229     <code>/test/here.html/more</code> in the above example will return
230     a 404 NOT FOUND error.</dd>
231
232     <dt><code>On</code></dt><dd>A request will be accepted if a
233     leading path component maps to a file that exists.  The above
234     example <code>/test/here.html/more</code> will be accepted if
235     <code>/test/here.html</code> maps to a valid file.</dd>
236
237     <dt><code>Default</code></dt><dd>The treatment of requests with
238     trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
239     The core handler for normal files defaults to rejecting
240     <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
241     <code>PATH_INFO</code> by default.</dd>
242     </dl>
243
244     <p>The primary purpose of the <code>AcceptPathInfo</code>
245     directive is to allow you to override the handler's choice of
246     accepting or rejecting <code>PATH_INFO</code>. This override is required,
247     for example, when you use a <a href="../filter.html">filter</a>, such
248     as <a href="mod_include.html">INCLUDES</a>, to generate content
249     based on <code>PATH_INFO</code>.  The core handler would usually reject
250     the request, so you can use the following configuration to enable
251     such a script:</p>
252
253     <div class="example"><p><code>
254       &lt;Files "mypaths.shtml"&gt;<br />
255       <span class="indent">
256         Options +Includes<br />
257         SetOutputFilter INCLUDES<br />
258         AcceptPathInfo On<br />
259       </span>
260       &lt;/Files&gt;
261     </code></p></div>
262
263
264 </div>
265 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
266 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
267 <table class="directive">
268 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
269 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
270 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
271 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
272 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
273 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
274 </table>
275     <p>While processing a request the server looks for
276     the first existing configuration file from this list of names in
277     every directory of the path to the document, if distributed
278     configuration files are <a href="#allowoverride">enabled for that
279     directory</a>. For example:</p>
280
281     <div class="example"><p><code>
282       AccessFileName .acl
283     </code></p></div>
284
285     <p>before returning the document
286     <code>/usr/local/web/index.html</code>, the server will read
287     <code>/.acl</code>, <code>/usr/.acl</code>,
288     <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
289     for directives, unless they have been disabled with</p>
290
291     <div class="example"><p><code>
292       &lt;Directory /&gt;<br />
293       <span class="indent">
294         AllowOverride None<br />
295       </span>
296       &lt;/Directory&gt;
297     </code></p></div>
298
299 <h3>See also</h3>
300 <ul>
301 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
302 <li><a href="../configuring.html">Configuration Files</a></li>
303 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
304 </ul>
305 </div>
306 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
307 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
308 <table class="directive">
309 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default charset parameter to be added when a response
310 content-type is <code>text/plain</code> or <code>text/html</code></td></tr>
311 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
312 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
313 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
314 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
315 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
316 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
317 </table>
318     <p>This directive specifies a default value for the media type
319     charset parameter (the name of a character encoding) to be added
320     to a response if and only if the response's content-type is either
321     <code>text/plain</code> or <code>text/html</code>.  This should override
322     any charset specified in the body of the response via a <code>META</code>
323     element, though the exact behavior is often dependent on the user's client
324     configuration. A setting of <code>AddDefaultCharset Off</code>
325     disables this functionality. <code>AddDefaultCharset On</code> enables
326     a default charset of <code>iso-8859-1</code>. Any other value is assumed
327     to be the <var>charset</var> to be used, which should be one of the
328     <a href="http://www.iana.org/assignments/character-sets">IANA registered
329     charset values</a> for use in Internet media types (MIME types).
330     For example:</p>
331
332     <div class="example"><p><code>
333       AddDefaultCharset utf-8
334     </code></p></div>
335
336     <p><code class="directive">AddDefaultCharset</code> should only be used when all
337     of the text resources to which it applies are known to be in that
338     character encoding and it is too inconvenient to label their charset
339     individually. One such example is to add the charset parameter
340     to resources containing generated content, such as legacy CGI
341     scripts, that might be vulnerable to cross-site scripting attacks
342     due to user-provided data being included in the output.  Note, however,
343     that a better solution is to just fix (or delete) those scripts, since
344     setting a default charset does not protect users that have enabled
345     the "auto-detect character encoding" feature on their browser.</p>
346
347 <h3>See also</h3>
348 <ul>
349 <li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li>
350 </ul>
351 </div>
352 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
353 <div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directive</a></h2>
354 <table class="directive">
355 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether encoded path separators in URLs are allowed to
356 be passed through</td></tr>
357 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
358 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
359 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
360 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
361 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
362 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.0.46 and later</td></tr>
363 </table>
364     <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
365     which contain encoded path separators (<code>%2F</code> for <code>/</code>
366     and additionally <code>%5C</code> for <code>\</code> on according systems)
367     to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
368
369     <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
370     mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
371
372     <div class="note"><h3>Note</h3>
373       <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
374       Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
375       according systems) will be left as such in the otherwise decoded URL
376       string.</p>
377     </div>
378
379 <h3>See also</h3>
380 <ul>
381 <li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
382 </ul>
383 </div>
384 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
385 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
386 <table class="directive">
387 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
388 <code>.htaccess</code> files</td></tr>
389 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
390 [<var>directive-type</var>] ...</code></td></tr>
391 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride None (2.3.9 and later), AllowOverride All (2.3.8 and earlier)</code></td></tr>
392 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
393 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
394 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
395 </table>
396     <p>When the server finds an <code>.htaccess</code> file (as
397     specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
398     it needs to know which directives declared in that file can override
399     earlier configuration directives.</p>
400
401     <div class="note"><h3>Only available in &lt;Directory&gt; sections</h3>
402     <code class="directive">AllowOverride</code> is valid only in
403     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
404     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
405     <code class="directive"><a href="#files">&lt;Files&gt;</a></code> sections.
406     </div>
407
408     <p>When this directive is set to <code>None</code>, then
409     <a href="#accessfilename">.htaccess</a> files are completely ignored.
410     In this case, the server will not even attempt to read
411     <code>.htaccess</code> files in the filesystem.</p>
412
413     <p>When this directive is set to <code>All</code>, then any
414     directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
415     <code>.htaccess</code> files.</p>
416
417     <p>The <var>directive-type</var> can be one of the following
418     groupings of directives.</p>
419
420     <dl>
421       <dt>AuthConfig</dt>
422
423       <dd>
424
425       Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
426       <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
427       <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
428       <code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code>,
429       <code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code>, <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>, <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code>, <em>etc.</em>).</dd>
430
431       <dt>FileInfo</dt>
432
433       <dd>
434       Allow use of the directives controlling document types
435      (<code class="directive"><a href="#errordocument">ErrorDocument</a></code>,
436       <code class="directive"><a href="#forcetype">ForceType</a></code>,
437       <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>,
438       <code class="directive"><a href="#sethandler">SetHandler</a></code>,
439       <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>,
440       <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and
441       <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove* directives),
442       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>),
443       <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
444       <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> from
445       <code class="module"><a href="../mod/mod_actions.html">mod_actions</a></code>.
446       </dd>
447
448       <dt>Indexes</dt>
449
450       <dd>
451       Allow use of the directives controlling directory indexing
452       (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
453       <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>,
454       <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
455       <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>,
456       <em>etc.</em>).</dd>
457
458       <dt>Limit</dt>
459
460       <dd>
461       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>
462
463       <dt>Options[=<var>Option</var>,...]</dt>
464
465       <dd>
466       Allow use of the directives controlling specific directory
467       features (<code class="directive"><a href="#options">Options</a></code> and
468       <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).
469       An equal sign may be given followed by a comma (but no spaces)
470       separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
471     </dl>
472
473     <p>Example:</p>
474
475     <div class="example"><p><code>
476       AllowOverride AuthConfig Indexes
477     </code></p></div>
478
479     <p>In the example above all directives that are neither in the group
480     <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
481     server error.</p>
482
483     <div class="note"><p>For security and performance reasons, do not set
484     <code>AllowOverride</code> to anything other than <code>None</code> 
485     in your <code>&lt;Directory /&gt;</code> block. Instead, find (or
486     create) the <code>&lt;Directory&gt;</code> block that refers to the
487     directory where you're actually planning to place a
488     <code>.htaccess</code> file.</p>
489     </div>
490
491 <h3>See also</h3>
492 <ul>
493 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
494 <li><a href="../configuring.html">Configuration Files</a></li>
495 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
496 </ul>
497 </div>
498 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
499 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
500 <table class="directive">
501 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
502 scripts</td></tr>
503 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
504 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
505 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
506 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
507 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
508 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
509 </table>
510     <p>This directive is used to control how Apache httpd finds the
511     interpreter used to run CGI scripts. For example, setting
512     <code>CGIMapExtension sys:\foo.nlm .foo</code> will
513     cause all CGI script files with a <code>.foo</code> extension to
514     be passed to the FOO interpreter.</p>
515
516 </div>
517 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
518 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
519 <table class="directive">
520 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of <code>Content-MD5</code> HTTP Response
521 headers</td></tr>
522 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
523 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
524 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
525 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
526 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
527 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
528 </table>
529     <p>This directive enables the generation of
530     <code>Content-MD5</code> headers as defined in RFC1864
531     respectively RFC2616.</p>
532
533     <p>MD5 is an algorithm for computing a "message digest"
534     (sometimes called "fingerprint") of arbitrary-length data, with
535     a high degree of confidence that any alterations in the data
536     will be reflected in alterations in the message digest.</p>
537
538     <p>The <code>Content-MD5</code> header provides an end-to-end
539     message integrity check (MIC) of the entity-body. A proxy or
540     client may check this header for detecting accidental
541     modification of the entity-body in transit. Example header:</p>
542
543     <div class="example"><p><code>
544       Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
545     </code></p></div>
546
547     <p>Note that this can cause performance problems on your server
548     since the message digest is computed on every request (the
549     values are not cached).</p>
550
551     <p><code>Content-MD5</code> is only sent for documents served
552     by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
553     SSI documents, output from CGI scripts, and byte range responses
554     do not have this header.</p>
555
556 </div>
557 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
558 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
559 <table class="directive">
560 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>This directive has no effect other than to emit warnings
561 if the value is not <code>none</code>. In prior versions, DefaultType
562 would specify a default media type to assign to response content for
563 which no other media type configuration could be found.
564 </td></tr>
565 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>media-type|none</var></code></td></tr>
566 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType none</code></td></tr>
567 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
568 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
569 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
570 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
571 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The argument <code>none</code> is available in Apache httpd 2.2.7 and later.  All other choices are DISABLED for 2.3.x and later.</td></tr>
572 </table>
573     <p>This directive has been disabled.  For backwards compatibility
574     of configuration files, it may be specified with the value
575     <code>none</code>, meaning no default media type. For example:</p>
576
577     <div class="example"><p><code>
578       DefaultType None
579     </code></p></div>
580
581     <p><code>DefaultType None</code> is only available in
582     httpd-2.2.7 and later.</p>
583
584     <p>Use the mime.types configuration file and the
585     <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> to configure media
586     type assignments via file extensions, or the
587     <code class="directive"><a href="#forcetype">ForceType</a></code> directive to configure
588     the media type for specific resources. Otherwise, the server will
589     send the response without a Content-Type header field and the
590     recipient may attempt to guess the media type.</p>
591
592 </div>
593 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
594 <div class="directive-section"><h2><a name="Define" id="Define">Define</a> <a name="define" id="define">Directive</a></h2>
595 <table class="directive">
596 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define the existence of a variable</td></tr>
597 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Define <var>parameter-name</var></code></td></tr>
598 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
599 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
600 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
601 </table>
602     <p>Equivalent to passing the <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p>
603     <p>This directive can be used to toggle the use of <code class="directive"><a href="#ifdefine">&lt;IfDefine&gt;</a></code> sections without needing to alter
604     <code>-D</code> arguments in any startup scripts.</p>
605
606 </div>
607 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
608 <div class="directive-section"><h2><a name="Directory" id="Directory">&lt;Directory&gt;</a> <a name="directory" id="directory">Directive</a></h2>
609 <table class="directive">
610 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
611 named file-system directory, sub-directories, and their contents.</td></tr>
612 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Directory <var>directory-path</var>&gt;
613 ... &lt;/Directory&gt;</code></td></tr>
614 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
615 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
616 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
617 </table>
618     <p><code class="directive">&lt;Directory&gt;</code> and
619     <code>&lt;/Directory&gt;</code> are used to enclose a group of
620     directives that will apply only to the named directory,
621     sub-directories of that directory, and the files within the respective 
622     directories.  Any directive that is allowed
623     in a directory context may be used. <var>Directory-path</var> is
624     either the full path to a directory, or a wild-card string using
625     Unix shell-style matching. In a wild-card string, <code>?</code> matches
626     any single character, and <code>*</code> matches any sequences of
627     characters. You may also use <code>[]</code> character ranges. None
628     of the wildcards match a `/' character, so <code>&lt;Directory
629     /*/public_html&gt;</code> will not match
630     <code>/home/user/public_html</code>, but <code>&lt;Directory
631     /home/*/public_html&gt;</code> will match. Example:</p>
632
633     <div class="example"><p><code>
634       &lt;Directory /usr/local/httpd/htdocs&gt;<br />
635       <span class="indent">
636         Options Indexes FollowSymLinks<br />
637       </span>
638       &lt;/Directory&gt;
639     </code></p></div>
640
641     <div class="note">
642       <p>Be careful with the <var>directory-path</var> arguments:
643       They have to literally match the filesystem path which Apache httpd uses
644       to access the files. Directives applied to a particular
645       <code>&lt;Directory&gt;</code> will not apply to files accessed from
646       that same directory via a different path, such as via different symbolic
647       links.</p>
648     </div>
649
650     <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular
651     expressions</a> can also be used, with the addition of the
652     <code>~</code> character. For example:</p>
653
654     <div class="example"><p><code>
655       &lt;Directory ~ "^/www/.*/[0-9]{3}"&gt;
656     </code></p></div>
657
658     <p>would match directories in <code>/www/</code> that consisted of
659     three numbers.</p>
660
661     <p>If multiple (non-regular expression) <code class="directive">&lt;Directory&gt;</code> sections
662     match the directory (or one of its parents) containing a document,
663     then the directives are applied in the order of shortest match
664     first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
665     with</p>
666
667     <div class="example"><p><code>
668       &lt;Directory /&gt;<br />
669       <span class="indent">
670         AllowOverride None<br />
671       </span>
672       &lt;/Directory&gt;<br />
673       <br />
674       &lt;Directory /home/&gt;<br />
675       <span class="indent">
676         AllowOverride FileInfo<br />
677       </span>
678       &lt;/Directory&gt;
679     </code></p></div>
680
681     <p>for access to the document <code>/home/web/dir/doc.html</code>
682     the steps are:</p>
683
684     <ul>
685       <li>Apply directive <code>AllowOverride None</code>
686       (disabling <code>.htaccess</code> files).</li>
687
688       <li>Apply directive <code>AllowOverride FileInfo</code> (for
689       directory <code>/home</code>).</li>
690
691       <li>Apply any <code>FileInfo</code> directives in
692       <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
693       <code>/home/web/dir/.htaccess</code> in that order.</li>
694     </ul>
695
696     <p>Regular expressions are not considered until after all of the
697     normal sections have been applied. Then all of the regular
698     expressions are tested in the order they appeared in the
699     configuration file. For example, with</p>
700
701     <div class="example"><p><code>
702       &lt;Directory ~ abc$&gt;<br />
703       <span class="indent">
704         # ... directives here ...<br />
705       </span>
706       &lt;/Directory&gt;
707     </code></p></div>
708
709     <p>the regular expression section won't be considered until after
710     all normal <code class="directive">&lt;Directory&gt;</code>s and
711     <code>.htaccess</code> files have been applied. Then the regular
712     expression will match on <code>/home/abc/public_html/abc</code> and
713     the corresponding <code class="directive">&lt;Directory&gt;</code> will
714     be applied.</p>
715
716    <p><strong>Note that the default access for
717     <code>&lt;Directory /&gt;</code> is <code>Allow from All</code>.
718     This means that Apache httpd will serve any file mapped from an URL. It is
719     recommended that you change this with a block such
720     as</strong></p>
721
722     <div class="example"><p><code>
723       &lt;Directory /&gt;<br />
724       <span class="indent">
725         Order Deny,Allow<br />
726         Deny from All<br />
727       </span>
728       &lt;/Directory&gt;
729     </code></p></div>
730
731     <p><strong>and then override this for directories you
732     <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
733     details.</strong></p>
734
735     <p>The directory sections occur in the <code>httpd.conf</code> file.
736     <code class="directive">&lt;Directory&gt;</code> directives
737     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>
738
739 <h3>See also</h3>
740 <ul>
741 <li><a href="../sections.html">How &lt;Directory&gt;,
742     &lt;Location&gt; and &lt;Files&gt; sections work</a> for an
743     explanation of how these different sections are combined when a
744     request is received</li>
745 </ul>
746 </div>
747 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
748 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch">&lt;DirectoryMatch&gt;</a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
749 <table class="directive">
750 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
751 the contents of file-system directories matching a regular expression.</td></tr>
752 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;DirectoryMatch <var>regex</var>&gt;
753 ... &lt;/DirectoryMatch&gt;</code></td></tr>
754 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
755 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
756 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
757 </table>
758     <p><code class="directive">&lt;DirectoryMatch&gt;</code> and
759     <code>&lt;/DirectoryMatch&gt;</code> are used to enclose a group
760     of directives which will apply only to the named directory (and the files within), 
761     the same as <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>. 
762     However, it takes as an argument a 
763     <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>.  For example:</p>
764
765     <div class="example"><p><code>
766       &lt;DirectoryMatch "^/www/(.+/)?[0-9]{3}"&gt;
767     </code></p></div>
768
769     <p>would match directories in <code>/www/</code> that consisted of three
770     numbers.</p>
771
772    <div class="note"><h3>Compatability</h3>
773       Prior to 2.3.9, this directive implicitly applied to sub-directories
774       (like <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>) and
775       could not match the end of line symbol ($).  In 2.3.9 and later,
776       only directories that match the expression are affected by the enclosed
777       directives.
778     </div>
779
780     <div class="note"><h3>Trailing Slash</h3>
781       This directive applies to requests for directories that may or may 
782       not end in a trailing slash, so expressions that are anchored to the 
783       end of line ($) must be written with care.
784     </div>
785
786 <h3>See also</h3>
787 <ul>
788 <li><code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> for
789 a description of how regular expressions are mixed in with normal
790 <code class="directive">&lt;Directory&gt;</code>s</li>
791 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt; and
792 &lt;Files&gt; sections work</a> for an explanation of how these different
793 sections are combined when a request is received</li>
794 </ul>
795 </div>
796 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
797 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
798 <table class="directive">
799 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
800 from the web</td></tr>
801 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
802 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
803 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
804 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
805 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
806 </table>
807     <p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
808     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
809     path from the requested URL to the document root to make the
810     path to the document. Example:</p>
811
812     <div class="example"><p><code>
813       DocumentRoot /usr/web
814     </code></p></div>
815
816     <p>then an access to
817     <code>http://www.my.host.com/index.html</code> refers to
818     <code>/usr/web/index.html</code>. If the <var>directory-path</var> is 
819     not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
820
821     <p>The <code class="directive">DocumentRoot</code> should be specified without
822     a trailing slash.</p>
823
824 <h3>See also</h3>
825 <ul>
826 <li><a href="../urlmapping.html#documentroot">Mapping URLs to Filesystem
827 Locations</a></li>
828 </ul>
829 </div>
830 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
831 <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
832 <table class="directive">
833 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
834 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
835 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
836 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
837 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
838 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
839 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
840 </table>
841     <p>This directive controls whether the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use
842     memory-mapping if it needs to read the contents of a file during
843     delivery.  By default, when the handling of a request requires
844     access to the data within a file -- for example, when delivering a
845     server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache httpd
846     memory-maps the file if the OS supports it.</p>
847
848     <p>This memory-mapping sometimes yields a performance improvement.
849     But in some environments, it is better to disable the memory-mapping
850     to prevent operational problems:</p>
851
852     <ul>
853     <li>On some multiprocessor systems, memory-mapping can reduce the
854     performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
855     <li>Deleting or truncating a file while <code class="program"><a href="../programs/httpd.html">httpd</a></code>
856       has it memory-mapped can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
857       crash with a segmentation fault.
858     </li>
859     </ul>
860
861     <p>For server configurations that are vulnerable to these problems,
862     you should disable memory-mapping of delivered files by specifying:</p>
863
864     <div class="example"><p><code>
865       EnableMMAP Off
866     </code></p></div>
867
868     <p>For NFS mounted files, this feature may be disabled explicitly for
869     the offending files by specifying:</p>
870
871     <div class="example"><p><code>
872       &lt;Directory "/path-to-nfs-files"&gt;
873       <span class="indent">
874         EnableMMAP Off
875       </span>
876       &lt;/Directory&gt;
877     </code></p></div>
878
879 </div>
880 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
881 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
882 <table class="directive">
883 <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>
884 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
885 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile Off</code></td></tr>
886 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
887 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
888 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
889 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
890 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later. Default changed to Off in
891 version 2.3.9.</td></tr>
892 </table>
893     <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
894     sendfile support from the kernel to transmit file contents to the client.
895     By default, when the handling of a request requires no access
896     to the data within a file -- for example, when delivering a
897     static file -- Apache httpd uses sendfile to deliver the file contents
898     without ever reading the file if the OS supports it.</p>
899
900     <p>This sendfile mechanism avoids separate read and send operations,
901     and buffer allocations. But on some platforms or within some
902     filesystems, it is better to disable this feature to avoid
903     operational problems:</p>
904
905     <ul>
906     <li>Some platforms may have broken sendfile support that the build
907     system did not detect, especially if the binaries were built on
908     another box and moved to such a machine with broken sendfile
909     support.</li>
910     <li>On Linux the use of sendfile triggers TCP-checksum
911     offloading bugs on certain networking cards when using IPv6.</li>
912     <li>On Linux on Itanium, sendfile may be unable to handle files
913     over 2GB in size.</li>
914     <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS, SMB, CIFS, FUSE),
915     the kernel may be unable to serve the network file through
916     its own cache.</li>
917     </ul>
918
919     <p>For server configurations that are not vulnerable to these problems,
920     you may enable this feature by specifying:</p>
921
922     <div class="example"><p><code>
923       EnableSendfile On
924     </code></p></div>
925
926     <p>For network mounted files, this feature may be disabled explicitly
927     for the offending files by specifying:</p>
928
929     <div class="example"><p><code>
930       &lt;Directory "/path-to-nfs-files"&gt;
931       <span class="indent">
932         EnableSendfile Off
933       </span>
934       &lt;/Directory&gt;
935     </code></p></div>
936     <p>Please note that the per-directory and .htaccess configuration
937        of <code class="directive">EnableSendfile</code> is not supported by
938        <code class="module"><a href="../mod/mod_cache_disk.html">mod_cache_disk</a></code>.
939        Only global definition of <code class="directive">EnableSendfile</code>
940        is taken into account by the module.
941     </p>
942
943 </div>
944 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
945 <div class="directive-section"><h2><a name="Error" id="Error">Error</a> <a name="error" id="error">Directive</a></h2>
946 <table class="directive">
947 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Abort configuration parsing with a custom error message</td></tr>
948 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Error <var>message</var></code></td></tr>
949 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
950 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
951 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
952 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>2.3.9 and later</td></tr>
953 </table>
954     <p>If an error can be detected within the configuration, this
955     directive can be used to generate a custom error message, and halt
956     configuration parsing.  The typical use is for reporting required
957     modules which are missing from the configuration.</p>
958
959     <div class="example"><h3>Example</h3><p><code>
960       # ensure that mod_include is loaded<br />
961       &lt;IfModule !include_module&gt;<br />
962       Error mod_include is required by mod_foo.  Load it with LoadModule.<br />
963       &lt;/IfModule&gt;<br />
964       <br />
965       # ensure that exactly one of SSL,NOSSL is defined<br />
966       &lt;IfDefine SSL&gt;<br />
967       &lt;IfDefine NOSSL&gt;<br />
968       Error Both SSL and NOSSL are defined.  Define only one of them.<br />
969       &lt;/IfDefine&gt;<br />
970       &lt;/IfDefine&gt;<br />
971       &lt;IfDefine !SSL&gt;<br />
972       &lt;IfDefine !NOSSL&gt;<br />
973       Error Either SSL or NOSSL must be defined.<br />
974       &lt;/IfDefine&gt;<br />
975       &lt;/IfDefine&gt;<br />
976     </code></p></div>
977
978
979 </div>
980 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
981 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
982 <table class="directive">
983 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
984 in case of an error</td></tr>
985 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
986 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
987 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
988 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
989 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
990 </table>
991     <p>In the event of a problem or error, Apache httpd can be configured
992     to do one of four things,</p>
993
994     <ol>
995       <li>output a simple hardcoded error message</li>
996
997       <li>output a customized message</li>
998
999       <li>redirect to a local <var>URL-path</var> to handle the
1000       problem/error</li>
1001
1002       <li>redirect to an external <var>URL</var> to handle the
1003       problem/error</li>
1004     </ol>
1005
1006     <p>The first option is the default, while options 2-4 are
1007     configured using the <code class="directive">ErrorDocument</code>
1008     directive, which is followed by the HTTP response code and a URL
1009     or a message. Apache httpd will sometimes offer additional information
1010     regarding the problem/error.</p>
1011
1012     <p>URLs can begin with a slash (/) for local web-paths (relative
1013     to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
1014     full URL which the client can resolve. Alternatively, a message
1015     can be provided to be displayed by the browser. Examples:</p>
1016
1017     <div class="example"><p><code>
1018       ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
1019       ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
1020       ErrorDocument 401 /subscription_info.html<br />
1021       ErrorDocument 403 "Sorry can't allow you access today"
1022     </code></p></div>
1023
1024     <p>Additionally, the special value <code>default</code> can be used
1025     to specify Apache httpd's simple hardcoded message.  While not required
1026     under normal circumstances, <code>default</code> will restore
1027     Apache httpd's simple hardcoded message for configurations that would
1028     otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
1029
1030     <div class="example"><p><code>
1031       ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
1032       &lt;Directory /web/docs&gt;<br />
1033       <span class="indent">
1034         ErrorDocument 404 default<br />
1035       </span>
1036       &lt;/Directory&gt;
1037     </code></p></div>
1038
1039     <p>Note that when you specify an <code class="directive">ErrorDocument</code>
1040     that points to a remote URL (ie. anything with a method such as
1041     <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
1042     client to tell it where to find the document, even if the
1043     document ends up being on the same server. This has several
1044     implications, the most important being that the client will not
1045     receive the original error status code, but instead will
1046     receive a redirect status code. This in turn can confuse web
1047     robots and other clients which try to determine if a URL is
1048     valid using the status code. In addition, if you use a remote
1049     URL in an <code>ErrorDocument 401</code>, the client will not
1050     know to prompt the user for a password since it will not
1051     receive the 401 status code. Therefore, <strong>if you use an
1052     <code>ErrorDocument 401</code> directive then it must refer to a local
1053     document.</strong></p>
1054
1055     <p>Microsoft Internet Explorer (MSIE) will by default ignore
1056     server-generated error messages when they are "too small" and substitute
1057     its own "friendly" error messages. The size threshold varies depending on
1058     the type of error, but in general, if you make your error document
1059     greater than 512 bytes, then MSIE will show the server-generated
1060     error rather than masking it.  More information is available in
1061     Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
1062
1063     <p>Although most error messages can be overriden, there are certain
1064     circumstances where the internal messages are used regardless of the
1065     setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>.  In
1066     particular, if a malformed request is detected, normal request processing
1067     will be immediately halted and the internal error message returned.
1068     This is necessary to guard against security problems caused by
1069     bad requests.</p>
1070    
1071     <p>If you are using mod_proxy, you may wish to enable
1072     <code class="directive"><a href="../mod/mod_proxy.html#proxyerroroverride">ProxyErrorOverride</a></code> so that you can provide
1073     custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
1074     Apache httpd will not generate custom error documents for proxied content.</p>
1075
1076 <h3>See also</h3>
1077 <ul>
1078 <li><a href="../custom-error.html">documentation of
1079     customizable responses</a></li>
1080 </ul>
1081 </div>
1082 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1083 <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
1084 <table class="directive">
1085 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
1086 <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>
1087 <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>
1088 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1089 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1090 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1091 </table>
1092     <p>The <code class="directive">ErrorLog</code> directive sets the name of
1093     the file to which the server will log any errors it encounters. If
1094     the <var>file-path</var> is not absolute then it is assumed to be 
1095     relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
1096
1097     <div class="example"><h3>Example</h3><p><code>
1098     ErrorLog /var/log/httpd/error_log
1099     </code></p></div>
1100
1101     <p>If the <var>file-path</var>
1102     begins with a pipe character "<code>|</code>" then it is assumed to be a
1103     command to spawn to handle the error log.</p>
1104
1105     <div class="example"><h3>Example</h3><p><code>
1106     ErrorLog "|/usr/local/bin/httpd_errors"
1107     </code></p></div>
1108
1109     <p>See the notes on <a href="../logs.html#piped">piped logs</a> for
1110     more information.</p>
1111
1112     <p>Using <code>syslog</code> instead of a filename enables logging
1113     via syslogd(8) if the system supports it. The default is to use
1114     syslog facility <code>local7</code>, but you can override this by
1115     using the <code>syslog:<var>facility</var></code> syntax where
1116     <var>facility</var> can be one of the names usually documented in
1117     syslog(1).  The facility is effectively global, and if it is changed
1118     in individual virtual hosts, the final facility specified affects the
1119     entire server.</p>
1120
1121     <div class="example"><h3>Example</h3><p><code>
1122     ErrorLog syslog:user
1123     </code></p></div>
1124
1125     <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
1126     document for details on why your security could be compromised
1127     if the directory where log files are stored is writable by
1128     anyone other than the user that starts the server.</p>
1129     <div class="warning"><h3>Note</h3>
1130       <p>When entering a file path on non-Unix platforms, care should be taken
1131       to make sure that only forward slashes are used even though the platform
1132       may allow the use of back slashes. In general it is a good idea to always 
1133       use forward slashes throughout the configuration files.</p>
1134     </div>
1135
1136 <h3>See also</h3>
1137 <ul>
1138 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1139 <li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
1140 </ul>
1141 </div>
1142 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1143 <div class="directive-section"><h2><a name="ErrorLogFormat" id="ErrorLogFormat">ErrorLogFormat</a> <a name="errorlogformat" id="errorlogformat">Directive</a></h2>
1144 <table class="directive">
1145 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Format specification for error log entries</td></tr>
1146 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> ErrorLog [connection|request] <var>format</var></code></td></tr>
1147 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1148 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1149 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1150 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.3.9 and later</td></tr>
1151 </table>
1152     <p><code class="directive">ErrorLogFormat</code> allows to specify what
1153     supplementary information is logged in the error log in addition to the
1154     actual log message.</p>
1155
1156     <div class="example"><h3>Simple example</h3><p><code>
1157         ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
1158     </code></p></div>
1159
1160     <p>Specifying <code>connection</code> or <code>request</code> as first
1161     paramter allows to specify additional formats, causing additional
1162     information to be logged when the first message is logged for a specific
1163     connection or request, respectivly. This additional information is only
1164     logged once per connection/request. If a connection or request is processed
1165     without causing any log message, the additional information is not logged
1166     either.</p>
1167
1168     <p>It can happen that some format string items do not produce output.  For
1169     example, the Referer header is only present if the log message is
1170     associated to a request and the log message happens at a time when the
1171     Referer header has already been read from the client.  If no output is
1172     produced, the default behaviour is to delete everything from the preceeding
1173     space character to the next space character.  This means the log line is
1174     implicitly divided into fields on non-whitespace to whitespace transitions.
1175     If a format string item does not produce output, the whole field is
1176     ommitted.  For example, if the remote address <code>%a</code> in the log
1177     format <code>[%t] [%l] [%a] %M&nbsp;</code> is not available, the surrounding
1178     brackets are not logged either.  Space characters can be escaped with a
1179     backslash to prevent them from delimiting a field.  The combination '%&nbsp;'
1180     (percent space) is a zero-witdh field delimiter that does not produce any
1181     output.</p>
1182
1183     <p>The above behaviour can be changed by adding modifiers to the format
1184     string item. A <code>-</code> (minus) modifier causes a minus to be logged if the
1185     respective item does not produce any output. In once-per-connection/request
1186     formats, it is also possible to use the <code>+</code> (plus) modifier. If an
1187     item with the plus modifier does not produce any output, the whole line is
1188     ommitted.</p>
1189
1190     <p>A number as modifier can be used to assign a log severity level to a
1191     format item. The item will only be logged if the severity of the log
1192     message is not higher than the specified log severity level. The number can
1193     range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8).</p>
1194
1195     <p>Some format string items accept additional parameters in braces.</p>
1196
1197     <table class="bordered"><tr class="header"><th>Format&nbsp;String</th> <th>Description</th></tr>
1198 <tr><td><code>%%</code></td>
1199         <td>The percent sign</td></tr>
1200 <tr class="odd"><td><code>%...a</code></td>
1201         <td>Remote IP-address and port</td></tr>
1202 <tr><td><code>%...A</code></td>
1203         <td>Local IP-address and port</td></tr>
1204 <tr class="odd"><td><code>%...{name}e</code></td>
1205         <td>Request environment variable <code>name</code></td></tr>
1206 <tr><td><code>%...E</code></td>
1207         <td>APR/OS error status code and string</td></tr>
1208 <tr class="odd"><td><code>%...F</code></td>
1209         <td>Source file name and line number of the log call</td></tr>
1210 <tr><td><code>%...{name}i</code></td>
1211         <td>Request header <code>name</code></td></tr>
1212 <tr class="odd"><td><code>%...k</code></td>
1213         <td>Number of keep-alive requests on this connection</td></tr>
1214 <tr><td><code>%...l</code></td>
1215         <td>Loglevel of the message</td></tr>
1216 <tr class="odd"><td><code>%...L</code></td>
1217         <td>Log ID of the request</td></tr>
1218 <tr><td><code>%...{c}L</code></td>
1219         <td>Log ID of the connection</td></tr>
1220 <tr class="odd"><td><code>%...{C}L</code></td>
1221         <td>Log ID of the connection if used in connection scope, empty otherwise</td></tr>
1222 <tr><td><code>%...m</code></td>
1223         <td>Name of the module logging the message</td></tr>
1224 <tr class="odd"><td><code>%M</code></td>
1225         <td>The actual log message</td></tr>
1226 <tr><td><code>%...{name}n</code></td>
1227         <td>Request note <code>name</code></td></tr>
1228 <tr class="odd"><td><code>%...P</code></td>
1229         <td>Process ID of current process</td></tr>
1230 <tr><td><code>%...T</code></td>
1231         <td>Thread ID of current thread</td></tr>
1232 <tr class="odd"><td><code>%...t</code></td>
1233         <td>The current time</td></tr>
1234 <tr><td><code>%...{u}t</code></td>
1235         <td>The current time including micro-seconds</td></tr>
1236 <tr class="odd"><td><code>%...{cu}t</code></td>
1237         <td>The current time in compact ISO 8601 format, including
1238             micro-seconds</td></tr>
1239 <tr><td><code>%...v</code></td>
1240         <td>The canonical <code class="directive"><a href="#servername">ServerName</a></code>
1241             of the current server.</td></tr>
1242 <tr class="odd"><td><code>%...V</code></td>
1243         <td>The server name of the server serving the request according to the
1244             <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code>
1245             setting.</td></tr>
1246 <tr><td><code>\&nbsp;</code> (backslash space)</td>
1247         <td>Non-field delimiting space</td></tr>
1248 <tr class="odd"><td><code>%&nbsp;</code> (percent space)</td>
1249         <td>Field delimiter (no output)</td></tr>
1250 </table>
1251
1252     <p>The log ID format <code>%L</code> produces a unique id for a connection
1253     or request. This can be used to correlate which log lines belong to the
1254     same connection or request, which request happens on which connection.
1255     A <code>%L</code> format string is also available in
1256     <code class="module"><a href="../mod/mod_log_config.html">mod_log_config</a></code>, to allow to correlate access log entries
1257     with error log lines. If <code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code> is loaded, its
1258     unique id will be used as log ID for requests.</p>
1259
1260     <div class="example"><h3>Example (somewhat similar to default format)</h3><p><code>
1261         ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P] %7F: %E: [client\ %a]
1262         %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
1263     </code></p></div>
1264
1265     <div class="example"><h3>Example (similar to the 2.2.x format)</h3><p><code>
1266         ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
1267         %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
1268     </code></p></div>
1269
1270     <div class="example"><h3>Advanced example with request/connection log IDs</h3><p><code>
1271         ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br />
1272         ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br />
1273         ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br />
1274         ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br />
1275         ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br />
1276     </code></p></div>
1277
1278
1279 <h3>See also</h3>
1280 <ul>
1281 <li><code class="directive"><a href="#errorlog">ErrorLog</a></code></li>
1282 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1283 <li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
1284 </ul>
1285 </div>
1286 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1287 <div class="directive-section"><h2><a name="ExtendedStatus" id="ExtendedStatus">ExtendedStatus</a> <a name="extendedstatus" id="extendedstatus">Directive</a></h2>
1288 <table class="directive">
1289 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Keep track of extended status information for each 
1290 request</td></tr>
1291 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ExtendedStatus On|Off</code></td></tr>
1292 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ExtendedStatus Off[*]</code></td></tr>
1293 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1294 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1295 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1296 </table>
1297     <p>This option tracks additional data per worker about the
1298     currently executing request, and a utilization summary; you 
1299     can see these variables during runtime by configuring 
1300     <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>.  Note that other modules may
1301     rely on this scoreboard.</p>
1302
1303     <p>This setting applies to the entire server, and cannot be
1304     enabled or disabled on a virtualhost-by-virtualhost basis.
1305     The collection of extended status information can slow down
1306     the server.  Also note that this setting cannot be changed
1307     during a graceful restart.</p>
1308
1309     <div class="note">
1310     <p>Note that loading <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> will change 
1311     the default behavior to ExtendedStatus On, while other
1312     third party modules may do the same.  Such modules rely on
1313     collecting detailed information about the state of all workers.
1314     The default is changed by <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> beginning
1315     with version 2.3.6; the previous default was always Off.</p>
1316     </div>
1317
1318
1319 </div>
1320 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1321 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
1322 <table class="directive">
1323 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
1324 HTTP response header for static files</td></tr>
1325 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
1326 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
1327 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1328 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1329 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1330 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1331 </table>
1332     <p>
1333     The <code class="directive">FileETag</code> directive configures the file
1334     attributes that are used to create the <code>ETag</code> (entity
1335     tag) response header field when the document is based on a static file.
1336     (The <code>ETag</code> value is used in cache management to save
1337     network bandwidth.) The
1338     <code class="directive">FileETag</code> directive allows you to choose
1339     which of these -- if any -- should be used. The recognized keywords are:
1340     </p>
1341
1342     <dl>
1343      <dt><strong>INode</strong></dt>
1344      <dd>The file's i-node number will be included in the calculation</dd>
1345      <dt><strong>MTime</strong></dt>
1346      <dd>The date and time the file was last modified will be included</dd>
1347      <dt><strong>Size</strong></dt>
1348      <dd>The number of bytes in the file will be included</dd>
1349      <dt><strong>All</strong></dt>
1350      <dd>All available fields will be used. This is equivalent to:
1351          <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1352      <dt><strong>None</strong></dt>
1353      <dd>If a document is file-based, no <code>ETag</code> field will be
1354        included in the response</dd>
1355     </dl>
1356
1357     <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1358     keywords may be prefixed with either <code>+</code> or <code>-</code>,
1359     which allow changes to be made to the default setting inherited
1360     from a broader scope. Any keyword appearing without such a prefix
1361     immediately and completely cancels the inherited setting.</p>
1362
1363     <p>If a directory's configuration includes
1364     <code>FileETag&nbsp;INode&nbsp;MTime&nbsp;Size</code>, and a
1365     subdirectory's includes <code>FileETag&nbsp;-INode</code>,
1366     the setting for that subdirectory (which will be inherited by
1367     any sub-subdirectories that don't override it) will be equivalent to
1368     <code>FileETag&nbsp;MTime&nbsp;Size</code>.</p>
1369     <div class="warning"><h3>Warning</h3>
1370     Do not change the default for directories or locations that have WebDAV
1371     enabled and use <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> as a storage provider.
1372     <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> uses <code>INode&nbsp;MTime&nbsp;Size</code>
1373     as a fixed format for <code>ETag</code> comparisons on conditional requests.
1374     These conditional requests will break if the <code>ETag</code> format is
1375     changed via <code class="directive">FileETag</code>.
1376     </div>
1377     <div class="note"><h3>Server Side Includes</h3>
1378     An ETag is not generated for responses parsed by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>, 
1379     since the response entity can change without a change of the INode, MTime, or Size 
1380     of the static file with embedded SSI directives.
1381     </div>
1382
1383
1384 </div>
1385 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1386 <div class="directive-section"><h2><a name="Files" id="Files">&lt;Files&gt;</a> <a name="files" id="files">Directive</a></h2>
1387 <table class="directive">
1388 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
1389 filenames</td></tr>
1390 <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>
1391 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1392 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1393 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1394 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1395 </table>
1396     <p>The <code class="directive">&lt;Files&gt;</code> directive
1397     limits the scope of the enclosed directives by filename. It is comparable
1398     to the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
1399     and <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
1400     directives. It should be matched with a <code>&lt;/Files&gt;</code>
1401     directive. The directives given within this section will be applied to
1402     any object with a basename (last component of filename) matching the
1403     specified filename. <code class="directive">&lt;Files&gt;</code>
1404     sections are processed in the order they appear in the
1405     configuration file, after the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections and
1406     <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location">&lt;Location&gt;</a></code> sections. Note
1407     that <code class="directive">&lt;Files&gt;</code> can be nested
1408     inside <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections to restrict the
1409     portion of the filesystem they apply to.</p>
1410
1411     <p>The <var>filename</var> argument should include a filename, or
1412     a wild-card string, where <code>?</code> matches any single character,
1413     and <code>*</code> matches any sequences of characters.
1414     <a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a> 
1415     can also be used, with the addition of the
1416     <code>~</code> character. For example:</p>
1417
1418     <div class="example"><p><code>
1419       &lt;Files ~ "\.(gif|jpe?g|png)$"&gt;
1420     </code></p></div>
1421
1422     <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch">&lt;FilesMatch&gt;</a></code> is preferred,
1423     however.</p>
1424
1425     <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
1426     <code>.htaccess</code> files. This allows users to control access to
1427     their own files, at a file-by-file level.</p>
1428
1429
1430 <h3>See also</h3>
1431 <ul>
1432 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1433     and &lt;Files&gt; sections work</a> for an explanation of how these
1434     different sections are combined when a request is received</li>
1435 </ul>
1436 </div>
1437 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1438 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch">&lt;FilesMatch&gt;</a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
1439 <table class="directive">
1440 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
1441 filenames</td></tr>
1442 <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>
1443 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1444 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1445 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1446 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1447 </table>
1448     <p>The <code class="directive">&lt;FilesMatch&gt;</code> directive
1449     limits the scope of the enclosed directives by filename, just as the
1450     <code class="directive"><a href="#files">&lt;Files&gt;</a></code> directive
1451     does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular 
1452     expression</a>. For example:</p>
1453
1454     <div class="example"><p><code>
1455       &lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
1456     </code></p></div>
1457
1458     <p>would match most common Internet graphics formats.</p>
1459
1460 <h3>See also</h3>
1461 <ul>
1462 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1463     and &lt;Files&gt; sections work</a> for an explanation of how these
1464     different sections are combined when a request is received</li>
1465 </ul>
1466 </div>
1467 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1468 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
1469 <table class="directive">
1470 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
1471 media type in the HTTP Content-Type header field</td></tr>
1472 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>media-type</var>|None</code></td></tr>
1473 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1474 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1475 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1476 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1477 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache httpd 2.0</td></tr>
1478 </table>
1479     <p>When placed into an <code>.htaccess</code> file or a
1480     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>, or
1481     <code class="directive"><a href="#location">&lt;Location&gt;</a></code> or
1482     <code class="directive"><a href="#files">&lt;Files&gt;</a></code>
1483     section, this directive forces all matching files to be served
1484     with the content type identification given by
1485     <var>media-type</var>. For example, if you had a directory full of
1486     GIF files, but did not want to label them all with <code>.gif</code>,
1487     you might want to use:</p>
1488
1489     <div class="example"><p><code>
1490       ForceType image/gif
1491     </code></p></div>
1492
1493     <p>Note that this directive overrides other indirect media type
1494     associations defined in mime.types or via the
1495     <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code>.</p>
1496
1497     <p>You can also override more general
1498     <code class="directive">ForceType</code> settings
1499     by using the value of <code>None</code>:</p>
1500
1501     <div class="example"><p><code>
1502       # force all files to be image/gif:<br />
1503       &lt;Location /images&gt;<br />
1504         <span class="indent">
1505           ForceType image/gif<br />
1506         </span>
1507       &lt;/Location&gt;<br />
1508       <br />
1509       # but normal mime-type associations here:<br />
1510       &lt;Location /images/mixed&gt;<br />
1511       <span class="indent">
1512         ForceType None<br />
1513       </span>
1514       &lt;/Location&gt;
1515     </code></p></div>
1516
1517     <p>This directive primarily overrides the content types generated for
1518     static files served out of the filesystem.  For resources other than 
1519     static files, where the generator of the response typically specifies 
1520     a Content-Type, this directive has no effect.</p>
1521
1522
1523 </div>
1524 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1525 <div class="directive-section"><h2><a name="GprofDir" id="GprofDir">GprofDir</a> <a name="gprofdir" id="gprofdir">Directive</a></h2>
1526 <table class="directive">
1527 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory to write gmon.out profiling data to.  </td></tr>
1528 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>GprofDir <var>/tmp/gprof/</var>|<var>/tmp/gprof/</var>%</code></td></tr>
1529 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1530 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1531 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1532 </table>
1533     <p>When the server has been compiled with gprof profiling suppport,
1534     <code class="directive">GprofDir</code> causes <code>gmon.out</code> files to
1535     be written to the specified directory when the process exits.  If the
1536     argument ends with a percent symbol ('%'), subdirectories are created
1537     for each process id.</p>
1538
1539     <p>This directive currently only works with the <code class="module"><a href="../mod/prefork.html">prefork</a></code> 
1540     MPM.</p>
1541
1542 </div>
1543 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1544 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
1545 <table class="directive">
1546 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1547 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1548 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
1549 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1550 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1551 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1552 </table>
1553     <p>This directive enables DNS lookups so that host names can be
1554     logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1555     The value <code>Double</code> refers to doing double-reverse
1556     DNS lookup. That is, after a reverse lookup is performed, a forward
1557     lookup is then performed on that result. At least one of the IP
1558     addresses in the forward lookup must match the original
1559     address. (In "tcpwrappers" terminology this is called
1560     <code>PARANOID</code>.)</p>
1561
1562     <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1563     used for controlling access by hostname, a double reverse lookup
1564     will be performed.  This is necessary for security. Note that the
1565     result of this double-reverse isn't generally available unless you
1566     set <code>HostnameLookups Double</code>. For example, if only
1567     <code>HostnameLookups On</code> and a request is made to an object
1568     that is protected by hostname restrictions, regardless of whether
1569     the double-reverse fails or not, CGIs will still be passed the
1570     single-reverse result in <code>REMOTE_HOST</code>.</p>
1571
1572     <p>The default is <code>Off</code> in order to save the network
1573     traffic for those sites that don't truly need the reverse
1574     lookups done. It is also better for the end users because they
1575     don't have to suffer the extra latency that a lookup entails.
1576     Heavily loaded sites should leave this directive
1577     <code>Off</code>, since DNS lookups can take considerable
1578     amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
1579     default to the <code>bin</code> subdirectory of your installation
1580     directory, can be used to look up host names from logged IP addresses
1581     offline.</p>
1582
1583 </div>
1584 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1585 <div class="directive-section"><h2><a name="If" id="If">&lt;If&gt;</a> <a name="if" id="if">Directive</a></h2>
1586 <table class="directive">
1587 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only if a condition is
1588 satisfied by a request at runtime</td></tr>
1589 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;If <var>expression</var>&gt; ... &lt;/If&gt;</code></td></tr>
1590 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1591 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1592 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1593 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1594 </table>
1595     <p>The <code class="directive">&lt;If&gt;</code> directive
1596     evaluates an expression at runtime, and applies the enclosed
1597     directives if and only if the expression evaluates to true.
1598     For example:</p>
1599
1600     <div class="example"><p><code>
1601         &lt;If "$req{Host} = ''"&gt;
1602     </code></p></div>
1603
1604     <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>
1605
1606     <p>You may compare the value of any variable in the request headers
1607     ($req), response headers ($resp) or environment ($env) in your
1608     expression.</p>
1609
1610     <p>Apart from <code>=</code>, <code>If</code> can use the <code>IN</code>
1611     operator to compare if the expression is in a given range:</p>
1612
1613     <div class="example"><p><code>
1614         &lt;If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS&gt;
1615     </code></p></div>
1616
1617
1618 <h3>See also</h3>
1619 <ul>
1620 <li><a href="../expr.html">Expressions in Apache HTTP Server</a>,
1621 for a complete reference and more examples.</li>
1622 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;,
1623     &lt;Files&gt; sections work</a> for an explanation of how these
1624     different sections are combined when a request is received.
1625     <code class="directive">&lt;If&gt;</code> has the same precedence
1626     and usage as <code class="directive">&lt;Files&gt;</code></li>
1627 </ul>
1628 </div>
1629 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1630 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine">&lt;IfDefine&gt;</a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
1631 <table class="directive">
1632 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
1633 if a test is true at startup</td></tr>
1634 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfDefine [!]<var>parameter-name</var>&gt; ...
1635     &lt;/IfDefine&gt;</code></td></tr>
1636 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1637 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1638 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1639 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1640 </table>
1641     <p>The <code>&lt;IfDefine <var>test</var>&gt;...&lt;/IfDefine&gt;
1642     </code> section is used to mark directives that are conditional. The
1643     directives within an <code class="directive">&lt;IfDefine&gt;</code>
1644     section are only processed if the <var>test</var> is true. If <var>
1645     test</var> is false, everything between the start and end markers is
1646     ignored.</p>
1647
1648     <p>The <var>test</var> in the <code class="directive">&lt;IfDefine&gt;</code> section directive can be one of two forms:</p>
1649
1650     <ul>
1651       <li><var>parameter-name</var></li>
1652
1653       <li><code>!</code><var>parameter-name</var></li>
1654     </ul>
1655
1656     <p>In the former case, the directives between the start and end
1657     markers are only processed if the parameter named
1658     <var>parameter-name</var> is defined. The second format reverses
1659     the test, and only processes the directives if
1660     <var>parameter-name</var> is <strong>not</strong> defined.</p>
1661
1662     <p>The <var>parameter-name</var> argument is a define as given on the
1663     <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter</var>
1664     </code> at the time the server was started or by the <code class="directive"><a href="#define">Define</a></code> directive.</p>
1665
1666     <p><code class="directive">&lt;IfDefine&gt;</code> sections are
1667     nest-able, which can be used to implement simple
1668     multiple-parameter tests. Example:</p>
1669
1670     <div class="example"><p><code>
1671       httpd -DReverseProxy -DUseCache -DMemCache ...<br />
1672       <br />
1673       # httpd.conf<br />
1674       &lt;IfDefine ReverseProxy&gt;<br />
1675       <span class="indent">
1676         LoadModule proxy_module   modules/mod_proxy.so<br />
1677         LoadModule proxy_http_module   modules/mod_proxy_http.so<br />
1678         &lt;IfDefine UseCache&gt;<br />
1679         <span class="indent">
1680           LoadModule cache_module   modules/mod_cache.so<br />
1681           &lt;IfDefine MemCache&gt;<br />
1682           <span class="indent">
1683             LoadModule mem_cache_module   modules/mod_mem_cache.so<br />
1684           </span>
1685           &lt;/IfDefine&gt;<br />
1686           &lt;IfDefine !MemCache&gt;<br />
1687           <span class="indent">
1688             LoadModule cache_disk_module   modules/mod_cache_disk.so<br />
1689           </span>
1690           &lt;/IfDefine&gt;
1691         </span>
1692         &lt;/IfDefine&gt;
1693       </span>
1694       &lt;/IfDefine&gt;
1695     </code></p></div>
1696
1697 </div>
1698 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1699 <div class="directive-section"><h2><a name="IfModule" id="IfModule">&lt;IfModule&gt;</a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
1700 <table class="directive">
1701 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
1702 presence or absence of a specific module</td></tr>
1703 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfModule [!]<var>module-file</var>|<var>module-identifier</var>&gt; ...
1704     &lt;/IfModule&gt;</code></td></tr>
1705 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1706 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1707 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1708 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1709 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Module identifiers are available in version 2.1 and
1710 later.</td></tr>
1711 </table>
1712     <p>The <code>&lt;IfModule <var>test</var>&gt;...&lt;/IfModule&gt;</code>
1713     section is used to mark directives that are conditional on the presence of
1714     a specific module. The directives within an <code class="directive">&lt;IfModule&gt;</code> section are only processed if the <var>test</var>
1715     is true. If <var>test</var> is false, everything between the start and
1716     end markers is ignored.</p>
1717
1718     <p>The <var>test</var> in the <code class="directive">&lt;IfModule&gt;</code> section directive can be one of two forms:</p>
1719
1720     <ul>
1721       <li><var>module</var></li>
1722
1723       <li>!<var>module</var></li>
1724     </ul>
1725
1726     <p>In the former case, the directives between the start and end
1727     markers are only processed if the module named <var>module</var>
1728     is included in Apache httpd -- either compiled in or
1729     dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1730     and only processes the directives if <var>module</var> is
1731     <strong>not</strong> included.</p>
1732
1733     <p>The <var>module</var> argument can be either the module identifier or
1734     the file name of the module, at the time it was compiled.  For example,
1735     <code>rewrite_module</code> is the identifier and
1736     <code>mod_rewrite.c</code> is the file name. If a module consists of
1737     several source files, use the name of the file containing the string
1738     <code>STANDARD20_MODULE_STUFF</code>.</p>
1739
1740     <p><code class="directive">&lt;IfModule&gt;</code> sections are
1741     nest-able, which can be used to implement simple multiple-module
1742     tests.</p>
1743
1744     <div class="note">This section should only be used if you need to have one
1745     configuration file that works whether or not a specific module
1746     is available. In normal operation, directives need not be
1747     placed in <code class="directive">&lt;IfModule&gt;</code>
1748     sections.</div>
1749
1750 </div>
1751 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1752 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
1753 <table class="directive">
1754 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
1755 the server configuration files</td></tr>
1756 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Include [<var>optional</var>|<var>strict</var>] <var>file-path</var>|<var>directory-path</var>|<var>wildcard</var></code></td></tr>
1757 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1758 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1759 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1760 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later, directory
1761 wildcard matching available in 2.3.6 and later</td></tr>
1762 </table>
1763     <p>This directive allows inclusion of other configuration files
1764     from within the server configuration files.</p>
1765
1766     <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used
1767     in the filename or directory parts of the path to include several files
1768     at once, in alphabetical order. In addition, if
1769     <code class="directive">Include</code> points to a directory, rather than a file,
1770     Apache httpd will read all files in that directory and any subdirectory.
1771     However, including entire directories is not recommended, because it is
1772     easy to accidentally leave temporary files in a directory that can cause
1773     <code class="program"><a href="../programs/httpd.html">httpd</a></code> to fail. Instead, we encourage you to use the
1774     wildcard syntax shown below, to include files that match a particular
1775     pattern, such as *.conf, for example.</p>
1776
1777     <p>When a wildcard is specified for a <strong>file</strong> component of
1778     the path, and no file matches the wildcard, the
1779     <code class="directive"><a href="#include">Include</a></code>
1780     directive will be <strong>silently ignored</strong>. When a wildcard is
1781     specified for a <strong>directory</strong> component of the path, and
1782     no directory matches the wildcard, the
1783     <code class="directive"><a href="#include">Include</a></code> directive will
1784     <strong>fail with an error</strong> saying the directory cannot be found.
1785     </p>
1786
1787     <p>For further control over the behaviour of the server when no files or
1788     directories match, prefix the path with the modifiers <var>optional</var>
1789     or <var>strict</var>. If <var>optional</var> is specified, any wildcard
1790     file or directory that does not match will be silently ignored. If
1791     <var>strict</var> is specified, any wildcard file or directory that does
1792     not match at least one file will cause server startup to fail.</p>
1793
1794     <p>When a directory or file component of the path is
1795     specified exactly, and that directory or file does not exist,
1796     <code class="directive"><a href="#include">Include</a></code> directive will fail with an
1797     error saying the file or directory cannot be found.</p>
1798
1799     <p>The file path specified may be an absolute path, or may be relative 
1800     to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1801
1802     <p>Examples:</p>
1803
1804     <div class="example"><p><code>
1805       Include /usr/local/apache2/conf/ssl.conf<br />
1806       Include /usr/local/apache2/conf/vhosts/*.conf
1807     </code></p></div>
1808
1809     <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1810
1811     <div class="example"><p><code>
1812       Include conf/ssl.conf<br />
1813       Include conf/vhosts/*.conf
1814     </code></p></div>
1815
1816     <p>Wildcards may be included in the directory or file portion of the
1817     path. In the following example, the server will fail to load if no
1818     directories match conf/vhosts/*, but will load successfully if no
1819     files match *.conf.</p>
1820   
1821     <div class="example"><p><code>
1822       Include conf/vhosts/*/vhost.conf<br />
1823       Include conf/vhosts/*/*.conf
1824     </code></p></div>
1825
1826     <p>In this example, the server will fail to load if either
1827     conf/vhosts/* matches no directories, or if *.conf matches no files:</p>
1828
1829     <div class="example"><p><code>
1830       Include strict conf/vhosts/*/*.conf
1831     </code></p></div>
1832   
1833     <p>In this example, the server load successfully if either conf/vhosts/*
1834     matches no directories, or if *.conf matches no files:</p>
1835
1836     <div class="example"><p><code>
1837       Include optional conf/vhosts/*/*.conf
1838     </code></p></div>
1839
1840
1841 <h3>See also</h3>
1842 <ul>
1843 <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
1844 </ul>
1845 </div>
1846 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1847 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
1848 <table class="directive">
1849 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
1850 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1851 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
1852 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1853 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1854 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1855 </table>
1856     <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1857     connection feature of HTTP/1.1 provide long-lived HTTP sessions
1858     which allow multiple requests to be sent over the same TCP
1859     connection. In some cases this has been shown to result in an
1860     almost 50% speedup in latency times for HTML documents with
1861     many images. To enable Keep-Alive connections, set
1862     <code>KeepAlive On</code>.</p>
1863
1864     <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1865     used if they are specifically requested by a client. In
1866     addition, a Keep-Alive connection with an HTTP/1.0 client can
1867     only be used when the length of the content is known in
1868     advance. This implies that dynamic content such as CGI output,
1869     SSI pages, and server-generated directory listings will
1870     generally not use Keep-Alive connections to HTTP/1.0 clients.
1871     For HTTP/1.1 clients, persistent connections are the default
1872     unless otherwise specified. If the client requests it, chunked
1873     encoding will be used in order to send content of unknown
1874     length over persistent connections.</p>
1875
1876     <p>When a client uses a Keep-Alive connection it will be counted
1877     as a single "request" for the <code class="directive"><a href="../mod/mpm_common.html#maxconnectionsperchild">MaxConnectionsPerChild</a></code> directive, regardless
1878     of how many requests are sent using the connection.</p>
1879
1880 <h3>See also</h3>
1881 <ul>
1882 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
1883 </ul>
1884 </div>
1885 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1886 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
1887 <table class="directive">
1888 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
1889 requests on a persistent connection</td></tr>
1890 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>num</var>[ms]</code></td></tr>
1891 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 5</code></td></tr>
1892 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1893 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1894 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1895 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Specifying a value in milliseconds is available in 
1896 Apache httpd 2.3.2 and later</td></tr>
1897 </table>
1898     <p>The number of seconds Apache httpd will wait for a subsequent
1899     request before closing the connection. By adding a postfix of ms the
1900     timeout can be also set in milliseconds. Once a request has been
1901     received, the timeout value specified by the
1902     <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
1903
1904     <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
1905     may cause performance problems in heavily loaded servers. The
1906     higher the timeout, the more server processes will be kept
1907     occupied waiting on connections with idle clients.</p>
1908     
1909     <p>In a name-based virtual host context, the value of the first
1910     defined virtual host (the default host) in a set of <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> will be used.
1911     The other values will be ignored.</p>
1912
1913 </div>
1914 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1915 <div class="directive-section"><h2><a name="Limit" id="Limit">&lt;Limit&gt;</a> <a name="limit" id="limit">Directive</a></h2>
1916 <table class="directive">
1917 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
1918 methods</td></tr>
1919 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Limit <var>method</var> [<var>method</var>] ... &gt; ...
1920     &lt;/Limit&gt;</code></td></tr>
1921 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1922 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig, Limit</td></tr>
1923 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1924 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1925 </table>
1926     <p>Access controls are normally effective for
1927     <strong>all</strong> access methods, and this is the usual
1928     desired behavior. <strong>In the general case, access control
1929     directives should not be placed within a
1930     <code class="directive">&lt;Limit&gt;</code> section.</strong></p>
1931
1932     <p>The purpose of the <code class="directive">&lt;Limit&gt;</code>
1933     directive is to restrict the effect of the access controls to the
1934     nominated HTTP methods. For all other methods, the access
1935     restrictions that are enclosed in the <code class="directive">&lt;Limit&gt;</code> bracket <strong>will have no
1936     effect</strong>. The following example applies the access control
1937     only to the methods <code>POST</code>, <code>PUT</code>, and
1938     <code>DELETE</code>, leaving all other methods unprotected:</p>
1939
1940     <div class="example"><p><code>
1941       &lt;Limit POST PUT DELETE&gt;<br />
1942       <span class="indent">
1943         Require valid-user<br />
1944       </span>
1945       &lt;/Limit&gt;
1946     </code></p></div>
1947
1948     <p>The method names listed can be one or more of: <code>GET</code>,
1949     <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1950     <code>CONNECT</code>, <code>OPTIONS</code>,
1951     <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1952     <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1953     <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1954     case-sensitive.</strong> If <code>GET</code> is used it will also
1955     restrict <code>HEAD</code> requests. The <code>TRACE</code> method
1956     cannot be limited (see <code class="directive"><a href="#traceenable">TraceEnable</a></code>).</p>
1957
1958     <div class="warning">A <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section should always be
1959     used in preference to a <code class="directive">&lt;Limit&gt;</code>
1960     section when restricting access, since a <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section provides protection
1961     against arbitrary methods.</div>
1962
1963     <p>The <code class="directive">&lt;Limit&gt;</code> and
1964     <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code>
1965     directives may be nested.  In this case, each successive level of
1966     <code class="directive">&lt;Limit&gt;</code> or <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> directives must
1967     further restrict the set of methods to which access controls apply.</p>
1968
1969     <div class="warning">When using
1970     <code class="directive">&lt;Limit&gt;</code> or
1971     <code class="directive">&lt;LimitExcept&gt;</code> directives with
1972     the <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> directive,
1973     note that the first <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code>
1974     to succeed authorizes the request, regardless of the presence of other
1975     <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> directives.</div>
1976
1977     <p>For example, given the following configuration, all users will
1978     be authorized for <code>POST</code> requests, and the
1979     <code>Require group editors</code> directive will be ignored
1980     in all cases:</p>
1981
1982     <div class="example"><p><code>
1983       &lt;LimitExcept GET&gt;
1984       <span class="indent">
1985         Require valid-user
1986       </span> 
1987       &lt;/LimitExcept&gt;<br />
1988       &lt;Limit POST&gt;
1989       <span class="indent">
1990         Require group editors
1991       </span> 
1992       &lt;/Limit&gt;
1993     </code></p></div>
1994
1995 </div>
1996 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1997 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept">&lt;LimitExcept&gt;</a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
1998 <table class="directive">
1999 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
2000 except the named ones</td></tr>
2001 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;LimitExcept <var>method</var> [<var>method</var>] ... &gt; ...
2002     &lt;/LimitExcept&gt;</code></td></tr>
2003 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2004 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig, Limit</td></tr>
2005 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2006 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2007 </table>
2008     <p><code class="directive">&lt;LimitExcept&gt;</code> and
2009     <code>&lt;/LimitExcept&gt;</code> are used to enclose
2010     a group of access control directives which will then apply to any
2011     HTTP access method <strong>not</strong> listed in the arguments;
2012     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
2013     both standard and nonstandard/unrecognized methods. See the
2014     documentation for <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> for more details.</p>
2015
2016     <p>For example:</p>
2017
2018     <div class="example"><p><code>
2019       &lt;LimitExcept POST GET&gt;<br />
2020       <span class="indent">
2021         Require valid-user<br />
2022       </span>
2023       &lt;/LimitExcept&gt;
2024     </code></p></div>
2025
2026
2027 </div>
2028 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2029 <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directive</a></h2>
2030 <table class="directive">
2031 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine maximum number of internal redirects and nested
2032 subrequests</td></tr>
2033 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
2034 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
2035 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2036 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2037 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2038 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.0.47 and later</td></tr>
2039 </table>
2040     <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
2041     redirects the original request to a CGI script. A subrequest is Apache httpd's
2042     mechanism to find out what would happen for some URI if it were requested.
2043     For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
2044     files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
2045     directive.</p>
2046
2047     <p><code class="directive">LimitInternalRecursion</code> prevents the server
2048     from crashing when entering an infinite loop of internal redirects or
2049     subrequests. Such loops are usually caused by misconfigurations.</p>
2050
2051     <p>The directive stores two different limits, which are evaluated on
2052     per-request basis. The first <var>number</var> is the maximum number of
2053     internal redirects, that may follow each other. The second <var>number</var>
2054     determines, how deep subrequests may be nested. If you specify only one
2055     <var>number</var>, it will be assigned to both limits.</p>
2056
2057     <div class="example"><h3>Example</h3><p><code>
2058       LimitInternalRecursion 5
2059     </code></p></div>
2060
2061 </div>
2062 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2063 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
2064 <table class="directive">
2065 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
2066 from the client</td></tr>
2067 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
2068 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
2069 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2070 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2071 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2072 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2073 </table>
2074     <p>This directive specifies the number of <var>bytes</var> from 0
2075     (meaning unlimited) to 2147483647 (2GB) that are allowed in a
2076     request body. See the note below for the limited applicability
2077     to proxy requests.</p>
2078
2079     <p>The <code class="directive">LimitRequestBody</code> directive allows
2080     the user to set a limit on the allowed size of an HTTP request
2081     message body within the context in which the directive is given
2082     (server, per-directory, per-file or per-location). If the client
2083     request exceeds that limit, the server will return an error
2084     response instead of servicing the request. The size of a normal
2085     request message body will vary greatly depending on the nature of
2086     the resource and the methods allowed on that resource. CGI scripts
2087     typically use the message body for retrieving form information.
2088     Implementations of the <code>PUT</code> method will require
2089     a value at least as large as any representation that the server
2090     wishes to accept for that resource.</p>
2091
2092     <p>This directive gives the server administrator greater
2093     control over abnormal client request behavior, which may be
2094     useful for avoiding some forms of denial-of-service
2095     attacks.</p>
2096
2097     <p>If, for example, you are permitting file upload to a particular
2098     location, and wish to limit the size of the uploaded file to 100K,
2099     you might use the following directive:</p>
2100
2101     <div class="example"><p><code>
2102       LimitRequestBody 102400
2103     </code></p></div>
2104     
2105     <div class="note"><p>For a full description of how this directive is interpreted by 
2106     proxy requests, see the <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> documentation.</p>
2107     </div>
2108
2109
2110 </div>
2111 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2112 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
2113 <table class="directive">
2114 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
2115 will be accepted from the client</td></tr>
2116 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
2117 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
2118 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2119 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2120 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2121 </table>
2122     <p><var>Number</var> is an integer from 0 (meaning unlimited) to
2123     32767. The default value is defined by the compile-time
2124     constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
2125     distributed).</p>
2126
2127     <p>The <code class="directive">LimitRequestFields</code> directive allows
2128     the server administrator to modify the limit on the number of
2129     request header fields allowed in an HTTP request. A server needs
2130     this value to be larger than the number of fields that a normal
2131     client request might include. The number of request header fields
2132     used by a client rarely exceeds 20, but this may vary among
2133     different client implementations, often depending upon the extent
2134     to which a user has configured their browser to support detailed
2135     content negotiation. Optional HTTP extensions are often expressed
2136     using request header fields.</p>
2137
2138     <p>This directive gives the server administrator greater
2139     control over abnormal client request behavior, which may be
2140     useful for avoiding some forms of denial-of-service attacks.
2141     The value should be increased if normal clients see an error
2142     response from the server that indicates too many fields were
2143     sent in the request.</p>
2144
2145     <p>For example:</p>
2146
2147     <div class="example"><p><code>
2148       LimitRequestFields 50
2149     </code></p></div>
2150
2151      <div class="warning"><h3>Warning</h3>
2152      <p> When name-based virtual hosting is used, the value for this 
2153      directive is taken from the default (first-listed) virtual host for the
2154      <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2155      </div>
2156
2157
2158 </div>
2159 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2160 <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
2161 <table class="directive">
2162 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
2163 client</td></tr>
2164 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldSize <var>bytes</var></code></td></tr>
2165 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldSize 8190</code></td></tr>
2166 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2167 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2168 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2169 </table>
2170     <p>This directive specifies the number of <var>bytes</var>
2171     that will be allowed in an HTTP request header.</p>
2172
2173     <p>The <code class="directive">LimitRequestFieldSize</code> directive
2174     allows the server administrator to reduce or increase the limit 
2175     on the allowed size of an HTTP request header field. A server
2176     needs this value to be large enough to hold any one header field 
2177     from a normal client request. The size of a normal request header 
2178     field will vary greatly among different client implementations, 
2179     often depending upon the extent to which a user has configured
2180     their browser to support detailed content negotiation. SPNEGO
2181     authentication headers can be up to 12392 bytes.</p>
2182
2183     <p>This directive gives the server administrator greater
2184     control over abnormal client request behavior, which may be
2185     useful for avoiding some forms of denial-of-service attacks.</p>
2186
2187     <p>For example:</p>
2188
2189     <div class="example"><p><code>
2190       LimitRequestFieldSize 4094
2191     </code></p></div>
2192
2193     <div class="note">Under normal conditions, the value should not be changed from
2194     the default.</div>
2195
2196     <div class="warning"><h3>Warning</h3>
2197     <p> When name-based virtual hosting is used, the value for this 
2198     directive is taken from the default (first-listed) virtual host for the
2199     <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2200     </div>
2201
2202
2203 </div>
2204 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2205 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
2206 <table class="directive">
2207 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
2208 from the client</td></tr>
2209 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
2210 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
2211 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2212 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2213 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2214 </table>
2215     <p>This directive sets the number of <var>bytes</var> that will be 
2216     allowed on the HTTP request-line.</p>
2217
2218     <p>The <code class="directive">LimitRequestLine</code> directive allows
2219     the server administrator to reduce or increase the limit on the allowed size
2220     of a client's HTTP request-line. Since the request-line consists of the
2221     HTTP method, URI, and protocol version, the
2222     <code class="directive">LimitRequestLine</code> directive places a
2223     restriction on the length of a request-URI allowed for a request
2224     on the server. A server needs this value to be large enough to
2225     hold any of its resource names, including any information that
2226     might be passed in the query part of a <code>GET</code> request.</p>
2227
2228     <p>This directive gives the server administrator greater
2229     control over abnormal client request behavior, which may be
2230     useful for avoiding some forms of denial-of-service attacks.</p>
2231
2232     <p>For example:</p>
2233
2234     <div class="example"><p><code>
2235       LimitRequestLine 4094
2236     </code></p></div>
2237
2238     <div class="note">Under normal conditions, the value should not be changed from
2239     the default.</div>
2240
2241     <div class="warning"><h3>Warning</h3>
2242     <p> When name-based virtual hosting is used, the value for this 
2243     directive is taken from the default (first-listed) virtual host for the
2244     <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2245     </div>
2246
2247
2248 </div>
2249 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2250 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
2251 <table class="directive">
2252 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
2253 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
2254 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
2255 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2256 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2257 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2258 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2259 </table>
2260     <p>Limit (in bytes) on maximum size of an XML-based request
2261     body. A value of <code>0</code> will disable any checking.</p>
2262
2263     <p>Example:</p>
2264
2265     <div class="example"><p><code>
2266       LimitXMLRequestBody 0
2267     </code></p></div>
2268
2269
2270 </div>
2271 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2272 <div class="directive-section"><h2><a name="Location" id="Location">&lt;Location&gt;</a> <a name="location" id="location">Directive</a></h2>
2273 <table class="directive">
2274 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
2275 URLs</td></tr>
2276 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Location
2277     <var>URL-path</var>|<var>URL</var>&gt; ... &lt;/Location&gt;</code></td></tr>
2278 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2279 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2280 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2281 </table>
2282     <p>The <code class="directive">&lt;Location&gt;</code> directive
2283     limits the scope of the enclosed directives by URL. It is similar to the
2284     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
2285     directive, and starts a subsection which is terminated with a
2286     <code>&lt;/Location&gt;</code> directive. <code class="directive">&lt;Location&gt;</code> sections are processed in the
2287     order they appear in the configuration file, after the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections and
2288     <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files">&lt;Files&gt;</a></code> sections.</p>
2289
2290     <p><code class="directive">&lt;Location&gt;</code> sections operate
2291     completely outside the filesystem.  This has several consequences.
2292     Most importantly, <code class="directive">&lt;Location&gt;</code>
2293     directives should not be used to control access to filesystem
2294     locations.  Since several different URLs may map to the same
2295     filesystem location, such access controls may by circumvented.</p>
2296
2297     <p>The enclosed directives will be applied to the request if the path component
2298     of the URL meets <em>any</em> of the following criteria:
2299     </p>
2300     <ul>
2301       <li>The specified location matches exactly the path component of the URL.
2302       </li>
2303       <li>The specified location, which ends in a forward slash, is a prefix 
2304       of the path component of the URL (treated as a context root).
2305       </li>
2306       <li>The specified location, with the addition of a trailing slash, is a 
2307       prefix of the path component of the URL (also treated as a context root).
2308       </li>
2309     </ul>
2310     <p>
2311     In the example below, where no trailing slash is used, requests to 
2312     /private1, /private1/ and /private1/file.txt will have the enclosed
2313     directives applied, but /private1other would not. 
2314     </p>
2315     <div class="example"><p><code>
2316       &lt;Location /private1&gt;
2317           ...
2318     </code></p></div>
2319     <p>
2320     In the example below, where a trailing slash is used, requests to 
2321     /private2/ and /private2/file.txt will have the enclosed
2322     directives applied, but /private2 and /private2other would not. 
2323     </p>
2324     <div class="example"><p><code>
2325       &lt;Location /private2<em>/</em>&gt;
2326           ...
2327     </code></p></div>
2328
2329     <div class="note"><h3>When to use <code class="directive">&lt;Location&gt;</code></h3>
2330
2331     <p>Use <code class="directive">&lt;Location&gt;</code> to apply
2332     directives to content that lives outside the filesystem.  For
2333     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
2334     <code>&lt;Location /&gt;</code>, which is an easy way to 
2335     apply a configuration to the entire server.</p>
2336     </div>
2337
2338     <p>For all origin (non-proxy) requests, the URL to be matched is a
2339     URL-path of the form <code>/path/</code>.  <em>No scheme, hostname,
2340     port, or query string may be included.</em>  For proxy requests, the
2341     URL to be matched is of the form
2342     <code>scheme://servername/path</code>, and you must include the
2343     prefix.</p>
2344
2345     <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
2346     any single character, and <code>*</code> matches any sequences of
2347     characters. Neither wildcard character matches a / in the URL-path.</p>
2348
2349     <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a>
2350     can also be used, with the addition of the <code>~</code> 
2351     character. For example:</p>
2352
2353     <div class="example"><p><code>
2354       &lt;Location ~ "/(extra|special)/data"&gt;
2355     </code></p></div>
2356
2357     <p>would match URLs that contained the substring <code>/extra/data</code>
2358     or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch">&lt;LocationMatch&gt;</a></code> behaves
2359     identical to the regex version of <code class="directive">&lt;Location&gt;</code>, and is preferred, for the
2360     simple reason that <code>~</code> is hard to distinguish from
2361     <code>-</code> in many fonts.</p>
2362
2363     <p>The <code class="directive">&lt;Location&gt;</code>
2364     functionality is especially useful when combined with the
2365     <code class="directive"><a href="#sethandler">SetHandler</a></code>
2366     directive. For example, to enable status requests, but allow them
2367     only from browsers at <code>example.com</code>, you might use:</p>
2368
2369     <div class="example"><p><code>
2370       &lt;Location /status&gt;<br />
2371       <span class="indent">
2372         SetHandler server-status<br />
2373         Require host example.com<br />
2374       </span>
2375       &lt;/Location&gt;
2376     </code></p></div>
2377
2378     <div class="note"><h3>Note about / (slash)</h3>
2379       <p>The slash character has special meaning depending on where in a
2380       URL it appears. People may be used to its behavior in the filesystem
2381       where multiple adjacent slashes are frequently collapsed to a single
2382       slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
2383       <code>/home/foo</code>). In URL-space this is not necessarily true.
2384       The <code class="directive"><a href="#locationmatch">&lt;LocationMatch&gt;</a></code>
2385       directive and the regex version of <code class="directive">&lt;Location&gt;</code> require you to explicitly specify multiple
2386       slashes if that is your intention.</p>
2387
2388       <p>For example, <code>&lt;LocationMatch ^/abc&gt;</code> would match
2389       the request URL <code>/abc</code> but not the request URL <code>
2390       //abc</code>. The (non-regex) <code class="directive">&lt;Location&gt;</code> directive behaves similarly when used for
2391       proxy requests. But when (non-regex) <code class="directive">&lt;Location&gt;</code> is used for non-proxy requests it will
2392       implicitly match multiple slashes with a single slash. For example,
2393       if you specify <code>&lt;Location /abc/def&gt;</code> and the
2394       request is to <code>/abc//def</code> then it will match.</p>
2395     </div>
2396
2397 <h3>See also</h3>
2398 <ul>
2399 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
2400     and &lt;Files&gt; sections work</a> for an explanation of how these
2401     different sections are combined when a request is received.</li>
2402 <li><code class="directive"><a href="#locationmatch">LocationMatch</a></code></li>
2403 </ul>
2404 </div>
2405 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2406 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch">&lt;LocationMatch&gt;</a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
2407 <table class="directive">
2408 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
2409 matching URLs</td></tr>
2410 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;LocationMatch
2411     <var>regex</var>&gt; ... &lt;/LocationMatch&gt;</code></td></tr>
2412 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2413 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2414 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2415 </table>
2416     <p>The <code class="directive">&lt;LocationMatch&gt;</code> directive
2417     limits the scope of the enclosed directives by URL, in an identical manner
2418     to <code class="directive"><a href="#location">&lt;Location&gt;</a></code>. However,
2419     it takes a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
2420     as an argument instead of a simple string. For example:</p>
2421
2422     <div class="example"><p><code>
2423       &lt;LocationMatch "/(extra|special)/data"&gt;
2424     </code></p></div>
2425
2426     <p>would match URLs that contained the substring <code>/extra/data</code>
2427     or <code>/special/data</code>.</p>
2428
2429 <h3>See also</h3>
2430 <ul>
2431 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
2432     and &lt;Files&gt; sections work</a> for an explanation of how these
2433     different sections are combined when a request is received</li>
2434 </ul>
2435 </div>
2436 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2437 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
2438 <table class="directive">
2439 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
2440 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel [<var>module</var>:]<var>level</var>
2441     [<var>module</var>:<var>level</var>] ...
2442 </code></td></tr>
2443 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
2444 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
2445 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2446 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2447 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Per-module and per-directory configuration is available in
2448     Apache HTTP Server 2.3.6 and later</td></tr>
2449 </table>
2450     <p><code class="directive">LogLevel</code> adjusts the verbosity of the
2451     messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
2452     <var>level</var>s are available, in order of decreasing
2453     significance:</p>
2454
2455     <table class="bordered">
2456     
2457       <tr>
2458         <th><strong>Level</strong> </th>
2459
2460         <th><strong>Description</strong> </th>
2461
2462         <th><strong>Example</strong> </th>
2463       </tr>
2464
2465       <tr>
2466         <td><code>emerg</code> </td>
2467
2468         <td>Emergencies - system is unusable.</td>
2469
2470         <td>"Child cannot open lock file. Exiting"</td>
2471       </tr>
2472
2473       <tr>
2474         <td><code>alert</code> </td>
2475
2476         <td>Action must be taken immediately.</td>
2477
2478         <td>"getpwuid: couldn't determine user name from uid"</td>
2479       </tr>
2480
2481       <tr>
2482         <td><code>crit</code> </td>
2483
2484         <td>Critical Conditions.</td>
2485
2486         <td>"socket: Failed to get a socket, exiting child"</td>
2487       </tr>
2488
2489       <tr>
2490         <td><code>error</code> </td>
2491
2492         <td>Error conditions.</td>
2493
2494         <td>"Premature end of script headers"</td>
2495       </tr>
2496
2497       <tr>
2498         <td><code>warn</code> </td>
2499
2500         <td>Warning conditions.</td>
2501
2502         <td>"child process 1234 did not exit, sending another
2503         SIGHUP"</td>
2504       </tr>
2505
2506       <tr>
2507         <td><code>notice</code> </td>
2508
2509         <td>Normal but significant condition.</td>
2510
2511         <td>"httpd: caught SIGBUS, attempting to dump core in
2512         ..."</td>
2513       </tr>
2514
2515       <tr>
2516         <td><code>info</code> </td>
2517
2518         <td>Informational.</td>
2519
2520         <td>"Server seems busy, (you may need to increase
2521         StartServers, or Min/MaxSpareServers)..."</td>
2522       </tr>
2523
2524       <tr>
2525         <td><code>debug</code> </td>
2526
2527         <td>Debug-level messages</td>
2528
2529         <td>"Opening config file ..."</td>
2530       </tr>
2531       <tr>
2532         <td><code>trace1</code> </td>
2533
2534         <td>Trace messages</td>
2535
2536         <td>"proxy: FTP: control connection complete"</td>
2537       </tr>
2538       <tr>
2539         <td><code>trace2</code> </td>
2540
2541         <td>Trace messages</td>
2542
2543         <td>"proxy: CONNECT: sending the CONNECT request to the remote proxy"</td>
2544       </tr>
2545       <tr>
2546         <td><code>trace3</code> </td>
2547
2548         <td>Trace messages</td>
2549
2550         <td>"openssl: Handshake: start"</td>
2551       </tr>
2552       <tr>
2553         <td><code>trace4</code> </td>
2554
2555         <td>Trace messages</td>
2556
2557         <td>"read from buffered SSL brigade, mode 0, 17 bytes"</td>
2558       </tr>
2559       <tr>
2560         <td><code>trace5</code> </td>
2561
2562         <td>Trace messages</td>
2563
2564         <td>"map lookup FAILED: map=rewritemap key=keyname"</td>
2565       </tr>
2566       <tr>
2567         <td><code>trace6</code> </td>
2568
2569         <td>Trace messages</td>
2570
2571         <td>"cache lookup FAILED, forcing new map lookup"</td>
2572       </tr>
2573       <tr>
2574         <td><code>trace7</code> </td>
2575
2576         <td>Trace messages, dumping large amounts of data</td>
2577
2578         <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2579       </tr>
2580       <tr>
2581         <td><code>trace8</code> </td>
2582
2583         <td>Trace messages, dumping large amounts of data</td>
2584
2585         <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2586       </tr>
2587     </table>
2588
2589     <p>When a particular level is specified, messages from all
2590     other levels of higher significance will be reported as well.
2591     <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2592     then messages with log levels of <code>notice</code> and
2593     <code>warn</code> will also be posted.</p>
2594
2595     <p>Using a level of at least <code>crit</code> is
2596     recommended.</p>
2597
2598     <p>For example:</p>
2599
2600     <div class="example"><p><code>
2601       LogLevel notice
2602     </code></p></div>
2603
2604     <div class="note"><h3>Note</h3>
2605       <p>When logging to a regular file messages of the level
2606       <code>notice</code> cannot be suppressed and thus are always
2607       logged. However, this doesn't apply when logging is done
2608       using <code>syslog</code>.</p>
2609     </div>
2610
2611     <p>Specifying a level without a module name will reset the level
2612     for all modules to that level.  Specifying a level with a module
2613     name will set the level for that module only. It is possible to
2614     use the module source file name, the module identifier, or the
2615     module identifier with the trailing <code>_module</code> omitted
2616     as module specification. This means the following three specifications
2617     are equivalent:</p>
2618
2619     <div class="example"><p><code>
2620       LogLevel info ssl:warn<br />
2621       LogLevel info mod_ssl.c:warn<br />
2622       LogLevel info ssl_module:warn<br />
2623     </code></p></div>
2624
2625     <p>It is also possible to change the level per directory:</p>
2626
2627     <div class="example"><p><code>
2628         LogLevel info<br />
2629         &lt;Directory /usr/local/apache/htdocs/app&gt;<br />
2630         &nbsp; LogLevel debug<br />
2631         &lt;/Files&gt;
2632     </code></p></div>
2633
2634     <div class="note">
2635         Per directory loglevel configuration only affects messages that are
2636         logged after the request has been parsed and that are associated with
2637         the request. Log messages which are associated with the connection or
2638         the server are not affected.
2639     </div>
2640
2641 </div>
2642 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2643 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
2644 <table class="directive">
2645 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
2646 connection</td></tr>
2647 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
2648 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
2649 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2650 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2651 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2652 </table>
2653     <p>The <code class="directive">MaxKeepAliveRequests</code> directive
2654     limits the number of requests allowed per connection when
2655     <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
2656     set to <code>0</code>, unlimited requests will be allowed. We
2657     recommend that this setting be kept to a high value for maximum
2658     server performance.</p>
2659
2660     <p>For example:</p>
2661
2662     <div class="example"><p><code>
2663       MaxKeepAliveRequests 500
2664     </code></p></div>
2665
2666 </div>
2667 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2668 <div class="directive-section"><h2><a name="Mutex" id="Mutex">Mutex</a> <a name="mutex" id="mutex">Directive</a></h2>
2669 <table class="directive">
2670 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures mutex mechanism and lock file directory for all
2671 or specified mutexes</td></tr>
2672 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Mutex <var>mechanism</var> [default|<var>mutex-name</var>] ... [OmitPID]</code></td></tr>
2673 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Mutex default</code></td></tr>
2674 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2675 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2676 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2677 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.3.4 and later</td></tr>
2678 </table>
2679     <p>The <code class="directive">Mutex</code> directive sets the mechanism,
2680     and optionally the lock file location, that httpd and modules use
2681     to serialize access to resources.  Specify <code>default</code> as
2682     the first argument to change the settings for all mutexes; specify
2683     a mutex name (see table below) as the first argument to override
2684     defaults only for that mutex.</p>
2685
2686     <p>The <code class="directive">Mutex</code> directive is typically used in
2687     the following exceptional situations:</p>
2688
2689     <ul>
2690         <li>change the mutex mechanism when the default mechanism selected
2691         by <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a> has a functional or performance
2692         problem</li>
2693
2694         <li>change the directory used by file-based mutexes when the
2695         default directory does not support locking</li>
2696     </ul>
2697
2698     <div class="note"><h3>Supported modules</h3>
2699     <p>This directive only configures mutexes which have been registered
2700     with the core server using the <code>ap_mutex_register()</code> API.
2701     All modules bundled with httpd support the <code class="directive">Mutex</code>
2702     directive, but third-party modules may not.  Consult the documentation
2703     of the third-party module, which must indicate the mutex name(s) which
2704     can be configured if this directive is supported.</p>
2705     </div>
2706
2707     <p>The following mutex <em>mechanisms</em> are available:</p>
2708     <ul>
2709         <li><code>default | yes</code>
2710         <p>This selects the default locking implementation, as determined by
2711         <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a>.  The default locking implementation can
2712         be displayed by running <code class="program"><a href="../programs/httpd.html">httpd</a></code> with the 
2713         <code>-V</code> option.</p></li>
2714
2715         <li><code>none | no</code>
2716         <p>This effectively disables the mutex, and is only allowed for a
2717         mutex if the module indicates that it is a valid choice.  Consult the
2718         module documentation for more information.</p></li>
2719
2720         <li><code>posixsem</code>
2721         <p>This is a mutex variant based on a Posix semaphore.</p>
2722
2723         <div class="warning"><h3>Warning</h3>
2724         <p>The semaphore ownership is not recovered if a thread in the process
2725         holding the mutex segfaults, resulting in a hang of the web server.</p>
2726         </div>
2727         </li>
2728
2729         <li><code>sysvsem</code>
2730         <p>This is a mutex variant based on a SystemV IPC semaphore.</p>
2731
2732         <div class="warning"><h3>Warning</h3>
2733         <p>It is possible to "leak" SysV semaphores if processes crash 
2734         before the semaphore is removed.</p>
2735         </div>
2736
2737         <div class="warning"><h3>Security</h3>
2738         <p>The semaphore API allows for a denial of service attack by any
2739         CGIs running under the same uid as the webserver (<em>i.e.</em>,
2740         all CGIs, unless you use something like <code class="program"><a href="../programs/suexec.html">suexec</a></code>
2741         or <code>cgiwrapper</code>).</p>
2742         </div>
2743         </li>
2744
2745         <li><code>sem</code>
2746         <p>This selects the "best" available semaphore implementation, choosing
2747         between Posix and SystemV IPC semaphores, in that order.</p></li>
2748
2749         <li><code>pthread</code>
2750         <p>This is a mutex variant based on cross-process Posix thread
2751         mutexes.</p>
2752
2753         <div class="warning"><h3>Warning</h3>
2754         <p>On most systems, if a child process terminates abnormally while
2755         holding a mutex that uses this implementation, the server will deadlock
2756         and stop responding to requests.  When this occurs, the server will
2757         require a manual restart to recover.</p>
2758         <p>Solaris is a notable exception as it provides a mechanism which
2759         usually allows the mutex to be recovered after a child process
2760         terminates abnormally while holding a mutex.</p>
2761         <p>If your system implements the
2762         <code>pthread_mutexattr_setrobust_np()</code> function, you may be able
2763         to use the <code>pthread</code> option safely.</p>
2764         </div>
2765         </li>
2766
2767         <li><code>fcntl:/path/to/mutex</code>
2768         <p>This is a mutex variant where a physical (lock-)file and the 
2769         <code>fcntl()</code> function are used as the mutex.</p>
2770
2771         <div class="warning"><h3>Warning</h3>
2772         <p>When multiple mutexes based on this mechanism are used within
2773         multi-threaded, multi-process environments, deadlock errors (EDEADLK)
2774         can be reported for valid mutex operations if <code>fcntl()</code>
2775         is not thread-aware, such as on Solaris.</p>
2776         </div>
2777         </li>
2778
2779         <li><code>flock:/path/to/mutex</code>
2780         <p>This is similar to the <code>fcntl:/path/to/mutex</code> method
2781         with the exception that the <code>flock()</code> function is used to
2782         provide file locking.</p></li>
2783
2784         <li><code>file:/path/to/mutex</code>
2785         <p>This selects the "best" available file locking implementation,
2786         choosing between <code>fcntl</code> and <code>flock</code>, in that
2787         order.</p></li>
2788     </ul>
2789
2790     <p>Most mechanisms are only available on selected platforms, where the 
2791     underlying platform and <a class="glossarylink" href="../glossary.html#apr" title="see glossary">APR</a> support it.  Mechanisms
2792     which aren't available on all platforms are <em>posixsem</em>,
2793     <em>sysvsem</em>, <em>sem</em>, <em>pthread</em>, <em>fcntl</em>, 
2794     <em>flock</em>, and <em>file</em>.</p>
2795
2796     <p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
2797     the path, if provided, is a directory where the lock file will be created.
2798     The default directory is httpd's run-time file directory relative to
2799     <code class="directive"><a href="#serverroot">ServerRoot</a></code>.  Always use a local disk
2800     filesystem for <code>/path/to/mutex</code> and never a directory residing
2801     on a NFS- or AFS-filesystem.  The basename of the file will be the mutex
2802     type, an optional instance string provided by the module, and unless the
2803     <code>OmitPID</code> keyword is specified, the process id of the httpd 
2804     parent process will be appended to to make the file name unique, avoiding
2805     conflicts when multiple httpd instances share a lock file directory.  For
2806     example, if the mutex name is <code>mpm-accept</code> and the lock file
2807     directory is <code>/var/httpd/locks</code>, the lock file name for the
2808     httpd instance with parent process id 12345 would be 
2809     <code>/var/httpd/locks/mpm-accept.12345</code>.</p>
2810
2811     <div class="warning"><h3>Security</h3>
2812     <p>It is best to <em>avoid</em> putting mutex files in a world-writable
2813     directory such as <code>/var/tmp</code> because someone could create
2814     a denial of service attack and prevent the server from starting by
2815     creating a lockfile with the same name as the one the server will try
2816     to create.</p>
2817     </div>
2818
2819     <p>The following table documents the names of mutexes used by httpd
2820     and bundled modules.</p>
2821
2822     <table class="bordered"><tr class="header">
2823             <th>Mutex name</th>
2824             <th>Module(s)</th>
2825             <th>Protected resource</th>
2826         </tr>
2827 <tr>
2828             <td><code>mpm-accept</code></td>
2829             <td><code class="module"><a href="../mod/prefork.html">prefork</a></code> and <code class="module"><a href="../mod/worker.html">worker</a></code> MPMs</td>
2830             <td>incoming connections, to avoid the thundering herd problem;
2831             for more information, refer to the
2832             <a href="../misc/perf-tuning.html">performance tuning</a>
2833             documentation</td>
2834         </tr>
2835 <tr class="odd">
2836             <td><code>authdigest-client</code></td>
2837             <td><code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
2838             <td>client list in shared memory</td>
2839         </tr>
2840 <tr>
2841             <td><code>authdigest-opaque</code></td>
2842             <td><code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
2843             <td>counter in shared memory</td>
2844         </tr>
2845 <tr class="odd">
2846             <td><code>ldap-cache</code></td>
2847             <td><code class="module"><a href="../mod/mod_ldap.html">mod_ldap</a></code></td>
2848             <td>LDAP result cache</td>
2849         </tr>
2850 <tr>
2851             <td><code>rewrite-map</code></td>
2852             <td><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code></td>
2853             <td>communication with external mapping programs, to avoid
2854             intermixed I/O from multiple requests</td>
2855         </tr>
2856 <tr class="odd">
2857             <td><code>ssl-cache</code></td>
2858             <td><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></td>
2859             <td>SSL session cache</td>
2860         </tr>
2861 <tr>
2862             <td><code>ssl-stapling</code></td>
2863             <td><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></td>
2864             <td>OCSP stapling response cache</td>
2865         </tr>
2866 <tr class="odd">
2867             <td><code>watchdog-callback</code></td>
2868             <td><code class="module"><a href="../mod/mod_watchdog.html">mod_watchdog</a></code></td>
2869             <td>callback function of a particular client module</td>
2870         </tr>
2871 </table>
2872
2873     <p>The <code>OmitPID</code> keyword suppresses the addition of the httpd
2874     parent process id from the lock file name.</p>
2875
2876     <p>In the following example, the mutex mechanism for the MPM accept
2877     mutex will be changed from the compiled-in default to <code>fcntl</code>,
2878     with the associated lock file created in directory
2879     <code>/var/httpd/locks</code>.  The mutex mechanism for all other mutexes
2880     will be changed from the compiled-in default to <code>sysvsem</code>.</p>
2881
2882     <div class="example"><p><code>
2883     Mutex default sysvsem<br />
2884     Mutex mpm-accept fcntl:/var/httpd/locks
2885     </code></p></div>
2886
2887 </div>
2888 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2889 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
2890 <table class="directive">
2891 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
2892 hosting</td></tr>
2893 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
2894 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2895 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2896 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2897 </table>
2898
2899 <p>A single <code class="directive">NameVirtualHost</code> directive 
2900 identifies a set of identical virtual hosts on which the server will  
2901 further select from on the basis of the <em>hostname</em> 
2902 requested by the client.  The <code class="directive">NameVirtualHost</code>
2903 directive is a required directive if you want to configure 
2904 <a href="../vhosts/">name-based virtual hosts</a>.</p>
2905
2906 <p>This directive, and the corresponding <code class="directive">VirtualHost</code>,
2907 <em>must</em> be qualified with a port number if the server supports both HTTP 
2908 and HTTPS connections.</p>
2909
2910 <p>Although <var>addr</var> can be a hostname, it is recommended
2911 that you always use an IP address or a wildcard.  A wildcard
2912 NameVirtualHost matches only virtualhosts that also have a literal wildcard
2913 as their argument.</p>
2914
2915 <p>In cases where a firewall or other proxy receives the requests and 
2916 forwards them on a different IP address to the server, you must specify the
2917 IP address of the physical interface on the machine which will be
2918 servicing the requests. </p>
2919
2920 <p> In the example below, requests received on interface 192.0.2.1 and port 80 
2921 will only select among the first two virtual hosts. Requests received on
2922 port 80 on any other interface will only select among the third and fourth
2923 virtual hosts. In the common case where the interface isn't important 
2924 to the mapping, only the "*:80" NameVirtualHost and VirtualHost directives 
2925 are necessary.</p>
2926
2927    <div class="example"><p><code>
2928       NameVirtualHost 192.0.2.1:80<br />
2929       NameVirtualHost *:80<br /><br />
2930
2931       &lt;VirtualHost 192.0.2.1:80&gt;<br />
2932       &nbsp; ServerName namebased-a.example.com<br />
2933       &lt;/VirtualHost&gt;<br />
2934       <br />
2935       &lt;VirtualHost 192.0.2.1:80&gt;<br />
2936       &nbsp; Servername namebased-b.example.com<br />
2937       &lt;/VirtualHost&gt;<br />
2938       <br />
2939       &lt;VirtualHost *:80&gt;<br />
2940       &nbsp; ServerName namebased-c.example.com <br />
2941       &lt;/VirtualHost&gt;<br />
2942       <br />
2943       &lt;VirtualHost *:80&gt;<br />
2944       &nbsp; ServerName namebased-d.example.com <br />
2945       &lt;/VirtualHost&gt;<br />
2946       <br />
2947
2948     </code></p></div>
2949
2950     <p>If no matching virtual host is found, then the first listed
2951     virtual host that matches the IP address and port will be used.</p>
2952
2953
2954     <p>IPv6 addresses must be enclosed in square brackets, as shown
2955     in the following example:</p>
2956
2957     <div class="example"><p><code>
2958       NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
2959     </code></p></div>
2960
2961     <div class="note"><h3>Argument to <code class="directive">&lt;VirtualHost&gt;</code>
2962       directive</h3>
2963       <p>Note that the argument to the <code class="directive">&lt;VirtualHost&gt;</code> directive must
2964       exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
2965
2966       <div class="example"><p><code>
2967         NameVirtualHost 192.0.2.2:80<br />
2968         &lt;VirtualHost 192.0.2.2:80&gt;<br />
2969         # ...<br />
2970         &lt;/VirtualHost&gt;<br />
2971       </code></p></div>
2972     </div>
2973
2974 <h3>See also</h3>
2975 <ul>
2976 <li><a href="../vhosts/">Virtual Hosts
2977 documentation</a></li>
2978 </ul>
2979 </div>
2980 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2981 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
2982 <table class="directive">
2983 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
2984 directory</td></tr>
2985 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
2986     [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
2987 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
2988 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2989 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
2990 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2991 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2992 </table>
2993     <p>The <code class="directive">Options</code> directive controls which
2994     server features are available in a particular directory.</p>
2995
2996     <p><var>option</var> can be set to <code>None</code>, in which
2997     case none of the extra features are enabled, or one or more of
2998     the following:</p>
2999
3000     <dl>
3001       <dt><code>All</code></dt>
3002
3003       <dd>All options except for <code>MultiViews</code>. This is the default
3004       setting.</dd>
3005
3006       <dt><code>ExecCGI</code></dt>
3007
3008       <dd>
3009       Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
3010       is permitted.</dd>
3011
3012       <dt><code>FollowSymLinks</code></dt>
3013
3014       <dd>
3015
3016       The server will follow symbolic links in this directory.
3017       <div class="note">
3018       <p>Even though the server follows the symlink it does <em>not</em>
3019       change the pathname used to match against <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections.</p>
3020       <p>Note also, that this option <strong>gets ignored</strong> if set
3021       inside a <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
3022       section.</p>
3023       <p>Omitting this option should not be considered a security restriction,
3024       since symlink testing is subject to race conditions that make it
3025       circumventable.</p>
3026       </div></dd>
3027
3028       <dt><code>Includes</code></dt>
3029
3030       <dd>
3031       Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
3032       are permitted.</dd>
3033
3034       <dt><code>IncludesNOEXEC</code></dt>
3035
3036       <dd>
3037
3038       Server-side includes are permitted, but the <code>#exec
3039       cmd</code> and <code>#exec cgi</code> are disabled. It is still
3040       possible to <code>#include virtual</code> CGI scripts from
3041       <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
3042       directories.</dd>
3043
3044       <dt><code>Indexes</code></dt>
3045
3046       <dd>
3047       If a URL which maps to a directory is requested, and there
3048       is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
3049       (<em>e.g.</em>, <code>index.html</code>) in that directory, then
3050       <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
3051       of the directory.</dd>
3052
3053       <dt><code>MultiViews</code></dt>
3054
3055       <dd>
3056       <a href="../content-negotiation.html">Content negotiated</a>
3057       "MultiViews" are allowed using
3058       <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.
3059       <div class="note"><h3>Note</h3> <p>This option gets ignored if set
3060       anywhere other than <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>, as <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>
3061       needs real resources to compare against and evaluate from.</p></div>
3062       </dd>
3063
3064       <dt><code>SymLinksIfOwnerMatch</code></dt>
3065
3066       <dd>The server will only follow symbolic links for which the
3067       target file or directory is owned by the same user id as the
3068       link.
3069
3070       <div class="note"><h3>Note</h3> <p>This option gets ignored if
3071       set inside a <code class="directive"><a href="#location">&lt;Location&gt;</a></code> section.</p>
3072       <p>This option should not be considered a security restriction,
3073       since symlink testing is subject to race conditions that make it
3074       circumventable.</p></div>
3075       </dd>
3076     </dl>
3077
3078     <p>Normally, if multiple <code class="directive">Options</code> could
3079     apply to a directory, then the most specific one is used and
3080     others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
3081     However if <em>all</em> the options on the
3082     <code class="directive">Options</code> directive are preceded by a
3083     <code>+</code> or <code>-</code> symbol, the options are
3084     merged. Any options preceded by a <code>+</code> are added to the
3085     options currently in force, and any options preceded by a
3086     <code>-</code> are removed from the options currently in
3087     force. </p>
3088
3089     <div class="warning"><h3>Warning</h3>
3090     <p>Mixing <code class="directive">Options</code> with a <code>+</code> or
3091     <code>-</code> with those without is not valid syntax, and is likely
3092     to cause unexpected results.</p>
3093     </div>
3094
3095     <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
3096
3097     <div class="example"><p><code>
3098       &lt;Directory /web/docs&gt;<br />
3099       <span class="indent">
3100         Options Indexes FollowSymLinks<br />
3101       </span>
3102       &lt;/Directory&gt;<br />
3103       <br />
3104       &lt;Directory /web/docs/spec&gt;<br />
3105       <span class="indent">
3106         Options Includes<br />
3107       </span>
3108       &lt;/Directory&gt;
3109     </code></p></div>
3110
3111     <p>then only <code>Includes</code> will be set for the
3112     <code>/web/docs/spec</code> directory. However if the second
3113     <code class="directive">Options</code> directive uses the <code>+</code> and
3114     <code>-</code> symbols:</p>
3115
3116     <div class="example"><p><code>
3117       &lt;Directory /web/docs&gt;<br />
3118       <span class="indent">
3119         Options Indexes FollowSymLinks<br />
3120       </span>
3121       &lt;/Directory&gt;<br />
3122       <br />
3123       &lt;Directory /web/docs/spec&gt;<br />
3124       <span class="indent">
3125         Options +Includes -Indexes<br />
3126       </span>
3127       &lt;/Directory&gt;
3128     </code></p></div>
3129
3130     <p>then the options <code>FollowSymLinks</code> and
3131     <code>Includes</code> are set for the <code>/web/docs/spec</code>
3132     directory.</p>
3133
3134     <div class="note"><h3>Note</h3>
3135       <p>Using <code>-IncludesNOEXEC</code> or
3136       <code>-Includes</code> disables server-side includes completely
3137       regardless of the previous setting.</p>
3138     </div>
3139
3140     <p>The default in the absence of any other settings is
3141     <code>All</code>.</p>
3142
3143 </div>
3144 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3145 <div class="directive-section"><h2><a name="Protocol" id="Protocol">Protocol</a> <a name="protocol" id="protocol">Directive</a></h2>
3146 <table class="directive">
3147 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Protocol for a listening socket</td></tr>
3148 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Protocol <var>protocol</var></code></td></tr>
3149 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
3150 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3151 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3152 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.1.5 and later.
3153 On Windows from Apache 2.3.3 and later.</td></tr>
3154 </table>
3155     <p>This directive specifies the protocol used for a specific listening socket.
3156        The protocol is used to determine which module should handle a request, and
3157        to apply protocol specific optimizations with the <code class="directive">AcceptFilter</code>
3158        directive.</p>
3159
3160     <p>You only need to set the protocol if you are running on non-standard ports, otherwise <code>http</code> is assumed for port 80 and <code>https</code> for port 443.</p>
3161
3162     <p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
3163
3164     <div class="example"><p><code>
3165       Protocol https
3166     </code></p></div>
3167
3168     <p>You can also specify the protocol using the <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> directive.</p>
3169
3170 <h3>See also</h3>
3171 <ul>
3172 <li><code class="directive">AcceptFilter</code></li>
3173 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3174 </ul>
3175 </div>
3176 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3177 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
3178 <table class="directive">
3179 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
3180 by Apache httpd children</td></tr>
3181 <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>
3182 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3183 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3184 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
3185 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3186 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3187 </table>
3188     <p>Takes 1 or 2 parameters. The first parameter sets the soft
3189     resource limit for all processes and the second parameter sets
3190     the maximum resource limit. Either parameter can be a number,
3191     or <code>max</code> to indicate to the server that the limit should
3192     be set to the maximum allowed by the operating system
3193     configuration. Raising the maximum resource limit requires that
3194     the server is running as <code>root</code>, or in the initial startup
3195     phase.</p>
3196
3197     <p>This applies to processes forked off from Apache httpd children
3198     servicing requests, not the Apache httpd children themselves. This
3199     includes CGI scripts and SSI exec commands, but not any
3200     processes forked off from the Apache httpd parent such as piped
3201     logs.</p>
3202
3203     <p>CPU resource limits are expressed in seconds per
3204     process.</p>
3205
3206 <h3>See also</h3>
3207 <ul>
3208 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
3209 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
3210 </ul>
3211 </div>
3212 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3213 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
3214 <table class="directive">
3215 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
3216 by Apache httpd children</td></tr>
3217 <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>
3218 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3219 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3220 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
3221 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3222 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3223 </table>
3224     <p>Takes 1 or 2 parameters. The first parameter sets the soft
3225     resource limit for all processes and the second parameter sets
3226     the maximum resource limit. Either parameter can be a number,
3227     or <code>max</code> to indicate to the server that the limit should
3228     be set to the maximum allowed by the operating system
3229     configuration. Raising the maximum resource limit requires that
3230     the server is running as <code>root</code>, or in the initial startup
3231     phase.</p>
3232
3233     <p>This applies to processes forked off from Apache httpd children
3234     servicing requests, not the Apache httpd children themselves. This
3235     includes CGI scripts and SSI exec commands, but not any
3236     processes forked off from the Apache httpd parent such as piped
3237     logs.</p>
3238
3239     <p>Memory resource limits are expressed in bytes per
3240     process.</p>
3241
3242 <h3>See also</h3>
3243 <ul>
3244 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
3245 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
3246 </ul>
3247 </div>
3248 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3249 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
3250 <table class="directive">
3251 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
3252 processes launched by Apache httpd children</td></tr>
3253 <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>
3254 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3255 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3256 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
3257 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3258 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3259 </table>
3260     <p>Takes 1 or 2 parameters. The first parameter sets the soft
3261     resource limit for all processes and the second parameter sets
3262     the maximum resource limit. Either parameter can be a number,
3263     or <code>max</code> to indicate to the server that the limit
3264     should be set to the maximum allowed by the operating system
3265     configuration. Raising the maximum resource limit requires that
3266     the server is running as <code>root</code>, or in the initial startup
3267     phase.</p>
3268
3269     <p>This applies to processes forked off from Apache httpd children
3270     servicing requests, not the Apache httpd children themselves. This
3271     includes CGI scripts and SSI exec commands, but not any
3272     processes forked off from the Apache httpd parent such as piped
3273     logs.</p>
3274
3275     <p>Process limits control the number of processes per user.</p>
3276
3277     <div class="note"><h3>Note</h3>
3278       <p>If CGI processes are <strong>not</strong> running
3279       under user ids other than the web server user id, this directive
3280       will limit the number of processes that the server itself can
3281       create. Evidence of this situation will be indicated by
3282       <strong><code>cannot fork</code></strong> messages in the
3283       <code>error_log</code>.</p>
3284     </div>
3285
3286 <h3>See also</h3>
3287 <ul>
3288 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
3289 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
3290 </ul>
3291 </div>
3292 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3293 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
3294 <table class="directive">
3295 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
3296 scripts</td></tr>
3297 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
3298 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
3299 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3300 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
3301 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3302 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3303 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only;
3304 option <code>Registry-Strict</code> is available in Apache HTTP Server 2.0 and
3305 later</td></tr>
3306 </table>
3307     <p>This directive is used to control how Apache httpd finds the
3308     interpreter used to run CGI scripts. The default setting is
3309     <code>Script</code>. This causes Apache httpd to use the interpreter pointed to
3310     by the shebang line (first line, starting with <code>#!</code>) in the
3311     script. On Win32 systems this line usually looks like:</p>
3312
3313     <div class="example"><p><code>
3314       #!C:/Perl/bin/perl.exe
3315     </code></p></div>
3316
3317     <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
3318
3319     <div class="example"><p><code>
3320       #!perl
3321     </code></p></div>
3322
3323     <p>Setting <code>ScriptInterpreterSource Registry</code> will
3324     cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
3325     searched using the script file extension (e.g., <code>.pl</code>) as a
3326     search key. The command defined by the registry subkey
3327     <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
3328     <code>Shell\Open\Command</code> is used to open the script file. If the
3329     registry keys cannot be found, Apache httpd falls back to the behavior of the
3330     <code>Script</code> option.</p>
3331
3332     <div class="warning"><h3>Security</h3>
3333     <p>Be careful when using <code>ScriptInterpreterSource
3334     Registry</code> with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
3335     Apache httpd will try to execute <strong>every</strong> file within this
3336     directory. The <code>Registry</code> setting may cause undesired
3337     program calls on files which are typically not executed. For
3338     example, the default open command on <code>.htm</code> files on
3339     most Windows systems will execute Microsoft Internet Explorer, so
3340     any HTTP request for an <code>.htm</code> file existing within the
3341     script directory would start the browser in the background on the
3342     server. This is a good way to crash your system within a minute or
3343     so.</p>
3344     </div>
3345
3346     <p>The option <code>Registry-Strict</code> which is new in Apache HTTP Server
3347     2.0 does the same thing as <code>Registry</code> but uses only the
3348     subkey <code>Shell\ExecCGI\Command</code>. The
3349     <code>ExecCGI</code> key is not a common one. It must be
3350     configured manually in the windows registry and hence prevents
3351     accidental program calls on your system.</p>
3352
3353 </div>
3354 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3355 <div class="directive-section"><h2><a name="SeeRequestTail" id="SeeRequestTail">SeeRequestTail</a> <a name="seerequesttail" id="seerequesttail">Directive</a></h2>
3356 <table class="directive">
3357 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine if mod_status displays the first 63 characters
3358 of a request or the last 63, assuming the request itself is greater than
3359 63 chars.</td></tr>
3360 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SeeRequestTail On|Off</code></td></tr>
3361 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SeeRequestTail Off</code></td></tr>
3362 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3363 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3364 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3365 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.2.7 and later.</td></tr>
3366 </table>
3367     <p>mod_status with <code>ExtendedStatus On</code>
3368     displays the actual request being handled. 
3369     For historical purposes, only 63 characters of the request
3370     are actually stored for display purposes. This directive
3371     controls whether the 1st 63 characters are stored (the previous
3372     behavior and the default) or if the last 63 characters are. This
3373     is only applicable, of course, if the length of the request is
3374     64 characters or greater.</p>
3375
3376     <p>If Apache httpd is handling <code>GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</code> mod_status displays as follows:
3377     </p>
3378
3379     <table class="bordered">
3380       <tr>
3381         <th>Off (default)</th>
3382         <td>GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples</td>
3383       </tr>
3384       <tr>
3385         <th>On</th>
3386         <td>orage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</td>
3387       </tr>
3388     </table>
3389
3390
3391 </div>
3392 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3393 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
3394 <table class="directive">
3395 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
3396 messages sent to the client</td></tr>
3397 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
3398 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
3399 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3400 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3401 </table>
3402     <p>The <code class="directive">ServerAdmin</code> sets the contact address
3403     that the server includes in any error messages it returns to the
3404     client. If the <code>httpd</code> doesn't recognize the supplied argument
3405     as an URL, it
3406     assumes, that it's an <var>email-address</var> and prepends it with
3407     <code>mailto:</code> in hyperlink targets. However, it's recommended to
3408     actually use an email address, since there are a lot of CGI scripts that
3409     make that assumption. If you want to use an URL, it should point to another
3410     server under your control. Otherwise users may not be able to contact you in
3411     case of errors.</p>
3412
3413     <p>It may be worth setting up a dedicated address for this, e.g.</p>
3414
3415     <div class="example"><p><code>
3416       ServerAdmin www-admin@foo.example.com
3417     </code></p></div>
3418     <p>as users do not always mention that they are talking about the
3419     server!</p>
3420
3421 </div>
3422 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3423 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
3424 <table class="directive">
3425 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
3426 to name-virtual hosts</td></tr>
3427 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
3428 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
3429 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3430 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3431 </table>
3432     <p>The <code class="directive">ServerAlias</code> directive sets the
3433     alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>. The
3434     <code class="directive">ServerAlias</code> may include wildcards, if appropriate.</p>
3435
3436     <div class="example"><p><code>
3437       &lt;VirtualHost *:80&gt;<br />
3438       ServerName server.domain.com<br />
3439       ServerAlias server server2.domain.com server2<br />
3440       ServerAlias *.example.com<br />
3441       UseCanonicalName Off<br />
3442       # ...<br />
3443       &lt;/VirtualHost&gt;
3444     </code></p></div>
3445
3446 <h3>See also</h3>
3447 <ul>
3448 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3449 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
3450 </ul>
3451 </div>
3452 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3453 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
3454 <table class="directive">
3455 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
3456 itself</td></tr>
3457 <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>
3458 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
3459 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3460 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3461 </table>
3462     <p>The <code class="directive">ServerName</code> directive sets the
3463     request scheme, hostname and
3464     port that the server uses to identify itself.  This is used when
3465     creating redirection URLs.</p>
3466
3467     <p>Additionally, <code class="directive">ServerName</code> is used (possibly
3468     in conjunction with <code class="directive">ServerAlias</code>) to uniquely
3469     identify a virtual host, when using <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
3470     
3471     <p>For example, if the name of the
3472     machine hosting the web server is <code>simple.example.com</code>,
3473     but the machine also has the DNS alias <code>www.example.com</code>
3474     and you wish the web server to be so identified, the following
3475     directive should be used:</p>
3476
3477     <div class="example"><p><code>
3478       ServerName www.example.com:80
3479     </code></p></div>
3480
3481     <p>The <code class="directive">ServerName</code> directive
3482     may appear anywhere within the definition of a server. However,
3483     each appearance overrides the previous appearance (within that
3484     server).</p>
3485
3486     <p>If no <code class="directive">ServerName</code> is specified, then the
3487     server attempts to deduce the hostname by performing a reverse
3488     lookup on the IP address. If no port is specified in the
3489     <code class="directive">ServerName</code>, then the server will use the
3490     port from the incoming request. For optimal reliability and
3491     predictability, you should specify an explicit hostname and port
3492     using the <code class="directive">ServerName</code> directive.</p>
3493
3494     <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
3495     the <code class="directive">ServerName</code> inside a
3496     <code class="directive"><a href="#virtualhost">&lt;VirtualHost&gt;</a></code>
3497     section specifies what hostname must appear in the request's
3498     <code>Host:</code> header to match this virtual host.</p>
3499
3500     <p>Sometimes, the server runs behind a device that processes SSL,
3501     such as a reverse proxy, load balancer or SSL offload
3502     appliance. When this is the case, specify the
3503     <code>https://</code> scheme and the port number to which the
3504     clients connect in the <code class="directive">ServerName</code> directive
3505     to make sure that the server generates the correct
3506     self-referential URLs. 
3507     </p>
3508
3509     <p>See the description of the
3510     <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> and
3511     <code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code> directives for
3512     settings which determine whether self-referential URLs (e.g., by the
3513     <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
3514     specified port, or to the port number given in the client's request.
3515     </p>
3516
3517     <div class="warning">
3518     <p>Failure to set <code class="directive">ServerName</code> to a name that
3519     your server can resolve to an IP address will result in a startup
3520     warning. <code>httpd</code> will then use whatever hostname it can
3521     determine, using the system's <code>hostname</code> command. This
3522     will almost never be the hostname you actually want.</p>
3523     <div class="example"><p><code>
3524     httpd: Could not reliably determine the server's fully qualified domain name, using rocinante.local for ServerName
3525     </code></p></div>
3526     </div>
3527
3528
3529 <h3>See also</h3>
3530 <ul>
3531 <li><a href="../dns-caveats.html">Issues Regarding DNS and
3532     Apache HTTP Server</a></li>
3533 <li><a href="../vhosts/">Apache HTTP Server virtual host
3534     documentation</a></li>
3535 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3536 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
3537 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
3538 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
3539 </ul>
3540 </div>
3541 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3542 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
3543 <table class="directive">
3544 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
3545 is accessed by an incompatible browser</td></tr>
3546 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
3547 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
3548 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3549 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3550 </table>
3551     <p>The <code class="directive">ServerPath</code> directive sets the legacy
3552     URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
3553
3554 <h3>See also</h3>
3555 <ul>
3556 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
3557 </ul>
3558 </div>
3559 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3560 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
3561 <table class="directive">
3562 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
3563 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
3564 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
3565 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3566 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3567 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3568 </table>
3569     <p>The <code class="directive">ServerRoot</code> directive sets the
3570     directory in which the server lives. Typically it will contain the
3571     subdirectories <code>conf/</code> and <code>logs/</code>. Relative
3572     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 
3573     relative to this directory.</p>
3574
3575     <div class="example"><h3>Example</h3><p><code>
3576       ServerRoot /home/httpd
3577     </code></p></div>
3578
3579
3580 <h3>See also</h3>
3581 <ul>
3582 <li><a href="../invoking.html">the <code>-d</code>
3583     option to <code>httpd</code></a></li>
3584 <li><a href="../misc/security_tips.html#serverroot">the
3585     security tips</a> for information on how to properly set
3586     permissions on the <code class="directive">ServerRoot</code></li>
3587 </ul>
3588 </div>
3589 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3590 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
3591 <table class="directive">
3592 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
3593 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
3594 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
3595 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3596 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
3597 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3598 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3599 </table>
3600     <p>The <code class="directive">ServerSignature</code> directive allows the
3601     configuration of a trailing footer line under server-generated
3602     documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
3603     listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
3604     would want to enable such a footer line is that in a chain of proxies,
3605     the user often has no possibility to tell which of the chained servers
3606     actually produced a returned error message.</p>
3607
3608     <p>The <code>Off</code>
3609     setting, which is the default, suppresses the footer line (and is
3610     therefore compatible with the behavior of Apache-1.2 and
3611     below). The <code>On</code> setting simply adds a line with the
3612     server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
3613     and the <code>EMail</code> setting additionally creates a
3614     "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
3615     document.</p>
3616
3617     <p>After version 2.0.44, the details of the server version number
3618     presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
3619
3620 <h3>See also</h3>
3621 <ul>
3622 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
3623 </ul>
3624 </div>
3625 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3626 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
3627 <table class="directive">
3628 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the <code>Server</code> HTTP response
3629 header</td></tr>
3630 <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>
3631 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
3632 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3633 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3634 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3635 </table>
3636     <p>This directive controls whether <code>Server</code> response
3637     header field which is sent back to clients includes a
3638     description of the generic OS-type of the server as well as
3639     information about compiled-in modules.</p>
3640
3641     <dl>
3642       <dt><code>ServerTokens Full</code> (or not specified)</dt>
3643
3644       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3645       (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
3646
3647       <dt><code>ServerTokens Prod[uctOnly]</code></dt>
3648
3649       <dd>Server sends (<em>e.g.</em>): <code>Server:
3650       Apache</code></dd>
3651
3652       <dt><code>ServerTokens Major</code></dt>
3653
3654       <dd>Server sends (<em>e.g.</em>): <code>Server:
3655       Apache/2</code></dd>
3656
3657       <dt><code>ServerTokens Minor</code></dt>
3658
3659       <dd>Server sends (<em>e.g.</em>): <code>Server:
3660       Apache/2.4</code></dd>
3661
3662       <dt><code>ServerTokens Min[imal]</code></dt>
3663
3664       <dd>Server sends (<em>e.g.</em>): <code>Server:
3665       Apache/2.4.1</code></dd>
3666
3667       <dt><code>ServerTokens OS</code></dt>
3668
3669       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3670       (Unix)</code></dd>
3671
3672     </dl>
3673
3674     <p>This setting applies to the entire server, and cannot be
3675     enabled or disabled on a virtualhost-by-virtualhost basis.</p>
3676
3677     <p>After version 2.0.44, this directive also controls the
3678     information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
3679     
3680     <div class="note">Setting <code class="directive">ServerTokens</code> to less than
3681     <code>minimal</code> is not recommended because it makes it more
3682     difficult to debug interoperational problems. Also note that
3683     disabling the Server: header does nothing at all to make your
3684     server more secure; the idea of "security through obscurity"
3685     is a myth and leads to a false sense of safety.</div>
3686
3687
3688 <h3>See also</h3>
3689 <ul>
3690 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
3691 </ul>
3692 </div>
3693 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3694 <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
3695 <table class="directive">
3696 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
3697 handler</td></tr>
3698 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
3699 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3700 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
3701 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3702 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3703 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved into the core in Apache httpd 2.0</td></tr>
3704 </table>
3705     <p>When placed into an <code>.htaccess</code> file or a
3706     <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> or
3707     <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
3708     section, this directive forces all matching files to be parsed
3709     through the <a href="../handler.html">handler</a> given by
3710     <var>handler-name</var>. For example, if you had a directory you
3711     wanted to be parsed entirely as imagemap rule files, regardless
3712     of extension, you might put the following into an
3713     <code>.htaccess</code> file in that directory:</p>
3714
3715     <div class="example"><p><code>
3716       SetHandler imap-file
3717     </code></p></div>
3718
3719     <p>Another example: if you wanted to have the server display a
3720     status report whenever a URL of
3721     <code>http://servername/status</code> was called, you might put
3722     the following into <code>httpd.conf</code>:</p>
3723
3724     <div class="example"><p><code>
3725       &lt;Location /status&gt;<br />
3726       <span class="indent">
3727         SetHandler server-status<br />
3728       </span>
3729       &lt;/Location&gt;
3730     </code></p></div>
3731
3732     <p>You can override an earlier defined <code class="directive">SetHandler</code>
3733     directive by using the value <code>None</code>.</p>
3734     <p><strong>Note:</strong> because SetHandler overrides default handlers,
3735     normal behaviour such as handling of URLs ending in a slash (/) as
3736     directories or index files is suppressed.</p>
3737
3738 <h3>See also</h3>
3739 <ul>
3740 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
3741 </ul>
3742 </div>
3743 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3744 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
3745 <table class="directive">
3746 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
3747 input</td></tr>
3748 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
3749 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3750 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
3751 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3752 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3753 </table>
3754     <p>The <code class="directive">SetInputFilter</code> directive sets the
3755     filter or filters which will process client requests and POST
3756     input when they are received by the server. This is in addition to
3757     any filters defined elsewhere, including the
3758     <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
3759     directive.</p>
3760
3761     <p>If more than one filter is specified, they must be separated
3762     by semicolons in the order in which they should process the
3763     content.</p>
3764
3765 <h3>See also</h3>
3766 <ul>
3767 <li><a href="../filter.html">Filters</a> documentation</li>
3768 </ul>
3769 </div>
3770 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3771 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
3772 <table class="directive">
3773 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
3774 server</td></tr>
3775 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
3776 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3777 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
3778 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3779 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3780 </table>
3781     <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
3782     which will process responses from the server before they are
3783     sent to the client. This is in addition to any filters defined
3784     elsewhere, including the
3785     <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
3786     directive.</p>
3787
3788     <p>For example, the following configuration will process all files
3789     in the <code>/www/data/</code> directory for server-side
3790     includes.</p>
3791
3792     <div class="example"><p><code>
3793       &lt;Directory /www/data/&gt;<br />
3794       <span class="indent">
3795         SetOutputFilter INCLUDES<br />
3796       </span>
3797       &lt;/Directory&gt;
3798     </code></p></div>
3799
3800     <p>If more than one filter is specified, they must be separated
3801     by semicolons in the order in which they should process the
3802     content.</p>
3803
3804 <h3>See also</h3>
3805 <ul>
3806 <li><a href="../filter.html">Filters</a> documentation</li>
3807 </ul>
3808 </div>
3809 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3810 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
3811 <table class="directive">
3812 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
3813 certain events before failing a request</td></tr>
3814 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
3815 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
3816 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
3817 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3818 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3819 </table>
3820     <p>The <code class="directive">TimeOut</code> directive defines the length
3821     of time Apache httpd will wait for I/O in various circumstances:</p>
3822
3823     <ol>
3824       <li>When reading data from the client, the length of time to
3825       wait for a TCP packet to arrive if the read buffer is
3826       empty.</li>
3827
3828       <li>When writing data to the client, the length of time to wait
3829       for an acknowledgement of a packet if the send buffer is
3830       full.</li>
3831
3832       <li>In <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>, the length of time to wait for
3833       output from a CGI script.</li>
3834
3835       <li>In <code class="module"><a href="../mod/mod_ext_filter.html">mod_ext_filter</a></code>, the length of time to
3836       wait for output from a filtering process.</li>
3837
3838       <li>In <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, the default timeout value if
3839       <code class="directive"><a href="../mod/mod_proxy.html#proxytimeout">ProxyTimeout</a></code> is not
3840       configured.</li>
3841     </ol>
3842
3843
3844 </div>
3845 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3846 <div class="directive-section"><h2><a name="TraceEnable" id="TraceEnable">TraceEnable</a> <a name="traceenable" id="traceenable">Directive</a></h2>
3847 <table class="directive">
3848 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines the behaviour on <code>TRACE</code> requests</td></tr>
3849 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TraceEnable <var>[on|off|extended]</var></code></td></tr>
3850 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TraceEnable on</code></td></tr>
3851 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3852 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3853 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3854 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 1.3.34, 2.0.55 and later</td></tr>
3855 </table>
3856     <p>This directive overrides the behavior of <code>TRACE</code> for both
3857     the core server and <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>.  The default
3858     <code>TraceEnable on</code> permits <code>TRACE</code> requests per
3859     RFC 2616, which disallows any request body to accompany the request.
3860     <code>TraceEnable off</code> causes the core server and
3861     <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> to return a <code>405</code> (Method not
3862     allowed) error to the client.</p>
3863
3864     <p>Finally, for testing and diagnostic purposes only, request
3865     bodies may be allowed using the non-compliant <code>TraceEnable 
3866     extended</code> directive.  The core (as an origin server) will
3867     restrict the request body to 64k (plus 8k for chunk headers if
3868     <code>Transfer-Encoding: chunked</code> is used).  The core will
3869     reflect the full headers and all chunk headers with the response
3870     body.  As a proxy server, the request body is not restricted to 64k.</p>
3871
3872 </div>
3873 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3874 <div class="directive-section"><h2><a name="UnDefine" id="UnDefine">UnDefine</a> <a name="undefine" id="undefine">Directive</a></h2>
3875 <table class="directive">
3876 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Undefine the existence of a variable</td></tr>
3877 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UnDefine <var>parameter-name</var></code></td></tr>
3878 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3879 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3880 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3881 </table>
3882     <p>Undoes the effect of a <code class="directive"><a href="#define">Define</a></code> or
3883     of passing a <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p>
3884     <p>This directive can be used to toggle the use of <code class="directive"><a href="#ifdefine">&lt;IfDefine&gt;</a></code> sections without needing to alter
3885     <code>-D</code> arguments in any startup scripts.</p>
3886
3887 </div>
3888 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3889 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
3890 <table class="directive">
3891 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
3892 port</td></tr>
3893 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
3894 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName Off</code></td></tr>
3895 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
3896 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3897 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3898 </table>
3899     <p>In many situations Apache httpd must construct a <em>self-referential</em>
3900     URL -- that is, a URL that refers back to the same server. With
3901     <code>UseCanonicalName On</code> Apache httpd will use the hostname and port
3902     specified in the <code class="directive"><a href="#servername">ServerName</a></code>
3903     directive to construct the canonical name for the server. This name
3904     is used in all self-referential URLs, and for the values of
3905     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
3906
3907     <p>With <code>UseCanonicalName Off</code> Apache httpd will form
3908     self-referential URLs using the hostname and port supplied by
3909     the client if any are supplied (otherwise it will use the
3910     canonical name, as defined above). These values are the same
3911     that are used to implement <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
3912     and are available with the same clients. The CGI variables
3913     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
3914     constructed from the client supplied values as well.</p>
3915
3916     <p>An example where this may be useful is on an intranet server
3917     where you have users connecting to the machine using short
3918     names such as <code>www</code>. You'll notice that if the users
3919     type a shortname, and a URL which is a directory, such as
3920     <code>http://www/splat</code>, <em>without the trailing
3921     slash</em> then Apache httpd will redirect them to
3922     <code>http://www.domain.com/splat/</code>. If you have
3923     authentication enabled, this will cause the user to have to
3924     authenticate twice (once for <code>www</code> and once again
3925     for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
3926     FAQ on this subject for more information</a>). But if
3927     <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
3928     Apache httpd will redirect to <code>http://www/splat/</code>.</p>
3929
3930     <p>There is a third option, <code>UseCanonicalName DNS</code>,
3931     which is intended for use with mass IP-based virtual hosting to
3932     support ancient clients that do not provide a
3933     <code>Host:</code> header. With this option Apache httpd does a
3934     reverse DNS lookup on the server IP address that the client
3935     connected to in order to work out self-referential URLs.</p>
3936
3937     <div class="warning"><h3>Warning</h3>
3938     <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
3939     they may be broken by this option. The client is essentially free
3940     to give whatever value they want as a hostname. But if the CGI is
3941     only using <code>SERVER_NAME</code> to construct self-referential URLs
3942     then it should be just fine.</p>
3943     </div>
3944
3945 <h3>See also</h3>
3946 <ul>
3947 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
3948 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
3949 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3950 </ul>
3951 </div>
3952 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3953 <div class="directive-section"><h2><a name="UseCanonicalPhysicalPort" id="UseCanonicalPhysicalPort">UseCanonicalPhysicalPort</a> <a name="usecanonicalphysicalport" id="usecanonicalphysicalport">Directive</a></h2>
3954 <table class="directive">
3955 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
3956 port</td></tr>
3957 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalPhysicalPort On|Off</code></td></tr>
3958 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalPhysicalPort Off</code></td></tr>
3959 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
3960 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3961 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3962 </table>
3963     <p>In many situations Apache httpd must construct a <em>self-referential</em>
3964     URL -- that is, a URL that refers back to the same server. With
3965     <code>UseCanonicalPhysicalPort On</code> Apache httpd will, when
3966     constructing the canonical port for the server to honor
3967     the <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive,
3968     provide the actual physical port number being used by this request
3969     as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
3970     Apache httpd will not ever use the actual physical port number, instead
3971     relying on all configured information to construct a valid port number.</p>
3972
3973     <div class="note"><h3>Note</h3>
3974     <p>The ordering of when the physical port is used is as follows:<br /><br />
3975      <code>UseCanonicalName On</code></p>
3976      <ul>
3977       <li>Port provided in <code>Servername</code></li>
3978       <li>Physical port</li>
3979       <li>Default port</li>
3980      </ul>
3981      <code>UseCanonicalName Off | DNS</code>
3982      <ul>
3983       <li>Parsed port from <code>Host:</code> header</li>
3984       <li>Physical port</li>
3985       <li>Port provided in <code>Servername</code></li>
3986       <li>Default port</li>
3987      </ul>
3988     
3989     <p>With <code>UseCanonicalPhysicalPort Off</code>, the
3990     physical ports are removed from the ordering.</p>
3991     </div>
3992
3993
3994 <h3>See also</h3>
3995 <ul>
3996 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3997 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
3998 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3999 </ul>
4000 </div>
4001 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4002 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost">&lt;VirtualHost&gt;</a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
4003 <table class="directive">
4004 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
4005 hostname or IP address</td></tr>
4006 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;VirtualHost
4007     <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
4008     ...&gt; ... &lt;/VirtualHost&gt;</code></td></tr>
4009 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
4010 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
4011 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
4012 </table>
4013     <p><code class="directive">&lt;VirtualHost&gt;</code> and
4014     <code>&lt;/VirtualHost&gt;</code> are used to enclose a group of
4015     directives that will apply only to a particular virtual host. Any
4016     directive that is allowed in a virtual host context may be
4017     used. When the server receives a request for a document on a
4018     particular virtual host, it uses the configuration directives
4019     enclosed in the <code class="directive">&lt;VirtualHost&gt;</code>
4020     section. <var>Addr</var> can be:</p>
4021
4022     <ul>
4023       <li>The IP address of the virtual host;</li>
4024
4025       <li>A fully qualified domain name for the IP address of the
4026       virtual host (not recommended);</li>
4027
4028       <li>The character <code>*</code>, which is used only in combination with
4029       <code>NameVirtualHost *</code> to match all IP addresses; or</li>
4030
4031       <li>The string <code>_default_</code>, which is used only
4032       with IP virtual hosting to catch unmatched IP addresses.</li>
4033     </ul>
4034
4035     <div class="example"><h3>Example</h3><p><code>
4036       &lt;VirtualHost 10.1.2.3&gt;<br />
4037       <span class="indent">
4038         ServerAdmin webmaster@host.example.com<br />
4039         DocumentRoot /www/docs/host.example.com<br />
4040         ServerName host.example.com<br />
4041         ErrorLog logs/host.example.com-error_log<br />
4042         TransferLog logs/host.example.com-access_log<br />
4043       </span>
4044       &lt;/VirtualHost&gt;
4045     </code></p></div>
4046
4047
4048     <p>IPv6 addresses must be specified in square brackets because
4049     the optional port number could not be determined otherwise.  An
4050     IPv6 example is shown below:</p>
4051
4052     <div class="example"><p><code>
4053       &lt;VirtualHost [2001:db8::a00:20ff:fea7:ccea]&gt;<br />
4054       <span class="indent">
4055         ServerAdmin webmaster@host.example.com<br />
4056         DocumentRoot /www/docs/host.example.com<br />
4057         ServerName host.example.com<br />
4058         ErrorLog logs/host.example.com-error_log<br />
4059         TransferLog logs/host.example.com-access_log<br />
4060       </span>
4061       &lt;/VirtualHost&gt;
4062     </code></p></div>
4063
4064     <p>Each Virtual Host must correspond to a different IP address,
4065     different port number or a different host name for the server,
4066     in the former case the server machine must be configured to
4067     accept IP packets for multiple addresses. (If the machine does
4068     not have multiple network interfaces, then this can be
4069     accomplished with the <code>ifconfig alias</code> command -- if
4070     your OS supports it).</p>
4071
4072     <div class="note"><h3>Note</h3>
4073     <p>The use of <code class="directive">&lt;VirtualHost&gt;</code> does
4074     <strong>not</strong> affect what addresses Apache httpd listens on. You
4075     may need to ensure that Apache httpd is listening on the correct addresses
4076     using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
4077     </div>
4078
4079     <p>When using IP-based virtual hosting, the special name
4080     <code>_default_</code> can be specified in
4081     which case this virtual host will match any IP address that is
4082     not explicitly listed in another virtual host. In the absence
4083     of any <code>_default_</code> virtual host the "main" server config,
4084     consisting of all those definitions outside any VirtualHost
4085     section, is used when no IP-match occurs.</p>
4086
4087     <p>You can specify a <code>:port</code> to change the port that is
4088     matched. If unspecified then it defaults to the same port as the
4089     most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
4090     statement of the main server. You may also specify <code>:*</code>
4091     to match all ports on that address. (This is recommended when used
4092     with <code>_default_</code>.)</p>
4093
4094     <p>A <code class="directive"><a href="#servername">ServerName</a></code> should be
4095     specified inside each <code class="directive">&lt;VirtualHost&gt;</code> block. If it is absent, the
4096     <code class="directive"><a href="#servername">ServerName</a></code> from the "main"
4097     server configuration will be inherited.</p>
4098
4099     <p>If no matching virtual host is found, then the first listed
4100     virtual host that matches the IP address will be used.  As a
4101     consequence, the first listed virtual host is the default virtual
4102     host.</p>
4103
4104     <div class="warning"><h3>Security</h3>
4105     <p>See the <a href="../misc/security_tips.html">security tips</a>
4106     document for details on why your security could be compromised if the
4107     directory where log files are stored is writable by anyone other
4108     than the user that starts the server.</p>
4109     </div>
4110
4111 <h3>See also</h3>
4112 <ul>
4113 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
4114 <li><a href="../dns-caveats.html">Issues Regarding DNS and
4115     Apache HTTP Server</a></li>
4116 <li><a href="../bind.html">Setting
4117     which addresses and ports Apache HTTP Server uses</a></li>
4118 <li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
4119     and &lt;Files&gt; sections work</a> for an explanation of how these
4120     different sections are combined when a request is received</li>
4121 </ul>
4122 </div>
4123 </div>
4124 <div class="bottomlang">
4125 <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
4126 <a href="../en/mod/core.html" title="English">&nbsp;en&nbsp;</a> |
4127 <a href="../es/mod/core.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
4128 <a href="../fr/mod/core.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
4129 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
4130 <a href="../tr/mod/core.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
4131 </div><div id="footer">
4132 <p class="apache">Copyright 2010 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
4133 <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>
4134 </body></html>