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