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