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