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