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