]> granicus.if.org Git - apache/blob - docs/manual/mod/core.xml.es
rebuild docs
[apache] / docs / manual / mod / core.xml.es
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- English Revision: 1040494:1590310 (outdated) -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="core.xml.meta">
24
25 <name>core</name>
26 <description>Funcionalides b&#225;sicas del Servidor HTTP Apache que siempre est&#225;n presentes.</description>
27 <status>Core</status>
28
29 <directivesynopsis>
30 <name>AcceptFilter</name>
31 <description>Configura mejoras para un Protocolo de Escucha de Sockets</description>
32 <syntax>AcceptFilter <var>protocol</var> <var>accept_filter</var></syntax>
33 <contextlist><context>server config</context></contextlist>
34 <compatibility>Disponible en Apache httpd 2.1.5 y posteriores.
35 En Windows desde Apache httpd 2.3.3 y posteriores.</compatibility>
36
37 <usage>
38     <p>Esta directiva hace posible mejoras espec&#237;ficas a nivel de sistema operativo
39        y a trav&#233;s del tipo de Protocolo para un socket que escucha.
40        La premisa b&#225;sica es que el kernel no env&#237;e un socket al servidor
41        hasta que o bien los datos se hayan recibido o bien se haya almacenado
42        en el buffer una Respuesta HTTP completa.  
43        Actualmente s&#243;lo est&#225;n soportados
44        <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&amp;sektion=9">
45        Accept Filters</a> sobre FreeBSD, <code>TCP_DEFER_ACCEPT</code> sobre Linux, 
46        y AcceptEx() sobre Windows.</p>
47
48     <p>El uso de <code>none</code> para un argumento desactiva cualquier filtro 
49        aceptado para ese protocolo. Esto es &#250;til para protocolos que requieren que un
50        servidor env&#237;e datos primeros, tales como <code>ftp:</code> o <code>nntp</code>:</p>
51     <example>AcceptFilter nntp none</example>
52
53     <p>Los nombres de protocolo por defecto son <code>https</code> para el puerto 443
54        y <code>http</code> para todos los dem&#225;s puertos. Para especificar que se est&#225;
55        utilizando otro protocolo con un puerto escuchando, a&#241;ade el argumento <var>protocol</var>
56        a la directiva <directive module="mpm_common">Listen</directive>.</p>
57
58     <p>Sobre FreeBDS los valores por defecto:</p>
59     <example>
60         AcceptFilter http httpready <br/>
61         AcceptFilter https dataready
62     </example>
63     
64     <p>El filtro <code>httpready</code> almacena en el buffer peticiones HTTP completas
65        a nivel de kernel.  Una vez que la petici&#243;n es recibida, el kernel la env&#237;a al servidor. 
66        Consulta la p&#225;gina man de
67        <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&amp;sektion=9">
68        accf_http(9)</a> para m&#225;s detalles.  Puesto que las peticiones HTTPS
69        est&#225;n encriptadas, s&#243;lo se utiliza el filtro
70        <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&amp;sektion=9">accf_data(9)</a>.</p>
71
72     <p>Sobre Linux los valores por defecto son:</p>
73     <example>
74         AcceptFilter http data <br/>
75         AcceptFilter https data
76     </example>
77
78     <p>En Linux, <code>TCP_DEFER_ACCEPT</code> no soporta el buffering en peticiones http.
79        Cualquier valor adem&#225;s de <code>none</code> habilitar&#225; 
80        <code>TCP_DEFER_ACCEPT</code> en ese socket. Para m&#225;s detalles 
81        ver la p&#225;gina man de Linux 
82        <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
83        tcp(7)</a>.</p>
84
85     <p>Sobre Windows los valores por defecto son:</p>
86     <example>
87         AcceptFilter http data <br/>
88         AcceptFilter https data
89     </example>
90
91     <p>Sobre Windows mpm_winnt interpreta el argumento AcceptFilter para conmutar la API
92        AcceptEx(), y no soporta el buffering sobre el protocolo http.  Hay dos valores
93        que utilizan la API Windows AcceptEx() y que recuperan sockets de red
94        entre conexciones.  <code>data</code> espera hasta que los datos han sido
95        transmitidos como se comentaba anteriormente, y el buffer inicial de datos y las
96        direcciones de red son recuperadas a partir de una &#250;nica llamada AcceptEx().
97        <code>connect</code> utiliza la API AcceptEx() API, y recupera tambi&#233;n
98        las direcciones de red, pero a diferencia de <code>none</code> 
99        la opci&#243;n <code>connect</code> no espera a la transmisi&#243;n inicial de los datos.</p>
100
101     <p>Sobre Windows, <code>none</code> prefiere accept() antes que AcceptEx()
102        y no recuperar&#225; sockets entre las conexiones.  Lo que es &#250;til para los adaptadores de
103        red con un soporte precario de drivers, as&#237; como para algunos proveedores de red
104        tales como drivers vpn, o filtros de spam, de virus o de spyware.</p>  
105
106 </usage>
107 <seealso><directive>Protocol</directive></seealso>
108 </directivesynopsis>
109
110 <directivesynopsis>
111 <name>AcceptPathInfo</name>
112 <description>Los recursos aceptan informaci&#243;n sobre su ruta</description>
113 <syntax>AcceptPathInfo On|Off|Default</syntax>
114 <default>AcceptPathInfo Default</default>
115 <contextlist><context>server config</context>
116 <context>virtual host</context><context>directory</context>
117 <context>.htaccess</context></contextlist>
118 <override>FileInfo</override>
119 <compatibility>Disponible en Apache httpd 2.0.30 y posteriores</compatibility>
120
121 <usage>
122
123     <p>Esta directiva controla si las peticiones que contienen informaci&#243;n sobre la ruta
124     que sigue un fichero que existe (o un fichero que no existe pero en un directorio que
125     s&#237; existe) ser&#225;n aceptadas o denegadas.  La informaci&#243;n de ruta puede estar disponible
126     para los scripts en la variable de entorno <code>PATH_INFO</code>.</p>
127
128     <p>Por ejemplo, asumamos que la ubicaci&#243;n <code>/test/</code> apunta a
129     un directorio que contiene &#250;nicamente el fichero
130     <code>here.html</code>.  Entonces, las peticiones tanto para
131     <code>/test/here.html/more</code> como para
132     <code>/test/nothere.html/more</code> recogen
133     <code>/more</code> como <code>PATH_INFO</code>.</p>
134
135     <p>Los tres posibles argumentos para la directiva
136     <directive>AcceptPathInfo</directive> son los siguientes:</p>
137     <dl>
138     <dt><code>Off</code></dt><dd>Una petici&#243;n s&#243;lo ser&#225; aceptada si
139     se corresponde con una ruta literal que existe.  Por lo tanto, una petici&#243;n
140     con una informaci&#243;n de ruta despu&#233;s del nombre de fichero tal como
141     <code>/test/here.html/more</code> en el ejemplo anterior devolver&#225;
142     un error 404 NOT FOUND.</dd>
143
144     <dt><code>On</code></dt><dd>Una petici&#243;n ser&#225; aceptada si una
145     ruta principal de acceso se corresponde con un fichero que existe. El ejemplo
146     anterior <code>/test/here.html/more</code> ser&#225; aceptado si
147     <code>/test/here.html</code> corresponde a un fichero v&#225;lido.</dd>
148
149     <dt><code>Default</code></dt><dd>La gesti&#243;n de las peticiones
150     con informaci&#243;n de ruta est&#225; determinada por el <a
151     href="../handler.html">controlador</a> responsable de la petici&#243;n.
152     El controlador principal para para ficheros normales rechaza por defecto
153     peticiones <code>PATH_INFO</code>. Los controladores que sirven scripts, tales como <a
154     href="mod_cgi.html">cgi-script</a> e <a
155     href="mod_isapi.html">isapi-handler</a>, normalmente aceptan
156     <code>PATH_INFO</code> por defecto.</dd>
157     </dl>
158
159     <p>El objetivo principal de la directiva <code>AcceptPathInfo</code>
160     es permitirte sobreescribir la opci&#243;n del controlador
161     de aceptar or rechazar <code>PATH_INFO</code>. Este tipo de sobreescritura se necesita,
162     por ejemplo, cuando utilizas un <a href="../filter.html">filtro</a>, tal como
163     <a href="mod_include.html">INCLUDES</a>, para generar contenido
164     basado en <code>PATH_INFO</code>. El controlador principal normalmente rechazar&#237;a
165     la petici&#243;n, de modo que puedes utilizar la siguiente configuraci&#243;n para habilitarla
166     como script:</p>
167
168     <example>
169       &lt;Files "mypaths.shtml"&gt;<br />
170       <indent>
171         Options +Includes<br />
172         SetOutputFilter INCLUDES<br />
173         AcceptPathInfo On<br />
174       </indent>
175       &lt;/Files&gt;
176     </example>
177
178 </usage>
179 </directivesynopsis>
180
181 <directivesynopsis>
182 <name>AccessFileName</name>
183 <description>Nombre del fichero distribuido de configuraci&#243;n</description>
184 <syntax>AccessFileName <var>filename</var> [<var>filename</var>] ...</syntax>
185 <default>AccessFileName .htaccess</default>
186 <contextlist><context>server config</context><context>virtual host</context>
187 </contextlist>
188
189 <usage>
190     <p>Mientras que procesa una petici&#243;n el servidor busca
191     el primer fichero de configuraci&#243;n existente dentro de un listado de nombres en
192     cada directorio de la ruta del documento, si los ficheros distribuidos
193     de configuraci&#243;n est&#225;n <a href="#allowoverride">habilitados para ese
194     directorio</a>. Por ejemplo:</p>
195
196     <example>
197       AccessFileName .acl
198     </example>
199
200     <p>antes de servir el documento
201     <code>/usr/local/web/index.html</code>, el servidor leer&#225;
202     <code>/.acl</code>, <code>/usr/.acl</code>,
203     <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
204     para las directivas, salvo que estén deshabilitadas with</p>
205
206     <example>
207       &lt;Directory /&gt;<br />
208       <indent>
209         AllowOverride None<br />
210       </indent>
211       &lt;/Directory&gt;
212     </example>
213 </usage>
214 <seealso><directive module="core">AllowOverride</directive></seealso>
215 <seealso><a href="../configuring.html">Configuration Files</a></seealso>
216 <seealso><a href="../howto/htaccess.html">.htaccess Files</a></seealso>
217 </directivesynopsis>
218
219 <directivesynopsis>
220 <name>AddDefaultCharset</name>
221 <description>Default charset parameter to be added when a response
222 content-type is <code>text/plain</code> or <code>text/html</code></description>
223 <syntax>AddDefaultCharset On|Off|<var>charset</var></syntax>
224 <default>AddDefaultCharset Off</default>
225 <contextlist><context>server config</context>
226 <context>virtual host</context><context>directory</context>
227 <context>.htaccess</context></contextlist>
228 <override>FileInfo</override>
229
230 <usage>
231     <p>This directive specifies a default value for the media type
232     charset parameter (the name of a character encoding) to be added
233     to a response if and only if the response's content-type is either
234     <code>text/plain</code> or <code>text/html</code>.  This should override
235     any charset specified in the body of the response via a <code>META</code>
236     element, though the exact behavior is often dependent on the user's client
237     configuration. A setting of <code>AddDefaultCharset Off</code>
238     disables this functionality. <code>AddDefaultCharset On</code> enables
239     a default charset of <code>iso-8859-1</code>. Any other value is assumed
240     to be the <var>charset</var> to be used, which should be one of the
241     <a href="http://www.iana.org/assignments/character-sets">IANA registered
242     charset values</a> for use in Internet media types (MIME types).
243     For example:</p>
244
245     <example>
246       AddDefaultCharset utf-8
247     </example>
248
249     <p><directive>AddDefaultCharset</directive> should only be used when all
250     of the text resources to which it applies are known to be in that
251     character encoding and it is too inconvenient to label their charset
252     individually. One such example is to add the charset parameter
253     to resources containing generated content, such as legacy CGI
254     scripts, that might be vulnerable to cross-site scripting attacks
255     due to user-provided data being included in the output.  Note, however,
256     that a better solution is to just fix (or delete) those scripts, since
257     setting a default charset does not protect users that have enabled
258     the "auto-detect character encoding" feature on their browser.</p>
259 </usage>
260 <seealso><directive module="mod_mime">AddCharset</directive></seealso>
261 </directivesynopsis>
262
263 <directivesynopsis>
264 <name>AllowEncodedSlashes</name>
265 <description>Determines whether encoded path separators in URLs are allowed to
266 be passed through</description>
267 <syntax>AllowEncodedSlashes On|Off</syntax>
268 <default>AllowEncodedSlashes Off</default>
269 <contextlist><context>server config</context><context>virtual host</context>
270 </contextlist>
271 <compatibility>Available in Apache httpd 2.0.46 and later</compatibility>
272
273 <usage>
274     <p>The <directive>AllowEncodedSlashes</directive> directive allows URLs
275     which contain encoded path separators (<code>%2F</code> for <code>/</code>
276     and additionally <code>%5C</code> for <code>\</code> on according systems)
277     to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
278
279     <p>Turning <directive>AllowEncodedSlashes</directive> <code>On</code> is
280     mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
281
282     <note><title>Note</title>
283       <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
284       Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
285       according systems) will be left as such in the otherwise decoded URL
286       string.</p>
287     </note>
288 </usage>
289 <seealso><directive module="core">AcceptPathInfo</directive></seealso>
290 </directivesynopsis>
291
292 <directivesynopsis>
293 <name>AllowOverride</name>
294 <description>Types of directives that are allowed in
295 <code>.htaccess</code> files</description>
296 <syntax>AllowOverride All|None|<var>directive-type</var>
297 [<var>directive-type</var>] ...</syntax>
298 <default>AllowOverride None (2.3.9 and later), AllowOverride All (2.3.8 and earlier)</default>
299 <contextlist><context>directory</context></contextlist>
300
301 <usage>
302     <p>When the server finds an <code>.htaccess</code> file (as
303     specified by <directive module="core">AccessFileName</directive>)
304     it needs to know which directives declared in that file can override
305     earlier configuration directives.</p>
306
307     <note><title>Only available in &lt;Directory&gt; sections</title>
308     <directive>AllowOverride</directive> is valid only in
309     <directive type="section" module="core">Directory</directive>
310     sections specified without regular expressions, not in <directive
311     type="section" module="core">Location</directive>, <directive
312     module="core" type="section">DirectoryMatch</directive> or
313     <directive type="section" module="core">Files</directive> sections.
314     </note>
315
316     <p>When this directive is set to <code>None</code>, then
317     <a href="#accessfilename">.htaccess</a> files are completely ignored.
318     In this case, the server will not even attempt to read
319     <code>.htaccess</code> files in the filesystem.</p>
320
321     <p>When this directive is set to <code>All</code>, then any
322     directive which has the .htaccess <a
323     href="directive-dict.html#Context">Context</a> is allowed in
324     <code>.htaccess</code> files.</p>
325
326     <p>The <var>directive-type</var> can be one of the following
327     groupings of directives.</p>
328
329     <dl>
330       <dt>AuthConfig</dt>
331
332       <dd>
333
334       Allow use of the authorization directives (<directive
335       module="mod_authn_dbm">AuthDBMGroupFile</directive>,
336       <directive module="mod_authn_dbm">AuthDBMUserFile</directive>,
337       <directive module="mod_authz_groupfile">AuthGroupFile</directive>,
338       <directive module="mod_authn_core">AuthName</directive>,
339       <directive module="mod_authn_core">AuthType</directive>, <directive
340       module="mod_authn_file">AuthUserFile</directive>, <directive
341       module="mod_authz_core">Require</directive>, <em>etc.</em>).</dd>
342
343       <dt>FileInfo</dt>
344
345       <dd>
346       Allow use of the directives controlling document types
347      (<directive module="core">ErrorDocument</directive>,
348       <directive module="core">ForceType</directive>,
349       <directive module="mod_negotiation">LanguagePriority</directive>,
350       <directive module="core">SetHandler</directive>,
351       <directive module="core">SetInputFilter</directive>,
352       <directive module="core">SetOutputFilter</directive>, and
353       <module>mod_mime</module> Add* and Remove* directives),
354       document meta data (<directive
355       module="mod_headers">Header</directive>, <directive
356       module="mod_headers">RequestHeader</directive>, <directive
357       module="mod_setenvif">SetEnvIf</directive>, <directive
358       module="mod_setenvif">SetEnvIfNoCase</directive>, <directive
359       module="mod_setenvif">BrowserMatch</directive>, <directive
360       module="mod_usertrack">CookieExpires</directive>, <directive
361       module="mod_usertrack">CookieDomain</directive>, <directive
362       module="mod_usertrack">CookieStyle</directive>, <directive
363       module="mod_usertrack">CookieTracking</directive>, <directive
364       module="mod_usertrack">CookieName</directive>),
365       <module>mod_rewrite</module> directives <directive
366       module="mod_rewrite">RewriteEngine</directive>, <directive
367       module="mod_rewrite">RewriteOptions</directive>, <directive
368       module="mod_rewrite">RewriteBase</directive>, <directive
369       module="mod_rewrite">RewriteCond</directive>, <directive
370       module="mod_rewrite">RewriteRule</directive>) and
371       <directive module="mod_actions">Action</directive> from
372       <module>mod_actions</module>.
373       </dd>
374
375       <dt>Indexes</dt>
376
377       <dd>
378       Allow use of the directives controlling directory indexing
379       (<directive
380       module="mod_autoindex">AddDescription</directive>,
381       <directive module="mod_autoindex">AddIcon</directive>, <directive
382       module="mod_autoindex">AddIconByEncoding</directive>,
383       <directive module="mod_autoindex">AddIconByType</directive>,
384       <directive module="mod_autoindex">DefaultIcon</directive>, <directive
385       module="mod_dir">DirectoryIndex</directive>, <directive
386       module="mod_autoindex">FancyIndexing</directive>, <directive
387       module="mod_autoindex">HeaderName</directive>, <directive
388       module="mod_autoindex">IndexIgnore</directive>, <directive
389       module="mod_autoindex">IndexOptions</directive>, <directive
390       module="mod_autoindex">ReadmeName</directive>,
391       <em>etc.</em>).</dd>
392
393       <dt>Limit</dt>
394
395       <dd>
396       Allow use of the directives controlling host access (<directive
397       module="mod_authz_host">Allow</directive>, <directive
398       module="mod_authz_host">Deny</directive> and <directive
399       module="mod_authz_host">Order</directive>).</dd>
400
401       <dt>Options[=<var>Option</var>,...]</dt>
402
403       <dd>
404       Allow use of the directives controlling specific directory
405       features (<directive module="core">Options</directive> and
406       <directive module="mod_include">XBitHack</directive>).
407       An equal sign may be given followed by a comma (but no spaces)
408       separated lists of options that may be set using the <directive
409       module="core">Options</directive> command.</dd>
410     </dl>
411
412     <p>Example:</p>
413
414     <example>
415       AllowOverride AuthConfig Indexes
416     </example>
417
418     <p>In the example above all directives that are neither in the group
419     <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
420     server error.</p>
421
422     <note><p>For security and performance reasons, do not set
423     <code>AllowOverride</code> to anything other than <code>None</code> 
424     in your <code>&lt;Directory /&gt;</code> block. Instead, find (or
425     create) the <code>&lt;Directory&gt;</code> block that refers to the
426     directory where you're actually planning to place a
427     <code>.htaccess</code> file.</p>
428     </note>
429 </usage>
430
431 <seealso><directive module="core">AccessFileName</directive></seealso>
432 <seealso><a href="../configuring.html">Configuration Files</a></seealso>
433 <seealso><a href="../howto/htaccess.html">.htaccess Files</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 httpd 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 RFC2616.</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>This directive has no effect other than to emit warnings
500 if the value is not <code>none</code>. In prior versions, DefaultType
501 would specify a default media type to assign to response content for
502 which no other media type configuration could be found.
503 </description>
504 <syntax>DefaultType <var>media-type|none</var></syntax>
505 <default>DefaultType none</default>
506 <contextlist><context>server config</context><context>virtual host</context>
507 <context>directory</context><context>.htaccess</context>
508 </contextlist>
509 <override>FileInfo</override>
510 <compatibility>The argument <code>none</code> is available in Apache httpd 2.2.7 and later.  All other choices are DISABLED for 2.3.x and later.</compatibility>
511
512 <usage>
513     <p>This directive has been disabled.  For backwards compatibility
514     of configuration files, it may be specified with the value
515     <code>none</code>, meaning no default media type. For example:</p>
516
517     <example>
518       DefaultType None
519     </example>
520
521     <p><code>DefaultType None</code> is only available in
522     httpd-2.2.7 and later.</p>
523
524     <p>Use the mime.types configuration file and the
525     <directive module="mod_mime">AddType</directive> to configure media
526     type assignments via file extensions, or the
527     <directive module="core">ForceType</directive> directive to configure
528     the media type for specific resources. Otherwise, the server will
529     send the response without a Content-Type header field and the
530     recipient may attempt to guess the media type.</p>
531 </usage>
532 </directivesynopsis>
533
534 <directivesynopsis>
535 <name>Define</name>
536 <description>Define the existence of a variable</description>
537 <syntax>Define <var>parameter-name</var></syntax>
538 <contextlist><context>server config</context></contextlist>
539
540 <usage>
541     <p>Equivalent to passing the <code>-D</code> argument to <program
542     >httpd</program>.</p>
543     <p>This directive can be used to toggle the use of <directive module="core"
544     type="section">IfDefine</directive> sections without needing to alter
545     <code>-D</code> arguments in any startup scripts.</p>
546 </usage>
547 </directivesynopsis>
548
549 <directivesynopsis type="section">
550 <name>Directory</name>
551 <description>Enclose a group of directives that apply only to the
552 named file-system directory, sub-directories, and their contents.</description>
553 <syntax>&lt;Directory <var>directory-path</var>&gt;
554 ... &lt;/Directory&gt;</syntax>
555 <contextlist><context>server config</context><context>virtual host</context>
556 </contextlist>
557
558 <usage>
559     <p><directive type="section">Directory</directive> and
560     <code>&lt;/Directory&gt;</code> are used to enclose a group of
561     directives that will apply only to the named directory,
562     sub-directories of that directory, and the files within the respective 
563     directories.  Any directive that is allowed
564     in a directory context may be used. <var>Directory-path</var> is
565     either the full path to a directory, or a wild-card string using
566     Unix shell-style matching. In a wild-card string, <code>?</code> matches
567     any single character, and <code>*</code> matches any sequences of
568     characters. You may also use <code>[]</code> character ranges. None
569     of the wildcards match a `/' character, so <code>&lt;Directory
570     /*/public_html&gt;</code> will not match
571     <code>/home/user/public_html</code>, but <code>&lt;Directory
572     /home/*/public_html&gt;</code> will match. Example:</p>
573
574     <example>
575       &lt;Directory /usr/local/httpd/htdocs&gt;<br />
576       <indent>
577         Options Indexes FollowSymLinks<br />
578       </indent>
579       &lt;/Directory&gt;
580     </example>
581
582     <note>
583       <p>Be careful with the <var>directory-path</var> arguments:
584       They have to literally match the filesystem path which Apache httpd uses
585       to access the files. Directives applied to a particular
586       <code>&lt;Directory&gt;</code> will not apply to files accessed from
587       that same directory via a different path, such as via different symbolic
588       links.</p>
589     </note>
590
591     <p><glossary ref="regex">Regular
592     expressions</glossary> can also be used, with the addition of the
593     <code>~</code> character. For example:</p>
594
595     <example>
596       &lt;Directory ~ "^/www/.*/[0-9]{3}"&gt;
597     </example>
598
599     <p>would match directories in <code>/www/</code> that consisted of
600     three numbers.</p>
601
602     <p>If multiple (non-regular expression) <directive
603     type="section">Directory</directive> sections
604     match the directory (or one of its parents) containing a document,
605     then the directives are applied in the order of shortest match
606     first, interspersed with the directives from the <a
607     href="#accessfilename">.htaccess</a> files. For example,
608     with</p>
609
610     <example>
611       &lt;Directory /&gt;<br />
612       <indent>
613         AllowOverride None<br />
614       </indent>
615       &lt;/Directory&gt;<br />
616       <br />
617       &lt;Directory /home/&gt;<br />
618       <indent>
619         AllowOverride FileInfo<br />
620       </indent>
621       &lt;/Directory&gt;
622     </example>
623
624     <p>for access to the document <code>/home/web/dir/doc.html</code>
625     the steps are:</p>
626
627     <ul>
628       <li>Apply directive <code>AllowOverride None</code>
629       (disabling <code>.htaccess</code> files).</li>
630
631       <li>Apply directive <code>AllowOverride FileInfo</code> (for
632       directory <code>/home</code>).</li>
633
634       <li>Apply any <code>FileInfo</code> directives in
635       <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
636       <code>/home/web/dir/.htaccess</code> in that order.</li>
637     </ul>
638
639     <p>Regular expressions are not considered until after all of the
640     normal sections have been applied. Then all of the regular
641     expressions are tested in the order they appeared in the
642     configuration file. For example, with</p>
643
644     <example>
645       &lt;Directory ~ abc$&gt;<br />
646       <indent>
647         # ... directives here ...<br />
648       </indent>
649       &lt;/Directory&gt;
650     </example>
651
652     <p>the regular expression section won't be considered until after
653     all normal <directive type="section">Directory</directive>s and
654     <code>.htaccess</code> files have been applied. Then the regular
655     expression will match on <code>/home/abc/public_html/abc</code> and
656     the corresponding <directive type="section">Directory</directive> will
657     be applied.</p>
658
659    <p><strong>Note that the default access for
660     <code>&lt;Directory /&gt;</code> is <code>Allow from All</code>.
661     This means that Apache httpd will serve any file mapped from an URL. It is
662     recommended that you change this with a block such
663     as</strong></p>
664
665     <example>
666       &lt;Directory /&gt;<br />
667       <indent>
668         Order Deny,Allow<br />
669         Deny from All<br />
670       </indent>
671       &lt;/Directory&gt;
672     </example>
673
674     <p><strong>and then override this for directories you
675     <em>want</em> accessible. See the <a
676     href="../misc/security_tips.html">Security Tips</a> page for more
677     details.</strong></p>
678
679     <p>The directory sections occur in the <code>httpd.conf</code> file.
680     <directive type="section">Directory</directive> directives
681     cannot nest, and cannot appear in a <directive module="core"
682     type="section">Limit</directive> or <directive module="core"
683     type="section">LimitExcept</directive> section.</p>
684 </usage>
685 <seealso><a href="../sections.html">How &lt;Directory&gt;,
686     &lt;Location&gt; and &lt;Files&gt; sections work</a> for an
687     explanation of how these different sections are combined when a
688     request is received</seealso>
689 </directivesynopsis>
690
691 <directivesynopsis type="section">
692 <name>DirectoryMatch</name>
693 <description>Enclose directives that apply to
694 the contents of file-system directories matching a regular expression.</description>
695 <syntax>&lt;DirectoryMatch <var>regex</var>&gt;
696 ... &lt;/DirectoryMatch&gt;</syntax>
697 <contextlist><context>server config</context><context>virtual host</context>
698 </contextlist>
699
700 <usage>
701     <p><directive type="section">DirectoryMatch</directive> and
702     <code>&lt;/DirectoryMatch&gt;</code> are used to enclose a group
703     of directives which will apply only to the named directory (and the files within), 
704     the same as <directive module="core" type="section">Directory</directive>. 
705     However, it takes as an argument a 
706     <glossary ref="regex">regular expression</glossary>.  For example:</p>
707
708     <example>
709       &lt;DirectoryMatch "^/www/(.+/)?[0-9]{3}"&gt;
710     </example>
711
712     <p>would match directories in <code>/www/</code> that consisted of three
713     numbers.</p>
714
715    <note><title>Compatability</title>
716       Prior to 2.3.9, this directive implicitly applied to sub-directories
717       (like <directive module="core" type="section">Directory</directive>) and
718       could not match the end of line symbol ($).  In 2.3.9 and later,
719       only directories that match the expression are affected by the enclosed
720       directives.
721     </note>
722
723     <note><title>Trailing Slash</title>
724       This directive applies to requests for directories that may or may 
725       not end in a trailing slash, so expressions that are anchored to the 
726       end of line ($) must be written with care.
727     </note>
728 </usage>
729 <seealso><directive type="section" module="core">Directory</directive> for
730 a description of how regular expressions are mixed in with normal
731 <directive type="section">Directory</directive>s</seealso>
732 <seealso><a
733 href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt; and
734 &lt;Files&gt; sections work</a> for an explanation of how these different
735 sections are combined when a request is received</seealso>
736 </directivesynopsis>
737
738 <directivesynopsis>
739 <name>DocumentRoot</name>
740 <description>Directory that forms the main document tree visible
741 from the web</description>
742 <syntax>DocumentRoot <var>directory-path</var></syntax>
743 <default>DocumentRoot /usr/local/apache/htdocs</default>
744 <contextlist><context>server config</context><context>virtual host</context>
745 </contextlist>
746
747 <usage>
748     <p>This directive sets the directory from which <program>httpd</program>
749     will serve files. Unless matched by a directive like <directive
750     module="mod_alias">Alias</directive>, the server appends the
751     path from the requested URL to the document root to make the
752     path to the document. Example:</p>
753
754     <example>
755       DocumentRoot /usr/web
756     </example>
757
758     <p>then an access to
759     <code>http://www.my.host.com/index.html</code> refers to
760     <code>/usr/web/index.html</code>. If the <var>directory-path</var> is 
761     not absolute then it is assumed to be relative to the <directive 
762     module="core">ServerRoot</directive>.</p>
763
764     <p>The <directive>DocumentRoot</directive> should be specified without
765     a trailing slash.</p>
766 </usage>
767 <seealso><a href="../urlmapping.html#documentroot">Mapping URLs to Filesystem
768 Locations</a></seealso>
769 </directivesynopsis>
770
771 <directivesynopsis>
772 <name>EnableMMAP</name>
773 <description>Use memory-mapping to read files during delivery</description>
774 <syntax>EnableMMAP On|Off</syntax>
775 <default>EnableMMAP On</default>
776 <contextlist><context>server config</context><context>virtual host</context>
777 <context>directory</context><context>.htaccess</context>
778 </contextlist>
779 <override>FileInfo</override>
780
781 <usage>
782     <p>This directive controls whether the <program>httpd</program> may use
783     memory-mapping if it needs to read the contents of a file during
784     delivery.  By default, when the handling of a request requires
785     access to the data within a file -- for example, when delivering a
786     server-parsed file using <module>mod_include</module> -- Apache httpd
787     memory-maps the file if the OS supports it.</p>
788
789     <p>This memory-mapping sometimes yields a performance improvement.
790     But in some environments, it is better to disable the memory-mapping
791     to prevent operational problems:</p>
792
793     <ul>
794     <li>On some multiprocessor systems, memory-mapping can reduce the
795     performance of the <program>httpd</program>.</li>
796     <li>Deleting or truncating a file while <program>httpd</program>
797       has it memory-mapped can cause <program>httpd</program> to
798       crash with a segmentation fault.
799     </li>
800     </ul>
801
802     <p>For server configurations that are vulnerable to these problems,
803     you should disable memory-mapping of delivered files by specifying:</p>
804
805     <example>
806       EnableMMAP Off
807     </example>
808
809     <p>For NFS mounted files, this feature may be disabled explicitly for
810     the offending files by specifying:</p>
811
812     <example>
813       &lt;Directory "/path-to-nfs-files"&gt;
814       <indent>
815         EnableMMAP Off
816       </indent>
817       &lt;/Directory&gt;
818     </example>
819 </usage>
820 </directivesynopsis>
821
822 <directivesynopsis>
823 <name>EnableSendfile</name>
824 <description>Use the kernel sendfile support to deliver files to the client</description>
825 <syntax>EnableSendfile On|Off</syntax>
826 <default>EnableSendfile Off</default>
827 <contextlist><context>server config</context><context>virtual host</context>
828 <context>directory</context><context>.htaccess</context>
829 </contextlist>
830 <override>FileInfo</override>
831 <compatibility>Available in version 2.0.44 and later. Default changed to Off in
832 version 2.3.9.</compatibility>
833
834 <usage>
835     <p>This directive controls whether <program>httpd</program> may use the
836     sendfile support from the kernel to transmit file contents to the client.
837     By default, when the handling of a request requires no access
838     to the data within a file -- for example, when delivering a
839     static file -- Apache httpd uses sendfile to deliver the file contents
840     without ever reading the file if the OS supports it.</p>
841
842     <p>This sendfile mechanism avoids separate read and send operations,
843     and buffer allocations. But on some platforms or within some
844     filesystems, it is better to disable this feature to avoid
845     operational problems:</p>
846
847     <ul>
848     <li>Some platforms may have broken sendfile support that the build
849     system did not detect, especially if the binaries were built on
850     another box and moved to such a machine with broken sendfile
851     support.</li>
852     <li>On Linux the use of sendfile triggers TCP-checksum
853     offloading bugs on certain networking cards when using IPv6.</li>
854     <li>On Linux on Itanium, sendfile may be unable to handle files
855     over 2GB in size.</li>
856     <li>With a network-mounted <directive
857     module="core">DocumentRoot</directive> (e.g., NFS, SMB, CIFS, FUSE),
858     the kernel may be unable to serve the network file through
859     its own cache.</li>
860     </ul>
861
862     <p>For server configurations that are not vulnerable to these problems,
863     you may enable this feature by specifying:</p>
864
865     <example>
866       EnableSendfile On
867     </example>
868
869     <p>For network mounted files, this feature may be disabled explicitly
870     for the offending files by specifying:</p>
871
872     <example>
873       &lt;Directory "/path-to-nfs-files"&gt;
874       <indent>
875         EnableSendfile Off
876       </indent>
877       &lt;/Directory&gt;
878     </example>
879     <p>Please note that the per-directory and .htaccess configuration
880        of <directive>EnableSendfile</directive> is not supported by
881        <module>mod_cache_disk</module>.
882        Only global definition of <directive>EnableSendfile</directive>
883        is taken into account by the module.
884     </p>
885 </usage>
886 </directivesynopsis>
887
888 <directivesynopsis>
889 <name>Error</name>
890 <description>Abort configuration parsing with a custom error message</description>
891 <syntax>Error <var>message</var></syntax>
892 <contextlist><context>server config</context><context>virtual host</context>
893 <context>directory</context><context>.htaccess</context>
894 </contextlist>
895 <compatibility>2.3.9 and later</compatibility>
896
897 <usage>
898     <p>If an error can be detected within the configuration, this
899     directive can be used to generate a custom error message, and halt
900     configuration parsing.  The typical use is for reporting required
901     modules which are missing from the configuration.</p>
902
903     <example><title>Example</title>
904       # ensure that mod_include is loaded<br />
905       &lt;IfModule !include_module&gt;<br />
906       Error mod_include is required by mod_foo.  Load it with LoadModule.<br />
907       &lt;/IfModule&gt;<br />
908       <br />
909       # ensure that exactly one of SSL,NOSSL is defined<br />
910       &lt;IfDefine SSL&gt;<br />
911       &lt;IfDefine NOSSL&gt;<br />
912       Error Both SSL and NOSSL are defined.  Define only one of them.<br />
913       &lt;/IfDefine&gt;<br />
914       &lt;/IfDefine&gt;<br />
915       &lt;IfDefine !SSL&gt;<br />
916       &lt;IfDefine !NOSSL&gt;<br />
917       Error Either SSL or NOSSL must be defined.<br />
918       &lt;/IfDefine&gt;<br />
919       &lt;/IfDefine&gt;<br />
920     </example>
921
922 </usage>
923 </directivesynopsis>
924
925 <directivesynopsis>
926 <name>ErrorDocument</name>
927 <description>What the server will return to the client
928 in case of an error</description>
929 <syntax>ErrorDocument <var>error-code</var> <var>document</var></syntax>
930 <contextlist><context>server config</context><context>virtual host</context>
931 <context>directory</context><context>.htaccess</context>
932 </contextlist>
933 <override>FileInfo</override>
934
935 <usage>
936     <p>In the event of a problem or error, Apache httpd can be configured
937     to do one of four things,</p>
938
939     <ol>
940       <li>output a simple hardcoded error message</li>
941
942       <li>output a customized message</li>
943
944       <li>redirect to a local <var>URL-path</var> to handle the
945       problem/error</li>
946
947       <li>redirect to an external <var>URL</var> to handle the
948       problem/error</li>
949     </ol>
950
951     <p>The first option is the default, while options 2-4 are
952     configured using the <directive>ErrorDocument</directive>
953     directive, which is followed by the HTTP response code and a URL
954     or a message. Apache httpd will sometimes offer additional information
955     regarding the problem/error.</p>
956
957     <p>URLs can begin with a slash (/) for local web-paths (relative
958     to the <directive module="core">DocumentRoot</directive>), or be a
959     full URL which the client can resolve. Alternatively, a message
960     can be provided to be displayed by the browser. Examples:</p>
961
962     <example>
963       ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
964       ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
965       ErrorDocument 401 /subscription_info.html<br />
966       ErrorDocument 403 "Sorry can't allow you access today"
967     </example>
968
969     <p>Additionally, the special value <code>default</code> can be used
970     to specify Apache httpd's simple hardcoded message.  While not required
971     under normal circumstances, <code>default</code> will restore
972     Apache httpd's simple hardcoded message for configurations that would
973     otherwise inherit an existing <directive>ErrorDocument</directive>.</p>
974
975     <example>
976       ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
977       &lt;Directory /web/docs&gt;<br />
978       <indent>
979         ErrorDocument 404 default<br />
980       </indent>
981       &lt;/Directory&gt;
982     </example>
983
984     <p>Note that when you specify an <directive>ErrorDocument</directive>
985     that points to a remote URL (ie. anything with a method such as
986     <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
987     client to tell it where to find the document, even if the
988     document ends up being on the same server. This has several
989     implications, the most important being that the client will not
990     receive the original error status code, but instead will
991     receive a redirect status code. This in turn can confuse web
992     robots and other clients which try to determine if a URL is
993     valid using the status code. In addition, if you use a remote
994     URL in an <code>ErrorDocument 401</code>, the client will not
995     know to prompt the user for a password since it will not
996     receive the 401 status code. Therefore, <strong>if you use an
997     <code>ErrorDocument 401</code> directive then it must refer to a local
998     document.</strong></p>
999
1000     <p>Microsoft Internet Explorer (MSIE) will by default ignore
1001     server-generated error messages when they are "too small" and substitute
1002     its own "friendly" error messages. The size threshold varies depending on
1003     the type of error, but in general, if you make your error document
1004     greater than 512 bytes, then MSIE will show the server-generated
1005     error rather than masking it.  More information is available in
1006     Microsoft Knowledge Base article <a
1007     href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807"
1008     >Q294807</a>.</p>
1009
1010     <p>Although most error messages can be overriden, there are certain
1011     circumstances where the internal messages are used regardless of the
1012     setting of <directive module="core">ErrorDocument</directive>.  In
1013     particular, if a malformed request is detected, normal request processing
1014     will be immediately halted and the internal error message returned.
1015     This is necessary to guard against security problems caused by
1016     bad requests.</p>
1017    
1018     <p>If you are using mod_proxy, you may wish to enable
1019     <directive module="mod_proxy">ProxyErrorOverride</directive> so that you can provide
1020     custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
1021     Apache httpd will not generate custom error documents for proxied content.</p>
1022 </usage>
1023
1024 <seealso><a href="../custom-error.html">documentation of
1025     customizable responses</a></seealso>
1026 </directivesynopsis>
1027
1028 <directivesynopsis>
1029 <name>ErrorLog</name>
1030 <description>Location where the server will log errors</description>
1031 <syntax> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</syntax>
1032 <default>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</default>
1033 <contextlist><context>server config</context><context>virtual host</context>
1034 </contextlist>
1035
1036 <usage>
1037     <p>The <directive>ErrorLog</directive> directive sets the name of
1038     the file to which the server will log any errors it encounters. If
1039     the <var>file-path</var> is not absolute then it is assumed to be 
1040     relative to the <directive module="core">ServerRoot</directive>.</p>
1041
1042     <example><title>Example</title>
1043     ErrorLog /var/log/httpd/error_log
1044     </example>
1045
1046     <p>If the <var>file-path</var>
1047     begins with a pipe character "<code>|</code>" then it is assumed to be a
1048     command to spawn to handle the error log.</p>
1049
1050     <example><title>Example</title>
1051     ErrorLog "|/usr/local/bin/httpd_errors"
1052     </example>
1053
1054     <p>See the notes on <a href="../logs.html#piped">piped logs</a> for
1055     more information.</p>
1056
1057     <p>Using <code>syslog</code> instead of a filename enables logging
1058     via syslogd(8) if the system supports it. The default is to use
1059     syslog facility <code>local7</code>, but you can override this by
1060     using the <code>syslog:<var>facility</var></code> syntax where
1061     <var>facility</var> can be one of the names usually documented in
1062     syslog(1).  The facility is effectively global, and if it is changed
1063     in individual virtual hosts, the final facility specified affects the
1064     entire server.</p>
1065
1066     <example><title>Example</title>
1067     ErrorLog syslog:user
1068     </example>
1069
1070     <p>SECURITY: See the <a
1071     href="../misc/security_tips.html#serverroot">security tips</a>
1072     document for details on why your security could be compromised
1073     if the directory where log files are stored is writable by
1074     anyone other than the user that starts the server.</p>
1075     <note type="warning"><title>Note</title>
1076       <p>When entering a file path on non-Unix platforms, care should be taken
1077       to make sure that only forward slashed are used even though the platform
1078       may allow the use of back slashes. In general it is a good idea to always 
1079       use forward slashes throughout the configuration files.</p>
1080     </note>
1081 </usage>
1082 <seealso><directive module="core">LogLevel</directive></seealso>
1083 <seealso><a href="../logs.html">Apache HTTP Server Log Files</a></seealso>
1084 </directivesynopsis>
1085
1086 <directivesynopsis>
1087 <name>ErrorLogFormat</name>
1088 <description>Format specification for error log entries</description>
1089 <syntax> ErrorLog [connection|request] <var>format</var></syntax>
1090 <contextlist><context>server config</context><context>virtual host</context>
1091 </contextlist>
1092 <compatibility>Available in Apache httpd 2.3.9 and later</compatibility>
1093
1094 <usage>
1095     <p><directive>ErrorLogFormat</directive> allows to specify what
1096     supplementary information is logged in the error log in addition to the
1097     actual log message.</p>
1098
1099     <example><title>Simple example</title>
1100         ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
1101     </example>
1102
1103     <p>Specifying <code>connection</code> or <code>request</code> as first
1104     paramter allows to specify additional formats, causing additional
1105     information to be logged when the first message is logged for a specific
1106     connection or request, respectivly. This additional information is only
1107     logged once per connection/request. If a connection or request is processed
1108     without causing any log message, the additional information is not logged
1109     either.</p>
1110
1111     <p>It can happen that some format string items do not produce output.  For
1112     example, the Referer header is only present if the log message is
1113     associated to a request and the log message happens at a time when the
1114     Referer header has already been read from the client.  If no output is
1115     produced, the default behaviour is to delete everything from the preceeding
1116     space character to the next space character.  This means the log line is
1117     implicitly divided into fields on non-whitespace to whitespace transitions.
1118     If a format string item does not produce output, the whole field is
1119     ommitted.  For example, if the remote address <code>%a</code> in the log
1120     format <code>[%t] [%l] [%a] %M&nbsp;</code> is not available, the surrounding
1121     brackets are not logged either.  Space characters can be escaped with a
1122     backslash to prevent them from delimiting a field.  The combination '%&nbsp;'
1123     (percent space) is a zero-witdh field delimiter that does not produce any
1124     output.</p>
1125
1126     <p>The above behaviour can be changed by adding modifiers to the format
1127     string item. A <code>-</code> (minus) modifier causes a minus to be logged if the
1128     respective item does not produce any output. In once-per-connection/request
1129     formats, it is also possible to use the <code>+</code> (plus) modifier. If an
1130     item with the plus modifier does not produce any output, the whole line is
1131     ommitted.</p>
1132
1133     <p>A number as modifier can be used to assign a log severity level to a
1134     format item. The item will only be logged if the severity of the log
1135     message is not higher than the specified log severity level. The number can
1136     range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8).</p>
1137
1138     <p>Some format string items accept additional parameters in braces.</p>
1139
1140     <table border="1" style="zebra">
1141     <columnspec><column width=".2"/><column width=".8"/></columnspec>
1142
1143     <tr><th>Format&nbsp;String</th> <th>Description</th></tr>
1144
1145     <tr><td><code>%%</code></td>
1146         <td>The percent sign</td></tr>
1147
1148     <tr><td><code>%...a</code></td>
1149         <td>Remote IP-address and port</td></tr>
1150
1151     <tr><td><code>%...A</code></td>
1152         <td>Local IP-address and port</td></tr>
1153
1154     <tr><td><code>%...{name}e</code></td>
1155         <td>Request environment variable <code>name</code></td></tr>
1156
1157     <tr><td><code>%...E</code></td>
1158         <td>APR/OS error status code and string</td></tr>
1159
1160     <tr><td><code>%...F</code></td>
1161         <td>Source file name and line number of the log call</td></tr>
1162
1163     <tr><td><code>%...{name}i</code></td>
1164         <td>Request header <code>name</code></td></tr>
1165
1166     <tr><td><code>%...k</code></td>
1167         <td>Number of keep-alive requests on this connection</td></tr>
1168
1169     <tr><td><code>%...l</code></td>
1170         <td>Loglevel of the message</td></tr>
1171
1172     <tr><td><code>%...L</code></td>
1173         <td>Log ID of the request</td></tr>
1174
1175     <tr><td><code>%...{c}L</code></td>
1176         <td>Log ID of the connection</td></tr>
1177
1178     <tr><td><code>%...{C}L</code></td>
1179         <td>Log ID of the connection if used in connection scope, empty otherwise</td></tr>
1180
1181     <tr><td><code>%...m</code></td>
1182         <td>Name of the module logging the message</td></tr>
1183
1184     <tr><td><code>%M</code></td>
1185         <td>The actual log message</td></tr>
1186
1187     <tr><td><code>%...{name}n</code></td>
1188         <td>Request note <code>name</code></td></tr>
1189
1190     <tr><td><code>%...P</code></td>
1191         <td>Process ID of current process</td></tr>
1192
1193     <tr><td><code>%...T</code></td>
1194         <td>Thread ID of current thread</td></tr>
1195
1196     <tr><td><code>%...t</code></td>
1197         <td>The current time</td></tr>
1198
1199     <tr><td><code>%...{u}t</code></td>
1200         <td>The current time including micro-seconds</td></tr>
1201
1202     <tr><td><code>%...{cu}t</code></td>
1203         <td>The current time in compact ISO 8601 format, including
1204             micro-seconds</td></tr>
1205
1206     <tr><td><code>%...v</code></td>
1207         <td>The canonical <directive module="core">ServerName</directive>
1208             of the current server.</td></tr>
1209
1210     <tr><td><code>%...V</code></td>
1211         <td>The server name of the server serving the request according to the
1212             <directive module="core" >UseCanonicalName</directive>
1213             setting.</td></tr>
1214
1215     <tr><td><code>\&nbsp;</code> (backslash space)</td>
1216         <td>Non-field delimiting space</td></tr>
1217
1218     <tr><td><code>%&nbsp;</code> (percent space)</td>
1219         <td>Field delimiter (no output)</td></tr>
1220     </table>
1221
1222     <p>The log ID format <code>%L</code> produces a unique id for a connection
1223     or request. This can be used to correlate which log lines belong to the
1224     same connection or request, which request happens on which connection.
1225     A <code>%L</code> format string is also available in
1226     <module>mod_log_config</module>, to allow to correlate access log entries
1227     with error log lines. If <module>mod_unique_id</module> is loaded, its
1228     unique id will be used as log ID for requests.</p>
1229
1230     <example><title>Example (somewhat similar to default format)</title>
1231         ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P] %7F: %E: [client\ %a]
1232         %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
1233     </example>
1234
1235     <example><title>Example (similar to the 2.2.x format)</title>
1236         ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
1237         %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
1238     </example>
1239
1240     <example><title>Advanced example with request/connection log IDs</title>
1241         ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br/>
1242         ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br/>
1243         ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br/>
1244         ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br/>
1245         ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br/>
1246     </example>
1247
1248 </usage>
1249 <seealso><directive module="core">ErrorLog</directive></seealso>
1250 <seealso><directive module="core">LogLevel</directive></seealso>
1251 <seealso><a href="../logs.html">Apache HTTP Server Log Files</a></seealso>
1252 </directivesynopsis>
1253
1254 <directivesynopsis>
1255 <name>ExtendedStatus</name>
1256 <description>Keep track of extended status information for each 
1257 request</description>
1258 <syntax>ExtendedStatus On|Off</syntax>
1259 <default>ExtendedStatus Off[*]</default>
1260 <contextlist><context>server config</context></contextlist>
1261
1262 <usage>
1263     <p>This option tracks additional data per worker about the
1264     currently executing request, and a utilization summary; you 
1265     can see these variables during runtime by configuring 
1266     <module>mod_status</module>.  Note that other modules may
1267     rely on this scoreboard.</p>
1268
1269     <p>This setting applies to the entire server, and cannot be
1270     enabled or disabled on a virtualhost-by-virtualhost basis.
1271     The collection of extended status information can slow down
1272     the server.  Also note that this setting cannot be changed
1273     during a graceful restart.</p>
1274
1275     <note>
1276     <p>Note that loading <module>mod_status</module> will change 
1277     the default behavior to ExtendedStatus On, while other
1278     third party modules may do the same.  Such modules rely on
1279     collecting detailed information about the state of all workers.
1280     The default is changed by <module>mod_status</module> beginning
1281     with version 2.3.6; the previous default was always Off.</p>
1282     </note>
1283
1284 </usage>
1285
1286 </directivesynopsis>
1287
1288 <directivesynopsis>
1289 <name>FileETag</name>
1290 <description>File attributes used to create the ETag
1291 HTTP response header for static files</description>
1292 <syntax>FileETag <var>component</var> ...</syntax>
1293 <default>FileETag INode MTime Size</default>
1294 <contextlist><context>server config</context><context>virtual host</context>
1295 <context>directory</context><context>.htaccess</context>
1296 </contextlist>
1297 <override>FileInfo</override>
1298
1299 <usage>
1300     <p>
1301     The <directive>FileETag</directive> directive configures the file
1302     attributes that are used to create the <code>ETag</code> (entity
1303     tag) response header field when the document is based on a static file.
1304     (The <code>ETag</code> value is used in cache management to save
1305     network bandwidth.) The
1306     <directive>FileETag</directive> directive allows you to choose
1307     which of these -- if any -- should be used. The recognized keywords are:
1308     </p>
1309
1310     <dl>
1311      <dt><strong>INode</strong></dt>
1312      <dd>The file's i-node number will be included in the calculation</dd>
1313      <dt><strong>MTime</strong></dt>
1314      <dd>The date and time the file was last modified will be included</dd>
1315      <dt><strong>Size</strong></dt>
1316      <dd>The number of bytes in the file will be included</dd>
1317      <dt><strong>All</strong></dt>
1318      <dd>All available fields will be used. This is equivalent to:
1319          <example>FileETag INode MTime Size</example></dd>
1320      <dt><strong>None</strong></dt>
1321      <dd>If a document is file-based, no <code>ETag</code> field will be
1322        included in the response</dd>
1323     </dl>
1324
1325     <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1326     keywords may be prefixed with either <code>+</code> or <code>-</code>,
1327     which allow changes to be made to the default setting inherited
1328     from a broader scope. Any keyword appearing without such a prefix
1329     immediately and completely cancels the inherited setting.</p>
1330
1331     <p>If a directory's configuration includes
1332     <code>FileETag&nbsp;INode&nbsp;MTime&nbsp;Size</code>, and a
1333     subdirectory's includes <code>FileETag&nbsp;-INode</code>,
1334     the setting for that subdirectory (which will be inherited by
1335     any sub-subdirectories that don't override it) will be equivalent to
1336     <code>FileETag&nbsp;MTime&nbsp;Size</code>.</p>
1337     <note type="warning"><title>Warning</title>
1338     Do not change the default for directories or locations that have WebDAV
1339     enabled and use <module>mod_dav_fs</module> as a storage provider.
1340     <module>mod_dav_fs</module> uses <code>INode&nbsp;MTime&nbsp;Size</code>
1341     as a fixed format for <code>ETag</code> comparisons on conditional requests.
1342     These conditional requests will break if the <code>ETag</code> format is
1343     changed via <directive>FileETag</directive>.
1344     </note>
1345     <note><title>Server Side Includes</title>
1346     An ETag is not generated for responses parsed by <module>mod_include</module>, 
1347     since the response entity can change without a change of the INode, MTime, or Size 
1348     of the static file with embedded SSI directives.
1349     </note>
1350
1351 </usage>
1352 </directivesynopsis>
1353
1354 <directivesynopsis type="section">
1355 <name>Files</name>
1356 <description>Contains directives that apply to matched
1357 filenames</description>
1358 <syntax>&lt;Files <var>filename</var>&gt; ... &lt;/Files&gt;</syntax>
1359 <contextlist><context>server config</context><context>virtual host</context>
1360 <context>directory</context><context>.htaccess</context>
1361 </contextlist>
1362 <override>All</override>
1363
1364 <usage>
1365     <p>The <directive type="section">Files</directive> directive
1366     limits the scope of the enclosed directives by filename. It is comparable
1367     to the <directive module="core" type="section">Directory</directive>
1368     and <directive module="core" type="section">Location</directive>
1369     directives. It should be matched with a <code>&lt;/Files&gt;</code>
1370     directive. The directives given within this section will be applied to
1371     any object with a basename (last component of filename) matching the
1372     specified filename. <directive type="section">Files</directive>
1373     sections are processed in the order they appear in the
1374     configuration file, after the <directive module="core"
1375     type="section">Directory</directive> sections and
1376     <code>.htaccess</code> files are read, but before <directive
1377     type="section" module="core">Location</directive> sections. Note
1378     that <directive type="section">Files</directive> can be nested
1379     inside <directive type="section"
1380     module="core">Directory</directive> sections to restrict the
1381     portion of the filesystem they apply to.</p>
1382
1383     <p>The <var>filename</var> argument should include a filename, or
1384     a wild-card string, where <code>?</code> matches any single character,
1385     and <code>*</code> matches any sequences of characters.
1386     <glossary ref="regex">Regular expressions</glossary> 
1387     can also be used, with the addition of the
1388     <code>~</code> character. For example:</p>
1389
1390     <example>
1391       &lt;Files ~ "\.(gif|jpe?g|png)$"&gt;
1392     </example>
1393
1394     <p>would match most common Internet graphics formats. <directive
1395     module="core" type="section">FilesMatch</directive> is preferred,
1396     however.</p>
1397
1398     <p>Note that unlike <directive type="section"
1399     module="core">Directory</directive> and <directive type="section"
1400     module="core">Location</directive> sections, <directive
1401     type="section">Files</directive> sections can be used inside
1402     <code>.htaccess</code> files. This allows users to control access to
1403     their own files, at a file-by-file level.</p>
1404
1405 </usage>
1406 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1407     and &lt;Files&gt; sections work</a> for an explanation of how these
1408     different sections are combined when a request is received</seealso>
1409 </directivesynopsis>
1410
1411 <directivesynopsis type="section">
1412 <name>FilesMatch</name>
1413 <description>Contains directives that apply to regular-expression matched
1414 filenames</description>
1415 <syntax>&lt;FilesMatch <var>regex</var>&gt; ... &lt;/FilesMatch&gt;</syntax>
1416 <contextlist><context>server config</context><context>virtual host</context>
1417 <context>directory</context><context>.htaccess</context>
1418 </contextlist>
1419 <override>All</override>
1420
1421 <usage>
1422     <p>The <directive type="section">FilesMatch</directive> directive
1423     limits the scope of the enclosed directives by filename, just as the
1424     <directive module="core" type="section">Files</directive> directive
1425     does. However, it accepts a <glossary ref="regex">regular 
1426     expression</glossary>. For example:</p>
1427
1428     <example>
1429       &lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
1430     </example>
1431
1432     <p>would match most common Internet graphics formats.</p>
1433 </usage>
1434
1435 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
1436     and &lt;Files&gt; sections work</a> for an explanation of how these
1437     different sections are combined when a request is received</seealso>
1438 </directivesynopsis>
1439
1440 <directivesynopsis>
1441 <name>ForceType</name>
1442 <description>Forces all matching files to be served with the specified
1443 media type in the HTTP Content-Type header field</description>
1444 <syntax>ForceType <var>media-type</var>|None</syntax>
1445 <contextlist><context>directory</context><context>.htaccess</context>
1446 </contextlist>
1447 <override>FileInfo</override>
1448 <compatibility>Moved to the core in Apache httpd 2.0</compatibility>
1449
1450 <usage>
1451     <p>When placed into an <code>.htaccess</code> file or a
1452     <directive type="section" module="core">Directory</directive>, or
1453     <directive type="section" module="core">Location</directive> or
1454     <directive type="section" module="core">Files</directive>
1455     section, this directive forces all matching files to be served
1456     with the content type identification given by
1457     <var>media-type</var>. For example, if you had a directory full of
1458     GIF files, but did not want to label them all with <code>.gif</code>,
1459     you might want to use:</p>
1460
1461     <example>
1462       ForceType image/gif
1463     </example>
1464
1465     <p>Note that this directive overrides other indirect media type
1466     associations defined in mime.types or via the
1467     <directive module="mod_mime">AddType</directive>.</p>
1468
1469     <p>You can also override more general
1470     <directive>ForceType</directive> settings
1471     by using the value of <code>None</code>:</p>
1472
1473     <example>
1474       # force all files to be image/gif:<br />
1475       &lt;Location /images&gt;<br />
1476         <indent>
1477           ForceType image/gif<br />
1478         </indent>
1479       &lt;/Location&gt;<br />
1480       <br />
1481       # but normal mime-type associations here:<br />
1482       &lt;Location /images/mixed&gt;<br />
1483       <indent>
1484         ForceType None<br />
1485       </indent>
1486       &lt;/Location&gt;
1487     </example>
1488
1489     <p>This directive primarily overrides the content types generated for
1490     static files served out of the filesystem.  For resources other than 
1491     static files, where the generator of the response typically specifies 
1492     a Content-Type, this directive has no effect.</p>
1493
1494 </usage>
1495 </directivesynopsis>
1496 <directivesynopsis>
1497 <name>GprofDir</name>
1498 <description>Directory to write gmon.out profiling data to.  </description>
1499 <syntax>GprofDir <var>/tmp/gprof/</var>|<var>/tmp/gprof/</var>%</syntax>
1500 <contextlist><context>server config</context><context>virtual host</context>
1501 </contextlist>
1502
1503 <usage>
1504     <p>When the server has been compiled with gprof profiling support,
1505     <directive>GprofDir</directive> causes <code>gmon.out</code> files to
1506     be written to the specified directory when the process exits.  If the
1507     argument ends with a percent symbol ('%'), subdirectories are created
1508     for each process id.</p>
1509
1510     <p>This directive currently only works with the <module>prefork</module> 
1511     MPM.</p>
1512 </usage>
1513 </directivesynopsis>
1514
1515 <directivesynopsis>
1516 <name>HostnameLookups</name>
1517 <description>Enables DNS lookups on client IP addresses</description>
1518 <syntax>HostnameLookups On|Off|Double</syntax>
1519 <default>HostnameLookups Off</default>
1520 <contextlist><context>server config</context><context>virtual host</context>
1521 <context>directory</context></contextlist>
1522
1523 <usage>
1524     <p>This directive enables DNS lookups so that host names can be
1525     logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1526     The value <code>Double</code> refers to doing double-reverse
1527     DNS lookup. That is, after a reverse lookup is performed, a forward
1528     lookup is then performed on that result. At least one of the IP
1529     addresses in the forward lookup must match the original
1530     address. (In "tcpwrappers" terminology this is called
1531     <code>PARANOID</code>.)</p>
1532
1533     <p>Regardless of the setting, when <module>mod_authz_host</module> is
1534     used for controlling access by hostname, a double reverse lookup
1535     will be performed.  This is necessary for security. Note that the
1536     result of this double-reverse isn't generally available unless you
1537     set <code>HostnameLookups Double</code>. For example, if only
1538     <code>HostnameLookups On</code> and a request is made to an object
1539     that is protected by hostname restrictions, regardless of whether
1540     the double-reverse fails or not, CGIs will still be passed the
1541     single-reverse result in <code>REMOTE_HOST</code>.</p>
1542
1543     <p>The default is <code>Off</code> in order to save the network
1544     traffic for those sites that don't truly need the reverse
1545     lookups done. It is also better for the end users because they
1546     don't have to suffer the extra latency that a lookup entails.
1547     Heavily loaded sites should leave this directive
1548     <code>Off</code>, since DNS lookups can take considerable
1549     amounts of time. The utility <program>logresolve</program>, compiled by
1550     default to the <code>bin</code> subdirectory of your installation
1551     directory, can be used to look up host names from logged IP addresses
1552     offline.</p>
1553 </usage>
1554 </directivesynopsis>
1555
1556 <directivesynopsis type="section">
1557 <name>If</name>
1558 <description>Contains directives that apply only if a condition is
1559 satisfied by a request at runtime</description>
1560 <syntax>&lt;If <var>expression</var>&gt; ... &lt;/If&gt;</syntax>
1561 <contextlist><context>server config</context><context>virtual host</context>
1562 <context>directory</context><context>.htaccess</context>
1563 </contextlist>
1564 <override>All</override>
1565
1566 <usage>
1567     <p>The <directive type="section">If</directive> directive
1568     evaluates an expression at runtime, and applies the enclosed
1569     directives if and only if the expression evaluates to true.
1570     For example:</p>
1571
1572     <example>
1573         &lt;If "$req{Host} = ''"&gt;
1574     </example>
1575
1576     <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>
1577
1578     <p>You may compare the value of any variable in the request headers
1579     ($req), response headers ($resp) or environment ($env) in your
1580     expression.</p>
1581
1582     <p>Apart from <code>=</code>, <code>If</code> can use the <code>IN</code>
1583     operator to compare if the expression is in a given range:</p>
1584
1585     <example>
1586         &lt;If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS&gt;
1587     </example>
1588
1589 </usage>
1590
1591 <seealso><a href="../expr.html">Expressions in Apache HTTP Server</a>,
1592 for a complete reference and more examples.</seealso>
1593 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;,
1594     &lt;Files&gt; sections work</a> for an explanation of how these
1595     different sections are combined when a request is received.
1596     <directive type="section">If</directive> has the same precedence
1597     and usage as <directive type="section">Files</directive></seealso>
1598 </directivesynopsis>
1599
1600 <directivesynopsis type="section">
1601 <name>IfDefine</name>
1602 <description>Encloses directives that will be processed only
1603 if a test is true at startup</description>
1604 <syntax>&lt;IfDefine [!]<var>parameter-name</var>&gt; ...
1605     &lt;/IfDefine&gt;</syntax>
1606 <contextlist><context>server config</context><context>virtual host</context>
1607 <context>directory</context><context>.htaccess</context>
1608 </contextlist>
1609 <override>All</override>
1610
1611 <usage>
1612     <p>The <code>&lt;IfDefine <var>test</var>&gt;...&lt;/IfDefine&gt;
1613     </code> section is used to mark directives that are conditional. The
1614     directives within an <directive type="section">IfDefine</directive>
1615     section are only processed if the <var>test</var> is true. If <var>
1616     test</var> is false, everything between the start and end markers is
1617     ignored.</p>
1618
1619     <p>The <var>test</var> in the <directive type="section"
1620     >IfDefine</directive> section directive can be one of two forms:</p>
1621
1622     <ul>
1623       <li><var>parameter-name</var></li>
1624
1625       <li><code>!</code><var>parameter-name</var></li>
1626     </ul>
1627
1628     <p>In the former case, the directives between the start and end
1629     markers are only processed if the parameter named
1630     <var>parameter-name</var> is defined. The second format reverses
1631     the test, and only processes the directives if
1632     <var>parameter-name</var> is <strong>not</strong> defined.</p>
1633
1634     <p>The <var>parameter-name</var> argument is a define as given on the
1635     <program>httpd</program> command line via <code>-D<var>parameter</var>
1636     </code> at the time the server was started or by the <directive
1637     module="core">Define</directive> directive.</p>
1638
1639     <p><directive type="section">IfDefine</directive> sections are
1640     nest-able, which can be used to implement simple
1641     multiple-parameter tests. Example:</p>
1642
1643     <example>
1644       httpd -DReverseProxy -DUseCache -DMemCache ...<br />
1645       <br />
1646       # httpd.conf<br />
1647       &lt;IfDefine ReverseProxy&gt;<br />
1648       <indent>
1649         LoadModule proxy_module   modules/mod_proxy.so<br />
1650         LoadModule proxy_http_module   modules/mod_proxy_http.so<br />
1651         &lt;IfDefine UseCache&gt;<br />
1652         <indent>
1653           LoadModule cache_module   modules/mod_cache.so<br />
1654           &lt;IfDefine MemCache&gt;<br />
1655           <indent>
1656             LoadModule mem_cache_module   modules/mod_mem_cache.so<br />
1657           </indent>
1658           &lt;/IfDefine&gt;<br />
1659           &lt;IfDefine !MemCache&gt;<br />
1660           <indent>
1661             LoadModule cache_disk_module   modules/mod_cache_disk.so<br />
1662           </indent>
1663           &lt;/IfDefine&gt;
1664         </indent>
1665         &lt;/IfDefine&gt;
1666       </indent>
1667       &lt;/IfDefine&gt;
1668     </example>
1669 </usage>
1670 </directivesynopsis>
1671
1672 <directivesynopsis type="section">
1673 <name>IfModule</name>
1674 <description>Encloses directives that are processed conditional on the
1675 presence or absence of a specific module</description>
1676 <syntax>&lt;IfModule [!]<var>module-file</var>|<var>module-identifier</var>&gt; ...
1677     &lt;/IfModule&gt;</syntax>
1678 <contextlist><context>server config</context><context>virtual host</context>
1679 <context>directory</context><context>.htaccess</context>
1680 </contextlist>
1681 <override>All</override>
1682 <compatibility>Module identifiers are available in version 2.1 and
1683 later.</compatibility>
1684
1685 <usage>
1686     <p>The <code>&lt;IfModule <var>test</var>&gt;...&lt;/IfModule&gt;</code>
1687     section is used to mark directives that are conditional on the presence of
1688     a specific module. The directives within an <directive type="section"
1689     >IfModule</directive> section are only processed if the <var>test</var>
1690     is true. If <var>test</var> is false, everything between the start and
1691     end markers is ignored.</p>
1692
1693     <p>The <var>test</var> in the <directive type="section"
1694     >IfModule</directive> section directive can be one of two forms:</p>
1695
1696     <ul>
1697       <li><var>module</var></li>
1698
1699       <li>!<var>module</var></li>
1700     </ul>
1701
1702     <p>In the former case, the directives between the start and end
1703     markers are only processed if the module named <var>module</var>
1704     is included in Apache httpd -- either compiled in or
1705     dynamically loaded using <directive module="mod_so"
1706     >LoadModule</directive>. The second format reverses the test,
1707     and only processes the directives if <var>module</var> is
1708     <strong>not</strong> included.</p>
1709
1710     <p>The <var>module</var> argument can be either the module identifier or
1711     the file name of the module, at the time it was compiled.  For example,
1712     <code>rewrite_module</code> is the identifier and
1713     <code>mod_rewrite.c</code> is the file name. If a module consists of
1714     several source files, use the name of the file containing the string
1715     <code>STANDARD20_MODULE_STUFF</code>.</p>
1716
1717     <p><directive type="section">IfModule</directive> sections are
1718     nest-able, which can be used to implement simple multiple-module
1719     tests.</p>
1720
1721     <note>This section should only be used if you need to have one
1722     configuration file that works whether or not a specific module
1723     is available. In normal operation, directives need not be
1724     placed in <directive type="section">IfModule</directive>
1725     sections.</note>
1726 </usage>
1727 </directivesynopsis>
1728
1729 <directivesynopsis>
1730 <name>Include</name>
1731 <description>Includes other configuration files from within
1732 the server configuration files</description>
1733 <syntax>Include [<var>optional</var>|<var>strict</var>] <var>file-path</var>|<var>directory-path</var>|<var>wildcard</var></syntax>
1734 <contextlist><context>server config</context><context>virtual host</context>
1735 <context>directory</context>
1736 </contextlist>
1737 <compatibility>Wildcard matching available in 2.0.41 and later, directory
1738 wildcard matching available in 2.3.6 and later</compatibility>
1739
1740 <usage>
1741     <p>This directive allows inclusion of other configuration files
1742     from within the server configuration files.</p>
1743
1744     <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used
1745     in the filename or directory parts of the path to include several files
1746     at once, in alphabetical order. In addition, if
1747     <directive>Include</directive> points to a directory, rather than a file,
1748     Apache httpd will read all files in that directory and any subdirectory.
1749     However, including entire directories is not recommended, because it is
1750     easy to accidentally leave temporary files in a directory that can cause
1751     <program>httpd</program> to fail. Instead, we encourage you to use the
1752     wildcard syntax shown below, to include files that match a particular
1753     pattern, such as *.conf, for example.</p>
1754
1755     <p>When a wildcard is specified for a <strong>file</strong> component of
1756     the path, and no file matches the wildcard, the
1757     <directive module="core">Include</directive>
1758     directive will be <strong>silently ignored</strong>. When a wildcard is
1759     specified for a <strong>directory</strong> component of the path, and
1760     no directory matches the wildcard, the
1761     <directive module="core">Include</directive> directive will
1762     <strong>fail with an error</strong> saying the directory cannot be found.
1763     </p>
1764
1765     <p>For further control over the behaviour of the server when no files or
1766     directories match, prefix the path with the modifiers <var>optional</var>
1767     or <var>strict</var>. If <var>optional</var> is specified, any wildcard
1768     file or directory that does not match will be silently ignored. If
1769     <var>strict</var> is specified, any wildcard file or directory that does
1770     not match at least one file will cause server startup to fail.</p>
1771
1772     <p>When a directory or file component of the path is
1773     specified exactly, and that directory or file does not exist,
1774     <directive module="core">Include</directive> directive will fail with an
1775     error saying the file or directory cannot be found.</p>
1776
1777     <p>The file path specified may be an absolute path, or may be relative 
1778     to the <directive module="core">ServerRoot</directive> directory.</p>
1779
1780     <p>Examples:</p>
1781
1782     <example>
1783       Include /usr/local/apache2/conf/ssl.conf<br />
1784       Include /usr/local/apache2/conf/vhosts/*.conf
1785     </example>
1786
1787     <p>Or, providing paths relative to your <directive
1788     module="core">ServerRoot</directive> directory:</p>
1789
1790     <example>
1791       Include conf/ssl.conf<br />
1792       Include conf/vhosts/*.conf
1793     </example>
1794
1795     <p>Wildcards may be included in the directory or file portion of the
1796     path. In the following example, the server will fail to load if no
1797     directories match conf/vhosts/*, but will load successfully if no
1798     files match *.conf.</p>
1799   
1800     <example>
1801       Include conf/vhosts/*/vhost.conf<br />
1802       Include conf/vhosts/*/*.conf
1803     </example>
1804
1805     <p>In this example, the server will fail to load if either
1806     conf/vhosts/* matches no directories, or if *.conf matches no files:</p>
1807
1808     <example>
1809       Include strict conf/vhosts/*/*.conf
1810     </example>
1811   
1812     <p>In this example, the server load successfully if either conf/vhosts/*
1813     matches no directories, or if *.conf matches no files:</p>
1814
1815     <example>
1816       Include optional conf/vhosts/*/*.conf
1817     </example>
1818
1819 </usage>
1820
1821 <seealso><program>apachectl</program></seealso>
1822 </directivesynopsis>
1823   
1824 <directivesynopsis>
1825 <name>KeepAlive</name>
1826 <description>Enables HTTP persistent connections</description>
1827 <syntax>KeepAlive On|Off</syntax>
1828 <default>KeepAlive On</default>
1829 <contextlist><context>server config</context><context>virtual host</context>
1830 </contextlist>
1831
1832 <usage>
1833     <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1834     connection feature of HTTP/1.1 provide long-lived HTTP sessions
1835     which allow multiple requests to be sent over the same TCP
1836     connection. In some cases this has been shown to result in an
1837     almost 50% speedup in latency times for HTML documents with
1838     many images. To enable Keep-Alive connections, set
1839     <code>KeepAlive On</code>.</p>
1840
1841     <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1842     used if they are specifically requested by a client. In
1843     addition, a Keep-Alive connection with an HTTP/1.0 client can
1844     only be used when the length of the content is known in
1845     advance. This implies that dynamic content such as CGI output,
1846     SSI pages, and server-generated directory listings will
1847     generally not use Keep-Alive connections to HTTP/1.0 clients.
1848     For HTTP/1.1 clients, persistent connections are the default
1849     unless otherwise specified. If the client requests it, chunked
1850     encoding will be used in order to send content of unknown
1851     length over persistent connections.</p>
1852
1853     <p>When a client uses a Keep-Alive connection it will be counted
1854     as a single "request" for the <directive module="mpm_common"
1855     >MaxConnectionsPerChild</directive> directive, regardless
1856     of how many requests are sent using the connection.</p>
1857 </usage>
1858
1859 <seealso><directive module="core">MaxKeepAliveRequests</directive></seealso>
1860 </directivesynopsis>
1861
1862 <directivesynopsis>
1863 <name>KeepAliveTimeout</name>
1864 <description>Amount of time the server will wait for subsequent
1865 requests on a persistent connection</description>
1866 <syntax>KeepAliveTimeout <var>num</var>[ms]</syntax>
1867 <default>KeepAliveTimeout 5</default>
1868 <contextlist><context>server config</context><context>virtual host</context>
1869 </contextlist>
1870 <compatibility>Specifying a value in milliseconds is available in 
1871 Apache httpd 2.3.2 and later</compatibility>
1872
1873 <usage>
1874     <p>The number of seconds Apache httpd will wait for a subsequent
1875     request before closing the connection. By adding a postfix of ms the
1876     timeout can be also set in milliseconds. Once a request has been
1877     received, the timeout value specified by the
1878     <directive module="core">Timeout</directive> directive applies.</p>
1879
1880     <p>Setting <directive>KeepAliveTimeout</directive> to a high value
1881     may cause performance problems in heavily loaded servers. The
1882     higher the timeout, the more server processes will be kept
1883     occupied waiting on connections with idle clients.</p>
1884     
1885     <p>In a name-based virtual host context, the value of the first
1886     defined virtual host (the default host) in a set of <directive
1887     module="core">NameVirtualHost</directive> will be used.
1888     The other values will be ignored.</p>
1889 </usage>
1890 </directivesynopsis>
1891
1892 <directivesynopsis type="section">
1893 <name>Limit</name>
1894 <description>Restrict enclosed access controls to only certain HTTP
1895 methods</description>
1896 <syntax>&lt;Limit <var>method</var> [<var>method</var>] ... &gt; ...
1897     &lt;/Limit&gt;</syntax>
1898 <contextlist><context>directory</context><context>.htaccess</context>
1899 </contextlist>
1900 <override>AuthConfig, Limit</override>
1901
1902 <usage>
1903     <p>Access controls are normally effective for
1904     <strong>all</strong> access methods, and this is the usual
1905     desired behavior. <strong>In the general case, access control
1906     directives should not be placed within a
1907     <directive type="section">Limit</directive> section.</strong></p>
1908
1909     <p>The purpose of the <directive type="section">Limit</directive>
1910     directive is to restrict the effect of the access controls to the
1911     nominated HTTP methods. For all other methods, the access
1912     restrictions that are enclosed in the <directive
1913     type="section">Limit</directive> bracket <strong>will have no
1914     effect</strong>. The following example applies the access control
1915     only to the methods <code>POST</code>, <code>PUT</code>, and
1916     <code>DELETE</code>, leaving all other methods unprotected:</p>
1917
1918     <example>
1919       &lt;Limit POST PUT DELETE&gt;<br />
1920       <indent>
1921         Require valid-user<br />
1922       </indent>
1923       &lt;/Limit&gt;
1924     </example>
1925
1926     <p>The method names listed can be one or more of: <code>GET</code>,
1927     <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1928     <code>CONNECT</code>, <code>OPTIONS</code>,
1929     <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1930     <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1931     <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1932     case-sensitive.</strong> If <code>GET</code> is used it will also
1933     restrict <code>HEAD</code> requests. The <code>TRACE</code> method
1934     cannot be limited (see <directive module="core"
1935     >TraceEnable</directive>).</p>
1936
1937     <note type="warning">A <directive type="section"
1938     module="core">LimitExcept</directive> section should always be
1939     used in preference to a <directive type="section">Limit</directive>
1940     section when restricting access, since a <directive type="section"
1941     module="core">LimitExcept</directive> section provides protection
1942     against arbitrary methods.</note>
1943
1944     <p>The <directive type="section">Limit</directive> and
1945     <directive type="section" module="core">LimitExcept</directive>
1946     directives may be nested.  In this case, each successive level of
1947     <directive type="section">Limit</directive> or <directive
1948     type="section" module="core">LimitExcept</directive> directives must
1949     further restrict the set of methods to which access controls apply.</p>
1950
1951     <note type="warning">When using
1952     <directive type="section">Limit</directive> or
1953     <directive type="section">LimitExcept</directive> directives with
1954     the <directive module="mod_authz_core">Require</directive> directive,
1955     note that the first <directive module="mod_authz_core">Require</directive>
1956     to succeed authorizes the request, regardless of the presence of other
1957     <directive module="mod_authz_core">Require</directive> directives.</note>
1958
1959     <p>For example, given the following configuration, all users will
1960     be authorized for <code>POST</code> requests, and the
1961     <code>Require group editors</code> directive will be ignored
1962     in all cases:</p>
1963
1964     <example>
1965       &lt;LimitExcept GET&gt;
1966       <indent>
1967         Require valid-user
1968       </indent> 
1969       &lt;/LimitExcept&gt;<br />
1970       &lt;Limit POST&gt;
1971       <indent>
1972         Require group editors
1973       </indent> 
1974       &lt;/Limit&gt;
1975     </example>
1976 </usage>
1977 </directivesynopsis>
1978
1979 <directivesynopsis type="section">
1980 <name>LimitExcept</name>
1981 <description>Restrict access controls to all HTTP methods
1982 except the named ones</description>
1983 <syntax>&lt;LimitExcept <var>method</var> [<var>method</var>] ... &gt; ...
1984     &lt;/LimitExcept&gt;</syntax>
1985 <contextlist><context>directory</context><context>.htaccess</context>
1986 </contextlist>
1987 <override>AuthConfig, Limit</override>
1988
1989 <usage>
1990     <p><directive type="section">LimitExcept</directive> and
1991     <code>&lt;/LimitExcept&gt;</code> are used to enclose
1992     a group of access control directives which will then apply to any
1993     HTTP access method <strong>not</strong> listed in the arguments;
1994     i.e., it is the opposite of a <directive type="section"
1995     module="core">Limit</directive> section and can be used to control
1996     both standard and nonstandard/unrecognized methods. See the
1997     documentation for <directive module="core"
1998     type="section">Limit</directive> for more details.</p>
1999
2000     <p>For example:</p>
2001
2002     <example>
2003       &lt;LimitExcept POST GET&gt;<br />
2004       <indent>
2005         Require valid-user<br />
2006       </indent>
2007       &lt;/LimitExcept&gt;
2008     </example>
2009
2010 </usage>
2011 </directivesynopsis>
2012
2013 <directivesynopsis>
2014 <name>LimitInternalRecursion</name>
2015 <description>Determine maximum number of internal redirects and nested
2016 subrequests</description>
2017 <syntax>LimitInternalRecursion <var>number</var> [<var>number</var>]</syntax>
2018 <default>LimitInternalRecursion 10</default>
2019 <contextlist><context>server config</context><context>virtual host</context>
2020 </contextlist>
2021 <compatibility>Available in Apache httpd 2.0.47 and later</compatibility>
2022
2023 <usage>
2024     <p>An internal redirect happens, for example, when using the <directive
2025     module="mod_actions">Action</directive> directive, which internally
2026     redirects the original request to a CGI script. A subrequest is Apache httpd's
2027     mechanism to find out what would happen for some URI if it were requested.
2028     For example, <module>mod_dir</module> uses subrequests to look for the
2029     files listed in the <directive module="mod_dir">DirectoryIndex</directive>
2030     directive.</p>
2031
2032     <p><directive>LimitInternalRecursion</directive> prevents the server
2033     from crashing when entering an infinite loop of internal redirects or
2034     subrequests. Such loops are usually caused by misconfigurations.</p>
2035
2036     <p>The directive stores two different limits, which are evaluated on
2037     per-request basis. The first <var>number</var> is the maximum number of
2038     internal redirects, that may follow each other. The second <var>number</var>
2039     determines, how deep subrequests may be nested. If you specify only one
2040     <var>number</var>, it will be assigned to both limits.</p>
2041
2042     <example><title>Example</title>
2043       LimitInternalRecursion 5
2044     </example>
2045 </usage>
2046 </directivesynopsis>
2047
2048 <directivesynopsis>
2049 <name>LimitRequestBody</name>
2050 <description>Restricts the total size of the HTTP request body sent
2051 from the client</description>
2052 <syntax>LimitRequestBody <var>bytes</var></syntax>
2053 <default>LimitRequestBody 0</default>
2054 <contextlist><context>server config</context><context>virtual host</context>
2055 <context>directory</context><context>.htaccess</context>
2056 </contextlist>
2057 <override>All</override>
2058
2059 <usage>
2060     <p>This directive specifies the number of <var>bytes</var> from 0
2061     (meaning unlimited) to 2147483647 (2GB) that are allowed in a
2062     request body. See the note below for the limited applicability
2063     to proxy requests.</p>
2064
2065     <p>The <directive>LimitRequestBody</directive> directive allows
2066     the user to set a limit on the allowed size of an HTTP request
2067     message body within the context in which the directive is given
2068     (server, per-directory, per-file or per-location). If the client
2069     request exceeds that limit, the server will return an error
2070     response instead of servicing the request. The size of a normal
2071     request message body will vary greatly depending on the nature of
2072     the resource and the methods allowed on that resource. CGI scripts
2073     typically use the message body for retrieving form information.
2074     Implementations of the <code>PUT</code> method will require
2075     a value at least as large as any representation that the server
2076     wishes to accept for that resource.</p>
2077
2078     <p>This directive gives the server administrator greater
2079     control over abnormal client request behavior, which may be
2080     useful for avoiding some forms of denial-of-service
2081     attacks.</p>
2082
2083     <p>If, for example, you are permitting file upload to a particular
2084     location, and wish to limit the size of the uploaded file to 100K,
2085     you might use the following directive:</p>
2086
2087     <example>
2088       LimitRequestBody 102400
2089     </example>
2090     
2091     <note><p>For a full description of how this directive is interpreted by 
2092     proxy requests, see the <module>mod_proxy</module> documentation.</p>
2093     </note>
2094
2095 </usage>
2096 </directivesynopsis>
2097
2098 <directivesynopsis>
2099 <name>LimitRequestFields</name>
2100 <description>Limits the number of HTTP request header fields that
2101 will be accepted from the client</description>
2102 <syntax>LimitRequestFields <var>number</var></syntax>
2103 <default>LimitRequestFields 100</default>
2104 <contextlist><context>server config</context><context>virtual host</context></contextlist>
2105
2106 <usage>
2107     <p><var>Number</var> is an integer from 0 (meaning unlimited) to
2108     32767. The default value is defined by the compile-time
2109     constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
2110     distributed).</p>
2111
2112     <p>The <directive>LimitRequestFields</directive> directive allows
2113     the server administrator to modify the limit on the number of
2114     request header fields allowed in an HTTP request. A server needs
2115     this value to be larger than the number of fields that a normal
2116     client request might include. The number of request header fields
2117     used by a client rarely exceeds 20, but this may vary among
2118     different client implementations, often depending upon the extent
2119     to which a user has configured their browser to support detailed
2120     content negotiation. Optional HTTP extensions are often expressed
2121     using request header fields.</p>
2122
2123     <p>This directive gives the server administrator greater
2124     control over abnormal client request behavior, which may be
2125     useful for avoiding some forms of denial-of-service attacks.
2126     The value should be increased if normal clients see an error
2127     response from the server that indicates too many fields were
2128     sent in the request.</p>
2129
2130     <p>For example:</p>
2131
2132     <example>
2133       LimitRequestFields 50
2134     </example>
2135
2136      <note type="warning"><title>Warning</title>
2137      <p> When name-based virtual hosting is used, the value for this 
2138      directive is taken from the default (first-listed) virtual host for the
2139      <directive>NameVirtualHost</directive> the connection was mapped to.</p>
2140      </note>
2141
2142 </usage>
2143 </directivesynopsis>
2144
2145 <directivesynopsis>
2146 <name>LimitRequestFieldSize</name>
2147 <description>Limits the size of the HTTP request header allowed from the
2148 client</description>
2149 <syntax>LimitRequestFieldSize <var>bytes</var></syntax>
2150 <default>LimitRequestFieldSize 8190</default>
2151 <contextlist><context>server config</context><context>virtual host</context></contextlist>
2152
2153 <usage>
2154     <p>This directive specifies the number of <var>bytes</var>
2155     that will be allowed in an HTTP request header.</p>
2156
2157     <p>The <directive>LimitRequestFieldSize</directive> directive
2158     allows the server administrator to reduce or increase the limit 
2159     on the allowed size of an HTTP request header field. A server
2160     needs this value to be large enough to hold any one header field 
2161     from a normal client request. The size of a normal request header 
2162     field will vary greatly among different client implementations, 
2163     often depending upon the extent to which a user has configured
2164     their browser to support detailed content negotiation. SPNEGO
2165     authentication headers can be up to 12392 bytes.</p>
2166
2167     <p>This directive gives the server administrator greater
2168     control over abnormal client request behavior, which may be
2169     useful for avoiding some forms of denial-of-service attacks.</p>
2170
2171     <p>For example:</p>
2172
2173     <example>
2174       LimitRequestFieldSize 4094
2175     </example>
2176
2177     <note>Under normal conditions, the value should not be changed from
2178     the default.</note>
2179
2180     <note type="warning"><title>Warning</title>
2181     <p> When name-based virtual hosting is used, the value for this 
2182     directive is taken from the default (first-listed) virtual host for the
2183     <directive>NameVirtualHost</directive> the connection was mapped to.</p>
2184     </note>
2185
2186 </usage>
2187 </directivesynopsis>
2188
2189 <directivesynopsis>
2190 <name>LimitRequestLine</name>
2191 <description>Limit the size of the HTTP request line that will be accepted
2192 from the client</description>
2193 <syntax>LimitRequestLine <var>bytes</var></syntax>
2194 <default>LimitRequestLine 8190</default>
2195 <contextlist><context>server config</context><context>virtual host</context></contextlist>
2196
2197 <usage>
2198     <p>This directive sets the number of <var>bytes</var> that will be 
2199     allowed on the HTTP request-line.</p>
2200
2201     <p>The <directive>LimitRequestLine</directive> directive allows
2202     the server administrator to reduce or increase the limit on the allowed size
2203     of a client's HTTP request-line. Since the request-line consists of the
2204     HTTP method, URI, and protocol version, the
2205     <directive>LimitRequestLine</directive> directive places a
2206     restriction on the length of a request-URI allowed for a request
2207     on the server. A server needs this value to be large enough to
2208     hold any of its resource names, including any information that
2209     might be passed in the query part of a <code>GET</code> request.</p>
2210
2211     <p>This directive gives the server administrator greater
2212     control over abnormal client request behavior, which may be
2213     useful for avoiding some forms of denial-of-service attacks.</p>
2214
2215     <p>For example:</p>
2216
2217     <example>
2218       LimitRequestLine 4094
2219     </example>
2220
2221     <note>Under normal conditions, the value should not be changed from
2222     the default.</note>
2223
2224     <note type="warning"><title>Warning</title>
2225     <p> When name-based virtual hosting is used, the value for this 
2226     directive is taken from the default (first-listed) virtual host for the
2227     <directive>NameVirtualHost</directive> the connection was mapped to.</p>
2228     </note>
2229
2230 </usage>
2231 </directivesynopsis>
2232
2233 <directivesynopsis>
2234 <name>LimitXMLRequestBody</name>
2235 <description>Limits the size of an XML-based request body</description>
2236 <syntax>LimitXMLRequestBody <var>bytes</var></syntax>
2237 <default>LimitXMLRequestBody 1000000</default>
2238 <contextlist><context>server config</context><context>virtual host</context>
2239 <context>directory</context><context>.htaccess</context></contextlist>
2240 <override>All</override>
2241
2242 <usage>
2243     <p>Limit (in bytes) on maximum size of an XML-based request
2244     body. A value of <code>0</code> will disable any checking.</p>
2245
2246     <p>Example:</p>
2247
2248     <example>
2249       LimitXMLRequestBody 0
2250     </example>
2251
2252 </usage>
2253 </directivesynopsis>
2254
2255 <directivesynopsis type="section">
2256 <name>Location</name>
2257 <description>Applies the enclosed directives only to matching
2258 URLs</description>
2259 <syntax>&lt;Location
2260     <var>URL-path</var>|<var>URL</var>&gt; ... &lt;/Location&gt;</syntax>
2261 <contextlist><context>server config</context><context>virtual host</context>
2262 </contextlist>
2263
2264 <usage>
2265     <p>The <directive type="section">Location</directive> directive
2266     limits the scope of the enclosed directives by URL. It is similar to the
2267     <directive type="section" module="core">Directory</directive>
2268     directive, and starts a subsection which is terminated with a
2269     <code>&lt;/Location&gt;</code> directive. <directive
2270     type="section">Location</directive> sections are processed in the
2271     order they appear in the configuration file, after the <directive
2272     type="section" module="core">Directory</directive> sections and
2273     <code>.htaccess</code> files are read, and after the <directive
2274     type="section" module="core">Files</directive> sections.</p>
2275
2276     <p><directive type="section">Location</directive> sections operate
2277     completely outside the filesystem.  This has several consequences.
2278     Most importantly, <directive type="section">Location</directive>
2279     directives should not be used to control access to filesystem
2280     locations.  Since several different URLs may map to the same
2281     filesystem location, such access controls may by circumvented.</p>
2282
2283     <p>The enclosed directives will be applied to the request if the path component
2284     of the URL meets <em>any</em> of the following criteria:
2285     </p>
2286     <ul>
2287       <li>The specified location matches exactly the path component of the URL.
2288       </li>
2289       <li>The specified location, which ends in a forward slash, is a prefix 
2290       of the path component of the URL (treated as a context root).
2291       </li>
2292       <li>The specified location, with the addition of a trailing slash, is a 
2293       prefix of the path component of the URL (also treated as a context root).
2294       </li>
2295     </ul>
2296     <p>
2297     In the example below, where no trailing slash is used, requests to 
2298     /private1, /private1/ and /private1/file.txt will have the enclosed
2299     directives applied, but /private1other would not. 
2300     </p>
2301     <example>
2302       &lt;Location /private1&gt;
2303           ...
2304     </example>
2305     <p>
2306     In the example below, where a trailing slash is used, requests to 
2307     /private2/ and /private2/file.txt will have the enclosed
2308     directives applied, but /private2 and /private2other would not. 
2309     </p>
2310     <example>
2311       &lt;Location /private2<em>/</em>&gt;
2312           ...
2313     </example>
2314
2315     <note><title>When to use <directive 
2316     type="section">Location</directive></title>
2317
2318     <p>Use <directive type="section">Location</directive> to apply
2319     directives to content that lives outside the filesystem.  For
2320     content that lives in the filesystem, use <directive
2321     type="section" module="core">Directory</directive> and <directive
2322     type="section" module="core">Files</directive>.  An exception is
2323     <code>&lt;Location /&gt;</code>, which is an easy way to 
2324     apply a configuration to the entire server.</p>
2325     </note>
2326
2327     <p>For all origin (non-proxy) requests, the URL to be matched is a
2328     URL-path of the form <code>/path/</code>.  <em>No scheme, hostname,
2329     port, or query string may be included.</em>  For proxy requests, the
2330     URL to be matched is of the form
2331     <code>scheme://servername/path</code>, and you must include the
2332     prefix.</p>
2333
2334     <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
2335     any single character, and <code>*</code> matches any sequences of
2336     characters. Neither wildcard character matches a / in the URL-path.</p>
2337
2338     <p><glossary ref="regex">Regular expressions</glossary>
2339     can also be used, with the addition of the <code>~</code> 
2340     character. For example:</p>
2341
2342     <example>
2343       &lt;Location ~ "/(extra|special)/data"&gt;
2344     </example>
2345
2346     <p>would match URLs that contained the substring <code>/extra/data</code>
2347     or <code>/special/data</code>. The directive <directive
2348     type="section" module="core">LocationMatch</directive> behaves
2349     identical to the regex version of <directive
2350     type="section">Location</directive>, and is preferred, for the
2351     simple reason that <code>~</code> is hard to distinguish from
2352     <code>-</code> in many fonts.</p>
2353
2354     <p>The <directive type="section">Location</directive>
2355     functionality is especially useful when combined with the
2356     <directive module="core">SetHandler</directive>
2357     directive. For example, to enable status requests, but allow them
2358     only from browsers at <code>example.com</code>, you might use:</p>
2359
2360     <example>
2361       &lt;Location /status&gt;<br />
2362       <indent>
2363         SetHandler server-status<br />
2364         Require host example.com<br />
2365       </indent>
2366       &lt;/Location&gt;
2367     </example>
2368
2369     <note><title>Note about / (slash)</title>
2370       <p>The slash character has special meaning depending on where in a
2371       URL it appears. People may be used to its behavior in the filesystem
2372       where multiple adjacent slashes are frequently collapsed to a single
2373       slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
2374       <code>/home/foo</code>). In URL-space this is not necessarily true.
2375       The <directive type="section" module="core">LocationMatch</directive>
2376       directive and the regex version of <directive type="section"
2377       >Location</directive> require you to explicitly specify multiple
2378       slashes if that is your intention.</p>
2379
2380       <p>For example, <code>&lt;LocationMatch ^/abc&gt;</code> would match
2381       the request URL <code>/abc</code> but not the request URL <code>
2382       //abc</code>. The (non-regex) <directive type="section"
2383       >Location</directive> directive behaves similarly when used for
2384       proxy requests. But when (non-regex) <directive type="section"
2385       >Location</directive> is used for non-proxy requests it will
2386       implicitly match multiple slashes with a single slash. For example,
2387       if you specify <code>&lt;Location /abc/def&gt;</code> and the
2388       request is to <code>/abc//def</code> then it will match.</p>
2389     </note>
2390 </usage>
2391 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
2392     and &lt;Files&gt; sections work</a> for an explanation of how these
2393     different sections are combined when a request is received.</seealso>
2394 <seealso><directive module="core">LocationMatch</directive></seealso>
2395 </directivesynopsis>
2396
2397 <directivesynopsis type="section">
2398 <name>LocationMatch</name>
2399 <description>Applies the enclosed directives only to regular-expression
2400 matching URLs</description>
2401 <syntax>&lt;LocationMatch
2402     <var>regex</var>&gt; ... &lt;/LocationMatch&gt;</syntax>
2403 <contextlist><context>server config</context><context>virtual host</context>
2404 </contextlist>
2405
2406 <usage>
2407     <p>The <directive type="section">LocationMatch</directive> directive
2408     limits the scope of the enclosed directives by URL, in an identical manner
2409     to <directive module="core" type="section">Location</directive>. However,
2410     it takes a <glossary ref="regex">regular expression</glossary>
2411     as an argument instead of a simple string. For example:</p>
2412
2413     <example>
2414       &lt;LocationMatch "/(extra|special)/data"&gt;
2415     </example>
2416
2417     <p>would match URLs that contained the substring <code>/extra/data</code>
2418     or <code>/special/data</code>.</p>
2419 </usage>
2420
2421 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
2422     and &lt;Files&gt; sections work</a> for an explanation of how these
2423     different sections are combined when a request is received</seealso>
2424 </directivesynopsis>
2425
2426 <directivesynopsis>
2427 <name>LogLevel</name>
2428 <description>Controls the verbosity of the ErrorLog</description>
2429 <syntax>LogLevel [<var>module</var>:]<var>level</var>
2430     [<var>module</var>:<var>level</var>] ...
2431 </syntax>
2432 <default>LogLevel warn</default>
2433 <contextlist><context>server config</context><context>virtual host</context>
2434 <context>directory</context>
2435 </contextlist>
2436 <compatibility>Per-module and per-directory configuration is available in
2437     Apache HTTP Server 2.3.6 and later</compatibility>
2438
2439 <usage>
2440     <p><directive>LogLevel</directive> adjusts the verbosity of the
2441     messages recorded in the error logs (see <directive
2442     module="core">ErrorLog</directive> directive). The following
2443     <var>level</var>s are available, in order of decreasing
2444     significance:</p>
2445
2446     <table border="1">
2447     <columnspec><column width=".2"/><column width=".3"/><column width=".5"/>
2448     </columnspec>
2449       <tr>
2450         <th><strong>Level</strong> </th>
2451
2452         <th><strong>Description</strong> </th>
2453
2454         <th><strong>Example</strong> </th>
2455       </tr>
2456
2457       <tr>
2458         <td><code>emerg</code> </td>
2459
2460         <td>Emergencies - system is unusable.</td>
2461
2462         <td>"Child cannot open lock file. Exiting"</td>
2463       </tr>
2464
2465       <tr>
2466         <td><code>alert</code> </td>
2467
2468         <td>Action must be taken immediately.</td>
2469
2470         <td>"getpwuid: couldn't determine user name from uid"</td>
2471       </tr>
2472
2473       <tr>
2474         <td><code>crit</code> </td>
2475
2476         <td>Critical Conditions.</td>
2477
2478         <td>"socket: Failed to get a socket, exiting child"</td>
2479       </tr>
2480
2481       <tr>
2482         <td><code>error</code> </td>
2483
2484         <td>Error conditions.</td>
2485
2486         <td>"Premature end of script headers"</td>
2487       </tr>
2488
2489       <tr>
2490         <td><code>warn</code> </td>
2491
2492         <td>Warning conditions.</td>
2493
2494         <td>"child process 1234 did not exit, sending another
2495         SIGHUP"</td>
2496       </tr>
2497
2498       <tr>
2499         <td><code>notice</code> </td>
2500
2501         <td>Normal but significant condition.</td>
2502
2503         <td>"httpd: caught SIGBUS, attempting to dump core in
2504         ..."</td>
2505       </tr>
2506
2507       <tr>
2508         <td><code>info</code> </td>
2509
2510         <td>Informational.</td>
2511
2512         <td>"Server seems busy, (you may need to increase
2513         StartServers, or Min/MaxSpareServers)..."</td>
2514       </tr>
2515
2516       <tr>
2517         <td><code>debug</code> </td>
2518
2519         <td>Debug-level messages</td>
2520
2521         <td>"Opening config file ..."</td>
2522       </tr>
2523       <tr>
2524         <td><code>trace1</code> </td>
2525
2526         <td>Trace messages</td>
2527
2528         <td>"proxy: FTP: control connection complete"</td>
2529       </tr>
2530       <tr>
2531         <td><code>trace2</code> </td>
2532
2533         <td>Trace messages</td>
2534
2535         <td>"proxy: CONNECT: sending the CONNECT request to the remote proxy"</td>
2536       </tr>
2537       <tr>
2538         <td><code>trace3</code> </td>
2539
2540         <td>Trace messages</td>
2541
2542         <td>"openssl: Handshake: start"</td>
2543       </tr>
2544       <tr>
2545         <td><code>trace4</code> </td>
2546
2547         <td>Trace messages</td>
2548
2549         <td>"read from buffered SSL brigade, mode 0, 17 bytes"</td>
2550       </tr>
2551       <tr>
2552         <td><code>trace5</code> </td>
2553
2554         <td>Trace messages</td>
2555
2556         <td>"map lookup FAILED: map=rewritemap key=keyname"</td>
2557       </tr>
2558       <tr>
2559         <td><code>trace6</code> </td>
2560
2561         <td>Trace messages</td>
2562
2563         <td>"cache lookup FAILED, forcing new map lookup"</td>
2564       </tr>
2565       <tr>
2566         <td><code>trace7</code> </td>
2567
2568         <td>Trace messages, dumping large amounts of data</td>
2569
2570         <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2571       </tr>
2572       <tr>
2573         <td><code>trace8</code> </td>
2574
2575         <td>Trace messages, dumping large amounts of data</td>
2576
2577         <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2578       </tr>
2579     </table>
2580
2581     <p>When a particular level is specified, messages from all
2582     other levels of higher significance will be reported as well.
2583     <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2584     then messages with log levels of <code>notice</code> and
2585     <code>warn</code> will also be posted.</p>
2586
2587     <p>Using a level of at least <code>crit</code> is
2588     recommended.</p>
2589
2590     <p>For example:</p>
2591
2592     <example>
2593       LogLevel notice
2594     </example>
2595
2596     <note><title>Note</title>
2597       <p>When logging to a regular file messages of the level
2598       <code>notice</code> cannot be suppressed and thus are always
2599       logged. However, this doesn't apply when logging is done
2600       using <code>syslog</code>.</p>
2601     </note>
2602
2603     <p>Specifying a level without a module name will reset the level
2604     for all modules to that level.  Specifying a level with a module
2605     name will set the level for that module only. It is possible to
2606     use the module source file name, the module identifier, or the
2607     module identifier with the trailing <code>_module</code> omitted
2608     as module specification. This means the following three specifications
2609     are equivalent:</p>
2610
2611     <example>
2612       LogLevel info ssl:warn<br />
2613       LogLevel info mod_ssl.c:warn<br />
2614       LogLevel info ssl_module:warn<br />
2615     </example>
2616
2617     <p>It is also possible to change the level per directory:</p>
2618
2619     <example>
2620         LogLevel info<br />
2621         &lt;Directory /usr/local/apache/htdocs/app&gt;<br />
2622         &nbsp; LogLevel debug<br />
2623         &lt;/Files&gt;
2624     </example>
2625
2626     <note>
2627         Per directory loglevel configuration only affects messages that are
2628         logged after the request has been parsed and that are associated with
2629         the request. Log messages which are associated with the connection or
2630         the server are not affected.
2631     </note>
2632 </usage>
2633 </directivesynopsis>
2634
2635 <directivesynopsis>
2636 <name>MaxKeepAliveRequests</name>
2637 <description>Number of requests allowed on a persistent
2638 connection</description>
2639 <syntax>MaxKeepAliveRequests <var>number</var></syntax>
2640 <default>MaxKeepAliveRequests 100</default>
2641 <contextlist><context>server config</context><context>virtual host</context>
2642 </contextlist>
2643
2644 <usage>
2645     <p>The <directive>MaxKeepAliveRequests</directive> directive
2646     limits the number of requests allowed per connection when
2647     <directive module="core" >KeepAlive</directive> is on. If it is
2648     set to <code>0</code>, unlimited requests will be allowed. We
2649     recommend that this setting be kept to a high value for maximum
2650     server performance.</p>
2651
2652     <p>For example:</p>
2653
2654     <example>
2655       MaxKeepAliveRequests 500
2656     </example>
2657 </usage>
2658 </directivesynopsis>
2659
2660 <directivesynopsis>
2661 <name>Mutex</name>
2662 <description>Configures mutex mechanism and lock file directory for all
2663 or specified mutexes</description>
2664 <syntax>Mutex <var>mechanism</var> [default|<var>mutex-name</var>] ... [OmitPID]</syntax>
2665 <default>Mutex default</default>
2666 <contextlist><context>server config</context></contextlist>
2667 <compatibility>Available in Apache HTTP Server 2.3.4 and later</compatibility>
2668
2669 <usage>
2670     <p>The <directive>Mutex</directive> directive sets the mechanism,
2671     and optionally the lock file location, that httpd and modules use
2672     to serialize access to resources.  Specify <code>default</code> as
2673     the first argument to change the settings for all mutexes; specify
2674     a mutex name (see table below) as the first argument to override
2675     defaults only for that mutex.</p>
2676
2677     <p>The <directive>Mutex</directive> directive is typically used in
2678     the following exceptional situations:</p>
2679
2680     <ul>
2681         <li>change the mutex mechanism when the default mechanism selected
2682         by <glossary>APR</glossary> has a functional or performance
2683         problem</li>
2684
2685         <li>change the directory used by file-based mutexes when the
2686         default directory does not support locking</li>
2687     </ul>
2688
2689     <note><title>Supported modules</title>
2690     <p>This directive only configures mutexes which have been registered
2691     with the core server using the <code>ap_mutex_register()</code> API.
2692     All modules bundled with httpd support the <directive>Mutex</directive>
2693     directive, but third-party modules may not.  Consult the documentation
2694     of the third-party module, which must indicate the mutex name(s) which
2695     can be configured if this directive is supported.</p>
2696     </note>
2697
2698     <p>The following mutex <em>mechanisms</em> are available:</p>
2699     <ul>
2700         <li><code>default | yes</code>
2701         <p>This selects the default locking implementation, as determined by
2702         <glossary>APR</glossary>.  The default locking implementation can
2703         be displayed by running <program>httpd</program> with the 
2704         <code>-V</code> option.</p></li>
2705
2706         <li><code>none | no</code>
2707         <p>This effectively disables the mutex, and is only allowed for a
2708         mutex if the module indicates that it is a valid choice.  Consult the
2709         module documentation for more information.</p></li>
2710
2711         <li><code>posixsem</code>
2712         <p>This is a mutex variant based on a Posix semaphore.</p>
2713
2714         <note type="warning"><title>Warning</title>
2715         <p>The semaphore ownership is not recovered if a thread in the process
2716         holding the mutex segfaults, resulting in a hang of the web server.</p>
2717         </note>
2718         </li>
2719
2720         <li><code>sysvsem</code>
2721         <p>This is a mutex variant based on a SystemV IPC semaphore.</p>
2722
2723         <note type="warning"><title>Warning</title>
2724         <p>It is possible to "leak" SysV semaphores if processes crash 
2725         before the semaphore is removed.</p>
2726         </note>
2727
2728         <note type="warning"><title>Security</title>
2729         <p>The semaphore API allows for a denial of service attack by any
2730         CGIs running under the same uid as the webserver (<em>i.e.</em>,
2731         all CGIs, unless you use something like <program>suexec</program>
2732         or <code>cgiwrapper</code>).</p>
2733         </note>
2734         </li>
2735
2736         <li><code>sem</code>
2737         <p>This selects the "best" available semaphore implementation, choosing
2738         between Posix and SystemV IPC semaphores, in that order.</p></li>
2739
2740         <li><code>pthread</code>
2741         <p>This is a mutex variant based on cross-process Posix thread
2742         mutexes.</p>
2743
2744         <note type="warning"><title>Warning</title>
2745         <p>On most systems, if a child process terminates abnormally while
2746         holding a mutex that uses this implementation, the server will deadlock
2747         and stop responding to requests.  When this occurs, the server will
2748         require a manual restart to recover.</p>
2749         <p>Solaris is a notable exception as it provides a mechanism which
2750         usually allows the mutex to be recovered after a child process
2751         terminates abnormally while holding a mutex.</p>
2752         <p>If your system implements the
2753         <code>pthread_mutexattr_setrobust_np()</code> function, you may be able
2754         to use the <code>pthread</code> option safely.</p>
2755         </note>
2756         </li>
2757
2758         <li><code>fcntl:/path/to/mutex</code>
2759         <p>This is a mutex variant where a physical (lock-)file and the 
2760         <code>fcntl()</code> function are used as the mutex.</p>
2761
2762         <note type="warning"><title>Warning</title>
2763         <p>When multiple mutexes based on this mechanism are used within
2764         multi-threaded, multi-process environments, deadlock errors (EDEADLK)
2765         can be reported for valid mutex operations if <code>fcntl()</code>
2766         is not thread-aware, such as on Solaris.</p>
2767         </note>
2768         </li>
2769
2770         <li><code>flock:/path/to/mutex</code>
2771         <p>This is similar to the <code>fcntl:/path/to/mutex</code> method
2772         with the exception that the <code>flock()</code> function is used to
2773         provide file locking.</p></li>
2774
2775         <li><code>file:/path/to/mutex</code>
2776         <p>This selects the "best" available file locking implementation,
2777         choosing between <code>fcntl</code> and <code>flock</code>, in that
2778         order.</p></li>
2779     </ul>
2780
2781     <p>Most mechanisms are only available on selected platforms, where the 
2782     underlying platform and <glossary>APR</glossary> support it.  Mechanisms
2783     which aren't available on all platforms are <em>posixsem</em>,
2784     <em>sysvsem</em>, <em>sem</em>, <em>pthread</em>, <em>fcntl</em>, 
2785     <em>flock</em>, and <em>file</em>.</p>
2786
2787     <p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
2788     the path, if provided, is a directory where the lock file will be created.
2789     The default directory is httpd's run-time file directory relative to
2790     <directive module="core">ServerRoot</directive>.  Always use a local disk
2791     filesystem for <code>/path/to/mutex</code> and never a directory residing
2792     on a NFS- or AFS-filesystem.  The basename of the file will be the mutex
2793     type, an optional instance string provided by the module, and unless the
2794     <code>OmitPID</code> keyword is specified, the process id of the httpd 
2795     parent process will be appended to to make the file name unique, avoiding
2796     conflicts when multiple httpd instances share a lock file directory.  For
2797     example, if the mutex name is <code>mpm-accept</code> and the lock file
2798     directory is <code>/var/httpd/locks</code>, the lock file name for the
2799     httpd instance with parent process id 12345 would be 
2800     <code>/var/httpd/locks/mpm-accept.12345</code>.</p>
2801
2802     <note type="warning"><title>Security</title>
2803     <p>It is best to <em>avoid</em> putting mutex files in a world-writable
2804     directory such as <code>/var/tmp</code> because someone could create
2805     a denial of service attack and prevent the server from starting by
2806     creating a lockfile with the same name as the one the server will try
2807     to create.</p>
2808     </note>
2809
2810     <p>The following table documents the names of mutexes used by httpd
2811     and bundled modules.</p>
2812
2813     <table border="1" style="zebra">
2814         <tr>
2815             <th>Mutex name</th>
2816             <th>Module(s)</th>
2817             <th>Protected resource</th>
2818         </tr>
2819         <tr>
2820             <td><code>mpm-accept</code></td>
2821             <td><module>prefork</module> and <module>worker</module> MPMs</td>
2822             <td>incoming connections, to avoid the thundering herd problem;
2823             for more information, refer to the
2824             <a href="../misc/perf-tuning.html">performance tuning</a>
2825             documentation</td>
2826         </tr>
2827         <tr>
2828             <td><code>authdigest-client</code></td>
2829             <td><module>mod_auth_digest</module></td>
2830             <td>client list in shared memory</td>
2831         </tr>
2832         <tr>
2833             <td><code>authdigest-opaque</code></td>
2834             <td><module>mod_auth_digest</module></td>
2835             <td>counter in shared memory</td>
2836         </tr>
2837         <tr>
2838             <td><code>ldap-cache</code></td>
2839             <td><module>mod_ldap</module></td>
2840             <td>LDAP result cache</td>
2841         </tr>
2842         <tr>
2843             <td><code>rewrite-map</code></td>
2844             <td><module>mod_rewrite</module></td>
2845             <td>communication with external mapping programs, to avoid
2846             intermixed I/O from multiple requests</td>
2847         </tr>
2848         <tr>
2849             <td><code>ssl-cache</code></td>
2850             <td><module>mod_ssl</module></td>
2851             <td>SSL session cache</td>
2852         </tr>
2853         <tr>
2854             <td><code>ssl-stapling</code></td>
2855             <td><module>mod_ssl</module></td>
2856             <td>OCSP stapling response cache</td>
2857         </tr>
2858         <tr>
2859             <td><code>watchdog-callback</code></td>
2860             <td><module>mod_watchdog</module></td>
2861             <td>callback function of a particular client module</td>
2862         </tr>
2863     </table>
2864
2865     <p>The <code>OmitPID</code> keyword suppresses the addition of the httpd
2866     parent process id from the lock file name.</p>
2867
2868     <p>In the following example, the mutex mechanism for the MPM accept
2869     mutex will be changed from the compiled-in default to <code>fcntl</code>,
2870     with the associated lock file created in directory
2871     <code>/var/httpd/locks</code>.  The mutex mechanism for all other mutexes
2872     will be changed from the compiled-in default to <code>sysvsem</code>.</p>
2873
2874     <example>
2875     Mutex default sysvsem<br />
2876     Mutex mpm-accept fcntl:/var/httpd/locks
2877     </example>
2878 </usage>
2879 </directivesynopsis>
2880
2881 <directivesynopsis>
2882 <name>NameVirtualHost</name>
2883 <description>Designates an IP address for name-virtual
2884 hosting</description>
2885 <syntax>NameVirtualHost <var>addr</var>[:<var>port</var>]</syntax>
2886 <contextlist><context>server config</context></contextlist>
2887
2888 <usage>
2889
2890 <p>A single <directive>NameVirtualHost</directive> directive 
2891 identifies a set of identical virtual hosts on which the server will  
2892 further select from on the basis of the <em>hostname</em> 
2893 requested by the client.  The <directive>NameVirtualHost</directive>
2894 directive is a required directive if you want to configure 
2895 <a href="../vhosts/">name-based virtual hosts</a>.</p>
2896
2897 <p>This directive, and the corresponding <directive >VirtualHost</directive>,
2898 <em>must</em> be qualified with a port number if the server supports both HTTP 
2899 and HTTPS connections.</p>
2900
2901 <p>Although <var>addr</var> can be a hostname, it is recommended
2902 that you always use an IP address or a wildcard.  A wildcard
2903 NameVirtualHost matches only virtualhosts that also have a literal wildcard
2904 as their argument.</p>
2905
2906 <p>In cases where a firewall or other proxy receives the requests and 
2907 forwards them on a different IP address to the server, you must specify the
2908 IP address of the physical interface on the machine which will be
2909 servicing the requests. </p>
2910
2911 <p> In the example below, requests received on interface 192.0.2.1 and port 80 
2912 will only select among the first two virtual hosts. Requests received on
2913 port 80 on any other interface will only select among the third and fourth
2914 virtual hosts. In the common case where the interface isn't important 
2915 to the mapping, only the "*:80" NameVirtualHost and VirtualHost directives 
2916 are necessary.</p>
2917
2918    <example>
2919       NameVirtualHost 192.0.2.1:80<br />
2920       NameVirtualHost *:80<br /><br />
2921
2922       &lt;VirtualHost 192.0.2.1:80&gt;<br />
2923       &nbsp; ServerName namebased-a.example.com<br />
2924       &lt;/VirtualHost&gt;<br />
2925       <br />
2926       &lt;VirtualHost 192.0.2.1:80&gt;<br />
2927       &nbsp; Servername namebased-b.example.com<br />
2928       &lt;/VirtualHost&gt;<br />
2929       <br />
2930       &lt;VirtualHost *:80&gt;<br />
2931       &nbsp; ServerName namebased-c.example.com <br />
2932       &lt;/VirtualHost&gt;<br />
2933       <br />
2934       &lt;VirtualHost *:80&gt;<br />
2935       &nbsp; ServerName namebased-d.example.com <br />
2936       &lt;/VirtualHost&gt;<br />
2937       <br />
2938
2939     </example>
2940
2941     <p>If no matching virtual host is found, then the first listed
2942     virtual host that matches the IP address and port will be used.</p>
2943
2944
2945     <p>IPv6 addresses must be enclosed in square brackets, as shown
2946     in the following example:</p>
2947
2948     <example>
2949       NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
2950     </example>
2951
2952     <note><title>Argument to <directive type="section">VirtualHost</directive>
2953       directive</title>
2954       <p>Note that the argument to the <directive
2955        type="section">VirtualHost</directive> directive must
2956       exactly match the argument to the <directive
2957       >NameVirtualHost</directive> directive.</p>
2958
2959       <example>
2960         NameVirtualHost 192.0.2.2:80<br />
2961         &lt;VirtualHost 192.0.2.2:80&gt;<br />
2962         # ...<br />
2963         &lt;/VirtualHost&gt;<br />
2964       </example>
2965     </note>
2966 </usage>
2967
2968 <seealso><a href="../vhosts/">Virtual Hosts
2969 documentation</a></seealso>
2970
2971 </directivesynopsis>
2972
2973 <directivesynopsis>
2974 <name>Options</name>
2975 <description>Configures what features are available in a particular
2976 directory</description>
2977 <syntax>Options
2978     [+|-]<var>option</var> [[+|-]<var>option</var>] ...</syntax>
2979 <default>Options All</default>
2980 <contextlist><context>server config</context><context>virtual host</context>
2981 <context>directory</context><context>.htaccess</context>
2982 </contextlist>
2983 <override>Options</override>
2984
2985 <usage>
2986     <p>The <directive>Options</directive> directive controls which
2987     server features are available in a particular directory.</p>
2988
2989     <p><var>option</var> can be set to <code>None</code>, in which
2990     case none of the extra features are enabled, or one or more of
2991     the following:</p>
2992
2993     <dl>
2994       <dt><code>All</code></dt>
2995
2996       <dd>All options except for <code>MultiViews</code>. This is the default
2997       setting.</dd>
2998
2999       <dt><code>ExecCGI</code></dt>
3000
3001       <dd>
3002       Execution of CGI scripts using <module>mod_cgi</module>
3003       is permitted.</dd>
3004
3005       <dt><code>FollowSymLinks</code></dt>
3006
3007       <dd>
3008
3009       The server will follow symbolic links in this directory.
3010       <note>
3011       <p>Even though the server follows the symlink it does <em>not</em>
3012       change the pathname used to match against <directive type="section"
3013       module="core">Directory</directive> sections.</p>
3014       <p>Note also, that this option <strong>gets ignored</strong> if set
3015       inside a <directive type="section" module="core">Location</directive>
3016       section.</p>
3017       <p>Omitting this option should not be considered a security restriction,
3018       since symlink testing is subject to race conditions that make it
3019       circumventable.</p>
3020       </note></dd>
3021
3022       <dt><code>Includes</code></dt>
3023
3024       <dd>
3025       Server-side includes provided by <module>mod_include</module>
3026       are permitted.</dd>
3027
3028       <dt><code>IncludesNOEXEC</code></dt>
3029
3030       <dd>
3031
3032       Server-side includes are permitted, but the <code>#exec
3033       cmd</code> and <code>#exec cgi</code> are disabled. It is still
3034       possible to <code>#include virtual</code> CGI scripts from
3035       <directive module="mod_alias">ScriptAlias</directive>ed
3036       directories.</dd>
3037
3038       <dt><code>Indexes</code></dt>
3039
3040       <dd>
3041       If a URL which maps to a directory is requested, and there
3042       is no <directive module="mod_dir">DirectoryIndex</directive>
3043       (<em>e.g.</em>, <code>index.html</code>) in that directory, then
3044       <module>mod_autoindex</module> will return a formatted listing
3045       of the directory.</dd>
3046
3047       <dt><code>MultiViews</code></dt>
3048
3049       <dd>
3050       <a href="../content-negotiation.html">Content negotiated</a>
3051       "MultiViews" are allowed using
3052       <module>mod_negotiation</module>.
3053       <note><title>Note</title> <p>This option gets ignored if set
3054       anywhere other than <directive module="core" type="section"
3055       >Directory</directive>, as <module>mod_negotiation</module>
3056       needs real resources to compare against and evaluate from.</p></note>
3057       </dd>
3058
3059       <dt><code>SymLinksIfOwnerMatch</code></dt>
3060
3061       <dd>The server will only follow symbolic links for which the
3062       target file or directory is owned by the same user id as the
3063       link.
3064
3065       <note><title>Note</title> <p>This option gets ignored if
3066       set inside a <directive module="core"
3067       type="section">Location</directive> section.</p>
3068       <p>This option should not be considered a security restriction,
3069       since symlink testing is subject to race conditions that make it
3070       circumventable.</p></note>
3071       </dd>
3072     </dl>
3073
3074     <p>Normally, if multiple <directive>Options</directive> could
3075     apply to a directory, then the most specific one is used and
3076     others are ignored; the options are not merged. (See <a
3077     href="../sections.html#mergin">how sections are merged</a>.)
3078     However if <em>all</em> the options on the
3079     <directive>Options</directive> directive are preceded by a
3080     <code>+</code> or <code>-</code> symbol, the options are
3081     merged. Any options preceded by a <code>+</code> are added to the
3082     options currently in force, and any options preceded by a
3083     <code>-</code> are removed from the options currently in
3084     force. </p>
3085
3086     <note type="warning"><title>Warning</title>
3087     <p>Mixing <directive>Options</directive> with a <code>+</code> or
3088     <code>-</code> with those without is not valid syntax, and is likely
3089     to cause unexpected results.</p>
3090     </note>
3091
3092     <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
3093
3094     <example>
3095       &lt;Directory /web/docs&gt;<br />
3096       <indent>
3097         Options Indexes FollowSymLinks<br />
3098       </indent>
3099       &lt;/Directory&gt;<br />
3100       <br />
3101       &lt;Directory /web/docs/spec&gt;<br />
3102       <indent>
3103         Options Includes<br />
3104       </indent>
3105       &lt;/Directory&gt;
3106     </example>
3107
3108     <p>then only <code>Includes</code> will be set for the
3109     <code>/web/docs/spec</code> directory. However if the second
3110     <directive>Options</directive> directive uses the <code>+</code> and
3111     <code>-</code> symbols:</p>
3112
3113     <example>
3114       &lt;Directory /web/docs&gt;<br />
3115       <indent>
3116         Options Indexes FollowSymLinks<br />
3117       </indent>
3118       &lt;/Directory&gt;<br />
3119       <br />
3120       &lt;Directory /web/docs/spec&gt;<br />
3121       <indent>
3122         Options +Includes -Indexes<br />
3123       </indent>
3124       &lt;/Directory&gt;
3125     </example>
3126
3127     <p>then the options <code>FollowSymLinks</code> and
3128     <code>Includes</code> are set for the <code>/web/docs/spec</code>
3129     directory.</p>
3130
3131     <note><title>Note</title>
3132       <p>Using <code>-IncludesNOEXEC</code> or
3133       <code>-Includes</code> disables server-side includes completely
3134       regardless of the previous setting.</p>
3135     </note>
3136
3137     <p>The default in the absence of any other settings is
3138     <code>All</code>.</p>
3139 </usage>
3140 </directivesynopsis>
3141
3142 <directivesynopsis>
3143 <name>Protocol</name>
3144 <description>Protocol for a listening socket</description>
3145 <syntax>Protocol <var>protocol</var></syntax>
3146 <contextlist><context>server config</context><context>virtual host</context></contextlist>
3147 <compatibility>Available in Apache 2.1.5 and later.
3148 On Windows from Apache 2.3.3 and later.</compatibility>
3149
3150 <usage>
3151     <p>This directive specifies the protocol used for a specific listening socket.
3152        The protocol is used to determine which module should handle a request, and
3153        to apply protocol specific optimizations with the <directive>AcceptFilter</directive>
3154        directive.</p>
3155
3156     <p>You only need to set the protocol if you are running on non-standard ports, otherwise <code>http</code> is assumed for port 80 and <code>https</code> for port 443.</p>
3157
3158     <p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
3159
3160     <example>
3161       Protocol https
3162     </example>
3163
3164     <p>You can also specify the protocol using the <directive module="mpm_common">Listen</directive> directive.</p>
3165 </usage>
3166 <seealso><directive>AcceptFilter</directive></seealso>
3167 <seealso><directive module="mpm_common">Listen</directive></seealso>
3168 </directivesynopsis>
3169
3170
3171 <directivesynopsis>
3172 <name>RLimitCPU</name>
3173 <description>Limits the CPU consumption of processes launched
3174 by Apache httpd children</description>
3175 <syntax>RLimitCPU <var>seconds</var>|max [<var>seconds</var>|max]</syntax>
3176 <default>Unset; uses operating system defaults</default>
3177 <contextlist><context>server config</context><context>virtual host</context>
3178 <context>directory</context><context>.htaccess</context></contextlist>
3179 <override>All</override>
3180
3181 <usage>
3182     <p>Takes 1 or 2 parameters. The first parameter sets the soft
3183     resource limit for all processes and the second parameter sets
3184     the maximum resource limit. Either parameter can be a number,
3185     or <code>max</code> to indicate to the server that the limit should
3186     be set to the maximum allowed by the operating system
3187     configuration. Raising the maximum resource limit requires that
3188     the server is running as <code>root</code>, or in the initial startup
3189     phase.</p>
3190
3191     <p>This applies to processes forked off from Apache httpd children
3192     servicing requests, not the Apache httpd children themselves. This
3193     includes CGI scripts and SSI exec commands, but not any
3194     processes forked off from the Apache httpd parent such as piped
3195     logs.</p>
3196
3197     <p>CPU resource limits are expressed in seconds per
3198     process.</p>
3199 </usage>
3200 <seealso><directive module="core">RLimitMEM</directive></seealso>
3201 <seealso><directive module="core">RLimitNPROC</directive></seealso>
3202 </directivesynopsis>
3203
3204 <directivesynopsis>
3205 <name>RLimitMEM</name>
3206 <description>Limits the memory consumption of processes launched
3207 by Apache httpd children</description>
3208 <syntax>RLimitMEM <var>bytes</var>|max [<var>bytes</var>|max]</syntax>
3209 <default>Unset; uses operating system defaults</default>
3210 <contextlist><context>server config</context><context>virtual host</context>
3211 <context>directory</context><context>.htaccess</context></contextlist>
3212 <override>All</override>
3213
3214 <usage>
3215     <p>Takes 1 or 2 parameters. The first parameter sets the soft
3216     resource limit for all processes and the second parameter sets
3217     the maximum resource limit. Either parameter can be a number,
3218     or <code>max</code> to indicate to the server that the limit should
3219     be set to the maximum allowed by the operating system
3220     configuration. Raising the maximum resource limit requires that
3221     the server is running as <code>root</code>, or in the initial startup
3222     phase.</p>
3223
3224     <p>This applies to processes forked off from Apache httpd children
3225     servicing requests, not the Apache httpd children themselves. This
3226     includes CGI scripts and SSI exec commands, but not any
3227     processes forked off from the Apache httpd parent such as piped
3228     logs.</p>
3229
3230     <p>Memory resource limits are expressed in bytes per
3231     process.</p>
3232 </usage>
3233 <seealso><directive module="core">RLimitCPU</directive></seealso>
3234 <seealso><directive module="core">RLimitNPROC</directive></seealso>
3235 </directivesynopsis>
3236
3237 <directivesynopsis>
3238 <name>RLimitNPROC</name>
3239 <description>Limits the number of processes that can be launched by
3240 processes launched by Apache httpd children</description>
3241 <syntax>RLimitNPROC <var>number</var>|max [<var>number</var>|max]</syntax>
3242 <default>Unset; uses operating system defaults</default>
3243 <contextlist><context>server config</context><context>virtual host</context>
3244 <context>directory</context><context>.htaccess</context></contextlist>
3245 <override>All</override>
3246
3247 <usage>
3248     <p>Takes 1 or 2 parameters. The first parameter sets the soft
3249     resource limit for all processes and the second parameter sets
3250     the maximum resource limit. Either parameter can be a number,
3251     or <code>max</code> to indicate to the server that the limit
3252     should be set to the maximum allowed by the operating system
3253     configuration. Raising the maximum resource limit requires that
3254     the server is running as <code>root</code>, or in the initial startup
3255     phase.</p>
3256
3257     <p>This applies to processes forked off from Apache httpd children
3258     servicing requests, not the Apache httpd children themselves. This
3259     includes CGI scripts and SSI exec commands, but not any
3260     processes forked off from the Apache httpd parent such as piped
3261     logs.</p>
3262
3263     <p>Process limits control the number of processes per user.</p>
3264
3265     <note><title>Note</title>
3266       <p>If CGI processes are <strong>not</strong> running
3267       under user ids other than the web server user id, this directive
3268       will limit the number of processes that the server itself can
3269       create. Evidence of this situation will be indicated by
3270       <strong><code>cannot fork</code></strong> messages in the
3271       <code>error_log</code>.</p>
3272     </note>
3273 </usage>
3274 <seealso><directive module="core">RLimitMEM</directive></seealso>
3275 <seealso><directive module="core">RLimitCPU</directive></seealso>
3276 </directivesynopsis>
3277
3278 <directivesynopsis>
3279 <name>ScriptInterpreterSource</name>
3280 <description>Technique for locating the interpreter for CGI
3281 scripts</description>
3282 <syntax>ScriptInterpreterSource Registry|Registry-Strict|Script</syntax>
3283 <default>ScriptInterpreterSource Script</default>
3284 <contextlist><context>server config</context><context>virtual host</context>
3285 <context>directory</context><context>.htaccess</context></contextlist>
3286 <override>FileInfo</override>
3287 <compatibility>Win32 only;
3288 option <code>Registry-Strict</code> is available in Apache HTTP Server 2.0 and
3289 later</compatibility>
3290
3291 <usage>
3292     <p>This directive is used to control how Apache httpd finds the
3293     interpreter used to run CGI scripts. The default setting is
3294     <code>Script</code>. This causes Apache httpd to use the interpreter pointed to
3295     by the shebang line (first line, starting with <code>#!</code>) in the
3296     script. On Win32 systems this line usually looks like:</p>
3297
3298     <example>
3299       #!C:/Perl/bin/perl.exe
3300     </example>
3301
3302     <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
3303
3304     <example>
3305       #!perl
3306     </example>
3307
3308     <p>Setting <code>ScriptInterpreterSource Registry</code> will
3309     cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
3310     searched using the script file extension (e.g., <code>.pl</code>) as a
3311     search key. The command defined by the registry subkey
3312     <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
3313     <code>Shell\Open\Command</code> is used to open the script file. If the
3314     registry keys cannot be found, Apache httpd falls back to the behavior of the
3315     <code>Script</code> option.</p>
3316
3317     <note type="warning"><title>Security</title>
3318     <p>Be careful when using <code>ScriptInterpreterSource
3319     Registry</code> with <directive
3320     module="mod_alias">ScriptAlias</directive>'ed directories, because
3321     Apache httpd will try to execute <strong>every</strong> file within this
3322     directory. The <code>Registry</code> setting may cause undesired
3323     program calls on files which are typically not executed. For
3324     example, the default open command on <code>.htm</code> files on
3325     most Windows systems will execute Microsoft Internet Explorer, so
3326     any HTTP request for an <code>.htm</code> file existing within the
3327     script directory would start the browser in the background on the
3328     server. This is a good way to crash your system within a minute or
3329     so.</p>
3330     </note>
3331
3332     <p>The option <code>Registry-Strict</code> which is new in Apache HTTP Server
3333     2.0 does the same thing as <code>Registry</code> but uses only the
3334     subkey <code>Shell\ExecCGI\Command</code>. The
3335     <code>ExecCGI</code> key is not a common one. It must be
3336     configured manually in the windows registry and hence prevents
3337     accidental program calls on your system.</p>
3338 </usage>
3339 </directivesynopsis>
3340
3341 <directivesynopsis>
3342 <name>SeeRequestTail</name>
3343 <description>Determine if mod_status displays the first 63 characters
3344 of a request or the last 63, assuming the request itself is greater than
3345 63 chars.</description>
3346 <syntax>SeeRequestTail On|Off</syntax>
3347 <default>SeeRequestTail Off</default>
3348 <contextlist><context>server config</context></contextlist>
3349 <compatibility>Available in Apache httpd 2.2.7 and later.</compatibility>
3350
3351 <usage>
3352     <p>mod_status with <code>ExtendedStatus On</code>
3353     displays the actual request being handled. 
3354     For historical purposes, only 63 characters of the request
3355     are actually stored for display purposes. This directive
3356     controls whether the 1st 63 characters are stored (the previous
3357     behavior and the default) or if the last 63 characters are. This
3358     is only applicable, of course, if the length of the request is
3359     64 characters or greater.</p>
3360
3361     <p>If Apache httpd is handling <code
3362     >GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</code
3363     > mod_status displays as follows:
3364     </p>
3365
3366     <table border="1">
3367       <tr>
3368         <th>Off (default)</th>
3369         <td>GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples</td>
3370       </tr>
3371       <tr>
3372         <th>On</th>
3373         <td>orage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</td>
3374       </tr>
3375     </table>
3376
3377 </usage>
3378 </directivesynopsis>
3379
3380 <directivesynopsis>
3381 <name>ServerAdmin</name>
3382 <description>Email address that the server includes in error
3383 messages sent to the client</description>
3384 <syntax>ServerAdmin <var>email-address</var>|<var>URL</var></syntax>
3385 <contextlist><context>server config</context><context>virtual host</context>
3386 </contextlist>
3387
3388 <usage>
3389     <p>The <directive>ServerAdmin</directive> sets the contact address
3390     that the server includes in any error messages it returns to the
3391     client. If the <code>httpd</code> doesn't recognize the supplied argument
3392     as an URL, it
3393     assumes, that it's an <var>email-address</var> and prepends it with
3394     <code>mailto:</code> in hyperlink targets. However, it's recommended to
3395     actually use an email address, since there are a lot of CGI scripts that
3396     make that assumption. If you want to use an URL, it should point to another
3397     server under your control. Otherwise users may not be able to contact you in
3398     case of errors.</p>
3399
3400     <p>It may be worth setting up a dedicated address for this, e.g.</p>
3401
3402     <example>
3403       ServerAdmin www-admin@foo.example.com
3404     </example>
3405     <p>as users do not always mention that they are talking about the
3406     server!</p>
3407 </usage>
3408 </directivesynopsis>
3409
3410 <directivesynopsis>
3411 <name>ServerAlias</name>
3412 <description>Alternate names for a host used when matching requests
3413 to name-virtual hosts</description>
3414 <syntax>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</syntax>
3415 <contextlist><context>virtual host</context></contextlist>
3416
3417 <usage>
3418     <p>The <directive>ServerAlias</directive> directive sets the
3419     alternate names for a host, for use with <a
3420     href="../vhosts/name-based.html">name-based virtual hosts</a>. The
3421     <directive>ServerAlias</directive> may include wildcards, if appropriate.</p>
3422
3423     <example>
3424       &lt;VirtualHost *:80&gt;<br />
3425       ServerName server.domain.com<br />
3426       ServerAlias server server2.domain.com server2<br />
3427       ServerAlias *.example.com<br />
3428       UseCanonicalName Off<br />
3429       # ...<br />
3430       &lt;/VirtualHost&gt;
3431     </example>
3432 </usage>
3433 <seealso><directive module="core">UseCanonicalName</directive></seealso>
3434 <seealso><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></seealso>
3435 </directivesynopsis>
3436
3437 <directivesynopsis>
3438 <name>ServerName</name>
3439 <description>Hostname and port that the server uses to identify
3440 itself</description>
3441 <syntax>ServerName [<var>scheme</var>://]<var>fully-qualified-domain-name</var>[:<var>port</var>]</syntax>
3442 <contextlist><context>server config</context><context>virtual host</context>
3443 </contextlist>
3444
3445 <usage>
3446     <p>The <directive>ServerName</directive> directive sets the
3447     request scheme, hostname and
3448     port that the server uses to identify itself.  This is used when
3449     creating redirection URLs.</p>
3450
3451     <p>Additionally, <directive>ServerName</directive> is used (possibly
3452     in conjunction with <directive>ServerAlias</directive>) to uniquely
3453     identify a virtual host, when using <a
3454     href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
3455     
3456     <p>For example, if the name of the
3457     machine hosting the web server is <code>simple.example.com</code>,
3458     but the machine also has the DNS alias <code>www.example.com</code>
3459     and you wish the web server to be so identified, the following
3460     directive should be used:</p>
3461
3462     <example>
3463       ServerName www.example.com:80
3464     </example>
3465
3466     <p>The <directive>ServerName</directive> directive
3467     may appear anywhere within the definition of a server. However,
3468     each appearance overrides the previous appearance (within that
3469     server).</p>
3470
3471     <p>If no <directive>ServerName</directive> is specified, then the
3472     server attempts to deduce the hostname by performing a reverse
3473     lookup on the IP address. If no port is specified in the
3474     <directive>ServerName</directive>, then the server will use the
3475     port from the incoming request. For optimal reliability and
3476     predictability, you should specify an explicit hostname and port
3477     using the <directive>ServerName</directive> directive.</p>
3478
3479     <p>If you are using <a
3480     href="../vhosts/name-based.html">name-based virtual hosts</a>,
3481     the <directive>ServerName</directive> inside a
3482     <directive type="section" module="core">VirtualHost</directive>
3483     section specifies what hostname must appear in the request's
3484     <code>Host:</code> header to match this virtual host.</p>
3485
3486     <p>Sometimes, the server runs behind a device that processes SSL,
3487     such as a reverse proxy, load balancer or SSL offload
3488     appliance. When this is the case, specify the
3489     <code>https://</code> scheme and the port number to which the
3490     clients connect in the <directive>ServerName</directive> directive
3491     to make sure that the server generates the correct
3492     self-referential URLs. 
3493     </p>
3494
3495     <p>See the description of the
3496     <directive module="core">UseCanonicalName</directive> and
3497     <directive module="core">UseCanonicalPhysicalPort</directive> directives for
3498     settings which determine whether self-referential URLs (e.g., by the
3499     <module>mod_dir</module> module) will refer to the
3500     specified port, or to the port number given in the client's request.
3501     </p>
3502
3503     <note type="warning">
3504     <p>Failure to set <directive>ServerName</directive> to a name that
3505     your server can resolve to an IP address will result in a startup
3506     warning. <code>httpd</code> will then use whatever hostname it can
3507     determine, using the system's <code>hostname</code> command. This
3508     will almost never be the hostname you actually want.</p>
3509     <example>
3510     httpd: Could not reliably determine the server's fully qualified domain name, using rocinante.local for ServerName
3511     </example>
3512     </note>
3513
3514 </usage>
3515
3516 <seealso><a href="../dns-caveats.html">Issues Regarding DNS and
3517     Apache HTTP Server</a></seealso>
3518 <seealso><a href="../vhosts/">Apache HTTP Server virtual host
3519     documentation</a></seealso>
3520 <seealso><directive module="core">UseCanonicalName</directive></seealso>
3521 <seealso><directive module="core">UseCanonicalPhysicalPort</directive></seealso>
3522 <seealso><directive module="core">NameVirtualHost</directive></seealso>
3523 <seealso><directive module="core">ServerAlias</directive></seealso>
3524 </directivesynopsis>
3525
3526 <directivesynopsis>
3527 <name>ServerPath</name>
3528 <description>Legacy URL pathname for a name-based virtual host that
3529 is accessed by an incompatible browser</description>
3530 <syntax>ServerPath <var>URL-path</var></syntax>
3531 <contextlist><context>virtual host</context></contextlist>
3532
3533 <usage>
3534     <p>The <directive>ServerPath</directive> directive sets the legacy
3535     URL pathname for a host, for use with <a
3536     href="../vhosts/">name-based virtual hosts</a>.</p>
3537 </usage>
3538 <seealso><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></seealso>
3539 </directivesynopsis>
3540
3541 <directivesynopsis>
3542 <name>ServerRoot</name>
3543 <description>Base directory for the server installation</description>
3544 <syntax>ServerRoot <var>directory-path</var></syntax>
3545 <default>ServerRoot /usr/local/apache</default>
3546 <contextlist><context>server config</context></contextlist>
3547
3548 <usage>
3549     <p>The <directive>ServerRoot</directive> directive sets the
3550     directory in which the server lives. Typically it will contain the
3551     subdirectories <code>conf/</code> and <code>logs/</code>. Relative
3552     paths in other configuration directives (such as <directive
3553     module="core">Include</directive> or <directive
3554     module="mod_so">LoadModule</directive>, for example) are taken as 
3555     relative to this directory.</p>
3556
3557     <example><title>Example</title>
3558       ServerRoot /home/httpd
3559     </example>
3560
3561 </usage>
3562 <seealso><a href="../invoking.html">the <code>-d</code>
3563     option to <code>httpd</code></a></seealso>
3564 <seealso><a href="../misc/security_tips.html#serverroot">the
3565     security tips</a> for information on how to properly set
3566     permissions on the <directive>ServerRoot</directive></seealso>
3567 </directivesynopsis>
3568
3569 <directivesynopsis>
3570 <name>ServerSignature</name>
3571 <description>Configures the footer on server-generated documents</description>
3572 <syntax>ServerSignature On|Off|EMail</syntax>
3573 <default>ServerSignature Off</default>
3574 <contextlist><context>server config</context><context>virtual host</context>
3575 <context>directory</context><context>.htaccess</context>
3576 </contextlist>
3577 <override>All</override>
3578
3579 <usage>
3580     <p>The <directive>ServerSignature</directive> directive allows the
3581     configuration of a trailing footer line under server-generated
3582     documents (error messages, <module>mod_proxy</module> ftp directory
3583     listings, <module>mod_info</module> output, ...). The reason why you
3584     would want to enable such a footer line is that in a chain of proxies,
3585     the user often has no possibility to tell which of the chained servers
3586     actually produced a returned error message.</p>
3587
3588     <p>The <code>Off</code>
3589     setting, which is the default, suppresses the footer line (and is
3590     therefore compatible with the behavior of Apache-1.2 and
3591     below). The <code>On</code> setting simply adds a line with the
3592     server version number and <directive
3593     module="core">ServerName</directive> of the serving virtual host,
3594     and the <code>EMail</code> setting additionally creates a
3595     "mailto:" reference to the <directive
3596     module="core">ServerAdmin</directive> of the referenced
3597     document.</p>
3598
3599     <p>After version 2.0.44, the details of the server version number
3600     presented are controlled by the <directive
3601     module="core">ServerTokens</directive> directive.</p>
3602 </usage>
3603 <seealso><directive module="core">ServerTokens</directive></seealso>
3604 </directivesynopsis>
3605
3606 <directivesynopsis>
3607 <name>ServerTokens</name>
3608 <description>Configures the <code>Server</code> HTTP response
3609 header</description>
3610 <syntax>ServerTokens Major|Minor|Min[imal]|Prod[uctOnly]|OS|Full</syntax>
3611 <default>ServerTokens Full</default>
3612 <contextlist><context>server config</context></contextlist>
3613
3614 <usage>
3615     <p>This directive controls whether <code>Server</code> response
3616     header field which is sent back to clients includes a
3617     description of the generic OS-type of the server as well as
3618     information about compiled-in modules.</p>
3619
3620     <dl>
3621       <dt><code>ServerTokens Full</code> (or not specified)</dt>
3622
3623       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3624       (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
3625
3626       <dt><code>ServerTokens Prod[uctOnly]</code></dt>
3627
3628       <dd>Server sends (<em>e.g.</em>): <code>Server:
3629       Apache</code></dd>
3630
3631       <dt><code>ServerTokens Major</code></dt>
3632
3633       <dd>Server sends (<em>e.g.</em>): <code>Server:
3634       Apache/2</code></dd>
3635
3636       <dt><code>ServerTokens Minor</code></dt>
3637
3638       <dd>Server sends (<em>e.g.</em>): <code>Server:
3639       Apache/2.4</code></dd>
3640
3641       <dt><code>ServerTokens Min[imal]</code></dt>
3642
3643       <dd>Server sends (<em>e.g.</em>): <code>Server:
3644       Apache/2.4.1</code></dd>
3645
3646       <dt><code>ServerTokens OS</code></dt>
3647
3648       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3649       (Unix)</code></dd>
3650
3651     </dl>
3652
3653     <p>This setting applies to the entire server, and cannot be
3654     enabled or disabled on a virtualhost-by-virtualhost basis.</p>
3655
3656     <p>After version 2.0.44, this directive also controls the
3657     information presented by the <directive
3658     module="core">ServerSignature</directive> directive.</p>
3659     
3660     <note>Setting <directive>ServerTokens</directive> to less than
3661     <code>minimal</code> is not recommended because it makes it more
3662     difficult to debug interoperational problems. Also note that
3663     disabling the Server: header does nothing at all to make your
3664     server more secure; the idea of "security through obscurity"
3665     is a myth and leads to a false sense of safety.</note>
3666
3667 </usage>
3668 <seealso><directive module="core">ServerSignature</directive></seealso>
3669 </directivesynopsis>
3670
3671 <directivesynopsis>
3672 <name>SetHandler</name>
3673 <description>Forces all matching files to be processed by a
3674 handler</description>
3675 <syntax>SetHandler <var>handler-name</var>|None</syntax>
3676 <contextlist><context>server config</context><context>virtual host</context>
3677 <context>directory</context><context>.htaccess</context>
3678 </contextlist>
3679 <override>FileInfo</override>
3680 <compatibility>Moved into the core in Apache httpd 2.0</compatibility>
3681
3682 <usage>
3683     <p>When placed into an <code>.htaccess</code> file or a
3684     <directive type="section" module="core">Directory</directive> or
3685     <directive type="section" module="core">Location</directive>
3686     section, this directive forces all matching files to be parsed
3687     through the <a href="../handler.html">handler</a> given by
3688     <var>handler-name</var>. For example, if you had a directory you
3689     wanted to be parsed entirely as imagemap rule files, regardless
3690     of extension, you might put the following into an
3691     <code>.htaccess</code> file in that directory:</p>
3692
3693     <example>
3694       SetHandler imap-file
3695     </example>
3696
3697     <p>Another example: if you wanted to have the server display a
3698     status report whenever a URL of
3699     <code>http://servername/status</code> was called, you might put
3700     the following into <code>httpd.conf</code>:</p>
3701
3702     <example>
3703       &lt;Location /status&gt;<br />
3704       <indent>
3705         SetHandler server-status<br />
3706       </indent>
3707       &lt;/Location&gt;
3708     </example>
3709
3710     <p>You can override an earlier defined <directive>SetHandler</directive>
3711     directive by using the value <code>None</code>.</p>
3712     <p><strong>Note:</strong> because SetHandler overrides default handlers,
3713     normal behaviour such as handling of URLs ending in a slash (/) as
3714     directories or index files is suppressed.</p>
3715 </usage>
3716
3717 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
3718
3719 </directivesynopsis>
3720
3721 <directivesynopsis>
3722 <name>SetInputFilter</name>
3723 <description>Sets the filters that will process client requests and POST
3724 input</description>
3725 <syntax>SetInputFilter <var>filter</var>[;<var>filter</var>...]</syntax>
3726 <contextlist><context>server config</context><context>virtual host</context>
3727 <context>directory</context><context>.htaccess</context>
3728 </contextlist>
3729 <override>FileInfo</override>
3730
3731 <usage>
3732     <p>The <directive>SetInputFilter</directive> directive sets the
3733     filter or filters which will process client requests and POST
3734     input when they are received by the server. This is in addition to
3735     any filters defined elsewhere, including the
3736     <directive module="mod_mime">AddInputFilter</directive>
3737     directive.</p>
3738
3739     <p>If more than one filter is specified, they must be separated
3740     by semicolons in the order in which they should process the
3741     content.</p>
3742 </usage>
3743 <seealso><a href="../filter.html">Filters</a> documentation</seealso>
3744 </directivesynopsis>
3745
3746 <directivesynopsis>
3747 <name>SetOutputFilter</name>
3748 <description>Sets the filters that will process responses from the
3749 server</description>
3750 <syntax>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</syntax>
3751 <contextlist><context>server config</context><context>virtual host</context>
3752 <context>directory</context><context>.htaccess</context>
3753 </contextlist>
3754 <override>FileInfo</override>
3755
3756 <usage>
3757     <p>The <directive>SetOutputFilter</directive> directive sets the filters
3758     which will process responses from the server before they are
3759     sent to the client. This is in addition to any filters defined
3760     elsewhere, including the
3761     <directive module="mod_mime">AddOutputFilter</directive>
3762     directive.</p>
3763
3764     <p>For example, the following configuration will process all files
3765     in the <code>/www/data/</code> directory for server-side
3766     includes.</p>
3767
3768     <example>
3769       &lt;Directory /www/data/&gt;<br />
3770       <indent>
3771         SetOutputFilter INCLUDES<br />
3772       </indent>
3773       &lt;/Directory&gt;
3774     </example>
3775
3776     <p>If more than one filter is specified, they must be separated
3777     by semicolons in the order in which they should process the
3778     content.</p>
3779 </usage>
3780 <seealso><a href="../filter.html">Filters</a> documentation</seealso>
3781 </directivesynopsis>
3782
3783 <directivesynopsis>
3784 <name>TimeOut</name>
3785 <description>Amount of time the server will wait for
3786 certain events before failing a request</description>
3787 <syntax>TimeOut <var>seconds</var></syntax>
3788 <default>TimeOut 60</default>
3789 <contextlist><context>server config</context><context>virtual host</context></contextlist>
3790
3791 <usage>
3792     <p>The <directive>TimeOut</directive> directive defines the length
3793     of time Apache httpd will wait for I/O in various circumstances:</p>
3794
3795     <ol>
3796       <li>When reading data from the client, the length of time to
3797       wait for a TCP packet to arrive if the read buffer is
3798       empty.</li>
3799
3800       <li>When writing data to the client, the length of time to wait
3801       for an acknowledgement of a packet if the send buffer is
3802       full.</li>
3803
3804       <li>In <module>mod_cgi</module>, the length of time to wait for
3805       output from a CGI script.</li>
3806
3807       <li>In <module>mod_ext_filter</module>, the length of time to
3808       wait for output from a filtering process.</li>
3809
3810       <li>In <module>mod_proxy</module>, the default timeout value if
3811       <directive module="mod_proxy">ProxyTimeout</directive> is not
3812       configured.</li>
3813     </ol>
3814
3815 </usage>
3816 </directivesynopsis>
3817
3818 <directivesynopsis>
3819 <name>TraceEnable</name>
3820 <description>Determines the behaviour on <code>TRACE</code> requests</description>
3821 <syntax>TraceEnable <var>[on|off|extended]</var></syntax>
3822 <default>TraceEnable on</default>
3823 <contextlist><context>server config</context></contextlist>
3824 <compatibility>Available in Apache HTTP Server 1.3.34, 2.0.55 and later</compatibility>
3825
3826 <usage>
3827     <p>This directive overrides the behavior of <code>TRACE</code> for both
3828     the core server and <module>mod_proxy</module>.  The default
3829     <code>TraceEnable on</code> permits <code>TRACE</code> requests per
3830     RFC 2616, which disallows any request body to accompany the request.
3831     <code>TraceEnable off</code> causes the core server and
3832     <module>mod_proxy</module> to return a <code>405</code> (Method not
3833     allowed) error to the client.</p>
3834
3835     <p>Finally, for testing and diagnostic purposes only, request
3836     bodies may be allowed using the non-compliant <code>TraceEnable 
3837     extended</code> directive.  The core (as an origin server) will
3838     restrict the request body to 64k (plus 8k for chunk headers if
3839     <code>Transfer-Encoding: chunked</code> is used).  The core will
3840     reflect the full headers and all chunk headers with the response
3841     body.  As a proxy server, the request body is not restricted to 64k.</p>
3842 </usage>
3843 </directivesynopsis>
3844
3845 <directivesynopsis>
3846 <name>UnDefine</name>
3847 <description>Undefine the existence of a variable</description>
3848 <syntax>UnDefine <var>parameter-name</var></syntax>
3849 <contextlist><context>server config</context></contextlist>
3850
3851 <usage>
3852     <p>Undoes the effect of a <directive module="core">Define</directive> or
3853     of passing a <code>-D</code> argument to <program>httpd</program>.</p>
3854     <p>This directive can be used to toggle the use of <directive module="core"
3855     type="section">IfDefine</directive> sections without needing to alter
3856     <code>-D</code> arguments in any startup scripts.</p>
3857 </usage>
3858 </directivesynopsis>
3859
3860 <directivesynopsis>
3861 <name>UseCanonicalName</name>
3862 <description>Configures how the server determines its own name and
3863 port</description>
3864 <syntax>UseCanonicalName On|Off|DNS</syntax>
3865 <default>UseCanonicalName Off</default>
3866 <contextlist><context>server config</context><context>virtual host</context>
3867 <context>directory</context></contextlist>
3868
3869 <usage>
3870     <p>In many situations Apache httpd must construct a <em>self-referential</em>
3871     URL -- that is, a URL that refers back to the same server. With
3872     <code>UseCanonicalName On</code> Apache httpd will use the hostname and port
3873     specified in the <directive module="core">ServerName</directive>
3874     directive to construct the canonical name for the server. This name
3875     is used in all self-referential URLs, and for the values of
3876     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
3877
3878     <p>With <code>UseCanonicalName Off</code> Apache httpd will form
3879     self-referential URLs using the hostname and port supplied by
3880     the client if any are supplied (otherwise it will use the
3881     canonical name, as defined above). These values are the same
3882     that are used to implement <a
3883     href="../vhosts/name-based.html">name-based virtual hosts</a>,
3884     and are available with the same clients. The CGI variables
3885     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
3886     constructed from the client supplied values as well.</p>
3887
3888     <p>An example where this may be useful is on an intranet server
3889     where you have users connecting to the machine using short
3890     names such as <code>www</code>. You'll notice that if the users
3891     type a shortname, and a URL which is a directory, such as
3892     <code>http://www/splat</code>, <em>without the trailing
3893     slash</em> then Apache httpd will redirect them to
3894     <code>http://www.domain.com/splat/</code>. If you have
3895     authentication enabled, this will cause the user to have to
3896     authenticate twice (once for <code>www</code> and once again
3897     for <code>www.domain.com</code> -- see <a
3898     href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
3899     FAQ on this subject for more information</a>). But if
3900     <directive>UseCanonicalName</directive> is set <code>Off</code>, then
3901     Apache httpd will redirect to <code>http://www/splat/</code>.</p>
3902
3903     <p>There is a third option, <code>UseCanonicalName DNS</code>,
3904     which is intended for use with mass IP-based virtual hosting to
3905     support ancient clients that do not provide a
3906     <code>Host:</code> header. With this option Apache httpd does a
3907     reverse DNS lookup on the server IP address that the client
3908     connected to in order to work out self-referential URLs.</p>
3909
3910     <note type="warning"><title>Warning</title>
3911     <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
3912     they may be broken by this option. The client is essentially free
3913     to give whatever value they want as a hostname. But if the CGI is
3914     only using <code>SERVER_NAME</code> to construct self-referential URLs
3915     then it should be just fine.</p>
3916     </note>
3917 </usage>
3918 <seealso><directive module="core">UseCanonicalPhysicalPort</directive></seealso>
3919 <seealso><directive module="core">ServerName</directive></seealso>
3920 <seealso><directive module="mpm_common">Listen</directive></seealso>
3921 </directivesynopsis>
3922
3923 <directivesynopsis>
3924 <name>UseCanonicalPhysicalPort</name>
3925 <description>Configures how the server determines its own name and
3926 port</description>
3927 <syntax>UseCanonicalPhysicalPort On|Off</syntax>
3928 <default>UseCanonicalPhysicalPort Off</default>
3929 <contextlist><context>server config</context><context>virtual host</context>
3930 <context>directory</context></contextlist>
3931
3932 <usage>
3933     <p>In many situations Apache httpd must construct a <em>self-referential</em>
3934     URL -- that is, a URL that refers back to the same server. With
3935     <code>UseCanonicalPhysicalPort On</code> Apache httpd will, when
3936     constructing the canonical port for the server to honor
3937     the <directive module="core">UseCanonicalName</directive> directive,
3938     provide the actual physical port number being used by this request
3939     as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
3940     Apache httpd will not ever use the actual physical port number, instead
3941     relying on all configured information to construct a valid port number.</p>
3942
3943     <note><title>Note</title>
3944     <p>The ordering of when the physical port is used is as follows:<br /><br />
3945      <code>UseCanonicalName On</code></p>
3946      <ul>
3947       <li>Port provided in <code>Servername</code></li>
3948       <li>Physical port</li>
3949       <li>Default port</li>
3950      </ul>
3951      <code>UseCanonicalName Off | DNS</code>
3952      <ul>
3953       <li>Parsed port from <code>Host:</code> header</li>
3954       <li>Physical port</li>
3955       <li>Port provided in <code>Servername</code></li>
3956       <li>Default port</li>
3957      </ul>
3958     
3959     <p>With <code>UseCanonicalPhysicalPort Off</code>, the
3960     physical ports are removed from the ordering.</p>
3961     </note>
3962
3963 </usage>
3964 <seealso><directive module="core">UseCanonicalName</directive></seealso>
3965 <seealso><directive module="core">ServerName</directive></seealso>
3966 <seealso><directive module="mpm_common">Listen</directive></seealso>
3967 </directivesynopsis>
3968
3969 <directivesynopsis type="section">
3970 <name>VirtualHost</name>
3971 <description>Contains directives that apply only to a specific
3972 hostname or IP address</description>
3973 <syntax>&lt;VirtualHost
3974     <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
3975     ...&gt; ... &lt;/VirtualHost&gt;</syntax>
3976 <contextlist><context>server config</context></contextlist>
3977
3978 <usage>
3979     <p><directive type="section">VirtualHost</directive> and
3980     <code>&lt;/VirtualHost&gt;</code> are used to enclose a group of
3981     directives that will apply only to a particular virtual host. Any
3982     directive that is allowed in a virtual host context may be
3983     used. When the server receives a request for a document on a
3984     particular virtual host, it uses the configuration directives
3985     enclosed in the <directive type="section">VirtualHost</directive>
3986     section. <var>Addr</var> can be:</p>
3987
3988     <ul>
3989       <li>The IP address of the virtual host;</li>
3990
3991       <li>A fully qualified domain name for the IP address of the
3992       virtual host (not recommended);</li>
3993
3994       <li>The character <code>*</code>, which is used only in combination with
3995       <code>NameVirtualHost *</code> to match all IP addresses; or</li>
3996
3997       <li>The string <code>_default_</code>, which is used only
3998       with IP virtual hosting to catch unmatched IP addresses.</li>
3999     </ul>
4000
4001     <example><title>Example</title>
4002       &lt;VirtualHost 10.1.2.3&gt;<br />
4003       <indent>
4004         ServerAdmin webmaster@host.example.com<br />
4005         DocumentRoot /www/docs/host.example.com<br />
4006         ServerName host.example.com<br />
4007         ErrorLog logs/host.example.com-error_log<br />
4008         TransferLog logs/host.example.com-access_log<br />
4009       </indent>
4010       &lt;/VirtualHost&gt;
4011     </example>
4012
4013
4014     <p>IPv6 addresses must be specified in square brackets because
4015     the optional port number could not be determined otherwise.  An
4016     IPv6 example is shown below:</p>
4017
4018     <example>
4019       &lt;VirtualHost [2001:db8::a00:20ff:fea7:ccea]&gt;<br />
4020       <indent>
4021         ServerAdmin webmaster@host.example.com<br />
4022         DocumentRoot /www/docs/host.example.com<br />
4023         ServerName host.example.com<br />
4024         ErrorLog logs/host.example.com-error_log<br />
4025         TransferLog logs/host.example.com-access_log<br />
4026       </indent>
4027       &lt;/VirtualHost&gt;
4028     </example>
4029
4030     <p>Each Virtual Host must correspond to a different IP address,
4031     different port number or a different host name for the server,
4032     in the former case the server machine must be configured to
4033     accept IP packets for multiple addresses. (If the machine does
4034     not have multiple network interfaces, then this can be
4035     accomplished with the <code>ifconfig alias</code> command -- if
4036     your OS supports it).</p>
4037
4038     <note><title>Note</title>
4039     <p>The use of <directive type="section">VirtualHost</directive> does
4040     <strong>not</strong> affect what addresses Apache httpd listens on. You
4041     may need to ensure that Apache httpd is listening on the correct addresses
4042     using <directive module="mpm_common">Listen</directive>.</p>
4043     </note>
4044
4045     <p>When using IP-based virtual hosting, the special name
4046     <code>_default_</code> can be specified in
4047     which case this virtual host will match any IP address that is
4048     not explicitly listed in another virtual host. In the absence
4049     of any <code>_default_</code> virtual host the "main" server config,
4050     consisting of all those definitions outside any VirtualHost
4051     section, is used when no IP-match occurs.</p>
4052
4053     <p>You can specify a <code>:port</code> to change the port that is
4054     matched. If unspecified then it defaults to the same port as the
4055     most recent <directive module="mpm_common">Listen</directive>
4056     statement of the main server. You may also specify <code>:*</code>
4057     to match all ports on that address. (This is recommended when used
4058     with <code>_default_</code>.)</p>
4059
4060     <p>A <directive module="core">ServerName</directive> should be
4061     specified inside each <directive
4062     type="section">VirtualHost</directive> block. If it is absent, the
4063     <directive module="core">ServerName</directive> from the "main"
4064     server configuration will be inherited.</p>
4065
4066     <p>If no matching virtual host is found, then the first listed
4067     virtual host that matches the IP address will be used.  As a
4068     consequence, the first listed virtual host is the default virtual
4069     host.</p>
4070
4071     <note type="warning"><title>Security</title>
4072     <p>See the <a href="../misc/security_tips.html">security tips</a>
4073     document for details on why your security could be compromised if the
4074     directory where log files are stored is writable by anyone other
4075     than the user that starts the server.</p>
4076     </note>
4077 </usage>
4078 <seealso><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></seealso>
4079 <seealso><a href="../dns-caveats.html">Issues Regarding DNS and
4080     Apache HTTP Server</a></seealso>
4081 <seealso><a href="../bind.html">Setting
4082     which addresses and ports Apache HTTP Server uses</a></seealso>
4083 <seealso><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
4084     and &lt;Files&gt; sections work</a> for an explanation of how these
4085     different sections are combined when a request is received</seealso>
4086 </directivesynopsis>
4087
4088 </modulesynopsis>