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