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