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