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