]> granicus.if.org Git - apache/blob - docs/manual/mod/core.xml
core: Introduce the IncludeStrict directive, which explicitly fails
[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 <compatibility>Available in Apache httpd 2.1.5 and later.
36 On Windows from Apache httpd 2.3.3 and later.</compatibility>
37
38 <usage>
39     <p>This directive enables operating system specific optimizations for a 
40        listening socket by the Protocol type. The basic premise is for the 
41        kernel to not send a socket to the server process until either data 
42        is received or an entire HTTP Request is buffered. Only
43        <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&amp;sektion=9">
44        FreeBSD's Accept Filters</a>, Linux's more primitive 
45        <code>TCP_DEFER_ACCEPT</code>, and Windows' optimized AcceptEx()
46        are currently supported.</p>
47
48     <p>Using <code>none</code> for an argument will disable any accept filters 
49        for that protocol.  This is useful for protocols that require a server
50        send data first, such as <code>ftp:</code> or <code>nntp</code>:</p>
51     <example>AcceptFilter nntp none</example>
52
53     <p>The default values on FreeBSD are:</p>
54     <example>
55         AcceptFilter http httpready <br/>
56         AcceptFilter https dataready
57     </example>
58     
59     <p>The <code>httpready</code> accept filter buffers entire HTTP requests at
60        the kernel level.  Once an entire request is received, the kernel then 
61        sends it to the server. See the 
62        <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&amp;sektion=9">
63        accf_http(9)</a> man page for more details.  Since HTTPS requests are 
64        encrypted only the <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&amp;sektion=9">
65        accf_data(9)</a> filter is used.</p>
66
67     <p>The default values on Linux are:</p>
68     <example>
69         AcceptFilter http data <br/>
70         AcceptFilter https data
71     </example>
72
73     <p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http
74        requests.  Any value besides <code>none</code> will enable 
75        <code>TCP_DEFER_ACCEPT</code> on that listener. For more details
76        see the Linux 
77        <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
78        tcp(7)</a> man page.</p>
79
80     <p>The default values on Windows are:</p>
81     <example>
82         AcceptFilter http data <br/>
83         AcceptFilter https data
84     </example>
85
86     <p>Window's mpm_winnt interprets the AcceptFilter to toggle the AcceptEx()
87        API, and does not support http protocol buffering.  There are two values
88        which utilize the Windows AcceptEx() API and will recycle network
89        sockets between connections.  <code>data</code> waits until data has
90        been transmitted as documented above, and the initial data buffer and
91        network endpoint addresses are all retrieved from the single AcceptEx()
92        invocation.  <code>connect</code> will use the AcceptEx() API, also
93        retrieve the network endpoint addresses, but like <code>none</code>
94        the <code>connect</code> option does not wait for the initial data
95        transmission.</p>
96
97     <p>On Windows, <code>none</code> uses accept() rather than than AcceptEx()
98        and will not recycle sockets between connections.  This is useful for
99        network adapters with broken driver support, as well as some virtual
100        network providers such as vpn drivers, or spam, virus or spyware
101        filters.</p>  
102
103 </usage>
104 </directivesynopsis>
105
106 <directivesynopsis>
107 <name>AcceptPathInfo</name>
108 <description>Resources accept trailing pathname information</description>
109 <syntax>AcceptPathInfo On|Off|Default</syntax>
110 <default>AcceptPathInfo Default</default>
111 <contextlist><context>server config</context>
112 <context>virtual host</context><context>directory</context>
113 <context>.htaccess</context></contextlist>
114 <override>FileInfo</override>
115 <compatibility>Available in Apache httpd 2.0.30 and later</compatibility>
116
117 <usage>
118
119     <p>This directive controls whether requests that contain trailing
120     pathname information that follows an actual filename (or
121     non-existent file in an existing directory) will be accepted or
122     rejected.  The trailing pathname information can be made
123     available to scripts in the <code>PATH_INFO</code> environment
124     variable.</p>
125
126     <p>For example, assume the location <code>/test/</code> points to
127     a directory that contains only the single file
128     <code>here.html</code>.  Then requests for
129     <code>/test/here.html/more</code> and
130     <code>/test/nothere.html/more</code> both collect
131     <code>/more</code> as <code>PATH_INFO</code>.</p>
132
133     <p>The three possible arguments for the
134     <directive>AcceptPathInfo</directive> directive are:</p>
135     <dl>
136     <dt><code>Off</code></dt><dd>A request will only be accepted if it
137     maps to a literal path that exists.  Therefore a request with
138     trailing pathname information after the true filename such as
139     <code>/test/here.html/more</code> in the above example will return
140     a 404 NOT FOUND error.</dd>
141
142     <dt><code>On</code></dt><dd>A request will be accepted if a
143     leading path component maps to a file that exists.  The above
144     example <code>/test/here.html/more</code> will be accepted if
145     <code>/test/here.html</code> maps to a valid file.</dd>
146
147     <dt><code>Default</code></dt><dd>The treatment of requests with
148     trailing pathname information is determined by the <a
149     href="../handler.html">handler</a> responsible for the request.
150     The core handler for normal files defaults to rejecting
151     <code>PATH_INFO</code> requests. Handlers that serve scripts, such as <a
152     href="mod_cgi.html">cgi-script</a> and <a
153     href="mod_isapi.html">isapi-handler</a>, generally accept
154     <code>PATH_INFO</code> by default.</dd>
155     </dl>
156
157     <p>The primary purpose of the <code>AcceptPathInfo</code>
158     directive is to allow you to override the handler's choice of
159     accepting or rejecting <code>PATH_INFO</code>. This override is required,
160     for example, when you use a <a href="../filter.html">filter</a>, such
161     as <a href="mod_include.html">INCLUDES</a>, to generate content
162     based on <code>PATH_INFO</code>.  The core handler would usually reject
163     the request, so you can use the following configuration to enable
164     such a script:</p>
165
166     <example>
167       &lt;Files "mypaths.shtml"&gt;<br />
168       <indent>
169         Options +Includes<br />
170         SetOutputFilter INCLUDES<br />
171         AcceptPathInfo On<br />
172       </indent>
173       &lt;/Files&gt;
174     </example>
175
176 </usage>
177 </directivesynopsis>
178
179 <directivesynopsis>
180 <name>AccessFileName</name>
181 <description>Name of the distributed configuration file</description>
182 <syntax>AccessFileName <var>filename</var> [<var>filename</var>] ...</syntax>
183 <default>AccessFileName .htaccess</default>
184 <contextlist><context>server config</context><context>virtual host</context>
185 </contextlist>
186
187 <usage>
188     <p>While processing a request the server looks for
189     the first existing configuration file from this list of names in
190     every directory of the path to the document, if distributed
191     configuration files are <a href="#allowoverride">enabled for that
192     directory</a>. For example:</p>
193
194     <example>
195       AccessFileName .acl
196     </example>
197
198     <p>before returning the document
199     <code>/usr/local/web/index.html</code>, the server will read
200     <code>/.acl</code>, <code>/usr/.acl</code>,
201     <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
202     for directives, unless they have been disabled with</p>
203
204     <example>
205       &lt;Directory /&gt;<br />
206       <indent>
207         AllowOverride None<br />
208       </indent>
209       &lt;/Directory&gt;
210     </example>
211 </usage>
212 <seealso><directive module="core">AllowOverride</directive></seealso>
213 <seealso><a href="../configuring.html">Configuration Files</a></seealso>
214 <seealso><a href="../howto/htaccess.html">.htaccess Files</a></seealso>
215 </directivesynopsis>
216
217 <directivesynopsis>
218 <name>AddDefaultCharset</name>
219 <description>Default charset parameter to be added when a response
220 content-type is <code>text/plain</code> or <code>text/html</code></description>
221 <syntax>AddDefaultCharset On|Off|<var>charset</var></syntax>
222 <default>AddDefaultCharset Off</default>
223 <contextlist><context>server config</context>
224 <context>virtual host</context><context>directory</context>
225 <context>.htaccess</context></contextlist>
226 <override>FileInfo</override>
227
228 <usage>
229     <p>This directive specifies a default value for the media type
230     charset parameter (the name of a character encoding) to be added
231     to a response if and only if the response's content-type is either
232     <code>text/plain</code> or <code>text/html</code>.  This should override
233     any charset specified in the body of the response via a <code>META</code>
234     element, though the exact behavior is often dependent on the user's client
235     configuration. A setting of <code>AddDefaultCharset Off</code>
236     disables this functionality. <code>AddDefaultCharset On</code> enables
237     a default charset of <code>iso-8859-1</code>. Any other value is assumed
238     to be the <var>charset</var> to be used, which should be one of the
239     <a href="http://www.iana.org/assignments/character-sets">IANA registered
240     charset values</a> for use in Internet media types (MIME types).
241     For example:</p>
242
243     <example>
244       AddDefaultCharset utf-8
245     </example>
246
247     <p><directive>AddDefaultCharset</directive> should only be used when all
248     of the text resources to which it applies are known to be in that
249     character encoding and it is too inconvenient to label their charset
250     individually. One such example is to add the charset parameter
251     to resources containing generated content, such as legacy CGI
252     scripts, that might be vulnerable to cross-site scripting attacks
253     due to user-provided data being included in the output.  Note, however,
254     that a better solution is to just fix (or delete) those scripts, since
255     setting a default charset does not protect users that have enabled
256     the "auto-detect character encoding" feature on their browser.</p>
257 </usage>
258 <seealso><directive module="mod_mime">AddCharset</directive></seealso>
259 </directivesynopsis>
260
261 <directivesynopsis>
262 <name>AddOutputFilterByType</name>
263 <description>assigns an output filter to a particular media-type</description>
264 <syntax>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
265 <var>media-type</var> [<var>media-type</var>] ...</syntax>
266 <contextlist><context>server config</context>
267 <context>virtual host</context><context>directory</context>
268 <context>.htaccess</context></contextlist>
269 <override>FileInfo</override>
270 <compatibility>Available in Apache httpd 2.0.33 and later; deprecated in Apache httpd 2.1 and later</compatibility>
271
272 <usage>
273     <p>This directive activates a particular output <a
274     href="../filter.html">filter</a> for a request depending on the
275     response <glossary>media-type</glossary>.  Because of certain
276     problems discussed below, this directive is deprecated.  The same
277     functionality is available using <module>mod_filter</module>.</p>
278
279     <p>The following example uses the <code>DEFLATE</code> filter, which
280     is provided by <module>mod_deflate</module>. It will compress all
281     output (either static or dynamic) which is labeled as
282     <code>text/html</code> or <code>text/plain</code> before it is sent
283     to the client.</p>
284
285     <example>
286       AddOutputFilterByType DEFLATE text/html text/plain
287     </example>
288
289     <p>If you want the content to be processed by more than one filter, their
290     names have to be separated by semicolons. It's also possible to use one
291     <directive>AddOutputFilterByType</directive> directive for each of
292     these filters.</p>
293
294     <p>The configuration below causes all script output labeled as
295     <code>text/html</code> to be processed at first by the
296     <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
297     filter.</p>
298
299     <example>
300     &lt;Location /cgi-bin/&gt;<br />
301     <indent>
302       Options Includes<br />
303       AddOutputFilterByType INCLUDES;DEFLATE text/html<br />
304     </indent>
305     &lt;/Location&gt;
306     </example>
307
308     <note type="warning"><title>Note</title>
309       <p>Enabling filters with <directive>AddOutputFilterByType</directive>
310       may fail partially or completely in some cases. For example, no
311       filters are applied if the <glossary>media-type</glossary> could not
312       be determined.  If you want to make sure that the filters will be
313       applied, assign the content type to a resource explicitly; for
314       example, with <directive module="mod_mime">AddType</directive> or
315       <directive module="core">ForceType</directive>. Setting the
316       content type within a (non-nph) CGI script is also safe.</p>
317
318     </note>
319 </usage>
320
321 <seealso><directive module="mod_mime">AddOutputFilter</directive></seealso>
322 <seealso><directive module="core">SetOutputFilter</directive></seealso>
323 <seealso><a href="../filter.html">filters</a></seealso>
324 </directivesynopsis>
325
326 <directivesynopsis>
327 <name>AllowEncodedSlashes</name>
328 <description>Determines whether encoded path separators in URLs are allowed to
329 be passed through</description>
330 <syntax>AllowEncodedSlashes On|Off</syntax>
331 <default>AllowEncodedSlashes Off</default>
332 <contextlist><context>server config</context><context>virtual host</context>
333 </contextlist>
334 <compatibility>Available in Apache httpd 2.0.46 and later</compatibility>
335
336 <usage>
337     <p>The <directive>AllowEncodedSlashes</directive> directive allows URLs
338     which contain encoded path separators (<code>%2F</code> for <code>/</code>
339     and additionally <code>%5C</code> for <code>\</code> on according systems)
340     to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
341
342     <p>Turning <directive>AllowEncodedSlashes</directive> <code>On</code> is
343     mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
344
345     <note><title>Note</title>
346       <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
347       Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
348       according systems) will be left as such in the otherwise decoded URL
349       string.</p>
350     </note>
351 </usage>
352 <seealso><directive module="core">AcceptPathInfo</directive></seealso>
353 </directivesynopsis>
354
355 <directivesynopsis>
356 <name>AllowOverride</name>
357 <description>Types of directives that are allowed in
358 <code>.htaccess</code> files</description>
359 <syntax>AllowOverride All|None|<var>directive-type</var>
360 [<var>directive-type</var>] ...</syntax>
361 <default>AllowOverride All</default>
362 <contextlist><context>directory</context></contextlist>
363
364 <usage>
365     <p>When the server finds an <code>.htaccess</code> file (as
366     specified by <directive module="core">AccessFileName</directive>)
367     it needs to know which directives declared in that file can override
368     earlier configuration directives.</p>
369
370     <note><title>Only available in &lt;Directory&gt; sections</title>
371     <directive>AllowOverride</directive> is valid only in
372     <directive type="section" module="core">Directory</directive>
373     sections specified without regular expressions, not in <directive
374     type="section" module="core">Location</directive>, <directive
375     module="core" type="section">DirectoryMatch</directive> or
376     <directive type="section" module="core">Files</directive> sections.
377     </note>
378
379     <p>When this directive is set to <code>None</code>, then
380     <a href="#accessfilename">.htaccess</a> files are completely ignored.
381     In this case, the server will not even attempt to read
382     <code>.htaccess</code> files in the filesystem.</p>
383
384     <p>When this directive is set to <code>All</code>, then any
385     directive which has the .htaccess <a
386     href="directive-dict.html#Context">Context</a> is allowed in
387     <code>.htaccess</code> files.</p>
388
389     <p>The <var>directive-type</var> can be one of the following
390     groupings of directives.</p>
391
392     <dl>
393       <dt>AuthConfig</dt>
394
395       <dd>
396
397       Allow use of the authorization directives (<directive
398       module="mod_authn_dbm">AuthDBMGroupFile</directive>,
399       <directive module="mod_authn_dbm">AuthDBMUserFile</directive>,
400       <directive module="mod_authz_groupfile">AuthGroupFile</directive>,
401       <directive module="mod_authn_core">AuthName</directive>,
402       <directive module="mod_authn_core">AuthType</directive>, <directive
403       module="mod_authn_file">AuthUserFile</directive>, <directive
404       module="mod_authz_core">Require</directive>, <em>etc.</em>).</dd>
405
406       <dt>FileInfo</dt>
407
408       <dd>
409       Allow use of the directives controlling document types
410      (<directive module="core">ErrorDocument</directive>,
411       <directive module="core">ForceType</directive>,
412       <directive module="mod_negotiation">LanguagePriority</directive>,
413       <directive module="core">SetHandler</directive>,
414       <directive module="core">SetInputFilter</directive>,
415       <directive module="core">SetOutputFilter</directive>, and
416       <module>mod_mime</module> Add* and Remove* directives),
417       document meta data (<directive
418       module="mod_headers">Header</directive>, <directive
419       module="mod_headers">RequestHeader</directive>, <directive
420       module="mod_setenvif">SetEnvIf</directive>, <directive
421       module="mod_setenvif">SetEnvIfNoCase</directive>, <directive
422       module="mod_setenvif">BrowserMatch</directive>, <directive
423       module="mod_usertrack">CookieExpires</directive>, <directive
424       module="mod_usertrack">CookieDomain</directive>, <directive
425       module="mod_usertrack">CookieStyle</directive>, <directive
426       module="mod_usertrack">CookieTracking</directive>, <directive
427       module="mod_usertrack">CookieName</directive>),
428       <module>mod_rewrite</module> directives <directive
429       module="mod_rewrite">RewriteEngine</directive>, <directive
430       module="mod_rewrite">RewriteOptions</directive>, <directive
431       module="mod_rewrite">RewriteBase</directive>, <directive
432       module="mod_rewrite">RewriteCond</directive>, <directive
433       module="mod_rewrite">RewriteRule</directive>) and
434       <directive module="mod_actions">Action</directive> from
435       <module>mod_actions</module>.
436       </dd>
437
438       <dt>Indexes</dt>
439
440       <dd>
441       Allow use of the directives controlling directory indexing
442       (<directive
443       module="mod_autoindex">AddDescription</directive>,
444       <directive module="mod_autoindex">AddIcon</directive>, <directive
445       module="mod_autoindex">AddIconByEncoding</directive>,
446       <directive module="mod_autoindex">AddIconByType</directive>,
447       <directive module="mod_autoindex">DefaultIcon</directive>, <directive
448       module="mod_dir">DirectoryIndex</directive>, <directive
449       module="mod_autoindex">FancyIndexing</directive>, <directive
450       module="mod_autoindex">HeaderName</directive>, <directive
451       module="mod_autoindex">IndexIgnore</directive>, <directive
452       module="mod_autoindex">IndexOptions</directive>, <directive
453       module="mod_autoindex">ReadmeName</directive>,
454       <em>etc.</em>).</dd>
455
456       <dt>Limit</dt>
457
458       <dd>
459       Allow use of the directives controlling host access (<directive
460       module="mod_authz_host">Allow</directive>, <directive
461       module="mod_authz_host">Deny</directive> and <directive
462       module="mod_authz_host">Order</directive>).</dd>
463
464       <dt>Options[=<var>Option</var>,...]</dt>
465
466       <dd>
467       Allow use of the directives controlling specific directory
468       features (<directive module="core">Options</directive> and
469       <directive module="mod_include">XBitHack</directive>).
470       An equal sign may be given followed by a comma (but no spaces)
471       separated lists of options that may be set using the <directive
472       module="core">Options</directive> command.</dd>
473     </dl>
474
475     <p>Example:</p>
476
477     <example>
478       AllowOverride AuthConfig Indexes
479     </example>
480
481     <p>In the example above all directives that are neither in the group
482     <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
483     server error.</p>
484
485     <note><p>For security and performance reasons, do not set
486     <code>AllowOverride</code> to anything other than <code>None</code> 
487     in your <code>&lt;Directory /&gt;</code> block. Instead, find (or
488     create) the <code>&lt;Directory&gt;</code> block that refers to the
489     directory where you're actually planning to place a
490     <code>.htaccess</code> file.</p>
491     </note>
492 </usage>
493
494 <seealso><directive module="core">AccessFileName</directive></seealso>
495 <seealso><a href="../configuring.html">Configuration Files</a></seealso>
496 <seealso><a href="../howto/htaccess.html">.htaccess Files</a></seealso>
497 </directivesynopsis>
498
499 <directivesynopsis>
500 <name>CGIMapExtension</name>
501 <description>Technique for locating the interpreter for CGI
502 scripts</description>
503 <syntax>CGIMapExtension <var>cgi-path</var> <var>.extension</var></syntax>
504 <contextlist><context>directory</context><context>.htaccess</context>
505 </contextlist>
506 <override>FileInfo</override>
507 <compatibility>NetWare only</compatibility>
508
509 <usage>
510     <p>This directive is used to control how Apache httpd finds the
511     interpreter used to run CGI scripts. For example, setting
512     <code>CGIMapExtension sys:\foo.nlm .foo</code> will
513     cause all CGI script files with a <code>.foo</code> extension to
514     be passed to the FOO interpreter.</p>
515 </usage>
516 </directivesynopsis>
517
518 <directivesynopsis>
519 <name>ContentDigest</name>
520 <description>Enables the generation of <code>Content-MD5</code> HTTP Response
521 headers</description>
522 <syntax>ContentDigest On|Off</syntax>
523 <default>ContentDigest Off</default>
524 <contextlist><context>server config</context><context>virtual host</context>
525 <context>directory</context><context>.htaccess</context>
526 </contextlist>
527 <override>Options</override>
528 <status>Experimental</status>
529
530 <usage>
531     <p>This directive enables the generation of
532     <code>Content-MD5</code> headers as defined in RFC1864
533     respectively RFC2616.</p>
534
535     <p>MD5 is an algorithm for computing a "message digest"
536     (sometimes called "fingerprint") of arbitrary-length data, with
537     a high degree of confidence that any alterations in the data
538     will be reflected in alterations in the message digest.</p>
539
540     <p>The <code>Content-MD5</code> header provides an end-to-end
541     message integrity check (MIC) of the entity-body. A proxy or
542     client may check this header for detecting accidental
543     modification of the entity-body in transit. Example header:</p>
544
545     <example>
546       Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
547     </example>
548
549     <p>Note that this can cause performance problems on your server
550     since the message digest is computed on every request (the
551     values are not cached).</p>
552
553     <p><code>Content-MD5</code> is only sent for documents served
554     by the <module>core</module>, and not by any module. For example,
555     SSI documents, output from CGI scripts, and byte range responses
556     do not have this header.</p>
557 </usage>
558 </directivesynopsis>
559
560 <directivesynopsis>
561 <name>DefaultType</name>
562 <description>This directive has no effect other than to emit warnings
563 if the value is not <code>none</code>. In prior versions, DefaultType
564 would specify a default media type to assign to response content for
565 which no other media type configuration could be found.
566 </description>
567 <syntax>DefaultType <var>media-type|none</var></syntax>
568 <default>DefaultType none</default>
569 <contextlist><context>server config</context><context>virtual host</context>
570 <context>directory</context><context>.htaccess</context>
571 </contextlist>
572 <override>FileInfo</override>
573 <compatibility>The argument <code>none</code> is available in Apache httpd 2.2.7 and later.  All other choices are DISABLED for 2.3.x and later.</compatibility>
574
575 <usage>
576     <p>This directive has been disabled.  For backwards compatibility
577     of configuration files, it may be specified with the value
578     <code>none</code>, meaning no default media type. For example:</p>
579
580     <example>
581       DefaultType None
582     </example>
583
584     <p><code>DefaultType None</code> is only available in
585     httpd-2.2.7 and later.</p>
586
587     <p>Use the mime.types configuration file and the
588     <directive module="mod_mime">AddType</directive> to configure media
589     type assignments via file extensions, or the
590     <directive module="core">ForceType</directive> directive to configure
591     the media type for specific resources. Otherwise, the server will
592     send the response without a Content-Type header field and the
593     recipient may attempt to guess the media type.</p>
594 </usage>
595 </directivesynopsis>
596
597 <directivesynopsis>
598 <name>Define</name>
599 <description>Define the existence of a variable</description>
600 <syntax>Define <var>parameter-name</var></syntax>
601 <contextlist><context>server config</context></contextlist>
602
603 <usage>
604     <p>Equivalent to passing the <code>-D</code> argument to <program
605     >httpd</program>.</p>
606     <p>This directive can be used to toggle the use of <directive module="core"
607     type="section">IfDefine</directive> sections without needing to alter
608     <code>-D</code> arguments in any startup scripts.</p>
609 </usage>
610 </directivesynopsis>
611
612 <directivesynopsis type="section">
613 <name>Directory</name>
614 <description>Enclose a group of directives that apply only to the
615 named file-system directory and sub-directories</description>
616 <syntax>&lt;Directory <var>directory-path</var>&gt;
617 ... &lt;/Directory&gt;</syntax>
618 <contextlist><context>server config</context><context>virtual host</context>
619 </contextlist>
620
621 <usage>
622     <p><directive type="section">Directory</directive> and
623     <code>&lt;/Directory&gt;</code> are used to enclose a group of
624     directives that will apply only to the named directory and
625     sub-directories of that directory. Any directive that is allowed
626     in a directory context may be used. <var>Directory-path</var> is
627     either the full path to a directory, or a wild-card string using
628     Unix shell-style matching. In a wild-card string, <code>?</code> matches
629     any single character, and <code>*</code> matches any sequences of
630     characters. You may also use <code>[]</code> character ranges. None
631     of the wildcards match a `/' character, so <code>&lt;Directory
632     /*/public_html&gt;</code> will not match
633     <code>/home/user/public_html</code>, but <code>&lt;Directory
634     /home/*/public_html&gt;</code> will match. Example:</p>
635
636     <example>
637       &lt;Directory /usr/local/httpd/htdocs&gt;<br />
638       <indent>
639         Options Indexes FollowSymLinks<br />
640       </indent>
641       &lt;/Directory&gt;
642     </example>
643
644     <note>
645       <p>Be careful with the <var>directory-path</var> arguments:
646       They have to literally match the filesystem path which Apache httpd uses
647       to access the files. Directives applied to a particular
648       <code>&lt;Directory&gt;</code> will not apply to files accessed from
649       that same directory via a different path, such as via different symbolic
650       links.</p>
651     </note>
652
653     <p><glossary ref="regex">Regular
654     expressions</glossary> can also be used, with the addition of the
655     <code>~</code> character. For example:</p>
656
657     <example>
658       &lt;Directory ~ "^/www/.*/[0-9]{3}"&gt;
659     </example>
660
661     <p>would match directories in <code>/www/</code> that consisted of
662     three numbers.</p>
663
664     <p>If multiple (non-regular expression) <directive
665     type="section">Directory</directive> sections
666     match the directory (or one of its parents) containing a document,
667     then the directives are applied in the order of shortest match
668     first, interspersed with the directives from the <a
669     href="#accessfilename">.htaccess</a> files. For example,
670     with</p>
671
672     <example>
673       &lt;Directory /&gt;<br />
674       <indent>
675         AllowOverride None<br />
676       </indent>
677       &lt;/Directory&gt;<br />
678       <br />
679       &lt;Directory /home/&gt;<br />
680       <indent>
681         AllowOverride FileInfo<br />
682       </indent>
683       &lt;/Directory&gt;
684     </example>
685
686     <p>for access to the document <code>/home/web/dir/doc.html</code>
687     the steps are:</p>
688
689     <ul>
690       <li>Apply directive <code>AllowOverride None</code>
691       (disabling <code>.htaccess</code> files).</li>
692
693       <li>Apply directive <code>AllowOverride FileInfo</code> (for
694       directory <code>/home</code>).</li>
695
696       <li>Apply any <code>FileInfo</code> directives in
697       <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
698       <code>/home/web/dir/.htaccess</code> in that order.</li>
699     </ul>
700
701     <p>Regular expressions are not considered until after all of the
702     normal sections have been applied. Then all of the regular
703     expressions are tested in the order they appeared in the
704     configuration file. For example, with</p>
705
706     <example>
707       &lt;Directory ~ abc$&gt;<br />
708       <indent>
709         # ... directives here ...<br />
710       </indent>
711       &lt;/Directory&gt;
712     </example>
713
714     <p>the regular expression section won't be considered until after
715     all normal <directive type="section">Directory</directive>s and
716     <code>.htaccess</code> files have been applied. Then the regular
717     expression will match on <code>/home/abc/public_html/abc</code> and
718     the corresponding <directive type="section">Directory</directive> will
719     be applied.</p>
720
721    <p><strong>Note that the default access for
722     <code>&lt;Directory /&gt;</code> is <code>Allow from All</code>.
723     This means that Apache httpd will serve any file mapped from an URL. It is
724     recommended that you change this with a block such
725     as</strong></p>
726
727     <example>
728       &lt;Directory /&gt;<br />
729       <indent>
730         Order Deny,Allow<br />
731         Deny from All<br />
732       </indent>
733       &lt;/Directory&gt;
734     </example>
735
736     <p><strong>and then override this for directories you
737     <em>want</em> accessible. See the <a
738     href="../misc/security_tips.html">Security Tips</a> page for more
739     details.</strong></p>
740
741     <p>The directory sections occur in the <code>httpd.conf</code> file.
742     <directive type="section">Directory</directive> directives
743     cannot nest, and cannot appear in a <directive module="core"
744     type="section">Limit</directive> or <directive module="core"
745     type="section">LimitExcept</directive> section.</p>
746 </usage>
747 <seealso><a href="../sections.html">How &lt;Directory&gt;,
748     &lt;Location&gt; and &lt;Files&gt; sections work</a> for an
749     explanation of how these different sections are combined when a
750     request is received</seealso>
751 </directivesynopsis>
752
753 <directivesynopsis type="section">
754 <name>DirectoryMatch</name>
755 <description>Enclose directives that apply to
756 file-system directories matching a regular expression and their
757 subdirectories</description>
758 <syntax>&lt;DirectoryMatch <var>regex</var>&gt;
759 ... &lt;/DirectoryMatch&gt;</syntax>
760 <contextlist><context>server config</context><context>virtual host</context>
761 </contextlist>
762
763 <usage>
764     <p><directive type="section">DirectoryMatch</directive> and
765     <code>&lt;/DirectoryMatch&gt;</code> are used to enclose a group
766     of directives which will apply only to the named directory and
767     sub-directories of that directory, the same as <directive
768     module="core" type="section">Directory</directive>. However, it
769     takes as an argument a <glossary ref="regex">regular 
770     expression</glossary>. For example:</p>
771
772     <example>
773       &lt;DirectoryMatch "^/www/(.+/)?[0-9]{3}"&gt;
774     </example>
775
776     <p>would match directories in <code>/www/</code> that consisted of three
777     numbers.</p>
778 </usage>
779 <seealso><directive type="section" module="core">Directory</directive> for
780 a description of how regular expressions are mixed in with normal
781 <directive type="section">Directory</directive>s</seealso>
782 <seealso><a
783 href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt; and
784 &lt;Files&gt; sections work</a> for an explanation of how these different
785 sections are combined when a request is received</seealso>
786 </directivesynopsis>
787
788 <directivesynopsis>
789 <name>DocumentRoot</name>
790 <description>Directory that forms the main document tree visible
791 from the web</description>
792 <syntax>DocumentRoot <var>directory-path</var></syntax>
793 <default>DocumentRoot /usr/local/apache/htdocs</default>
794 <contextlist><context>server config</context><context>virtual host</context>
795 </contextlist>
796
797 <usage>
798     <p>This directive sets the directory from which <program>httpd</program>
799     will serve files. Unless matched by a directive like <directive
800     module="mod_alias">Alias</directive>, the server appends the
801     path from the requested URL to the document root to make the
802     path to the document. Example:</p>
803
804     <example>
805       DocumentRoot /usr/web
806     </example>
807
808     <p>then an access to
809     <code>http://www.my.host.com/index.html</code> refers to
810     <code>/usr/web/index.html</code>. If the <var>directory-path</var> is 
811     not absolute then it is assumed to be relative to the <directive 
812     module="core">ServerRoot</directive>.</p>
813
814     <p>The <directive>DocumentRoot</directive> should be specified without
815     a trailing slash.</p>
816 </usage>
817 <seealso><a href="../urlmapping.html#documentroot">Mapping URLs to Filesystem
818 Locations</a></seealso>
819 </directivesynopsis>
820
821 <directivesynopsis>
822 <name>EnableMMAP</name>
823 <description>Use memory-mapping to read files during delivery</description>
824 <syntax>EnableMMAP On|Off</syntax>
825 <default>EnableMMAP On</default>
826 <contextlist><context>server config</context><context>virtual host</context>
827 <context>directory</context><context>.htaccess</context>
828 </contextlist>
829 <override>FileInfo</override>
830
831 <usage>
832     <p>This directive controls whether the <program>httpd</program> may use
833     memory-mapping if it needs to read the contents of a file during
834     delivery.  By default, when the handling of a request requires
835     access to the data within a file -- for example, when delivering a
836     server-parsed file using <module>mod_include</module> -- Apache httpd
837     memory-maps the file if the OS supports it.</p>
838
839     <p>This memory-mapping sometimes yields a performance improvement.
840     But in some environments, it is better to disable the memory-mapping
841     to prevent operational problems:</p>
842
843     <ul>
844     <li>On some multiprocessor systems, memory-mapping can reduce the
845     performance of the <program>httpd</program>.</li>
846     <li>Deleting or truncating a file while <program>httpd</program>
847       has it memory-mapped can cause <program>httpd</program> to
848       crash with a segmentation fault.
849     </li>
850     </ul>
851
852     <p>For server configurations that are vulnerable to these problems,
853     you should disable memory-mapping of delivered files by specifying:</p>
854
855     <example>
856       EnableMMAP Off
857     </example>
858
859     <p>For NFS mounted files, this feature may be disabled explicitly for
860     the offending files by specifying:</p>
861
862     <example>
863       &lt;Directory "/path-to-nfs-files"&gt;
864       <indent>
865         EnableMMAP Off
866       </indent>
867       &lt;/Directory&gt;
868     </example>
869 </usage>
870 </directivesynopsis>
871
872 <directivesynopsis>
873 <name>EnableSendfile</name>
874 <description>Use the kernel sendfile support to deliver files to the client</description>
875 <syntax>EnableSendfile On|Off</syntax>
876 <default>EnableSendfile On</default>
877 <contextlist><context>server config</context><context>virtual host</context>
878 <context>directory</context><context>.htaccess</context>
879 </contextlist>
880 <override>FileInfo</override>
881 <compatibility>Available in version 2.0.44 and later</compatibility>
882
883 <usage>
884     <p>This directive controls whether <program>httpd</program> may use the
885     sendfile support from the kernel to transmit file contents to the client.
886     By default, when the handling of a request requires no access
887     to the data within a file -- for example, when delivering a
888     static file -- Apache httpd uses sendfile to deliver the file contents
889     without ever reading the file if the OS supports it.</p>
890
891     <p>This sendfile mechanism avoids separate read and send operations,
892     and buffer allocations. But on some platforms or within some
893     filesystems, it is better to disable this feature to avoid
894     operational problems:</p>
895
896     <ul>
897     <li>Some platforms may have broken sendfile support that the build
898     system did not detect, especially if the binaries were built on
899     another box and moved to such a machine with broken sendfile
900     support.</li>
901     <li>On Linux the use of sendfile triggers TCP-checksum
902     offloading bugs on certain networking cards when using IPv6.</li>
903     <li>On Linux on Itanium, sendfile may be unable to handle files
904     over 2GB in size.</li>
905     <li>With a network-mounted <directive
906     module="core">DocumentRoot</directive> (e.g., NFS or SMB),
907     the kernel may be unable to serve the network file through
908     its own cache.</li>
909     </ul>
910
911     <p>For server configurations that are vulnerable to these problems,
912     you should disable this feature by specifying:</p>
913
914     <example>
915       EnableSendfile Off
916     </example>
917
918     <p>For NFS or SMB mounted files, this feature may be disabled explicitly
919     for the offending files by specifying:</p>
920
921     <example>
922       &lt;Directory "/path-to-nfs-files"&gt;
923       <indent>
924         EnableSendfile Off
925       </indent>
926       &lt;/Directory&gt;
927     </example>
928     <p>Please note that the per-directory and .htaccess configuration
929        of <directive>EnableSendfile</directive> is not supported by
930        <module>mod_disk_cache</module>.
931        Only global definition of <directive>EnableSendfile</directive>
932        is taken into account by the module.
933     </p>
934 </usage>
935 </directivesynopsis>
936
937 <directivesynopsis>
938 <name>ErrorDocument</name>
939 <description>What the server will return to the client
940 in case of an error</description>
941 <syntax>ErrorDocument <var>error-code</var> <var>document</var></syntax>
942 <contextlist><context>server config</context><context>virtual host</context>
943 <context>directory</context><context>.htaccess</context>
944 </contextlist>
945 <override>FileInfo</override>
946 <compatibility>Quoting syntax for text messages is different in Apache HTTP Server
947 2.0</compatibility>
948
949 <usage>
950     <p>In the event of a problem or error, Apache httpd can be configured
951     to do one of four things,</p>
952
953     <ol>
954       <li>output a simple hardcoded error message</li>
955
956       <li>output a customized message</li>
957
958       <li>redirect to a local <var>URL-path</var> to handle the
959       problem/error</li>
960
961       <li>redirect to an external <var>URL</var> to handle the
962       problem/error</li>
963     </ol>
964
965     <p>The first option is the default, while options 2-4 are
966     configured using the <directive>ErrorDocument</directive>
967     directive, which is followed by the HTTP response code and a URL
968     or a message. Apache httpd will sometimes offer additional information
969     regarding the problem/error.</p>
970
971     <p>URLs can begin with a slash (/) for local web-paths (relative
972     to the <directive module="core">DocumentRoot</directive>), or be a
973     full URL which the client can resolve. Alternatively, a message
974     can be provided to be displayed by the browser. Examples:</p>
975
976     <example>
977       ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
978       ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
979       ErrorDocument 401 /subscription_info.html<br />
980       ErrorDocument 403 "Sorry can't allow you access today"
981     </example>
982
983     <p>Additionally, the special value <code>default</code> can be used
984     to specify Apache httpd's simple hardcoded message.  While not required
985     under normal circumstances, <code>default</code> will restore
986     Apache httpd's simple hardcoded message for configurations that would
987     otherwise inherit an existing <directive>ErrorDocument</directive>.</p>
988
989     <example>
990       ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
991       &lt;Directory /web/docs&gt;<br />
992       <indent>
993         ErrorDocument 404 default<br />
994       </indent>
995       &lt;/Directory&gt;
996     </example>
997
998     <p>Note that when you specify an <directive>ErrorDocument</directive>
999     that points to a remote URL (ie. anything with a method such as
1000     <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
1001     client to tell it where to find the document, even if the
1002     document ends up being on the same server. This has several
1003     implications, the most important being that the client will not
1004     receive the original error status code, but instead will
1005     receive a redirect status code. This in turn can confuse web
1006     robots and other clients which try to determine if a URL is
1007     valid using the status code. In addition, if you use a remote
1008     URL in an <code>ErrorDocument 401</code>, the client will not
1009     know to prompt the user for a password since it will not
1010     receive the 401 status code. Therefore, <strong>if you use an
1011     <code>ErrorDocument 401</code> directive then it must refer to a local
1012     document.</strong></p>
1013
1014     <p>Microsoft Internet Explorer (MSIE) will by default ignore
1015     server-generated error messages when they are "too small" and substitute
1016     its own "friendly" error messages. The size threshold varies depending on
1017     the type of error, but in general, if you make your error document
1018     greater than 512 bytes, then MSIE will show the server-generated
1019     error rather than masking it.  More information is available in
1020     Microsoft Knowledge Base article <a
1021     href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807"
1022     >Q294807</a>.</p>
1023
1024     <p>Although most error messages can be overriden, there are certain
1025     circumstances where the internal messages are used regardless of the
1026     setting of <directive module="core">ErrorDocument</directive>.  In
1027     particular, if a malformed request is detected, normal request processing
1028     will be immediately halted and the internal error message returned.
1029     This is necessary to guard against security problems caused by
1030     bad requests.</p>
1031    
1032     <p>If you are using mod_proxy, you may wish to enable
1033     <directive module="mod_proxy">ProxyErrorOverride</directive> so that you can provide
1034     custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
1035     Apache httpd will not generate custom error documents for proxied content.</p>
1036 </usage>
1037
1038 <seealso><a href="../custom-error.html">documentation of
1039     customizable responses</a></seealso>
1040 </directivesynopsis>
1041
1042 <directivesynopsis>
1043 <name>ErrorLog</name>
1044 <description>Location where the server will log errors</description>
1045 <syntax> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</syntax>
1046 <default>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</default>
1047 <contextlist><context>server config</context><context>virtual host</context>
1048 </contextlist>
1049
1050 <usage>
1051     <p>The <directive>ErrorLog</directive> directive sets the name of
1052     the file to which the server will log any errors it encounters. If
1053     the <var>file-path</var> is not absolute then it is assumed to be 
1054     relative to the <directive module="core">ServerRoot</directive>.</p>
1055
1056     <example><title>Example</title>
1057     ErrorLog /var/log/httpd/error_log
1058     </example>
1059
1060     <p>If the <var>file-path</var>
1061     begins with a pipe (|) then it is assumed to be a command to spawn
1062     to handle the error log.</p>
1063
1064     <example><title>Example</title>
1065     ErrorLog "|/usr/local/bin/httpd_errors"
1066     </example>
1067
1068     <p>Using <code>syslog</code> instead of a filename enables logging
1069     via syslogd(8) if the system supports it. The default is to use
1070     syslog facility <code>local7</code>, but you can override this by
1071     using the <code>syslog:<var>facility</var></code> syntax where
1072     <var>facility</var> can be one of the names usually documented in
1073     syslog(1).</p>
1074
1075     <example><title>Example</title>
1076     ErrorLog syslog:user
1077     </example>
1078
1079     <p>SECURITY: See the <a
1080     href="../misc/security_tips.html#serverroot">security tips</a>
1081     document for details on why your security could be compromised
1082     if the directory where log files are stored is writable by
1083     anyone other than the user that starts the server.</p>
1084     <note type="warning"><title>Note</title>
1085       <p>When entering a file path on non-Unix platforms, care should be taken
1086       to make sure that only forward slashed are used even though the platform
1087       may allow the use of back slashes. In general it is a good idea to always 
1088       use forward slashes throughout the configuration files.</p>
1089     </note>
1090 </usage>
1091 <seealso><directive module="core">LogLevel</directive></seealso>
1092 <seealso><a href="../logs.html">Apache HTTP Server Log Files</a></seealso>
1093 </directivesynopsis>
1094
1095 <directivesynopsis>
1096 <name>ExtendedStatus</name>
1097 <description>Keep track of extended status information for each 
1098 request</description>
1099 <syntax>ExtendedStatus On|Off</syntax>
1100 <default>ExtendedStatus Off[*]</default>
1101 <contextlist><context>server config</context></contextlist>
1102
1103 <usage>
1104     <p>This option tracks additional data per worker about the
1105     currently executing request, and a utilization summary; you 
1106     can see these variables during runtime by configuring 
1107     <module>mod_status</module>.  Note that other modules may
1108     rely on this scoreboard.</p>
1109
1110     <p>This setting applies to the entire server, and cannot be
1111     enabled or disabled on a virtualhost-by-virtualhost basis.
1112     The collection of extended status information can slow down
1113     the server.  Also note that this setting cannot be changed
1114     during a graceful restart.</p>
1115
1116     <note>
1117     <p>Note that loading <module>mod_status</module> will change 
1118     the default behavior to ExtendedStatus On, while other
1119     third party modules may do the same.  Such modules rely on
1120     collecting detailed information about the state of all workers.
1121     The default is changed by <module>mod_status</module> beginning
1122     with version 2.3.6; the previous default was always Off.</p>
1123     </note>
1124
1125 </usage>
1126
1127 </directivesynopsis>
1128
1129 <directivesynopsis>
1130 <name>FileETag</name>
1131 <description>File attributes used to create the ETag
1132 HTTP response header for static files</description>
1133 <syntax>FileETag <var>component</var> ...</syntax>
1134 <default>FileETag INode MTime Size</default>
1135 <contextlist><context>server config</context><context>virtual host</context>
1136 <context>directory</context><context>.htaccess</context>
1137 </contextlist>
1138 <override>FileInfo</override>
1139
1140 <usage>
1141     <p>
1142     The <directive>FileETag</directive> directive configures the file
1143     attributes that are used to create the <code>ETag</code> (entity
1144     tag) response header field when the document is based on a static file.
1145     (The <code>ETag</code> value is used in cache management to save
1146     network bandwidth.) In Apache httpd 1.3.22 and earlier, the
1147     <code>ETag</code> value was <em>always</em> formed
1148     from the file's inode, size, and last-modified time (mtime). The
1149     <directive>FileETag</directive> directive allows you to choose
1150     which of these -- if any -- should be used. The recognized keywords are:
1151     </p>
1152
1153     <dl>
1154      <dt><strong>INode</strong></dt>
1155      <dd>The file's i-node number will be included in the calculation</dd>
1156      <dt><strong>MTime</strong></dt>
1157      <dd>The date and time the file was last modified will be included</dd>
1158      <dt><strong>Size</strong></dt>
1159      <dd>The number of bytes in the file will be included</dd>
1160      <dt><strong>All</strong></dt>
1161      <dd>All available fields will be used. This is equivalent to:
1162          <example>FileETag INode MTime Size</example></dd>
1163      <dt><strong>None</strong></dt>
1164      <dd>If a document is file-based, no <code>ETag</code> field will be
1165        included in the response</dd>
1166     </dl>
1167
1168     <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1169     keywords may be prefixed with either <code>+</code> or <code>-</code>,
1170     which allow changes to be made to the default setting inherited
1171     from a broader scope. Any keyword appearing without such a prefix
1172     immediately and completely cancels the inherited setting.</p>
1173
1174     <p>If a directory's configuration includes
1175     <code>FileETag&nbsp;INode&nbsp;MTime&nbsp;Size</code>, and a
1176     subdirectory's includes <code>FileETag&nbsp;-INode</code>,
1177     the setting for that subdirectory (which will be inherited by
1178     any sub-subdirectories that don't override it) will be equivalent to
1179     <code>FileETag&nbsp;MTime&nbsp;Size</code>.</p>
1180     <note type="warning"><title>Warning</title>
1181     Do not change the default for directories or locations that have WebDAV
1182     enabled and use <module>mod_dav_fs</module> as a storage provider.
1183     <module>mod_dav_fs</module> uses <code>INode&nbsp;MTime&nbsp;Size</code>
1184     as a fixed format for <code>ETag</code> comparisons on conditional requests.
1185     These conditional requests will break if the <code>ETag</code> format is
1186     changed via <directive>FileETag</directive>.
1187     </note>
1188     <note><title>Server Side Includes</title>
1189     An ETag is not generated for responses parsed by <module>mod_include</module>, 
1190     since the response entity can change without a change of the INode, MTime, or Size 
1191     of the static file with embedded SSI directives.
1192     </note>
1193
1194 </usage>
1195 </directivesynopsis>
1196
1197 <directivesynopsis type="section">
1198 <name>Files</name>
1199 <description>Contains directives that apply to matched
1200 filenames</description>
1201 <syntax>&lt;Files <var>filename</var>&gt; ... &lt;/Files&gt;</syntax>
1202 <contextlist><context>server config</context><context>virtual host</context>
1203 <context>directory</context><context>.htaccess</context>
1204 </contextlist>
1205 <override>All</override>
1206
1207 <usage>
1208     <p>The <directive type="section">Files</directive> directive
1209     limits the scope of the enclosed directives by filename. It is comparable
1210     to the <directive module="core" type="section">Directory</directive>
1211     and <directive module="core" type="section">Location</directive>
1212     directives. It should be matched with a <code>&lt;/Files&gt;</code>
1213     directive. The directives given within this section will be applied to
1214     any object with a basename (last component of filename) matching the
1215     specified filename. <directive type="section">Files</directive>
1216     sections are processed in the order they appear in the
1217     configuration file, after the <directive module="core"
1218     type="section">Directory</directive> sections and
1219     <code>.htaccess</code> files are read, but before <directive
1220     type="section" module="core">Location</directive> sections. Note
1221     that <directive type="section">Files</directive> can be nested
1222     inside <directive type="section"
1223     module="core">Directory</directive> sections to restrict the
1224     portion of the filesystem they apply to.</p>
1225
1226     <p>The <var>filename</var> argument should include a filename, or
1227     a wild-card string, where <code>?</code> matches any single character,
1228     and <code>*</code> matches any sequences of characters.
1229     <glossary ref="regex">Regular expressions</glossary> 
1230     can also be used, with the addition of the
1231     <code>~</code> character. For example:</p>
1232
1233     <example>
1234       &lt;Files ~ "\.(gif|jpe?g|png)$"&gt;
1235     </example>
1236
1237     <p>would match most common Internet graphics formats. <directive
1238     module="core" type="section">FilesMatch</directive> is preferred,
1239     however.</p>
1240
1241     <p>Note that unlike <directive type="section"
1242     module="core">Directory</directive> and <directive type="section"
1243     module="core">Location</directive> sections, <directive
1244     type="section">Files</directive> sections can be used inside
1245     <code>.htaccess</code> files. This allows users to control access to
1246     their own files, at a file-by-file level.</p>
1247
1248 </usage>
1249 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1250     and &lt;Files&gt; sections work</a> for an explanation of how these
1251     different sections are combined when a request is received</seealso>
1252 </directivesynopsis>
1253
1254 <directivesynopsis type="section">
1255 <name>FilesMatch</name>
1256 <description>Contains directives that apply to regular-expression matched
1257 filenames</description>
1258 <syntax>&lt;FilesMatch <var>regex</var>&gt; ... &lt;/FilesMatch&gt;</syntax>
1259 <contextlist><context>server config</context><context>virtual host</context>
1260 <context>directory</context><context>.htaccess</context>
1261 </contextlist>
1262 <override>All</override>
1263
1264 <usage>
1265     <p>The <directive type="section">FilesMatch</directive> directive
1266     limits the scope of the enclosed directives by filename, just as the
1267     <directive module="core" type="section">Files</directive> directive
1268     does. However, it accepts a <glossary ref="regex">regular 
1269     expression</glossary>. For example:</p>
1270
1271     <example>
1272       &lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
1273     </example>
1274
1275     <p>would match most common Internet graphics formats.</p>
1276 </usage>
1277
1278 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1279     and &lt;Files&gt; sections work</a> for an explanation of how these
1280     different sections are combined when a request is received</seealso>
1281 </directivesynopsis>
1282
1283 <directivesynopsis>
1284 <name>ForceType</name>
1285 <description>Forces all matching files to be served with the specified
1286 media type in the HTTP Content-Type header field</description>
1287 <syntax>ForceType <var>media-type</var>|None</syntax>
1288 <contextlist><context>directory</context><context>.htaccess</context>
1289 </contextlist>
1290 <override>FileInfo</override>
1291 <compatibility>Moved to the core in Apache httpd 2.0</compatibility>
1292
1293 <usage>
1294     <p>When placed into an <code>.htaccess</code> file or a
1295     <directive type="section" module="core">Directory</directive>, or
1296     <directive type="section" module="core">Location</directive> or
1297     <directive type="section" module="core">Files</directive>
1298     section, this directive forces all matching files to be served
1299     with the content type identification given by
1300     <var>media-type</var>. For example, if you had a directory full of
1301     GIF files, but did not want to label them all with <code>.gif</code>,
1302     you might want to use:</p>
1303
1304     <example>
1305       ForceType image/gif
1306     </example>
1307
1308     <p>Note that this directive overrides other indirect media type
1309     associations defined in mime.types or via the
1310     <directive module="mod_mime">AddType</directive>.</p>
1311
1312     <p>You can also override more general
1313     <directive>ForceType</directive> settings
1314     by using the value of <code>None</code>:</p>
1315
1316     <example>
1317       # force all files to be image/gif:<br />
1318       &lt;Location /images&gt;<br />
1319         <indent>
1320           ForceType image/gif<br />
1321         </indent>
1322       &lt;/Location&gt;<br />
1323       <br />
1324       # but normal mime-type associations here:<br />
1325       &lt;Location /images/mixed&gt;<br />
1326       <indent>
1327         ForceType None<br />
1328       </indent>
1329       &lt;/Location&gt;
1330     </example>
1331 </usage>
1332 </directivesynopsis>
1333
1334 <directivesynopsis>
1335 <name>HostnameLookups</name>
1336 <description>Enables DNS lookups on client IP addresses</description>
1337 <syntax>HostnameLookups On|Off|Double</syntax>
1338 <default>HostnameLookups Off</default>
1339 <contextlist><context>server config</context><context>virtual host</context>
1340 <context>directory</context></contextlist>
1341
1342 <usage>
1343     <p>This directive enables DNS lookups so that host names can be
1344     logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1345     The value <code>Double</code> refers to doing double-reverse
1346     DNS lookup. That is, after a reverse lookup is performed, a forward
1347     lookup is then performed on that result. At least one of the IP
1348     addresses in the forward lookup must match the original
1349     address. (In "tcpwrappers" terminology this is called
1350     <code>PARANOID</code>.)</p>
1351
1352     <p>Regardless of the setting, when <module>mod_authz_host</module> is
1353     used for controlling access by hostname, a double reverse lookup
1354     will be performed.  This is necessary for security. Note that the
1355     result of this double-reverse isn't generally available unless you
1356     set <code>HostnameLookups Double</code>. For example, if only
1357     <code>HostnameLookups On</code> and a request is made to an object
1358     that is protected by hostname restrictions, regardless of whether
1359     the double-reverse fails or not, CGIs will still be passed the
1360     single-reverse result in <code>REMOTE_HOST</code>.</p>
1361
1362     <p>The default is <code>Off</code> in order to save the network
1363     traffic for those sites that don't truly need the reverse
1364     lookups done. It is also better for the end users because they
1365     don't have to suffer the extra latency that a lookup entails.
1366     Heavily loaded sites should leave this directive
1367     <code>Off</code>, since DNS lookups can take considerable
1368     amounts of time. The utility <program>logresolve</program>, compiled by
1369     default to the <code>bin</code> subdirectory of your installation
1370     directory, can be used to look up host names from logged IP addresses
1371     offline.</p>
1372 </usage>
1373 </directivesynopsis>
1374
1375 <directivesynopsis type="section">
1376 <name>If</name>
1377 <description>Contains directives that apply only if a condition is
1378 satisfied by a request at runtime</description>
1379 <syntax>&lt;If <var>expression</var>&gt; ... &lt;/If&gt;</syntax>
1380 <contextlist><context>server config</context><context>virtual host</context>
1381 <context>directory</context><context>.htaccess</context>
1382 </contextlist>
1383 <override>All</override>
1384
1385 <usage>
1386     <p>The <directive type="section">If</directive> directive
1387     evaluates an expression at runtime, and applies the enclosed
1388     directives if and only if the expression evaluates to true.
1389     For example:</p>
1390
1391     <example>
1392         &lt;If "$req{Host} = ''"&gt;
1393     </example>
1394
1395     <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>
1396
1397     <p>You may compare the value of any variable in the request headers
1398     ($req), response headers ($resp) or environment ($env) in your
1399     expression.</p>
1400 </usage>
1401
1402 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;,
1403     &lt;Files&gt; sections work</a> for an explanation of how these
1404     different sections are combined when a request is received.
1405     <directive type="section">If</directive> has the same precedence
1406     and usage as <directive type="section">Files</directive></seealso>
1407 </directivesynopsis>
1408
1409 <directivesynopsis type="section">
1410 <name>IfDefine</name>
1411 <description>Encloses directives that will be processed only
1412 if a test is true at startup</description>
1413 <syntax>&lt;IfDefine [!]<var>parameter-name</var>&gt; ...
1414     &lt;/IfDefine&gt;</syntax>
1415 <contextlist><context>server config</context><context>virtual host</context>
1416 <context>directory</context><context>.htaccess</context>
1417 </contextlist>
1418 <override>All</override>
1419
1420 <usage>
1421     <p>The <code>&lt;IfDefine <var>test</var>&gt;...&lt;/IfDefine&gt;
1422     </code> section is used to mark directives that are conditional. The
1423     directives within an <directive type="section">IfDefine</directive>
1424     section are only processed if the <var>test</var> is true. If <var>
1425     test</var> is false, everything between the start and end markers is
1426     ignored.</p>
1427
1428     <p>The <var>test</var> in the <directive type="section"
1429     >IfDefine</directive> section directive can be one of two forms:</p>
1430
1431     <ul>
1432       <li><var>parameter-name</var></li>
1433
1434       <li><code>!</code><var>parameter-name</var></li>
1435     </ul>
1436
1437     <p>In the former case, the directives between the start and end
1438     markers are only processed if the parameter named
1439     <var>parameter-name</var> is defined. The second format reverses
1440     the test, and only processes the directives if
1441     <var>parameter-name</var> is <strong>not</strong> defined.</p>
1442
1443     <p>The <var>parameter-name</var> argument is a define as given on the
1444     <program>httpd</program> command line via <code>-D<var>parameter</var>
1445     </code> at the time the server was started or by the <directive
1446     module="core">Define</directive> directive.</p>
1447
1448     <p><directive type="section">IfDefine</directive> sections are
1449     nest-able, which can be used to implement simple
1450     multiple-parameter tests. Example:</p>
1451
1452     <example>
1453       httpd -DReverseProxy -DUseCache -DMemCache ...<br />
1454       <br />
1455       # httpd.conf<br />
1456       &lt;IfDefine ReverseProxy&gt;<br />
1457       <indent>
1458         LoadModule proxy_module   modules/mod_proxy.so<br />
1459         LoadModule proxy_http_module   modules/mod_proxy_http.so<br />
1460         &lt;IfDefine UseCache&gt;<br />
1461         <indent>
1462           LoadModule cache_module   modules/mod_cache.so<br />
1463           &lt;IfDefine MemCache&gt;<br />
1464           <indent>
1465             LoadModule mem_cache_module   modules/mod_mem_cache.so<br />
1466           </indent>
1467           &lt;/IfDefine&gt;<br />
1468           &lt;IfDefine !MemCache&gt;<br />
1469           <indent>
1470             LoadModule disk_cache_module   modules/mod_disk_cache.so<br />
1471           </indent>
1472           &lt;/IfDefine&gt;
1473         </indent>
1474         &lt;/IfDefine&gt;
1475       </indent>
1476       &lt;/IfDefine&gt;
1477     </example>
1478 </usage>
1479 </directivesynopsis>
1480
1481 <directivesynopsis type="section">
1482 <name>IfModule</name>
1483 <description>Encloses directives that are processed conditional on the
1484 presence or absence of a specific module</description>
1485 <syntax>&lt;IfModule [!]<var>module-file</var>|<var>module-identifier</var>&gt; ...
1486     &lt;/IfModule&gt;</syntax>
1487 <contextlist><context>server config</context><context>virtual host</context>
1488 <context>directory</context><context>.htaccess</context>
1489 </contextlist>
1490 <override>All</override>
1491 <compatibility>Module identifiers are available in version 2.1 and
1492 later.</compatibility>
1493
1494 <usage>
1495     <p>The <code>&lt;IfModule <var>test</var>&gt;...&lt;/IfModule&gt;</code>
1496     section is used to mark directives that are conditional on the presence of
1497     a specific module. The directives within an <directive type="section"
1498     >IfModule</directive> section are only processed if the <var>test</var>
1499     is true. If <var>test</var> is false, everything between the start and
1500     end markers is ignored.</p>
1501
1502     <p>The <var>test</var> in the <directive type="section"
1503     >IfModule</directive> section directive can be one of two forms:</p>
1504
1505     <ul>
1506       <li><var>module</var></li>
1507
1508       <li>!<var>module</var></li>
1509     </ul>
1510
1511     <p>In the former case, the directives between the start and end
1512     markers are only processed if the module named <var>module</var>
1513     is included in Apache httpd -- either compiled in or
1514     dynamically loaded using <directive module="mod_so"
1515     >LoadModule</directive>. The second format reverses the test,
1516     and only processes the directives if <var>module</var> is
1517     <strong>not</strong> included.</p>
1518
1519     <p>The <var>module</var> argument can be either the module identifier or
1520     the file name of the module, at the time it was compiled.  For example,
1521     <code>rewrite_module</code> is the identifier and
1522     <code>mod_rewrite.c</code> is the file name. If a module consists of
1523     several source files, use the name of the file containing the string
1524     <code>STANDARD20_MODULE_STUFF</code>.</p>
1525
1526     <p><directive type="section">IfModule</directive> sections are
1527     nest-able, which can be used to implement simple multiple-module
1528     tests.</p>
1529
1530     <note>This section should only be used if you need to have one
1531     configuration file that works whether or not a specific module
1532     is available. In normal operation, directives need not be
1533     placed in <directive type="section">IfModule</directive>
1534     sections.</note>
1535 </usage>
1536 </directivesynopsis>
1537
1538 <directivesynopsis>
1539 <name>Include</name>
1540 <description>Includes other configuration files from within
1541 the server configuration files</description>
1542 <syntax>Include <var>file-path</var>|<var>directory-path</var>|
1543 <var>wildcard</var></syntax>
1544 <contextlist><context>server config</context><context>virtual host</context>
1545 <context>directory</context>
1546 </contextlist>
1547 <compatibility>Wildcard matching available in 2.0.41 and later, directory
1548 wildcard matching available in 2.3.6 and later</compatibility>
1549
1550 <usage>
1551     <p>This directive allows inclusion of other configuration files
1552     from within the server configuration files.</p>
1553
1554     <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used
1555     in the filename or directory parts of the path to include several files
1556     at once, in alphabetical order. In addition, if
1557     <directive>Include</directive> points to a directory, rather than a file,
1558     Apache httpd will read all files in that directory and any subdirectory.
1559     However, including entire directories is not recommended, because it is
1560     easy to accidentally leave temporary files in a directory that can cause
1561     <program>httpd</program> to fail. Instead, we encourage you to use the
1562     wildcard syntax shown below, to include files that match a particular
1563     pattern, such as *.conf, for example.</p>
1564
1565     <p>When a wildcard is specified for a file or directory component of the
1566     path, and no file or directory matches the wildcard, the
1567     <directive module="core">Include</directive> directive will be
1568     silently ignored. When a directory or file component of the path is
1569     specified exactly, and that directory or file does not exist,
1570     <directive module="core">Include</directive> directive will fail with an
1571     error saying the file or directory cannot be found. This removes the need
1572     for placeholder files to exist so that at least one file or directory is
1573     found by the wildcard.</p>
1574
1575     <p>Under certain circumstances, it may be required for the server to fail
1576     explicitly when no files or directories match a specific wildcard. In these
1577     cases, use the <directive module="code">IncludeStrict</directive>
1578     directive instead.</p>
1579
1580     <p>The file path specified may be an absolute path, or may be relative 
1581     to the <directive module="core">ServerRoot</directive> directory.</p>
1582
1583     <p>Examples:</p>
1584
1585     <example>
1586       Include /usr/local/apache2/conf/ssl.conf<br />
1587       Include /usr/local/apache2/conf/vhosts/*.conf
1588     </example>
1589
1590     <p>Or, providing paths relative to your <directive
1591     module="core">ServerRoot</directive> directory:</p>
1592
1593     <example>
1594       Include conf/ssl.conf<br />
1595       Include conf/vhosts/*.conf
1596     </example>
1597
1598     <p>Wildcards may be included in the directory or file portion of the
1599     path:</p>
1600   
1601     <example>
1602       Include conf/vhosts/*/vhost.conf
1603       Include conf/vhosts/*/*.conf
1604     </example>
1605
1606 </usage>
1607
1608 <seealso><program>apachectl</program></seealso>
1609 </directivesynopsis>
1610
1611 <directivesynopsis>
1612 <name>IncludeStrict</name>
1613 <description>Includes other configuration files from within the server
1614 configuration files, throwing an error if no files or directories match
1615 a wildcard
1616 </description>
1617 <syntax>IncludeStrict <var>file-path</var>|<var>directory-path</var>|
1618 <var>wildcard</var></syntax>
1619 <contextlist><context>server config</context><context>virtual host</context>
1620 <context>directory</context>
1621 </contextlist>
1622 <compatibility>Available in 2.3.6 and later</compatibility>
1623
1624 <usage>
1625       <p>This directive allows inclusion of other configuration files
1626       from within the server configuration files.</p>
1627
1628       <p>It is functionally equivalent to the
1629       <directive module="core">Include</directive> directive, with the additional
1630       restriction that any wildcards are required to match at least one file or
1631       directory.</p>
1632
1633       <p>The file path specified may be an absolute path, or may be relative 
1634       to the <directive module="core">ServerRoot</directive> directory.</p>
1635
1636       <p>Example:</p>
1637
1638       <p>The server will fail to load if the wildcard path
1639       <var>/usr/local/apache2/conf/vhosts/*.conf</var> does not match at least
1640       one file or directory.</p>
1641
1642       <example>
1643         IncludeStrict /usr/local/apache2/conf/ssl.conf<br />
1644         IncludeStrict /usr/local/apache2/conf/vhosts/*.conf
1645       </example>
1646
1647 </usage>
1648
1649 <seealso><program>apachectl</program></seealso>
1650 </directivesynopsis>
1651   
1652 <directivesynopsis>
1653 <name>KeepAlive</name>
1654 <description>Enables HTTP persistent connections</description>
1655 <syntax>KeepAlive On|Off</syntax>
1656 <default>KeepAlive On</default>
1657 <contextlist><context>server config</context><context>virtual host</context>
1658 </contextlist>
1659
1660 <usage>
1661     <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1662     connection feature of HTTP/1.1 provide long-lived HTTP sessions
1663     which allow multiple requests to be sent over the same TCP
1664     connection. In some cases this has been shown to result in an
1665     almost 50% speedup in latency times for HTML documents with
1666     many images. To enable Keep-Alive connections, set
1667     <code>KeepAlive On</code>.</p>
1668
1669     <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1670     used if they are specifically requested by a client. In
1671     addition, a Keep-Alive connection with an HTTP/1.0 client can
1672     only be used when the length of the content is known in
1673     advance. This implies that dynamic content such as CGI output,
1674     SSI pages, and server-generated directory listings will
1675     generally not use Keep-Alive connections to HTTP/1.0 clients.
1676     For HTTP/1.1 clients, persistent connections are the default
1677     unless otherwise specified. If the client requests it, chunked
1678     encoding will be used in order to send content of unknown
1679     length over persistent connections.</p>
1680
1681     <p>When a client uses a Keep-Alive connection it will be counted
1682     as a single "request" for the <directive module="mpm_common"
1683     >MaxRequestsPerChild</directive> directive, regardless
1684     of how many requests are sent using the connection.</p>
1685 </usage>
1686
1687 <seealso><directive module="core">MaxKeepAliveRequests</directive></seealso>
1688 </directivesynopsis>
1689
1690 <directivesynopsis>
1691 <name>KeepAliveTimeout</name>
1692 <description>Amount of time the server will wait for subsequent
1693 requests on a persistent connection</description>
1694 <syntax>KeepAliveTimeout <var>num</var>[ms]</syntax>
1695 <default>KeepAliveTimeout 5</default>
1696 <contextlist><context>server config</context><context>virtual host</context>
1697 </contextlist>
1698 <compatibility>Specifying a value in milliseconds is available in 
1699 Apache httpd 2.3.2 and later</compatibility>
1700
1701 <usage>
1702     <p>The number of seconds Apache httpd will wait for a subsequent
1703     request before closing the connection. By adding a postfix of ms the
1704     timeout can be also set in milliseconds. Once a request has been
1705     received, the timeout value specified by the
1706     <directive module="core">Timeout</directive> directive applies.</p>
1707
1708     <p>Setting <directive>KeepAliveTimeout</directive> to a high value
1709     may cause performance problems in heavily loaded servers. The
1710     higher the timeout, the more server processes will be kept
1711     occupied waiting on connections with idle clients.</p>
1712     
1713     <p>In a name-based virtual host context, the value of the first
1714     defined virtual host (the default host) in a set of <directive
1715     module="core">NameVirtualHost</directive> will be used.
1716     The other values will be ignored.</p>
1717 </usage>
1718 </directivesynopsis>
1719
1720 <directivesynopsis type="section">
1721 <name>Limit</name>
1722 <description>Restrict enclosed access controls to only certain HTTP
1723 methods</description>
1724 <syntax>&lt;Limit <var>method</var> [<var>method</var>] ... &gt; ...
1725     &lt;/Limit&gt;</syntax>
1726 <contextlist><context>directory</context><context>.htaccess</context>
1727 </contextlist>
1728 <override>AuthConfig, Limit</override>
1729
1730 <usage>
1731     <p>Access controls are normally effective for
1732     <strong>all</strong> access methods, and this is the usual
1733     desired behavior. <strong>In the general case, access control
1734     directives should not be placed within a
1735     <directive type="section">Limit</directive> section.</strong></p>
1736
1737     <p>The purpose of the <directive type="section">Limit</directive>
1738     directive is to restrict the effect of the access controls to the
1739     nominated HTTP methods. For all other methods, the access
1740     restrictions that are enclosed in the <directive
1741     type="section">Limit</directive> bracket <strong>will have no
1742     effect</strong>. The following example applies the access control
1743     only to the methods <code>POST</code>, <code>PUT</code>, and
1744     <code>DELETE</code>, leaving all other methods unprotected:</p>
1745
1746     <example>
1747       &lt;Limit POST PUT DELETE&gt;<br />
1748       <indent>
1749         Require valid-user<br />
1750       </indent>
1751       &lt;/Limit&gt;
1752     </example>
1753
1754     <p>The method names listed can be one or more of: <code>GET</code>,
1755     <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1756     <code>CONNECT</code>, <code>OPTIONS</code>,
1757     <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1758     <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1759     <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1760     case-sensitive.</strong> If <code>GET</code> is used it will also
1761     restrict <code>HEAD</code> requests. The <code>TRACE</code> method
1762     cannot be limited (see <directive module="core"
1763     >TraceEnable</directive>).</p>
1764
1765     <note type="warning">A <directive type="section"
1766     module="core">LimitExcept</directive> section should always be
1767     used in preference to a <directive type="section">Limit</directive>
1768     section when restricting access, since a <directive type="section"
1769     module="core">LimitExcept</directive> section provides protection
1770     against arbitrary methods.</note>
1771
1772     <p>The <directive type="section">Limit</directive> and
1773     <directive type="section" module="core">LimitExcept</directive>
1774     directives may be nested.  In this case, each successive level of
1775     <directive type="section">Limit</directive> or <directive
1776     type="section" module="core">LimitExcept</directive> directives must
1777     further restrict the set of methods to which access controls apply.</p>
1778
1779     <note type="warning">When using
1780     <directive type="section">Limit</directive> or
1781     <directive type="section">LimitExcept</directive> directives with
1782     the <directive module="mod_authz_core">Require</directive> directive,
1783     note that the first <directive module="mod_authz_core">Require</directive>
1784     to succeed authorizes the request, regardless of the presence of other
1785     <directive module="mod_authz_core">Require</directive> directives.</note>
1786
1787     <p>For example, given the following configuration, all users will
1788     be authorized for <code>POST</code> requests, and the
1789     <code>Require group editors</code> directive will be ignored
1790     in all cases:</p>
1791
1792     <example>
1793       &lt;LimitExcept GET&gt;
1794       <indent>
1795         Require valid-user
1796       </indent> 
1797       &lt;/LimitExcept&gt;<br />
1798       &lt;Limit POST&gt;
1799       <indent>
1800         Require group editors
1801       </indent> 
1802       &lt;/Limit&gt;
1803     </example>
1804 </usage>
1805 </directivesynopsis>
1806
1807 <directivesynopsis type="section">
1808 <name>LimitExcept</name>
1809 <description>Restrict access controls to all HTTP methods
1810 except the named ones</description>
1811 <syntax>&lt;LimitExcept <var>method</var> [<var>method</var>] ... &gt; ...
1812     &lt;/LimitExcept&gt;</syntax>
1813 <contextlist><context>directory</context><context>.htaccess</context>
1814 </contextlist>
1815 <override>AuthConfig, Limit</override>
1816
1817 <usage>
1818     <p><directive type="section">LimitExcept</directive> and
1819     <code>&lt;/LimitExcept&gt;</code> are used to enclose
1820     a group of access control directives which will then apply to any
1821     HTTP access method <strong>not</strong> listed in the arguments;
1822     i.e., it is the opposite of a <directive type="section"
1823     module="core">Limit</directive> section and can be used to control
1824     both standard and nonstandard/unrecognized methods. See the
1825     documentation for <directive module="core"
1826     type="section">Limit</directive> for more details.</p>
1827
1828     <p>For example:</p>
1829
1830     <example>
1831       &lt;LimitExcept POST GET&gt;<br />
1832       <indent>
1833         Require valid-user<br />
1834       </indent>
1835       &lt;/LimitExcept&gt;
1836     </example>
1837
1838 </usage>
1839 </directivesynopsis>
1840
1841 <directivesynopsis>
1842 <name>LimitInternalRecursion</name>
1843 <description>Determine maximum number of internal redirects and nested
1844 subrequests</description>
1845 <syntax>LimitInternalRecursion <var>number</var> [<var>number</var>]</syntax>
1846 <default>LimitInternalRecursion 10</default>
1847 <contextlist><context>server config</context><context>virtual host</context>
1848 </contextlist>
1849 <compatibility>Available in Apache httpd 2.0.47 and later</compatibility>
1850
1851 <usage>
1852     <p>An internal redirect happens, for example, when using the <directive
1853     module="mod_actions">Action</directive> directive, which internally
1854     redirects the original request to a CGI script. A subrequest is Apache httpd's
1855     mechanism to find out what would happen for some URI if it were requested.
1856     For example, <module>mod_dir</module> uses subrequests to look for the
1857     files listed in the <directive module="mod_dir">DirectoryIndex</directive>
1858     directive.</p>
1859
1860     <p><directive>LimitInternalRecursion</directive> prevents the server
1861     from crashing when entering an infinite loop of internal redirects or
1862     subrequests. Such loops are usually caused by misconfigurations.</p>
1863
1864     <p>The directive stores two different limits, which are evaluated on
1865     per-request basis. The first <var>number</var> is the maximum number of
1866     internal redirects, that may follow each other. The second <var>number</var>
1867     determines, how deep subrequests may be nested. If you specify only one
1868     <var>number</var>, it will be assigned to both limits.</p>
1869
1870     <example><title>Example</title>
1871       LimitInternalRecursion 5
1872     </example>
1873 </usage>
1874 </directivesynopsis>
1875
1876 <directivesynopsis>
1877 <name>LimitRequestBody</name>
1878 <description>Restricts the total size of the HTTP request body sent
1879 from the client</description>
1880 <syntax>LimitRequestBody <var>bytes</var></syntax>
1881 <default>LimitRequestBody 0</default>
1882 <contextlist><context>server config</context><context>virtual host</context>
1883 <context>directory</context><context>.htaccess</context>
1884 </contextlist>
1885 <override>All</override>
1886
1887 <usage>
1888     <p>This directive specifies the number of <var>bytes</var> from 0
1889     (meaning unlimited) to 2147483647 (2GB) that are allowed in a
1890     request body.</p>
1891
1892     <p>The <directive>LimitRequestBody</directive> directive allows
1893     the user to set a limit on the allowed size of an HTTP request
1894     message body within the context in which the directive is given
1895     (server, per-directory, per-file or per-location). If the client
1896     request exceeds that limit, the server will return an error
1897     response instead of servicing the request. The size of a normal
1898     request message body will vary greatly depending on the nature of
1899     the resource and the methods allowed on that resource. CGI scripts
1900     typically use the message body for retrieving form information.
1901     Implementations of the <code>PUT</code> method will require
1902     a value at least as large as any representation that the server
1903     wishes to accept for that resource.</p>
1904
1905     <p>This directive gives the server administrator greater
1906     control over abnormal client request behavior, which may be
1907     useful for avoiding some forms of denial-of-service
1908     attacks.</p>
1909
1910     <p>If, for example, you are permitting file upload to a particular
1911     location, and wish to limit the size of the uploaded file to 100K,
1912     you might use the following directive:</p>
1913
1914     <example>
1915       LimitRequestBody 102400
1916     </example>
1917
1918 </usage>
1919 </directivesynopsis>
1920
1921 <directivesynopsis>
1922 <name>LimitRequestFields</name>
1923 <description>Limits the number of HTTP request header fields that
1924 will be accepted from the client</description>
1925 <syntax>LimitRequestFields <var>number</var></syntax>
1926 <default>LimitRequestFields 100</default>
1927 <contextlist><context>server config</context></contextlist>
1928
1929 <usage>
1930     <p><var>Number</var> is an integer from 0 (meaning unlimited) to
1931     32767. The default value is defined by the compile-time
1932     constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
1933     distributed).</p>
1934
1935     <p>The <directive>LimitRequestFields</directive> directive allows
1936     the server administrator to modify the limit on the number of
1937     request header fields allowed in an HTTP request. A server needs
1938     this value to be larger than the number of fields that a normal
1939     client request might include. The number of request header fields
1940     used by a client rarely exceeds 20, but this may vary among
1941     different client implementations, often depending upon the extent
1942     to which a user has configured their browser to support detailed
1943     content negotiation. Optional HTTP extensions are often expressed
1944     using request header fields.</p>
1945
1946     <p>This directive gives the server administrator greater
1947     control over abnormal client request behavior, which may be
1948     useful for avoiding some forms of denial-of-service attacks.
1949     The value should be increased if normal clients see an error
1950     response from the server that indicates too many fields were
1951     sent in the request.</p>
1952
1953     <p>For example:</p>
1954
1955     <example>
1956       LimitRequestFields 50
1957     </example>
1958
1959 </usage>
1960 </directivesynopsis>
1961
1962 <directivesynopsis>
1963 <name>LimitRequestFieldSize</name>
1964 <description>Limits the size of the HTTP request header allowed from the
1965 client</description>
1966 <syntax>LimitRequestFieldSize <var>bytes</var></syntax>
1967 <default>LimitRequestFieldSize 8190</default>
1968 <contextlist><context>server config</context></contextlist>
1969
1970 <usage>
1971     <p>This directive specifies the number of <var>bytes</var>
1972     that will be allowed in an HTTP request header.</p>
1973
1974     <p>The <directive>LimitRequestFieldSize</directive> directive
1975     allows the server administrator to reduce or increase the limit 
1976     on the allowed size of an HTTP request header field. A server
1977     needs this value to be large enough to hold any one header field 
1978     from a normal client request. The size of a normal request header 
1979     field will vary greatly among different client implementations, 
1980     often depending upon the extent to which a user has configured
1981     their browser to support detailed content negotiation. SPNEGO
1982     authentication headers can be up to 12392 bytes.</p>
1983
1984     <p>This directive gives the server administrator greater
1985     control over abnormal client request behavior, which may be
1986     useful for avoiding some forms of denial-of-service attacks.</p>
1987
1988     <p>For example:</p>
1989
1990     <example>
1991       LimitRequestFieldSize 4094
1992     </example>
1993
1994     <note>Under normal conditions, the value should not be changed from
1995     the default.</note>
1996
1997 </usage>
1998 </directivesynopsis>
1999
2000 <directivesynopsis>
2001 <name>LimitRequestLine</name>
2002 <description>Limit the size of the HTTP request line that will be accepted
2003 from the client</description>
2004 <syntax>LimitRequestLine <var>bytes</var></syntax>
2005 <default>LimitRequestLine 8190</default>
2006 <contextlist><context>server config</context></contextlist>
2007
2008 <usage>
2009     <p>This directive sets the number of <var>bytes</var> that will be 
2010     allowed on the HTTP request-line.</p>
2011
2012     <p>The <directive>LimitRequestLine</directive> directive allows
2013     the server administrator to reduce or increase the limit on the allowed size
2014     of a client's HTTP request-line. Since the request-line consists of the
2015     HTTP method, URI, and protocol version, the
2016     <directive>LimitRequestLine</directive> directive places a
2017     restriction on the length of a request-URI allowed for a request
2018     on the server. A server needs this value to be large enough to
2019     hold any of its resource names, including any information that
2020     might be passed in the query part of a <code>GET</code> request.</p>
2021
2022     <p>This directive gives the server administrator greater
2023     control over abnormal client request behavior, which may be
2024     useful for avoiding some forms of denial-of-service attacks.</p>
2025
2026     <p>For example:</p>
2027
2028     <example>
2029       LimitRequestLine 4094
2030     </example>
2031
2032     <note>Under normal conditions, the value should not be changed from
2033     the default.</note>
2034 </usage>
2035 </directivesynopsis>
2036
2037 <directivesynopsis>
2038 <name>LimitXMLRequestBody</name>
2039 <description>Limits the size of an XML-based request body</description>
2040 <syntax>LimitXMLRequestBody <var>bytes</var></syntax>
2041 <default>LimitXMLRequestBody 1000000</default>
2042 <contextlist><context>server config</context><context>virtual host</context>
2043 <context>directory</context><context>.htaccess</context></contextlist>
2044 <override>All</override>
2045
2046 <usage>
2047     <p>Limit (in bytes) on maximum size of an XML-based request
2048     body. A value of <code>0</code> will disable any checking.</p>
2049
2050     <p>Example:</p>
2051
2052     <example>
2053       LimitXMLRequestBody 0
2054     </example>
2055
2056 </usage>
2057 </directivesynopsis>
2058
2059 <directivesynopsis type="section">
2060 <name>Location</name>
2061 <description>Applies the enclosed directives only to matching
2062 URLs</description>
2063 <syntax>&lt;Location
2064     <var>URL-path</var>|<var>URL</var>&gt; ... &lt;/Location&gt;</syntax>
2065 <contextlist><context>server config</context><context>virtual host</context>
2066 </contextlist>
2067
2068 <usage>
2069     <p>The <directive type="section">Location</directive> directive
2070     limits the scope of the enclosed directives by URL. It is similar to the
2071     <directive type="section" module="core">Directory</directive>
2072     directive, and starts a subsection which is terminated with a
2073     <code>&lt;/Location&gt;</code> directive. <directive
2074     type="section">Location</directive> sections are processed in the
2075     order they appear in the configuration file, after the <directive
2076     type="section" module="core">Directory</directive> sections and
2077     <code>.htaccess</code> files are read, and after the <directive
2078     type="section" module="core">Files</directive> sections.</p>
2079
2080     <p><directive type="section">Location</directive> sections operate
2081     completely outside the filesystem.  This has several consequences.
2082     Most importantly, <directive type="section">Location</directive>
2083     directives should not be used to control access to filesystem
2084     locations.  Since several different URLs may map to the same
2085     filesystem location, such access controls may by circumvented.</p>
2086
2087     <note><title>When to use <directive 
2088     type="section">Location</directive></title>
2089
2090     <p>Use <directive type="section">Location</directive> to apply
2091     directives to content that lives outside the filesystem.  For
2092     content that lives in the filesystem, use <directive
2093     type="section" module="core">Directory</directive> and <directive
2094     type="section" module="core">Files</directive>.  An exception is
2095     <code>&lt;Location /&gt;</code>, which is an easy way to 
2096     apply a configuration to the entire server.</p>
2097     </note>
2098
2099     <p>For all origin (non-proxy) requests, the URL to be matched is a
2100     URL-path of the form <code>/path/</code>.  <em>No scheme, hostname,
2101     port, or query string may be included.</em>  For proxy requests, the
2102     URL to be matched is of the form
2103     <code>scheme://servername/path</code>, and you must include the
2104     prefix.</p>
2105
2106     <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
2107     any single character, and <code>*</code> matches any sequences of
2108     characters. Neither wildcard character matches a / in the URL-path.</p>
2109
2110     <p><glossary ref="regex">Regular expressions</glossary>
2111     can also be used, with the addition of the <code>~</code> 
2112     character. For example:</p>
2113
2114     <example>
2115       &lt;Location ~ "/(extra|special)/data"&gt;
2116     </example>
2117
2118     <p>would match URLs that contained the substring <code>/extra/data</code>
2119     or <code>/special/data</code>. The directive <directive
2120     type="section" module="core">LocationMatch</directive> behaves
2121     identical to the regex version of <directive
2122     type="section">Location</directive>, and is preferred, for the
2123     simple reason that <code>~</code> is hard to distinguish from
2124     <code>-</code> in many fonts.</p>
2125
2126     <p>The <directive type="section">Location</directive>
2127     functionality is especially useful when combined with the
2128     <directive module="core">SetHandler</directive>
2129     directive. For example, to enable status requests, but allow them
2130     only from browsers at <code>example.com</code>, you might use:</p>
2131
2132     <example>
2133       &lt;Location /status&gt;<br />
2134       <indent>
2135         SetHandler server-status<br />
2136         Order Deny,Allow<br />
2137         Deny from all<br />
2138         Allow from .example.com<br />
2139       </indent>
2140       &lt;/Location&gt;
2141     </example>
2142
2143     <note><title>Note about / (slash)</title>
2144       <p>The slash character has special meaning depending on where in a
2145       URL it appears. People may be used to its behavior in the filesystem
2146       where multiple adjacent slashes are frequently collapsed to a single
2147       slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
2148       <code>/home/foo</code>). In URL-space this is not necessarily true.
2149       The <directive type="section" module="core">LocationMatch</directive>
2150       directive and the regex version of <directive type="section"
2151       >Location</directive> require you to explicitly specify multiple
2152       slashes if that is your intention.</p>
2153
2154       <p>For example, <code>&lt;LocationMatch ^/abc&gt;</code> would match
2155       the request URL <code>/abc</code> but not the request URL <code>
2156       //abc</code>. The (non-regex) <directive type="section"
2157       >Location</directive> directive behaves similarly when used for
2158       proxy requests. But when (non-regex) <directive type="section"
2159       >Location</directive> is used for non-proxy requests it will
2160       implicitly match multiple slashes with a single slash. For example,
2161       if you specify <code>&lt;Location /abc/def&gt;</code> and the
2162       request is to <code>/abc//def</code> then it will match.</p>
2163     </note>
2164 </usage>
2165 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
2166     and &lt;Files&gt; sections work</a> for an explanation of how these
2167     different sections are combined when a request is received.</seealso>
2168 <seealso><directive module="core">LocationMatch</directive></seealso>
2169 </directivesynopsis>
2170
2171 <directivesynopsis type="section">
2172 <name>LocationMatch</name>
2173 <description>Applies the enclosed directives only to regular-expression
2174 matching URLs</description>
2175 <syntax>&lt;LocationMatch
2176     <var>regex</var>&gt; ... &lt;/LocationMatch&gt;</syntax>
2177 <contextlist><context>server config</context><context>virtual host</context>
2178 </contextlist>
2179
2180 <usage>
2181     <p>The <directive type="section">LocationMatch</directive> directive
2182     limits the scope of the enclosed directives by URL, in an identical manner
2183     to <directive module="core" type="section">Location</directive>. However,
2184     it takes a <glossary ref="regex">regular expression</glossary>
2185     as an argument instead of a simple string. For example:</p>
2186
2187     <example>
2188       &lt;LocationMatch "/(extra|special)/data"&gt;
2189     </example>
2190
2191     <p>would match URLs that contained the substring <code>/extra/data</code>
2192     or <code>/special/data</code>.</p>
2193 </usage>
2194
2195 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
2196     and &lt;Files&gt; sections work</a> for an explanation of how these
2197     different sections are combined when a request is received</seealso>
2198 </directivesynopsis>
2199
2200 <directivesynopsis>
2201 <name>LogLevel</name>
2202 <description>Controls the verbosity of the ErrorLog</description>
2203 <syntax>LogLevel <var>level</var></syntax>
2204 <default>LogLevel warn</default>
2205 <contextlist><context>server config</context><context>virtual host</context>
2206 </contextlist>
2207
2208 <usage>
2209     <p><directive>LogLevel</directive> adjusts the verbosity of the
2210     messages recorded in the error logs (see <directive
2211     module="core">ErrorLog</directive> directive). The following
2212     <var>level</var>s are available, in order of decreasing
2213     significance:</p>
2214
2215     <table border="1">
2216     <columnspec><column width=".2"/><column width=".3"/><column width=".5"/>
2217     </columnspec>
2218       <tr>
2219         <th><strong>Level</strong> </th>
2220
2221         <th><strong>Description</strong> </th>
2222
2223         <th><strong>Example</strong> </th>
2224       </tr>
2225
2226       <tr>
2227         <td><code>emerg</code> </td>
2228
2229         <td>Emergencies - system is unusable.</td>
2230
2231         <td>"Child cannot open lock file. Exiting"</td>
2232       </tr>
2233
2234       <tr>
2235         <td><code>alert</code> </td>
2236
2237         <td>Action must be taken immediately.</td>
2238
2239         <td>"getpwuid: couldn't determine user name from uid"</td>
2240       </tr>
2241
2242       <tr>
2243         <td><code>crit</code> </td>
2244
2245         <td>Critical Conditions.</td>
2246
2247         <td>"socket: Failed to get a socket, exiting child"</td>
2248       </tr>
2249
2250       <tr>
2251         <td><code>error</code> </td>
2252
2253         <td>Error conditions.</td>
2254
2255         <td>"Premature end of script headers"</td>
2256       </tr>
2257
2258       <tr>
2259         <td><code>warn</code> </td>
2260
2261         <td>Warning conditions.</td>
2262
2263         <td>"child process 1234 did not exit, sending another
2264         SIGHUP"</td>
2265       </tr>
2266
2267       <tr>
2268         <td><code>notice</code> </td>
2269
2270         <td>Normal but significant condition.</td>
2271
2272         <td>"httpd: caught SIGBUS, attempting to dump core in
2273         ..."</td>
2274       </tr>
2275
2276       <tr>
2277         <td><code>info</code> </td>
2278
2279         <td>Informational.</td>
2280
2281         <td>"Server seems busy, (you may need to increase
2282         StartServers, or Min/MaxSpareServers)..."</td>
2283       </tr>
2284
2285       <tr>
2286         <td><code>debug</code> </td>
2287
2288         <td>Debug-level messages</td>
2289
2290         <td>"Opening config file ..."</td>
2291       </tr>
2292     </table>
2293
2294     <p>When a particular level is specified, messages from all
2295     other levels of higher significance will be reported as well.
2296     <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2297     then messages with log levels of <code>notice</code> and
2298     <code>warn</code> will also be posted.</p>
2299
2300     <p>Using a level of at least <code>crit</code> is
2301     recommended.</p>
2302
2303     <p>For example:</p>
2304
2305     <example>
2306       LogLevel notice
2307     </example>
2308
2309     <note><title>Note</title>
2310       <p>When logging to a regular file messages of the level
2311       <code>notice</code> cannot be suppressed and thus are always
2312       logged. However, this doesn't apply when logging is done
2313       using <code>syslog</code>.</p>
2314     </note>
2315 </usage>
2316 </directivesynopsis>
2317
2318 <directivesynopsis>
2319 <name>MaxKeepAliveRequests</name>
2320 <description>Number of requests allowed on a persistent
2321 connection</description>
2322 <syntax>MaxKeepAliveRequests <var>number</var></syntax>
2323 <default>MaxKeepAliveRequests 100</default>
2324 <contextlist><context>server config</context><context>virtual host</context>
2325 </contextlist>
2326
2327 <usage>
2328     <p>The <directive>MaxKeepAliveRequests</directive> directive
2329     limits the number of requests allowed per connection when
2330     <directive module="core" >KeepAlive</directive> is on. If it is
2331     set to <code>0</code>, unlimited requests will be allowed. We
2332     recommend that this setting be kept to a high value for maximum
2333     server performance.</p>
2334
2335     <p>For example:</p>
2336
2337     <example>
2338       MaxKeepAliveRequests 500
2339     </example>
2340 </usage>
2341 </directivesynopsis>
2342
2343 <directivesynopsis>
2344 <name>Mutex</name>
2345 <description>Configures mutex mechanism and lock file directory for all
2346 or specified mutexes</description>
2347 <syntax>Mutex <var>mechanism</var> [default|<var>mutex-name</var>] ... [OmitPID]</syntax>
2348 <default>Mutex default</default>
2349 <contextlist><context>server config</context></contextlist>
2350 <compatibility>Available in Apache HTTP Server 2.3.4 and later</compatibility>
2351
2352 <usage>
2353     <p>The <directive>Mutex</directive> directive sets the mechanism,
2354     and optionally the lock file location, that httpd and modules use
2355     to serialize access to resources.  Specify <code>default</code> as
2356     the first argument to change the settings for all mutexes; specify
2357     a mutex name (see table below) as the first argument to override
2358     defaults only for that mutex.</p>
2359
2360     <p>The <directive>Mutex</directive> directive is typically used in
2361     the following exceptional situations:</p>
2362
2363     <ul>
2364         <li>change the mutex mechanism when the default mechanism selected
2365         by <glossary>APR</glossary> has a functional or performance
2366         problem</li>
2367
2368         <li>change the directory used by file-based mutexes when the
2369         default directory does not support locking</li>
2370     </ul>
2371
2372     <note><title>Supported modules</title>
2373     <p>This directive only configures mutexes which have been registered
2374     with the core server using the <code>ap_mutex_register()</code> API.
2375     All modules bundled with httpd support the <directive>Mutex</directive>
2376     directive, but third-party modules may not.  Consult the documentation
2377     of the third-party module, which must indicate the mutex name(s) which
2378     can be configured if this directive is supported.</p>
2379     </note>
2380
2381     <p>The following mutex <em>mechanisms</em> are available:</p>
2382     <ul>
2383         <li><code>default | yes</code>
2384         <p>This selects the default locking implementation, as determined by
2385         <glossary>APR</glossary>.  The default locking implementation can
2386         be displayed by running <program>httpd</program> with the 
2387         <code>-V</code> option.</p></li>
2388
2389         <li><code>none | no</code>
2390         <p>This effectively disables the mutex, and is only allowed for a
2391         mutex if the module indicates that it is a valid choice.  Consult the
2392         module documentation for more information.</p></li>
2393
2394         <li><code>posixsem</code>
2395         <p>This is a mutex variant based on a Posix semaphore.</p>
2396
2397         <note type="warning"><title>Warning</title>
2398         <p>The semaphore ownership is not recovered if a thread in the process
2399         holding the mutex segfaults, resulting in a hang of the web server.</p>
2400         </note>
2401         </li>
2402
2403         <li><code>sysvsem</code>
2404         <p>This is a mutex variant based on a SystemV IPC semaphore.</p>
2405
2406         <note type="warning"><title>Warning</title>
2407         <p>It is possible to "leak" SysV semaphores if processes crash 
2408         before the semaphore is removed.</p>
2409         </note>
2410
2411         <note type="warning"><title>Security</title>
2412         <p>The semaphore API allows for a denial of service attack by any
2413         CGIs running under the same uid as the webserver (<em>i.e.</em>,
2414         all CGIs, unless you use something like <program>suexec</program>
2415         or <code>cgiwrapper</code>).</p>
2416         </note>
2417         </li>
2418
2419         <li><code>sem</code>
2420         <p>This selects the "best" available semaphore implementation, choosing
2421         between Posix and SystemV IPC semaphores, in that order.</p></li>
2422
2423         <li><code>pthread</code>
2424         <p>This is a mutex variant based on cross-process Posix thread
2425         mutexes.</p>
2426
2427         <note type="warning"><title>Warning</title>
2428         <p>On most systems, if a child process terminates abnormally while
2429         holding a mutex that uses this implementation, the server will deadlock
2430         and stop responding to requests.  When this occurs, the server will
2431         require a manual restart to recover.</p>
2432         <p>Solaris is a notable exception as it provides a mechanism which
2433         usually allows the mutex to be recovered after a child process
2434         terminates abnormally while holding a mutex.</p>
2435         <p>If your system implements the
2436         <code>pthread_mutexattr_setrobust_np()</code> function, you may be able
2437         to use the <code>pthread</code> option safely.</p>
2438         </note>
2439         </li>
2440
2441         <li><code>fcntl:/path/to/mutex</code>
2442         <p>This is a mutex variant where a physical (lock-)file and the 
2443         <code>fcntl()</code> function are used as the mutex.</p>
2444
2445         <note type="warning"><title>Warning</title>
2446         <p>When multiple mutexes based on this mechanism are used within
2447         multi-threaded, multi-process environments, deadlock errors (EDEADLK)
2448         can be reported for valid mutex operations if <code>fcntl()</code>
2449         is not thread-aware, such as on Solaris.</p>
2450         </note>
2451         </li>
2452
2453         <li><code>flock:/path/to/mutex</code>
2454         <p>This is similar to the <code>fcntl:/path/to/mutex</code> method
2455         with the exception that the <code>flock()</code> function is used to
2456         provide file locking.</p></li>
2457
2458         <li><code>file:/path/to/mutex</code>
2459         <p>This selects the "best" available file locking implementation,
2460         choosing between <code>fcntl</code> and <code>flock</code>, in that
2461         order.</p></li>
2462     </ul>
2463
2464     <p>Most mechanisms are only available on selected platforms, where the 
2465     underlying platform and <glossary>APR</glossary> support it.  Mechanisms
2466     which aren't available on all platforms are <em>posixsem</em>,
2467     <em>sysvsem</em>, <em>sem</em>, <em>pthread</em>, <em>fcntl</em>, 
2468     <em>flock</em>, and <em>file</em>.</p>
2469
2470     <p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
2471     the path, if provided, is a directory where the lock file will be created.
2472     The default directory is httpd's run-time file directory relative to
2473     <directive module="core">ServerRoot</directive>.  Always use a local disk
2474     filesystem for <code>/path/to/mutex</code> and never a directory residing
2475     on a NFS- or AFS-filesystem.  The basename of the file will be the mutex
2476     type, an optional instance string provided by the module, and unless the
2477     <code>OmitPID</code> keyword is specified, the process id of the httpd 
2478     parent process will be appended to to make the file name unique, avoiding
2479     conflicts when multiple httpd instances share a lock file directory.  For
2480     example, if the mutex name is <code>mpm-accept</code> and the lock file
2481     directory is <code>/var/httpd/locks</code>, the lock file name for the
2482     httpd instance with parent process id 12345 would be 
2483     <code>/var/httpd/locks/mpm-accept.12345</code>.</p>
2484
2485     <note type="warning"><title>Security</title>
2486     <p>It is best to <em>avoid</em> putting mutex files in a world-writable
2487     directory such as <code>/var/tmp</code> because someone could create
2488     a denial of service attack and prevent the server from starting by
2489     creating a lockfile with the same name as the one the server will try
2490     to create.</p>
2491     </note>
2492
2493     <p>The following table documents the names of mutexes used by httpd
2494     and bundled modules.</p>
2495
2496     <table border="1" style="zebra">
2497         <tr>
2498             <th>Mutex name</th>
2499             <th>Module(s)</th>
2500             <th>Protected resource</th>
2501         </tr>
2502         <tr>
2503             <td><code>mpm-accept</code></td>
2504             <td><module>prefork</module> and <module>worker</module> MPMs</td>
2505             <td>incoming connections, to avoid the thundering herd problem;
2506             for more information, refer to the
2507             <a href="../misc/perf-tuning.html">performance tuning</a>
2508             documentation</td>
2509         </tr>
2510         <tr>
2511             <td><code>authdigest-client</code></td>
2512             <td><module>mod_auth_digest</module></td>
2513             <td>client list in shared memory</td>
2514         </tr>
2515         <tr>
2516             <td><code>authdigest-opaque</code></td>
2517             <td><module>mod_auth_digest</module></td>
2518             <td>counter in shared memory</td>
2519         </tr>
2520         <tr>
2521             <td><code>ldap-cache</code></td>
2522             <td><module>mod_ldap</module></td>
2523             <td>LDAP result cache</td>
2524         </tr>
2525         <tr>
2526             <td><code>rewrite-map</code></td>
2527             <td><module>mod_rewrite</module></td>
2528             <td>communication with external mapping programs, to avoid
2529             intermixed I/O from multiple requests</td>
2530         </tr>
2531         <tr>
2532             <td><code>ssl-cache</code></td>
2533             <td><module>mod_ssl</module></td>
2534             <td>SSL session cache</td>
2535         </tr>
2536         <tr>
2537             <td><code>ssl-stapling</code></td>
2538             <td><module>mod_ssl</module></td>
2539             <td>OCSP stapling response cache</td>
2540         </tr>
2541         <tr>
2542             <td><code>watchdog-callback</code></td>
2543             <td><module>mod_watchdog</module></td>
2544             <td>callback function of a particular client module</td>
2545         </tr>
2546     </table>
2547
2548     <p>The <code>OmitPID</code> keyword suppresses the addition of the httpd
2549     parent process id from the lock file name.</p>
2550
2551     <p>In the following example, the mutex mechanism for the MPM accept
2552     mutex will be changed from the compiled-in default to <code>fcntl</code>,
2553     with the associated lock file created in directory
2554     <code>/var/httpd/locks</code>.  The mutex mechanism for all other mutexes
2555     will be changed from the compiled-in default to <code>sysvsem</code>.</p>
2556
2557     <example>
2558     Mutex default sysvsem<br />
2559     Mutex mpm-accept fcntl:/var/httpd/locks
2560     </example>
2561 </usage>
2562 </directivesynopsis>
2563
2564 <directivesynopsis>
2565 <name>NameVirtualHost</name>
2566 <description>Designates an IP address for name-virtual
2567 hosting</description>
2568 <syntax>NameVirtualHost <var>addr</var>[:<var>port</var>]</syntax>
2569 <contextlist><context>server config</context></contextlist>
2570
2571 <usage>
2572
2573 <p>A single <directive>NameVirtualHost</directive> directive 
2574 identifies a set of identical virtual hosts on which the server will  
2575 further select from on the basis of the <em>hostname</em> 
2576 requested by the client.  The <directive>NameVirtualHost</directive>
2577 directive is a required directive if you want to configure 
2578 <a href="../vhosts/">name-based virtual hosts</a>.</p>
2579
2580 <p>This directive, and the corresponding <directive >VirtualHost</directive>,
2581 <em>must</em> be qualified with a port number if the server supports both HTTP 
2582 and HTTPS connections.</p>
2583
2584 <p>Although <var>addr</var> can be a hostname, it is recommended
2585 that you always use an IP address or a wildcard.  A wildcard
2586 NameVirtualHost matches only virtualhosts that also have a literal wildcard
2587 as their argument.</p>
2588
2589 <p>In cases where a firewall or other proxy receives the requests and 
2590 forwards them on a different IP address to the server, you must specify the
2591 IP address of the physical interface on the machine which will be
2592 servicing the requests. </p>
2593
2594 <p> In the example below, requests received on interface 192.0.2.1 and port 80 
2595 will only select among the first two virtual hosts. Requests received on
2596 port 80 on any other interface will only select among the third and fourth
2597 virtual hosts. In the common case where the interface isn't important 
2598 to the mapping, only the "*:80" NameVirtualHost and VirtualHost directives 
2599 are necessary.</p>
2600
2601    <example>
2602       NameVirtualHost 192.0.2.1:80<br />
2603       NameVirtualHost *:80<br /><br />
2604
2605       &lt;VirtualHost 192.0.2.1:80&gt;<br />
2606       &nbsp; ServerName namebased-a.example.com<br />
2607       &lt;/VirtualHost&gt;<br />
2608       <br />
2609       &lt;VirtualHost 192.0.2.1:80&gt;<br />
2610       &nbsp; Servername namebased-b.example.com<br />
2611       &lt;/VirtualHost&gt;<br />
2612       <br />
2613       &lt;VirtualHost *:80&gt;<br />
2614       &nbsp; ServerName namebased-c.example.com <br />
2615       &lt;/VirtualHost&gt;<br />
2616       <br />
2617       &lt;VirtualHost *:80&gt;<br />
2618       &nbsp; ServerName namebased-d.example.com <br />
2619       &lt;/VirtualHost&gt;<br />
2620       <br />
2621
2622     </example>
2623
2624     <p>IPv6 addresses must be enclosed in square brackets, as shown
2625     in the following example:</p>
2626
2627     <example>
2628       NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
2629     </example>
2630
2631     <note><title>Argument to <directive type="section">VirtualHost</directive>
2632       directive</title>
2633       <p>Note that the argument to the <directive
2634        type="section">VirtualHost</directive> directive must
2635       exactly match the argument to the <directive
2636       >NameVirtualHost</directive> directive.</p>
2637
2638       <example>
2639         NameVirtualHost 192.0.2.2:80<br />
2640         &lt;VirtualHost 192.0.2.2:80&gt;<br />
2641         # ...<br />
2642         &lt;/VirtualHost&gt;<br />
2643       </example>
2644     </note>
2645 </usage>
2646
2647 <seealso><a href="../vhosts/">Virtual Hosts
2648 documentation</a></seealso>
2649
2650 </directivesynopsis>
2651
2652 <directivesynopsis>
2653 <name>Options</name>
2654 <description>Configures what features are available in a particular
2655 directory</description>
2656 <syntax>Options
2657     [+|-]<var>option</var> [[+|-]<var>option</var>] ...</syntax>
2658 <default>Options All</default>
2659 <contextlist><context>server config</context><context>virtual host</context>
2660 <context>directory</context><context>.htaccess</context>
2661 </contextlist>
2662 <override>Options</override>
2663
2664 <usage>
2665     <p>The <directive>Options</directive> directive controls which
2666     server features are available in a particular directory.</p>
2667
2668     <p><var>option</var> can be set to <code>None</code>, in which
2669     case none of the extra features are enabled, or one or more of
2670     the following:</p>
2671
2672     <dl>
2673       <dt><code>All</code></dt>
2674
2675       <dd>All options except for <code>MultiViews</code>. This is the default
2676       setting.</dd>
2677
2678       <dt><code>ExecCGI</code></dt>
2679
2680       <dd>
2681       Execution of CGI scripts using <module>mod_cgi</module>
2682       is permitted.</dd>
2683
2684       <dt><code>FollowSymLinks</code></dt>
2685
2686       <dd>
2687
2688       The server will follow symbolic links in this directory.
2689       <note>
2690       <p>Even though the server follows the symlink it does <em>not</em>
2691       change the pathname used to match against <directive type="section"
2692       module="core">Directory</directive> sections.</p>
2693       <p>Note also, that this option <strong>gets ignored</strong> if set
2694       inside a <directive type="section" module="core">Location</directive>
2695       section.</p>
2696       <p>Omitting this option should not be considered a security restriction,
2697       since symlink testing is subject to race conditions that make it
2698       circumventable.</p>
2699       </note></dd>
2700
2701       <dt><code>Includes</code></dt>
2702
2703       <dd>
2704       Server-side includes provided by <module>mod_include</module>
2705       are permitted.</dd>
2706
2707       <dt><code>IncludesNOEXEC</code></dt>
2708
2709       <dd>
2710
2711       Server-side includes are permitted, but the <code>#exec
2712       cmd</code> and <code>#exec cgi</code> are disabled. It is still
2713       possible to <code>#include virtual</code> CGI scripts from
2714       <directive module="mod_alias">ScriptAlias</directive>ed
2715       directories.</dd>
2716
2717       <dt><code>Indexes</code></dt>
2718
2719       <dd>
2720       If a URL which maps to a directory is requested, and there
2721       is no <directive module="mod_dir">DirectoryIndex</directive>
2722       (<em>e.g.</em>, <code>index.html</code>) in that directory, then
2723       <module>mod_autoindex</module> will return a formatted listing
2724       of the directory.</dd>
2725
2726       <dt><code>MultiViews</code></dt>
2727
2728       <dd>
2729       <a href="../content-negotiation.html">Content negotiated</a>
2730       "MultiViews" are allowed using
2731       <module>mod_negotiation</module>.</dd>
2732
2733       <dt><code>SymLinksIfOwnerMatch</code></dt>
2734
2735       <dd>The server will only follow symbolic links for which the
2736       target file or directory is owned by the same user id as the
2737       link.
2738
2739       <note><title>Note</title> <p>This option gets ignored if
2740       set inside a <directive module="core"
2741       type="section">Location</directive> section.</p>
2742       <p>This option should not be considered a security restriction,
2743       since symlink testing is subject to race conditions that make it
2744       circumventable.</p></note>
2745       </dd>
2746     </dl>
2747
2748     <p>Normally, if multiple <directive>Options</directive> could
2749     apply to a directory, then the most specific one is used and
2750     others are ignored; the options are not merged. (See <a
2751     href="../sections.html#mergin">how sections are merged</a>.)
2752     However if <em>all</em> the options on the
2753     <directive>Options</directive> directive are preceded by a
2754     <code>+</code> or <code>-</code> symbol, the options are
2755     merged. Any options preceded by a <code>+</code> are added to the
2756     options currently in force, and any options preceded by a
2757     <code>-</code> are removed from the options currently in
2758     force. </p>
2759
2760     <note type="warning"><title>Warning</title>
2761     <p>Mixing <directive>Options</directive> with a <code>+</code> or
2762     <code>-</code> with those without is not valid syntax, and is likely
2763     to cause unexpected results.</p>
2764     </note>
2765
2766     <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
2767
2768     <example>
2769       &lt;Directory /web/docs&gt;<br />
2770       <indent>
2771         Options Indexes FollowSymLinks<br />
2772       </indent>
2773       &lt;/Directory&gt;<br />
2774       <br />
2775       &lt;Directory /web/docs/spec&gt;<br />
2776       <indent>
2777         Options Includes<br />
2778       </indent>
2779       &lt;/Directory&gt;
2780     </example>
2781
2782     <p>then only <code>Includes</code> will be set for the
2783     <code>/web/docs/spec</code> directory. However if the second
2784     <directive>Options</directive> directive uses the <code>+</code> and
2785     <code>-</code> symbols:</p>
2786
2787     <example>
2788       &lt;Directory /web/docs&gt;<br />
2789       <indent>
2790         Options Indexes FollowSymLinks<br />
2791       </indent>
2792       &lt;/Directory&gt;<br />
2793       <br />
2794       &lt;Directory /web/docs/spec&gt;<br />
2795       <indent>
2796         Options +Includes -Indexes<br />
2797       </indent>
2798       &lt;/Directory&gt;
2799     </example>
2800
2801     <p>then the options <code>FollowSymLinks</code> and
2802     <code>Includes</code> are set for the <code>/web/docs/spec</code>
2803     directory.</p>
2804
2805     <note><title>Note</title>
2806       <p>Using <code>-IncludesNOEXEC</code> or
2807       <code>-Includes</code> disables server-side includes completely
2808       regardless of the previous setting.</p>
2809     </note>
2810
2811     <p>The default in the absence of any other settings is
2812     <code>All</code>.</p>
2813 </usage>
2814 </directivesynopsis>
2815
2816 <directivesynopsis>
2817 <name>RLimitCPU</name>
2818 <description>Limits the CPU consumption of processes launched
2819 by Apache httpd children</description>
2820 <syntax>RLimitCPU <var>seconds</var>|max [<var>seconds</var>|max]</syntax>
2821 <default>Unset; uses operating system defaults</default>
2822 <contextlist><context>server config</context><context>virtual host</context>
2823 <context>directory</context><context>.htaccess</context></contextlist>
2824 <override>All</override>
2825
2826 <usage>
2827     <p>Takes 1 or 2 parameters. The first parameter sets the soft
2828     resource limit for all processes and the second parameter sets
2829     the maximum resource limit. Either parameter can be a number,
2830     or <code>max</code> to indicate to the server that the limit should
2831     be set to the maximum allowed by the operating system
2832     configuration. Raising the maximum resource limit requires that
2833     the server is running as <code>root</code>, or in the initial startup
2834     phase.</p>
2835
2836     <p>This applies to processes forked off from Apache httpd children
2837     servicing requests, not the Apache httpd children themselves. This
2838     includes CGI scripts and SSI exec commands, but not any
2839     processes forked off from the Apache httpd parent such as piped
2840     logs.</p>
2841
2842     <p>CPU resource limits are expressed in seconds per
2843     process.</p>
2844 </usage>
2845 <seealso><directive module="core">RLimitMEM</directive></seealso>
2846 <seealso><directive module="core">RLimitNPROC</directive></seealso>
2847 </directivesynopsis>
2848
2849 <directivesynopsis>
2850 <name>RLimitMEM</name>
2851 <description>Limits the memory consumption of processes launched
2852 by Apache httpd children</description>
2853 <syntax>RLimitMEM <var>bytes</var>|max [<var>bytes</var>|max]</syntax>
2854 <default>Unset; uses operating system defaults</default>
2855 <contextlist><context>server config</context><context>virtual host</context>
2856 <context>directory</context><context>.htaccess</context></contextlist>
2857 <override>All</override>
2858
2859 <usage>
2860     <p>Takes 1 or 2 parameters. The first parameter sets the soft
2861     resource limit for all processes and the second parameter sets
2862     the maximum resource limit. Either parameter can be a number,
2863     or <code>max</code> to indicate to the server that the limit should
2864     be set to the maximum allowed by the operating system
2865     configuration. Raising the maximum resource limit requires that
2866     the server is running as <code>root</code>, or in the initial startup
2867     phase.</p>
2868
2869     <p>This applies to processes forked off from Apache httpd children
2870     servicing requests, not the Apache httpd children themselves. This
2871     includes CGI scripts and SSI exec commands, but not any
2872     processes forked off from the Apache httpd parent such as piped
2873     logs.</p>
2874
2875     <p>Memory resource limits are expressed in bytes per
2876     process.</p>
2877 </usage>
2878 <seealso><directive module="core">RLimitCPU</directive></seealso>
2879 <seealso><directive module="core">RLimitNPROC</directive></seealso>
2880 </directivesynopsis>
2881
2882 <directivesynopsis>
2883 <name>RLimitNPROC</name>
2884 <description>Limits the number of processes that can be launched by
2885 processes launched by Apache httpd children</description>
2886 <syntax>RLimitNPROC <var>number</var>|max [<var>number</var>|max]</syntax>
2887 <default>Unset; uses operating system defaults</default>
2888 <contextlist><context>server config</context><context>virtual host</context>
2889 <context>directory</context><context>.htaccess</context></contextlist>
2890 <override>All</override>
2891
2892 <usage>
2893     <p>Takes 1 or 2 parameters. The first parameter sets the soft
2894     resource limit for all processes and the second parameter sets
2895     the maximum resource limit. Either parameter can be a number,
2896     or <code>max</code> to indicate to the server that the limit
2897     should be set to the maximum allowed by the operating system
2898     configuration. Raising the maximum resource limit requires that
2899     the server is running as <code>root</code>, or in the initial startup
2900     phase.</p>
2901
2902     <p>This applies to processes forked off from Apache httpd children
2903     servicing requests, not the Apache httpd children themselves. This
2904     includes CGI scripts and SSI exec commands, but not any
2905     processes forked off from the Apache httpd parent such as piped
2906     logs.</p>
2907
2908     <p>Process limits control the number of processes per user.</p>
2909
2910     <note><title>Note</title>
2911       <p>If CGI processes are <strong>not</strong> running
2912       under user ids other than the web server user id, this directive
2913       will limit the number of processes that the server itself can
2914       create. Evidence of this situation will be indicated by
2915       <strong><code>cannot fork</code></strong> messages in the
2916       <code>error_log</code>.</p>
2917     </note>
2918 </usage>
2919 <seealso><directive module="core">RLimitMEM</directive></seealso>
2920 <seealso><directive module="core">RLimitCPU</directive></seealso>
2921 </directivesynopsis>
2922
2923 <directivesynopsis>
2924 <name>ScriptInterpreterSource</name>
2925 <description>Technique for locating the interpreter for CGI
2926 scripts</description>
2927 <syntax>ScriptInterpreterSource Registry|Registry-Strict|Script</syntax>
2928 <default>ScriptInterpreterSource Script</default>
2929 <contextlist><context>server config</context><context>virtual host</context>
2930 <context>directory</context><context>.htaccess</context></contextlist>
2931 <override>FileInfo</override>
2932 <compatibility>Win32 only;
2933 option <code>Registry-Strict</code> is available in Apache HTTP Server 2.0 and
2934 later</compatibility>
2935
2936 <usage>
2937     <p>This directive is used to control how Apache httpd finds the
2938     interpreter used to run CGI scripts. The default setting is
2939     <code>Script</code>. This causes Apache httpd to use the interpreter pointed to
2940     by the shebang line (first line, starting with <code>#!</code>) in the
2941     script. On Win32 systems this line usually looks like:</p>
2942
2943     <example>
2944       #!C:/Perl/bin/perl.exe
2945     </example>
2946
2947     <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
2948
2949     <example>
2950       #!perl
2951     </example>
2952
2953     <p>Setting <code>ScriptInterpreterSource Registry</code> will
2954     cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
2955     searched using the script file extension (e.g., <code>.pl</code>) as a
2956     search key. The command defined by the registry subkey
2957     <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
2958     <code>Shell\Open\Command</code> is used to open the script file. If the
2959     registry keys cannot be found, Apache httpd falls back to the behavior of the
2960     <code>Script</code> option.</p>
2961
2962     <note type="warning"><title>Security</title>
2963     <p>Be careful when using <code>ScriptInterpreterSource
2964     Registry</code> with <directive
2965     module="mod_alias">ScriptAlias</directive>'ed directories, because
2966     Apache httpd will try to execute <strong>every</strong> file within this
2967     directory. The <code>Registry</code> setting may cause undesired
2968     program calls on files which are typically not executed. For
2969     example, the default open command on <code>.htm</code> files on
2970     most Windows systems will execute Microsoft Internet Explorer, so
2971     any HTTP request for an <code>.htm</code> file existing within the
2972     script directory would start the browser in the background on the
2973     server. This is a good way to crash your system within a minute or
2974     so.</p>
2975     </note>
2976
2977     <p>The option <code>Registry-Strict</code> which is new in Apache HTTP Server
2978     2.0 does the same thing as <code>Registry</code> but uses only the
2979     subkey <code>Shell\ExecCGI\Command</code>. The
2980     <code>ExecCGI</code> key is not a common one. It must be
2981     configured manually in the windows registry and hence prevents
2982     accidental program calls on your system.</p>
2983 </usage>
2984 </directivesynopsis>
2985
2986 <directivesynopsis>
2987 <name>SeeRequestTail</name>
2988 <description>Determine if mod_status displays the first 63 characters
2989 of a request or the last 63, assuming the request itself is greater than
2990 63 chars.</description>
2991 <syntax>SeeRequestTail On|Off</syntax>
2992 <default>SeeRequestTail Off</default>
2993 <contextlist><context>server config</context></contextlist>
2994 <compatibility>Available in Apache httpd 2.2.7 and later.</compatibility>
2995
2996 <usage>
2997     <p>mod_status with <code>ExtendedStatus On</code>
2998     displays the actual request being handled. 
2999     For historical purposes, only 63 characters of the request
3000     are actually stored for display purposes. This directive
3001     controls whether the 1st 63 characters are stored (the previous
3002     behavior and the default) or if the last 63 characters are. This
3003     is only applicable, of course, if the length of the request is
3004     64 characters or greater.</p>
3005
3006     <p>If Apache httpd is handling <code
3007     >GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</code
3008     > mod_status displays as follows:
3009     </p>
3010
3011     <table border="1">
3012       <tr>
3013         <th>Off (default)</th>
3014         <td>GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples</td>
3015       </tr>
3016       <tr>
3017         <th>On</th>
3018         <td>orage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</td>
3019       </tr>
3020     </table>
3021
3022 </usage>
3023 </directivesynopsis>
3024
3025 <directivesynopsis>
3026 <name>ServerAdmin</name>
3027 <description>Email address that the server includes in error
3028 messages sent to the client</description>
3029 <syntax>ServerAdmin <var>email-address</var>|<var>URL</var></syntax>
3030 <contextlist><context>server config</context><context>virtual host</context>
3031 </contextlist>
3032
3033 <usage>
3034     <p>The <directive>ServerAdmin</directive> sets the contact address
3035     that the server includes in any error messages it returns to the
3036     client. If the <code>httpd</code> doesn't recognize the supplied argument
3037     as an URL, it
3038     assumes, that it's an <var>email-address</var> and prepends it with
3039     <code>mailto:</code> in hyperlink targets. However, it's recommended to
3040     actually use an email address, since there are a lot of CGI scripts that
3041     make that assumption. If you want to use an URL, it should point to another
3042     server under your control. Otherwise users may not be able to contact you in
3043     case of errors.</p>
3044
3045     <p>It may be worth setting up a dedicated address for this, e.g.</p>
3046
3047     <example>
3048       ServerAdmin www-admin@foo.example.com
3049     </example>
3050     <p>as users do not always mention that they are talking about the
3051     server!</p>
3052 </usage>
3053 </directivesynopsis>
3054
3055 <directivesynopsis>
3056 <name>ServerAlias</name>
3057 <description>Alternate names for a host used when matching requests
3058 to name-virtual hosts</description>
3059 <syntax>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</syntax>
3060 <contextlist><context>virtual host</context></contextlist>
3061
3062 <usage>
3063     <p>The <directive>ServerAlias</directive> directive sets the
3064     alternate names for a host, for use with <a
3065     href="../vhosts/name-based.html">name-based virtual hosts</a>. The
3066     <directive>ServerAlias</directive> may include wildcards, if appropriate.</p>
3067
3068     <example>
3069       &lt;VirtualHost *:80&gt;<br />
3070       ServerName server.domain.com<br />
3071       ServerAlias server server2.domain.com server2<br />
3072       ServerAlias *.example.com<br />
3073       # ...<br />
3074       &lt;/VirtualHost&gt;
3075     </example>
3076 </usage>
3077 <seealso><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></seealso>
3078 </directivesynopsis>
3079
3080 <directivesynopsis>
3081 <name>ServerName</name>
3082 <description>Hostname and port that the server uses to identify
3083 itself</description>
3084 <syntax>ServerName [<var>scheme</var>://]<var>fully-qualified-domain-name</var>[:<var>port</var>]</syntax>
3085 <contextlist><context>server config</context><context>virtual host</context>
3086 </contextlist>
3087 <compatibility>In version 2.0, this
3088      directive supersedes the functionality of the <directive>Port</directive>
3089      directive from version 1.3.</compatibility>
3090
3091 <usage>
3092     <p>The <directive>ServerName</directive> directive sets the
3093     request scheme, hostname and
3094     port that the server uses to identify itself.  This is used when
3095     creating redirection URLs. For example, if the name of the
3096     machine hosting the web server is <code>simple.example.com</code>,
3097     but the machine also has the DNS alias <code>www.example.com</code>
3098     and you wish the web server to be so identified, the following
3099     directive should be used:</p>
3100
3101     <example>
3102       ServerName www.example.com:80
3103     </example>
3104
3105     <p>If no <directive>ServerName</directive> is specified, then the
3106     server attempts to deduce the hostname by performing a reverse
3107     lookup on the IP address. If no port is specified in the
3108     <directive>ServerName</directive>, then the server will use the
3109     port from the incoming request. For optimal reliability and
3110     predictability, you should specify an explicit hostname and port
3111     using the <directive>ServerName</directive> directive.</p>
3112
3113     <p>If you are using <a
3114     href="../vhosts/name-based.html">name-based virtual hosts</a>,
3115     the <directive>ServerName</directive> inside a
3116     <directive type="section" module="core">VirtualHost</directive>
3117     section specifies what hostname must appear in the request's
3118     <code>Host:</code> header to match this virtual host.</p>
3119
3120
3121     <p>Sometimes, the server runs behind a device that processes SSL,
3122     such as a reverse proxy, load balancer or SSL offload
3123     appliance. When this is the case, specify the
3124     <code>https://</code> scheme and the port number to which the
3125     clients connect in the <directive>ServerName</directive> directive
3126     to make sure that the server generates the correct
3127     self-referential URLs. 
3128     </p>
3129
3130     <p>See the description of the
3131     <directive module="core">UseCanonicalName</directive> and
3132     <directive module="core">UseCanonicalPhysicalPort</directive> directives for
3133     settings which determine whether self-referential URLs (e.g., by the
3134     <module>mod_dir</module> module) will refer to the
3135     specified port, or to the port number given in the client's request.
3136     </p>
3137
3138 </usage>
3139
3140 <seealso><a href="../dns-caveats.html">Issues Regarding DNS and
3141     Apache HTTP Server</a></seealso>
3142 <seealso><a href="../vhosts/">Apache HTTP Server virtual host
3143     documentation</a></seealso>
3144 <seealso><directive module="core">UseCanonicalName</directive></seealso>
3145 <seealso><directive module="core">UseCanonicalPhysicalPort</directive></seealso>
3146 <seealso><directive module="core">NameVirtualHost</directive></seealso>
3147 <seealso><directive module="core">ServerAlias</directive></seealso>
3148 </directivesynopsis>
3149
3150 <directivesynopsis>
3151 <name>ServerPath</name>
3152 <description>Legacy URL pathname for a name-based virtual host that
3153 is accessed by an incompatible browser</description>
3154 <syntax>ServerPath <var>URL-path</var></syntax>
3155 <contextlist><context>virtual host</context></contextlist>
3156
3157 <usage>
3158     <p>The <directive>ServerPath</directive> directive sets the legacy
3159     URL pathname for a host, for use with <a
3160     href="../vhosts/">name-based virtual hosts</a>.</p>
3161 </usage>
3162 <seealso><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></seealso>
3163 </directivesynopsis>
3164
3165 <directivesynopsis>
3166 <name>ServerRoot</name>
3167 <description>Base directory for the server installation</description>
3168 <syntax>ServerRoot <var>directory-path</var></syntax>
3169 <default>ServerRoot /usr/local/apache</default>
3170 <contextlist><context>server config</context></contextlist>
3171
3172 <usage>
3173     <p>The <directive>ServerRoot</directive> directive sets the
3174     directory in which the server lives. Typically it will contain the
3175     subdirectories <code>conf/</code> and <code>logs/</code>. Relative
3176     paths in other configuration directives (such as <directive
3177     module="core">Include</directive> or <directive
3178     module="mod_so">LoadModule</directive>, for example) are taken as 
3179     relative to this directory.</p>
3180
3181     <example><title>Example</title>
3182       ServerRoot /home/httpd
3183     </example>
3184
3185 </usage>
3186 <seealso><a href="../invoking.html">the <code>-d</code>
3187     option to <code>httpd</code></a></seealso>
3188 <seealso><a href="../misc/security_tips.html#serverroot">the
3189     security tips</a> for information on how to properly set
3190     permissions on the <directive>ServerRoot</directive></seealso>
3191 </directivesynopsis>
3192
3193 <directivesynopsis>
3194 <name>ServerSignature</name>
3195 <description>Configures the footer on server-generated documents</description>
3196 <syntax>ServerSignature On|Off|EMail</syntax>
3197 <default>ServerSignature Off</default>
3198 <contextlist><context>server config</context><context>virtual host</context>
3199 <context>directory</context><context>.htaccess</context>
3200 </contextlist>
3201 <override>All</override>
3202
3203 <usage>
3204     <p>The <directive>ServerSignature</directive> directive allows the
3205     configuration of a trailing footer line under server-generated
3206     documents (error messages, <module>mod_proxy</module> ftp directory
3207     listings, <module>mod_info</module> output, ...). The reason why you
3208     would want to enable such a footer line is that in a chain of proxies,
3209     the user often has no possibility to tell which of the chained servers
3210     actually produced a returned error message.</p>
3211
3212     <p>The <code>Off</code>
3213     setting, which is the default, suppresses the footer line (and is
3214     therefore compatible with the behavior of Apache-1.2 and
3215     below). The <code>On</code> setting simply adds a line with the
3216     server version number and <directive
3217     module="core">ServerName</directive> of the serving virtual host,
3218     and the <code>EMail</code> setting additionally creates a
3219     "mailto:" reference to the <directive
3220     module="core">ServerAdmin</directive> of the referenced
3221     document.</p>
3222
3223     <p>After version 2.0.44, the details of the server version number
3224     presented are controlled by the <directive
3225     module="core">ServerTokens</directive> directive.</p>
3226 </usage>
3227 <seealso><directive module="core">ServerTokens</directive></seealso>
3228 </directivesynopsis>
3229
3230 <directivesynopsis>
3231 <name>ServerTokens</name>
3232 <description>Configures the <code>Server</code> HTTP response
3233 header</description>
3234 <syntax>ServerTokens Major|Minor|Min[imal]|Prod[uctOnly]|OS|Full</syntax>
3235 <default>ServerTokens Full</default>
3236 <contextlist><context>server config</context></contextlist>
3237
3238 <usage>
3239     <p>This directive controls whether <code>Server</code> response
3240     header field which is sent back to clients includes a
3241     description of the generic OS-type of the server as well as
3242     information about compiled-in modules.</p>
3243
3244     <dl>
3245       <dt><code>ServerTokens Full</code> (or not specified)</dt>
3246
3247       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3248       (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
3249
3250       <dt><code>ServerTokens Prod[uctOnly]</code></dt>
3251
3252       <dd>Server sends (<em>e.g.</em>): <code>Server:
3253       Apache</code></dd>
3254
3255       <dt><code>ServerTokens Major</code></dt>
3256
3257       <dd>Server sends (<em>e.g.</em>): <code>Server:
3258       Apache/2</code></dd>
3259
3260       <dt><code>ServerTokens Minor</code></dt>
3261
3262       <dd>Server sends (<em>e.g.</em>): <code>Server:
3263       Apache/2.4</code></dd>
3264
3265       <dt><code>ServerTokens Min[imal]</code></dt>
3266
3267       <dd>Server sends (<em>e.g.</em>): <code>Server:
3268       Apache/2.4.1</code></dd>
3269
3270       <dt><code>ServerTokens OS</code></dt>
3271
3272       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3273       (Unix)</code></dd>
3274
3275     </dl>
3276
3277     <p>This setting applies to the entire server, and cannot be
3278     enabled or disabled on a virtualhost-by-virtualhost basis.</p>
3279
3280     <p>After version 2.0.44, this directive also controls the
3281     information presented by the <directive
3282     module="core">ServerSignature</directive> directive.</p>
3283     
3284     <note>Setting <directive>ServerTokens</directive> to less than
3285     <code>minimal</code> is not recommended because it makes it more
3286     difficult to debug interoperational problems. Also note that
3287     disabling the Server: header does nothing at all to make your
3288     server more secure; the idea of "security through obscurity"
3289     is a myth and leads to a false sense of safety.</note>
3290
3291 </usage>
3292 <seealso><directive module="core">ServerSignature</directive></seealso>
3293 </directivesynopsis>
3294
3295 <directivesynopsis>
3296 <name>SetHandler</name>
3297 <description>Forces all matching files to be processed by a
3298 handler</description>
3299 <syntax>SetHandler <var>handler-name</var>|None</syntax>
3300 <contextlist><context>server config</context><context>virtual host</context>
3301 <context>directory</context><context>.htaccess</context>
3302 </contextlist>
3303 <override>FileInfo</override>
3304 <compatibility>Moved into the core in Apache httpd 2.0</compatibility>
3305
3306 <usage>
3307     <p>When placed into an <code>.htaccess</code> file or a
3308     <directive type="section" module="core">Directory</directive> or
3309     <directive type="section" module="core">Location</directive>
3310     section, this directive forces all matching files to be parsed
3311     through the <a href="../handler.html">handler</a> given by
3312     <var>handler-name</var>. For example, if you had a directory you
3313     wanted to be parsed entirely as imagemap rule files, regardless
3314     of extension, you might put the following into an
3315     <code>.htaccess</code> file in that directory:</p>
3316
3317     <example>
3318       SetHandler imap-file
3319     </example>
3320
3321     <p>Another example: if you wanted to have the server display a
3322     status report whenever a URL of
3323     <code>http://servername/status</code> was called, you might put
3324     the following into <code>httpd.conf</code>:</p>
3325
3326     <example>
3327       &lt;Location /status&gt;<br />
3328       <indent>
3329         SetHandler server-status<br />
3330       </indent>
3331       &lt;/Location&gt;
3332     </example>
3333
3334     <p>You can override an earlier defined <directive>SetHandler</directive>
3335     directive by using the value <code>None</code>.</p>
3336     <p><strong>Note:</strong> because SetHandler overrides default handlers,
3337     normal behaviour such as handling of URLs ending in a slash (/) as
3338     directories or index files is suppressed.</p>
3339 </usage>
3340
3341 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
3342
3343 </directivesynopsis>
3344
3345 <directivesynopsis>
3346 <name>SetInputFilter</name>
3347 <description>Sets the filters that will process client requests and POST
3348 input</description>
3349 <syntax>SetInputFilter <var>filter</var>[;<var>filter</var>...]</syntax>
3350 <contextlist><context>server config</context><context>virtual host</context>
3351 <context>directory</context><context>.htaccess</context>
3352 </contextlist>
3353 <override>FileInfo</override>
3354
3355 <usage>
3356     <p>The <directive>SetInputFilter</directive> directive sets the
3357     filter or filters which will process client requests and POST
3358     input when they are received by the server. This is in addition to
3359     any filters defined elsewhere, including the
3360     <directive module="mod_mime">AddInputFilter</directive>
3361     directive.</p>
3362
3363     <p>If more than one filter is specified, they must be separated
3364     by semicolons in the order in which they should process the
3365     content.</p>
3366 </usage>
3367 <seealso><a href="../filter.html">Filters</a> documentation</seealso>
3368 </directivesynopsis>
3369
3370 <directivesynopsis>
3371 <name>SetOutputFilter</name>
3372 <description>Sets the filters that will process responses from the
3373 server</description>
3374 <syntax>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</syntax>
3375 <contextlist><context>server config</context><context>virtual host</context>
3376 <context>directory</context><context>.htaccess</context>
3377 </contextlist>
3378 <override>FileInfo</override>
3379
3380 <usage>
3381     <p>The <directive>SetOutputFilter</directive> directive sets the filters
3382     which will process responses from the server before they are
3383     sent to the client. This is in addition to any filters defined
3384     elsewhere, including the
3385     <directive module="mod_mime">AddOutputFilter</directive>
3386     directive.</p>
3387
3388     <p>For example, the following configuration will process all files
3389     in the <code>/www/data/</code> directory for server-side
3390     includes.</p>
3391
3392     <example>
3393       &lt;Directory /www/data/&gt;<br />
3394       <indent>
3395         SetOutputFilter INCLUDES<br />
3396       </indent>
3397       &lt;/Directory&gt;
3398     </example>
3399
3400     <p>If more than one filter is specified, they must be separated
3401     by semicolons in the order in which they should process the
3402     content.</p>
3403 </usage>
3404 <seealso><a href="../filter.html">Filters</a> documentation</seealso>
3405 </directivesynopsis>
3406
3407 <directivesynopsis>
3408 <name>TimeOut</name>
3409 <description>Amount of time the server will wait for
3410 certain events before failing a request</description>
3411 <syntax>TimeOut <var>seconds</var></syntax>
3412 <default>TimeOut 300</default>
3413 <contextlist><context>server config</context><context>virtual host</context></contextlist>
3414
3415 <usage>
3416     <p>The <directive>TimeOut</directive> directive defines the length
3417     of time Apache httpd will wait for I/O in various circumstances:</p>
3418
3419     <ol>
3420       <li>When reading data from the client, the length of time to
3421       wait for a TCP packet to arrive if the read buffer is
3422       empty.</li>
3423
3424       <li>When writing data to the client, the length of time to wait
3425       for an acknowledgement of a packet if the send buffer is
3426       full.</li>
3427
3428       <li>In <module>mod_cgi</module>, the length of time to wait for
3429       output from a CGI script.</li>
3430
3431       <li>In <module>mod_ext_filter</module>, the length of time to
3432       wait for output from a filtering process.</li>
3433
3434       <li>In <module>mod_proxy</module>, the default timeout value if
3435       <directive module="mod_proxy">ProxyTimeout</directive> is not
3436       configured.</li>
3437     </ol>
3438
3439 </usage>
3440 </directivesynopsis>
3441
3442 <directivesynopsis>
3443 <name>TraceEnable</name>
3444 <description>Determines the behaviour on <code>TRACE</code>
3445 requests</description>
3446 <syntax>TraceEnable <var>[on|off|extended]</var></syntax>
3447 <default>TraceEnable on</default>
3448 <contextlist><context>server config</context></contextlist>
3449 <compatibility>Available in Apache HTTP Server 1.3.34, 2.0.55 and later</compatibility>
3450
3451 <usage>
3452     <p>This directive overrides the behavior of <code>TRACE</code> for both
3453     the core server and <module>mod_proxy</module>.  The default
3454     <code>TraceEnable on</code> permits <code>TRACE</code> requests per
3455     RFC 2616, which disallows any request body to accompany the request.
3456     <code>TraceEnable off</code> causes the core server and
3457     <module>mod_proxy</module> to return a <code>405</code> (Method not
3458     allowed) error to the client.</p>
3459
3460     <p>Finally, for testing and diagnostic purposes only, request
3461     bodies may be allowed using the non-compliant <code>TraceEnable 
3462     extended</code> directive.  The core (as an origin server) will
3463     restrict the request body to 64k (plus 8k for chunk headers if
3464     <code>Transfer-Encoding: chunked</code> is used).  The core will
3465     reflect the full headers and all chunk headers with the response
3466     body.  As a proxy server, the request body is not restricted to 64k.</p>
3467 </usage>
3468 </directivesynopsis>
3469
3470 <directivesynopsis>
3471 <name>UnDefine</name>
3472 <description>Undefine the existence of a variable</description>
3473 <syntax>UnDefine <var>parameter-name</var></syntax>
3474 <contextlist><context>server config</context></contextlist>
3475
3476 <usage>
3477     <p>Undoes the effect of a <directive module="core">Define</directive> or
3478     of passing a <code>-D</code> argument to <program>httpd</program>.</p>
3479     <p>This directive can be used to toggle the use of <directive module="core"
3480     type="section">IfDefine</directive> sections without needing to alter
3481     <code>-D</code> arguments in any startup scripts.</p>
3482 </usage>
3483 </directivesynopsis>
3484
3485 <directivesynopsis>
3486 <name>UseCanonicalName</name>
3487 <description>Configures how the server determines its own name and
3488 port</description>
3489 <syntax>UseCanonicalName On|Off|DNS</syntax>
3490 <default>UseCanonicalName Off</default>
3491 <contextlist><context>server config</context><context>virtual host</context>
3492 <context>directory</context></contextlist>
3493
3494 <usage>
3495     <p>In many situations Apache httpd must construct a <em>self-referential</em>
3496     URL -- that is, a URL that refers back to the same server. With
3497     <code>UseCanonicalName On</code> Apache httpd will use the hostname and port
3498     specified in the <directive module="core">ServerName</directive>
3499     directive to construct the canonical name for the server. This name
3500     is used in all self-referential URLs, and for the values of
3501     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
3502
3503     <p>With <code>UseCanonicalName Off</code> Apache httpd will form
3504     self-referential URLs using the hostname and port supplied by
3505     the client if any are supplied (otherwise it will use the
3506     canonical name, as defined above). These values are the same
3507     that are used to implement <a
3508     href="../vhosts/name-based.html">name-based virtual hosts</a>,
3509     and are available with the same clients. The CGI variables
3510     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
3511     constructed from the client supplied values as well.</p>
3512
3513     <p>An example where this may be useful is on an intranet server
3514     where you have users connecting to the machine using short
3515     names such as <code>www</code>. You'll notice that if the users
3516     type a shortname, and a URL which is a directory, such as
3517     <code>http://www/splat</code>, <em>without the trailing
3518     slash</em> then Apache httpd will redirect them to
3519     <code>http://www.domain.com/splat/</code>. If you have
3520     authentication enabled, this will cause the user to have to
3521     authenticate twice (once for <code>www</code> and once again
3522     for <code>www.domain.com</code> -- see <a
3523     href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
3524     FAQ on this subject for more information</a>). But if
3525     <directive>UseCanonicalName</directive> is set <code>Off</code>, then
3526     Apache httpd will redirect to <code>http://www/splat/</code>.</p>
3527
3528     <p>There is a third option, <code>UseCanonicalName DNS</code>,
3529     which is intended for use with mass IP-based virtual hosting to
3530     support ancient clients that do not provide a
3531     <code>Host:</code> header. With this option Apache httpd does a
3532     reverse DNS lookup on the server IP address that the client
3533     connected to in order to work out self-referential URLs.</p>
3534
3535     <note type="warning"><title>Warning</title>
3536     <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
3537     they may be broken by this option. The client is essentially free
3538     to give whatever value they want as a hostname. But if the CGI is
3539     only using <code>SERVER_NAME</code> to construct self-referential URLs
3540     then it should be just fine.</p>
3541     </note>
3542 </usage>
3543 <seealso><directive module="core">UseCanonicalPhysicalPort</directive></seealso>
3544 <seealso><directive module="core">ServerName</directive></seealso>
3545 <seealso><directive module="mpm_common">Listen</directive></seealso>
3546 </directivesynopsis>
3547
3548 <directivesynopsis>
3549 <name>UseCanonicalPhysicalPort</name>
3550 <description>Configures how the server determines its own name and
3551 port</description>
3552 <syntax>UseCanonicalPhysicalPort On|Off</syntax>
3553 <default>UseCanonicalPhysicalPort Off</default>
3554 <contextlist><context>server config</context><context>virtual host</context>
3555 <context>directory</context></contextlist>
3556
3557 <usage>
3558     <p>In many situations Apache httpd must construct a <em>self-referential</em>
3559     URL -- that is, a URL that refers back to the same server. With
3560     <code>UseCanonicalPhysicalPort On</code> Apache httpd will, when
3561     constructing the canonical port for the server to honor
3562     the <directive module="core">UseCanonicalName</directive> directive,
3563     provide the actual physical port number being used by this request
3564     as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
3565     Apache httpd will not ever use the actual physical port number, instead
3566     relying on all configured information to construct a valid port number.</p>
3567
3568     <note><title>Note</title>
3569     <p>The ordering of when the physical port is used is as follows:<br /><br />
3570      <code>UseCanonicalName On</code></p>
3571      <ul>
3572       <li>Port provided in <code>Servername</code></li>
3573       <li>Physical port</li>
3574       <li>Default port</li>
3575      </ul>
3576      <code>UseCanonicalName Off | DNS</code>
3577      <ul>
3578       <li>Parsed port from <code>Host:</code> header</li>
3579       <li>Physical port</li>
3580       <li>Port provided in <code>Servername</code></li>
3581       <li>Default port</li>
3582      </ul>
3583     
3584     <p>With <code>UseCanonicalPhysicalPort Off</code>, the
3585     physical ports are removed from the ordering.</p>
3586     </note>
3587
3588 </usage>
3589 <seealso><directive module="core">UseCanonicalName</directive></seealso>
3590 <seealso><directive module="core">ServerName</directive></seealso>
3591 <seealso><directive module="mpm_common">Listen</directive></seealso>
3592 </directivesynopsis>
3593
3594 <directivesynopsis type="section">
3595 <name>VirtualHost</name>
3596 <description>Contains directives that apply only to a specific
3597 hostname or IP address</description>
3598 <syntax>&lt;VirtualHost
3599     <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
3600     ...&gt; ... &lt;/VirtualHost&gt;</syntax>
3601 <contextlist><context>server config</context></contextlist>
3602
3603 <usage>
3604     <p><directive type="section">VirtualHost</directive> and
3605     <code>&lt;/VirtualHost&gt;</code> are used to enclose a group of
3606     directives that will apply only to a particular virtual host. Any
3607     directive that is allowed in a virtual host context may be
3608     used. When the server receives a request for a document on a
3609     particular virtual host, it uses the configuration directives
3610     enclosed in the <directive type="section">VirtualHost</directive>
3611     section. <var>Addr</var> can be:</p>
3612
3613     <ul>
3614       <li>The IP address of the virtual host;</li>
3615
3616       <li>A fully qualified domain name for the IP address of the
3617       virtual host (not recommended);</li>
3618
3619       <li>The character <code>*</code>, which is used only in combination with
3620       <code>NameVirtualHost *</code> to match all IP addresses; or</li>
3621
3622       <li>The string <code>_default_</code>, which is used only
3623       with IP virtual hosting to catch unmatched IP addresses.</li>
3624     </ul>
3625
3626     <example><title>Example</title>
3627       &lt;VirtualHost 10.1.2.3&gt;<br />
3628       <indent>
3629         ServerAdmin webmaster@host.example.com<br />
3630         DocumentRoot /www/docs/host.example.com<br />
3631         ServerName host.example.com<br />
3632         ErrorLog logs/host.example.com-error_log<br />
3633         TransferLog logs/host.example.com-access_log<br />
3634       </indent>
3635       &lt;/VirtualHost&gt;
3636     </example>
3637
3638
3639     <p>IPv6 addresses must be specified in square brackets because
3640     the optional port number could not be determined otherwise.  An
3641     IPv6 example is shown below:</p>
3642
3643     <example>
3644       &lt;VirtualHost [2001:db8::a00:20ff:fea7:ccea]&gt;<br />
3645       <indent>
3646         ServerAdmin webmaster@host.example.com<br />
3647         DocumentRoot /www/docs/host.example.com<br />
3648         ServerName host.example.com<br />
3649         ErrorLog logs/host.example.com-error_log<br />
3650         TransferLog logs/host.example.com-access_log<br />
3651       </indent>
3652       &lt;/VirtualHost&gt;
3653     </example>
3654
3655     <p>Each Virtual Host must correspond to a different IP address,
3656     different port number or a different host name for the server,
3657     in the former case the server machine must be configured to
3658     accept IP packets for multiple addresses. (If the machine does
3659     not have multiple network interfaces, then this can be
3660     accomplished with the <code>ifconfig alias</code> command -- if
3661     your OS supports it).</p>
3662
3663     <note><title>Note</title>
3664     <p>The use of <directive type="section">VirtualHost</directive> does
3665     <strong>not</strong> affect what addresses Apache httpd listens on. You
3666     may need to ensure that Apache httpd is listening on the correct addresses
3667     using <directive module="mpm_common">Listen</directive>.</p>
3668     </note>
3669
3670     <p>When using IP-based virtual hosting, the special name
3671     <code>_default_</code> can be specified in
3672     which case this virtual host will match any IP address that is
3673     not explicitly listed in another virtual host. In the absence
3674     of any <code>_default_</code> virtual host the "main" server config,
3675     consisting of all those definitions outside any VirtualHost
3676     section, is used when no IP-match occurs.</p>
3677
3678     <p>You can specify a <code>:port</code> to change the port that is
3679     matched. If unspecified then it defaults to the same port as the
3680     most recent <directive module="mpm_common">Listen</directive>
3681     statement of the main server. You may also specify <code>:*</code>
3682     to match all ports on that address. (This is recommended when used
3683     with <code>_default_</code>.)</p>
3684
3685     <p>A <directive module="core">ServerName</directive> should be
3686     specified inside each <directive
3687     type="section">VirtualHost</directive> block. If it is absent, the
3688     <directive module="core">ServerName</directive> from the "main"
3689     server configuration will be inherited.</p>
3690
3691     <note type="warning"><title>Security</title>
3692     <p>See the <a href="../misc/security_tips.html">security tips</a>
3693     document for details on why your security could be compromised if the
3694     directory where log files are stored is writable by anyone other
3695     than the user that starts the server.</p>
3696     </note>
3697 </usage>
3698 <seealso><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></seealso>
3699 <seealso><a href="../dns-caveats.html">Issues Regarding DNS and
3700     Apache HTTP Server</a></seealso>
3701 <seealso><a href="../bind.html">Setting
3702     which addresses and ports Apache HTTP Server uses</a></seealso>
3703 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
3704     and &lt;Files&gt; sections work</a> for an explanation of how these
3705     different sections are combined when a request is received</seealso>
3706 </directivesynopsis>
3707
3708 </modulesynopsis>