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