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