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