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