core.xml.es revision 897b9432efe6e6effa0939f700b1ccc50b29698c
f062ed7bd262a37a909dd77ce5fc23b446818823fielding<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
f062ed7bd262a37a909dd77ce5fc23b446818823fielding<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
f062ed7bd262a37a909dd77ce5fc23b446818823fielding<!-- English Revision: 1040494:1300883 (outdated) -->
2d2eda71267231c2526be701fe655db125852c1ffielding Licensed to the Apache Software Foundation (ASF) under one or more
2d2eda71267231c2526be701fe655db125852c1ffielding contributor license agreements. See the NOTICE file distributed with
2d2eda71267231c2526be701fe655db125852c1ffielding this work for additional information regarding copyright ownership.
2d2eda71267231c2526be701fe655db125852c1ffielding The ASF licenses this file to You under the Apache License, Version 2.0
2d2eda71267231c2526be701fe655db125852c1ffielding (the "License"); you may not use this file except in compliance with
f062ed7bd262a37a909dd77ce5fc23b446818823fielding the License. You may obtain a copy of the License at
2d2eda71267231c2526be701fe655db125852c1ffielding Unless required by applicable law or agreed to in writing, software
2d2eda71267231c2526be701fe655db125852c1ffielding distributed under the License is distributed on an "AS IS" BASIS,
2d2eda71267231c2526be701fe655db125852c1ffielding WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding See the License for the specific language governing permissions and
f062ed7bd262a37a909dd77ce5fc23b446818823fielding limitations under the License.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding<description>Funcionalides básicas del Servidor HTTP Apache que siempre están presentes.</description>
f062ed7bd262a37a909dd77ce5fc23b446818823fielding<directivesynopsis>
f062ed7bd262a37a909dd77ce5fc23b446818823fielding<description>Configura mejoras para un Protocolo de Escucha de Sockets</description>
f062ed7bd262a37a909dd77ce5fc23b446818823fielding<syntax>AcceptFilter <var>protocol</var> <var>accept_filter</var></syntax>
64185f9824e42f21ca7b9ae6c004484215c031a7rbb<contextlist><context>server config</context></contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding<compatibility>Disponible en Apache httpd 2.1.5 y posteriores.
f062ed7bd262a37a909dd77ce5fc23b446818823fieldingEn Windows desde Apache httpd 2.3.3 y posteriores.</compatibility>
f062ed7bd262a37a909dd77ce5fc23b446818823fielding <p>Esta directiva hace posible mejoras específicas a nivel de sistema operativo
2d2eda71267231c2526be701fe655db125852c1ffielding y a través del tipo de Protocolo para un socket que escucha.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding La premisa básica es que el kernel no envíe un socket al servidor
f062ed7bd262a37a909dd77ce5fc23b446818823fielding hasta que o bien los datos se hayan recibido o bien se haya almacenado
f062ed7bd262a37a909dd77ce5fc23b446818823fielding en el buffer una Respuesta HTTP completa.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding Actualmente sólo están soportados
f062ed7bd262a37a909dd77ce5fc23b446818823fielding <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&sektion=9">
f062ed7bd262a37a909dd77ce5fc23b446818823fielding Accept Filters</a> sobre FreeBSD, <code>TCP_DEFER_ACCEPT</code> sobre Linux,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding y AcceptEx() sobre Windows.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>El uso de <code>none</code> para un argumento desactiva cualquier filtro
2d2eda71267231c2526be701fe655db125852c1ffielding aceptado para ese protocolo. Esto es útil para protocolos que requieren que un
f062ed7bd262a37a909dd77ce5fc23b446818823fielding servidor envíe datos primeros, tales como <code>ftp:</code> o <code>nntp</code>:</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Los nombres de protocolo por defecto son <code>https</code> para el puerto 443
f062ed7bd262a37a909dd77ce5fc23b446818823fielding y <code>http</code> para todos los demás puertos. Para especificar que se está
f062ed7bd262a37a909dd77ce5fc23b446818823fielding utilizando otro protocolo con un puerto escuchando, añade el argumento <var>protocol</var>
f062ed7bd262a37a909dd77ce5fc23b446818823fielding a la directiva <directive module="mpm_common">Listen</directive>.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding AcceptFilter http httpready <br/>
2d2eda71267231c2526be701fe655db125852c1ffielding AcceptFilter https dataready
2d2eda71267231c2526be701fe655db125852c1ffielding <p>El filtro <code>httpready</code> almacena en el buffer peticiones HTTP completas
2d2eda71267231c2526be701fe655db125852c1ffielding a nivel de kernel. Una vez que la petición es recibida, el kernel la envía al servidor.
2d2eda71267231c2526be701fe655db125852c1ffielding Consulta la página man de
2d2eda71267231c2526be701fe655db125852c1ffielding <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&sektion=9">
2d2eda71267231c2526be701fe655db125852c1ffielding accf_http(9)</a> para más detalles. Puesto que las peticiones HTTPS
2d2eda71267231c2526be701fe655db125852c1ffielding están encriptadas, sólo se utiliza el filtro
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&sektion=9">accf_data(9)</a>.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb AcceptFilter http data <br/>
952908500d5f99f35afc5ed510391b9bdc3833farbb AcceptFilter https data
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>En Linux, <code>TCP_DEFER_ACCEPT</code> no soporta el buffering en peticiones http.
30c289e6bc6d28d210b21edd800ab2cfc78a8381wrowe Cualquier valor además de <code>none</code> habilitará
bd53cb2bf4d77574fd502e1c02d8c3c0d5431967stoddard <code>TCP_DEFER_ACCEPT</code> en ese socket. Para más detalles
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb ver la página man de Linux
b4c8a80f7dbfc9b56dbe03bdc28f0b5eb5f23697rbb <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb AcceptFilter http data <br/>
14bea4ba98aabaf554e37165a07123bb05d6736bstoddard AcceptFilter https data
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb </example>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>Sobre Windows mpm_winnt interpreta el argumento AcceptFilter para conmutar la API
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb AcceptEx(), y no soporta el buffering sobre el protocolo http. Hay dos valores
2d2eda71267231c2526be701fe655db125852c1ffielding que utilizan la API Windows AcceptEx() y que recuperan sockets de red
2d2eda71267231c2526be701fe655db125852c1ffielding entre conexciones. <code>data</code> espera hasta que los datos han sido
2d2eda71267231c2526be701fe655db125852c1ffielding transmitidos como se comentaba anteriormente, y el buffer inicial de datos y las
2d2eda71267231c2526be701fe655db125852c1ffielding direcciones de red son recuperadas a partir de una única llamada AcceptEx().
2d2eda71267231c2526be701fe655db125852c1ffielding <code>connect</code> utiliza la API AcceptEx() API, y recupera también
2d2eda71267231c2526be701fe655db125852c1ffielding las direccciones de red, pero a diferencia de <code>none</code>
2d2eda71267231c2526be701fe655db125852c1ffielding la opción <code>connect</code> no espera a la transmisión inicial de los datos.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Sobre Windows, <code>none</code> prefiere accept() antes que AcceptEx()
2d2eda71267231c2526be701fe655db125852c1ffielding y no recuperará sockets entre las conexiones. Lo que es útil para los adaptadores de
2d2eda71267231c2526be701fe655db125852c1ffielding red con un soporte precario de drivers, así como para algunos proveedores de red
2d2eda71267231c2526be701fe655db125852c1ffielding tales como drivers vpn, o filtros de spam, de virus o de spyware.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Los recursos aceptan información sobre su ruta</description>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb<context>virtual host</context><context>directory</context>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb<compatibility>Disponible en Apache httpd 2.0.30 y posteriores</compatibility>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Esta directiva controla si las peticiones que contienen información sobre la ruta
2d2eda71267231c2526be701fe655db125852c1ffielding que sigue un fichero que existe (o un fichero que no existe pero en un directorio que
2d2eda71267231c2526be701fe655db125852c1ffielding sí existe) serán aceptadas o denegadas. La información de ruta puede estar disponible
2d2eda71267231c2526be701fe655db125852c1ffielding para los scripts en la variable de entorno <code>PATH_INFO</code>.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Por ejemplo, asumamos que la ubicación <code>/test/</code> apunta a
2d2eda71267231c2526be701fe655db125852c1ffielding un directorio que contiene únicamente el fichero
2d2eda71267231c2526be701fe655db125852c1ffielding <code>here.html</code>. Entonces, las peticiones tanto para
2d2eda71267231c2526be701fe655db125852c1ffielding <code>/more</code> como <code>PATH_INFO</code>.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Los tres posibles argumentos para la directiva
2d2eda71267231c2526be701fe655db125852c1ffielding <directive>AcceptPathInfo</directive> son los siguientes:</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <dt><code>Off</code></dt><dd>Una petición sólo será aceptada si
2d2eda71267231c2526be701fe655db125852c1ffielding se corresponde con una ruta literal que existe. Por lo tanto, una petición
2d2eda71267231c2526be701fe655db125852c1ffielding con una información de ruta después del nombre de fichero tal como
2d2eda71267231c2526be701fe655db125852c1ffielding <code>/test/here.html/more</code> en el ejemplo anterior devolverá
2d2eda71267231c2526be701fe655db125852c1ffielding un error 404 NOT FOUND.</dd>
2d2eda71267231c2526be701fe655db125852c1ffielding <dt><code>On</code></dt><dd>Una petición será aceptada si una
2d2eda71267231c2526be701fe655db125852c1ffielding ruta principal de acceso se corresponde con un fichero que existe. El ejemplo
2d2eda71267231c2526be701fe655db125852c1ffielding anterior <code>/test/here.html/more</code> será aceptado si
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <code>/test/here.html</code> corresponde a un fichero válido.</dd>
2d2eda71267231c2526be701fe655db125852c1ffielding <dt><code>Default</code></dt><dd>La gestión de las peticiones
2d2eda71267231c2526be701fe655db125852c1ffielding con información de ruta está determinada por el <a
2d2eda71267231c2526be701fe655db125852c1ffielding href="/handler.html">controlador</a> responsable de la petición.
2d2eda71267231c2526be701fe655db125852c1ffielding El controlador principal para para ficheros normales rechaza por defecto
2d2eda71267231c2526be701fe655db125852c1ffielding peticiones <code>PATH_INFO</code>. Los controladores que sirven scripts, tales como <a
2d2eda71267231c2526be701fe655db125852c1ffielding href="mod_isapi.html">isapi-handler</a>, normalmente aceptan
2d2eda71267231c2526be701fe655db125852c1ffielding <p>El objetivo principal de la directiva <code>AcceptPathInfo</code>
2d2eda71267231c2526be701fe655db125852c1ffielding es permitirte sobreescribir la opción del controlador
2d2eda71267231c2526be701fe655db125852c1ffielding de aceptar or rechazar <code>PATH_INFO</code>. Este tipo de sobreescritura se necesita,
2d2eda71267231c2526be701fe655db125852c1ffielding por ejemplo, cuando utilizas un <a href="/filter.html">filtro</a>, tal como
2d2eda71267231c2526be701fe655db125852c1ffielding <a href="mod_include.html">INCLUDES</a>, para generar contenido
2d2eda71267231c2526be701fe655db125852c1ffielding basado en <code>PATH_INFO</code>. El controlador principal normalmente rechazaría
2d2eda71267231c2526be701fe655db125852c1ffielding la petición, de modo que puedes utilizar la siguiente configuración para habilitarla
2d2eda71267231c2526be701fe655db125852c1ffielding como script:</p>
2d2eda71267231c2526be701fe655db125852c1ffielding Options +Includes<br />
2d2eda71267231c2526be701fe655db125852c1ffielding SetOutputFilter INCLUDES<br />
2d2eda71267231c2526be701fe655db125852c1ffielding AcceptPathInfo On<br />
2d2eda71267231c2526be701fe655db125852c1ffielding </Files>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Nombre del fichero distribuido de configuración</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<syntax>AccessFileName <var>filename</var> [<var>filename</var>] ...</syntax>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Mientras que procesa una petición el servidor busca
2d2eda71267231c2526be701fe655db125852c1ffielding el primer fichero de configuración existente dentro de un listado de nombres en
2d2eda71267231c2526be701fe655db125852c1ffielding cada directorio de la ruta del documento, si los ficheros distribuidos
2d2eda71267231c2526be701fe655db125852c1ffielding de configuración están <a href="#allowoverride">habilitados para ese
2d2eda71267231c2526be701fe655db125852c1ffielding AccessFileName .acl
2d2eda71267231c2526be701fe655db125852c1ffielding <p>antes de servir el documento
2d2eda71267231c2526be701fe655db125852c1ffielding <code>/usr/local/web/index.html</code>, el servidor leerá
2d2eda71267231c2526be701fe655db125852c1ffielding <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
2d2eda71267231c2526be701fe655db125852c1ffielding para las directivas, salvo que estén deshabilitadas with</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <Directory /><br />
2d2eda71267231c2526be701fe655db125852c1ffielding AllowOverride None<br />
e44e11f9fece12c783f18d033923bfc0d6b4289aake </Directory>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><directive module="core">AllowOverride</directive></seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><a href="/configuring.html">Configuration Files</a></seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><a href="/howto/htaccess.html">.htaccess Files</a></seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Default charset parameter to be added when a response
2d2eda71267231c2526be701fe655db125852c1ffieldingcontent-type is <code>text/plain</code> or <code>text/html</code></description>
2d2eda71267231c2526be701fe655db125852c1ffielding<syntax>AddDefaultCharset On|Off|<var>charset</var></syntax>
2d2eda71267231c2526be701fe655db125852c1ffielding<context>virtual host</context><context>directory</context>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>This directive specifies a default value for the media type
2d2eda71267231c2526be701fe655db125852c1ffielding charset parameter (the name of a character encoding) to be added
2d2eda71267231c2526be701fe655db125852c1ffielding to a response if and only if the response's content-type is either
2d2eda71267231c2526be701fe655db125852c1ffielding <code>text/plain</code> or <code>text/html</code>. This should override
2d2eda71267231c2526be701fe655db125852c1ffielding any charset specified in the body of the response via a <code>META</code>
2d2eda71267231c2526be701fe655db125852c1ffielding element, though the exact behavior is often dependent on the user's client
2d2eda71267231c2526be701fe655db125852c1ffielding configuration. A setting of <code>AddDefaultCharset Off</code>
2d2eda71267231c2526be701fe655db125852c1ffielding disables this functionality. <code>AddDefaultCharset On</code> enables
2d2eda71267231c2526be701fe655db125852c1ffielding a default charset of <code>iso-8859-1</code>. Any other value is assumed
2d2eda71267231c2526be701fe655db125852c1ffielding to be the <var>charset</var> to be used, which should be one of the
2d2eda71267231c2526be701fe655db125852c1ffielding <a href="http://www.iana.org/assignments/character-sets">IANA registered
2d2eda71267231c2526be701fe655db125852c1ffielding charset values</a> for use in Internet media types (MIME types).
2d2eda71267231c2526be701fe655db125852c1ffielding For example:</p>
2d2eda71267231c2526be701fe655db125852c1ffielding AddDefaultCharset utf-8
2d2eda71267231c2526be701fe655db125852c1ffielding <p><directive>AddDefaultCharset</directive> should only be used when all
2d2eda71267231c2526be701fe655db125852c1ffielding of the text resources to which it applies are known to be in that
2d2eda71267231c2526be701fe655db125852c1ffielding character encoding and it is too inconvenient to label their charset
2d2eda71267231c2526be701fe655db125852c1ffielding individually. One such example is to add the charset parameter
2d2eda71267231c2526be701fe655db125852c1ffielding to resources containing generated content, such as legacy CGI
2d2eda71267231c2526be701fe655db125852c1ffielding scripts, that might be vulnerable to cross-site scripting attacks
2d2eda71267231c2526be701fe655db125852c1ffielding due to user-provided data being included in the output. Note, however,
2d2eda71267231c2526be701fe655db125852c1ffielding that a better solution is to just fix (or delete) those scripts, since
2d2eda71267231c2526be701fe655db125852c1ffielding setting a default charset does not protect users that have enabled
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet the "auto-detect character encoding" feature on their browser.</p>
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet<seealso><directive module="mod_mime">AddCharset</directive></seealso>
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet</directivesynopsis>
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Determines whether encoded path separators in URLs are allowed to
2d2eda71267231c2526be701fe655db125852c1ffieldingbe passed through</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding<compatibility>Available in Apache httpd 2.0.46 and later</compatibility>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>The <directive>AllowEncodedSlashes</directive> directive allows URLs
2d2eda71267231c2526be701fe655db125852c1ffielding which contain encoded path separators (<code>%2F</code> for <code>/</code>
2d2eda71267231c2526be701fe655db125852c1ffielding and additionally <code>%5C</code> for <code>\</code> on according systems)
2d2eda71267231c2526be701fe655db125852c1ffielding to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>Turning <directive>AllowEncodedSlashes</directive> <code>On</code> is
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
32644678e889a3253f71bde0b3d6daea6d9dc21awrowe Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
32644678e889a3253f71bde0b3d6daea6d9dc21awrowe according systems) will be left as such in the otherwise decoded URL
725c954c86847e3c0dd394907a20b273ee8126earbb string.</p>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb<seealso><directive module="core">AcceptPathInfo</directive></seealso>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb</directivesynopsis>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb<directivesynopsis>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb<description>Types of directives that are allowed in
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb<default>AllowOverride None (2.3.9 and later), AllowOverride All (2.3.8 and earlier)</default>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>When the server finds an <code>.htaccess</code> file (as
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb specified by <directive module="core">AccessFileName</directive>)
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb it needs to know which directives declared in that file can override
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb earlier configuration directives.</p>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <note><title>Only available in <Directory> sections</title>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive type="section" module="core">Directory</directive>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb sections specified without regular expressions, not in <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb type="section" module="core">Location</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="core" type="section">DirectoryMatch</directive> or
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive type="section" module="core">Files</directive> sections.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>When this directive is set to <code>None</code>, then
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <a href="#accessfilename">.htaccess</a> files are completely ignored.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb In this case, the server will not even attempt to read
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>When this directive is set to <code>All</code>, then any
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb directive which has the .htaccess <a
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb href="directive-dict.html#Context">Context</a> is allowed in
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>The <var>directive-type</var> can be one of the following
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb groupings of directives.</p>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb Allow use of the authorization directives (<directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive module="mod_authn_dbm">AuthDBMUserFile</directive>,
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive module="mod_authz_groupfile">AuthGroupFile</directive>,
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive module="mod_authn_core">AuthName</directive>,
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive module="mod_authn_core">AuthType</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_authn_file">AuthUserFile</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_authz_core">Require</directive>, <em>etc.</em>).</dd>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb Allow use of the directives controlling document types
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive module="mod_negotiation">LanguagePriority</directive>,
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive module="core">SetOutputFilter</directive>, and
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb document meta data (<directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_headers">RequestHeader</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_setenvif">SetEnvIfNoCase</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_setenvif">BrowserMatch</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_usertrack">CookieExpires</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_usertrack">CookieDomain</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_usertrack">CookieStyle</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_usertrack">CookieTracking</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_rewrite">RewriteEngine</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_rewrite">RewriteOptions</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_rewrite">RewriteBase</directive>, <directive
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb module="mod_rewrite">RewriteCond</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding <directive module="mod_actions">Action</directive> from
2d2eda71267231c2526be701fe655db125852c1ffielding Allow use of the directives controlling directory indexing
725c954c86847e3c0dd394907a20b273ee8126earbb (<directive
2d2eda71267231c2526be701fe655db125852c1ffielding <directive module="mod_autoindex">AddIcon</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding module="mod_autoindex">AddIconByEncoding</directive>,
2d2eda71267231c2526be701fe655db125852c1ffielding <directive module="mod_autoindex">AddIconByType</directive>,
2d2eda71267231c2526be701fe655db125852c1ffielding <directive module="mod_autoindex">DefaultIcon</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding module="mod_dir">DirectoryIndex</directive>, <directive
7463de0c603f07c9e1820e812d2f1a73661843e6rbb module="mod_autoindex">FancyIndexing</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding module="mod_autoindex">HeaderName</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding module="mod_autoindex">IndexIgnore</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding module="mod_autoindex">IndexOptions</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding Allow use of the directives controlling host access (<directive
2d2eda71267231c2526be701fe655db125852c1ffielding module="mod_authz_host">Allow</directive>, <directive
2d2eda71267231c2526be701fe655db125852c1ffielding module="mod_authz_host">Deny</directive> and <directive
2d2eda71267231c2526be701fe655db125852c1ffielding Allow use of the directives controlling specific directory
2d2eda71267231c2526be701fe655db125852c1ffielding features (<directive module="core">Options</directive> and
2d2eda71267231c2526be701fe655db125852c1ffielding <directive module="mod_include">XBitHack</directive>).
2d2eda71267231c2526be701fe655db125852c1ffielding An equal sign may be given followed by a comma (but no spaces)
2d2eda71267231c2526be701fe655db125852c1ffielding separated lists of options that may be set using the <directive
2d2eda71267231c2526be701fe655db125852c1ffielding AllowOverride AuthConfig Indexes
2d2eda71267231c2526be701fe655db125852c1ffielding <p>In the example above all directives that are neither in the group
2d2eda71267231c2526be701fe655db125852c1ffielding <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
2d2eda71267231c2526be701fe655db125852c1ffielding server error.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <note><p>For security and performance reasons, do not set
2d2eda71267231c2526be701fe655db125852c1ffielding <code>AllowOverride</code> to anything other than <code>None</code>
2d2eda71267231c2526be701fe655db125852c1ffielding in your <code><Directory /></code> block. Instead, find (or
2d2eda71267231c2526be701fe655db125852c1ffielding create) the <code><Directory></code> block that refers to the
2d2eda71267231c2526be701fe655db125852c1ffielding directory where you're actually planning to place a
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><directive module="core">AccessFileName</directive></seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><a href="/configuring.html">Configuration Files</a></seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><a href="/howto/htaccess.html">.htaccess Files</a></seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Technique for locating the interpreter for CGI
2d2eda71267231c2526be701fe655db125852c1ffieldingscripts</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<syntax>CGIMapExtension <var>cgi-path</var> <var>.extension</var></syntax>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>directory</context><context>.htaccess</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>This directive is used to control how Apache httpd finds the
2d2eda71267231c2526be701fe655db125852c1ffielding interpreter used to run CGI scripts. For example, setting
2d2eda71267231c2526be701fe655db125852c1ffielding <code>CGIMapExtension sys:\foo.nlm .foo</code> will
2d2eda71267231c2526be701fe655db125852c1ffielding cause all CGI script files with a <code>.foo</code> extension to
2d2eda71267231c2526be701fe655db125852c1ffielding be passed to the FOO interpreter.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Enables the generation of <code>Content-MD5</code> HTTP Response
2d2eda71267231c2526be701fe655db125852c1ffieldingheaders</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding<context>directory</context><context>.htaccess</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>This directive enables the generation of
2d2eda71267231c2526be701fe655db125852c1ffielding <code>Content-MD5</code> headers as defined in RFC1864
2d2eda71267231c2526be701fe655db125852c1ffielding respectively RFC2616.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>MD5 is an algorithm for computing a "message digest"
2d2eda71267231c2526be701fe655db125852c1ffielding (sometimes called "fingerprint") of arbitrary-length data, with
2d2eda71267231c2526be701fe655db125852c1ffielding a high degree of confidence that any alterations in the data
2d2eda71267231c2526be701fe655db125852c1ffielding will be reflected in alterations in the message digest.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>The <code>Content-MD5</code> header provides an end-to-end
2d2eda71267231c2526be701fe655db125852c1ffielding message integrity check (MIC) of the entity-body. A proxy or
2d2eda71267231c2526be701fe655db125852c1ffielding client may check this header for detecting accidental
2d2eda71267231c2526be701fe655db125852c1ffielding modification of the entity-body in transit. Example header:</p>
2d2eda71267231c2526be701fe655db125852c1ffielding Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Note that this can cause performance problems on your server
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar since the message digest is computed on every request (the
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar values are not cached).</p>
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar <p><code>Content-MD5</code> is only sent for documents served
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar by the <module>core</module>, and not by any module. For example,
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar SSI documents, output from CGI scripts, and byte range responses
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar do not have this header.</p>
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>This directive has no effect other than to emit warnings
2d2eda71267231c2526be701fe655db125852c1ffieldingif the value is not <code>none</code>. In prior versions, DefaultType
54e94821097724bf413d2d4cc70711760f7494e1trawickwould specify a default media type to assign to response content for
54e94821097724bf413d2d4cc70711760f7494e1trawickwhich no other media type configuration could be found.
54e94821097724bf413d2d4cc70711760f7494e1trawick</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<syntax>DefaultType <var>media-type|none</var></syntax>
54e94821097724bf413d2d4cc70711760f7494e1trawick<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding<context>directory</context><context>.htaccess</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
54e94821097724bf413d2d4cc70711760f7494e1trawick<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>
54e94821097724bf413d2d4cc70711760f7494e1trawick <p>This directive has been disabled. For backwards compatibility
54e94821097724bf413d2d4cc70711760f7494e1trawick of configuration files, it may be specified with the value
54e94821097724bf413d2d4cc70711760f7494e1trawick <code>none</code>, meaning no default media type. For example:</p>
54e94821097724bf413d2d4cc70711760f7494e1trawick DefaultType None
2d2eda71267231c2526be701fe655db125852c1ffielding <p><code>DefaultType None</code> is only available in
2d2eda71267231c2526be701fe655db125852c1ffielding httpd-2.2.7 and later.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <directive module="mod_mime">AddType</directive> to configure media
2d2eda71267231c2526be701fe655db125852c1ffielding type assignments via file extensions, or the
2d2eda71267231c2526be701fe655db125852c1ffielding <directive module="core">ForceType</directive> directive to configure
2d2eda71267231c2526be701fe655db125852c1ffielding the media type for specific resources. Otherwise, the server will
2d2eda71267231c2526be701fe655db125852c1ffielding send the response without a Content-Type header field and the
2d2eda71267231c2526be701fe655db125852c1ffielding recipient may attempt to guess the media type.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Define the existence of a variable</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>server config</context></contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Equivalent to passing the <code>-D</code> argument to <program
2d2eda71267231c2526be701fe655db125852c1ffielding <p>This directive can be used to toggle the use of <directive module="core"
2d2eda71267231c2526be701fe655db125852c1ffielding type="section">IfDefine</directive> sections without needing to alter
2d2eda71267231c2526be701fe655db125852c1ffielding <code>-D</code> arguments in any startup scripts.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>Enclose a group of directives that apply only to the
952908500d5f99f35afc5ed510391b9bdc3833farbbnamed file-system directory, sub-directories, and their contents.</description>
952908500d5f99f35afc5ed510391b9bdc3833farbb... </Directory></syntax>
952908500d5f99f35afc5ed510391b9bdc3833farbb<contextlist><context>server config</context><context>virtual host</context>
952908500d5f99f35afc5ed510391b9bdc3833farbb</contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding <p><directive type="section">Directory</directive> and
2d2eda71267231c2526be701fe655db125852c1ffielding <code></Directory></code> are used to enclose a group of
3887202241db08986e94b252fbd06a55e55d4b2dbhyde directives that will apply only to the named directory,
3887202241db08986e94b252fbd06a55e55d4b2dbhyde sub-directories of that directory, and the files within the respective
3887202241db08986e94b252fbd06a55e55d4b2dbhyde directories. Any directive that is allowed
3887202241db08986e94b252fbd06a55e55d4b2dbhyde in a directory context may be used. <var>Directory-path</var> is
3887202241db08986e94b252fbd06a55e55d4b2dbhyde either the full path to a directory, or a wild-card string using
3887202241db08986e94b252fbd06a55e55d4b2dbhyde Unix shell-style matching. In a wild-card string, <code>?</code> matches
3887202241db08986e94b252fbd06a55e55d4b2dbhyde any single character, and <code>*</code> matches any sequences of
3887202241db08986e94b252fbd06a55e55d4b2dbhyde characters. You may also use <code>[]</code> character ranges. None
2d2eda71267231c2526be701fe655db125852c1ffielding of the wildcards match a `/' character, so <code><Directory
3887202241db08986e94b252fbd06a55e55d4b2dbhyde /*/public_html></code> will not match
2d2eda71267231c2526be701fe655db125852c1ffielding <code>/home/user/public_html</code>, but <code><Directory
2d2eda71267231c2526be701fe655db125852c1ffielding /home/*/public_html></code> will match. Example:</p>
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick Options Indexes FollowSymLinks<br />
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick </Directory>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>Be careful with the <var>directory-path</var> arguments:
952908500d5f99f35afc5ed510391b9bdc3833farbb They have to literally match the filesystem path which Apache httpd uses
952908500d5f99f35afc5ed510391b9bdc3833farbb to access the files. Directives applied to a particular
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <code><Directory></code> will not apply to files accessed from
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick that same directory via a different path, such as via different symbolic
952908500d5f99f35afc5ed510391b9bdc3833farbb expressions</glossary> can also be used, with the addition of the
952908500d5f99f35afc5ed510391b9bdc3833farbb <Directory ~ "^/www/.*/[0-9]{3}">
b28574227fcf956444ac03bde294122a05ad2bderbb <p>would match directories in <code>/www/</code> that consisted of
952908500d5f99f35afc5ed510391b9bdc3833farbb three numbers.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb match the directory (or one of its parents) containing a document,
2d2eda71267231c2526be701fe655db125852c1ffielding then the directives are applied in the order of shortest match
952908500d5f99f35afc5ed510391b9bdc3833farbb first, interspersed with the directives from the <a
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm href="#accessfilename">.htaccess</a> files. For example,
2d2eda71267231c2526be701fe655db125852c1ffielding <Directory /><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb AllowOverride None<br />
952908500d5f99f35afc5ed510391b9bdc3833farbb </Directory><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb <Directory /home/><br />
2d2eda71267231c2526be701fe655db125852c1ffielding AllowOverride FileInfo<br />
952908500d5f99f35afc5ed510391b9bdc3833farbb </Directory>
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>for access to the document <code>/home/web/dir/doc.html</code>
2d2eda71267231c2526be701fe655db125852c1ffielding the steps are:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>Apply directive <code>AllowOverride FileInfo</code> (for
952908500d5f99f35afc5ed510391b9bdc3833farbb <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
952908500d5f99f35afc5ed510391b9bdc3833farbb <code>/home/web/dir/.htaccess</code> in that order.</li>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>Regular expressions are not considered until after all of the
952908500d5f99f35afc5ed510391b9bdc3833farbb normal sections have been applied. Then all of the regular
952908500d5f99f35afc5ed510391b9bdc3833farbb expressions are tested in the order they appeared in the
952908500d5f99f35afc5ed510391b9bdc3833farbb configuration file. For example, with</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <Directory ~ abc$><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb # ... directives here ...<br />
2d2eda71267231c2526be701fe655db125852c1ffielding </Directory>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>the regular expression section won't be considered until after
2d2eda71267231c2526be701fe655db125852c1ffielding all normal <directive type="section">Directory</directive>s and
952908500d5f99f35afc5ed510391b9bdc3833farbb <code>.htaccess</code> files have been applied. Then the regular
952908500d5f99f35afc5ed510391b9bdc3833farbb expression will match on <code>/home/abc/public_html/abc</code> and
952908500d5f99f35afc5ed510391b9bdc3833farbb the corresponding <directive type="section">Directory</directive> will
952908500d5f99f35afc5ed510391b9bdc3833farbb be applied.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <code><Directory /></code> is <code>Allow from All</code>.
952908500d5f99f35afc5ed510391b9bdc3833farbb This means that Apache httpd will serve any file mapped from an URL. It is
952908500d5f99f35afc5ed510391b9bdc3833farbb recommended that you change this with a block such
952908500d5f99f35afc5ed510391b9bdc3833farbb <Directory /><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb Order Deny,Allow<br />
952908500d5f99f35afc5ed510391b9bdc3833farbb Deny from All<br />
952908500d5f99f35afc5ed510391b9bdc3833farbb </Directory>
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb href="/misc/security_tips.html">Security Tips</a> page for more
2d2eda71267231c2526be701fe655db125852c1ffielding <p>The directory sections occur in the <code>httpd.conf</code> file.
5d54ba1fdf6f8d7167fafcd93bef30df3906b1aecoar <directive type="section">Directory</directive> directives
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar cannot nest, and cannot appear in a <directive module="core"
2d2eda71267231c2526be701fe655db125852c1ffielding type="section">Limit</directive> or <directive module="core"
952908500d5f99f35afc5ed510391b9bdc3833farbb <Location> and <Files> sections work</a> for an
952908500d5f99f35afc5ed510391b9bdc3833farbb explanation of how these different sections are combined when a
952908500d5f99f35afc5ed510391b9bdc3833farbb request is received</seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>Enclose directives that apply to
952908500d5f99f35afc5ed510391b9bdc3833farbbthe contents of file-system directories matching a regular expression.</description>
952908500d5f99f35afc5ed510391b9bdc3833farbb... </DirectoryMatch></syntax>
952908500d5f99f35afc5ed510391b9bdc3833farbb<contextlist><context>server config</context><context>virtual host</context>
952908500d5f99f35afc5ed510391b9bdc3833farbb</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p><directive type="section">DirectoryMatch</directive> and
952908500d5f99f35afc5ed510391b9bdc3833farbb <code></DirectoryMatch></code> are used to enclose a group
952908500d5f99f35afc5ed510391b9bdc3833farbb of directives which will apply only to the named directory (and the files within),
952908500d5f99f35afc5ed510391b9bdc3833farbb the same as <directive module="core" type="section">Directory</directive>.
952908500d5f99f35afc5ed510391b9bdc3833farbb However, it takes as an argument a
952908500d5f99f35afc5ed510391b9bdc3833farbb <glossary ref="regex">regular expression</glossary>. For example:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>would match directories in <code>/www/</code> that consisted of three
2d2eda71267231c2526be701fe655db125852c1ffielding numbers.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding Prior to 2.3.9, this directive implicitly applied to sub-directories
2d2eda71267231c2526be701fe655db125852c1ffielding (like <directive module="core" type="section">Directory</directive>) and
2d2eda71267231c2526be701fe655db125852c1ffielding could not match the end of line symbol ($). In 2.3.9 and later,
2d2eda71267231c2526be701fe655db125852c1ffielding only directories that match the expression are affected by the enclosed
2d2eda71267231c2526be701fe655db125852c1ffielding directives.
2d2eda71267231c2526be701fe655db125852c1ffielding This directive applies to requests for directories that may or may
2d2eda71267231c2526be701fe655db125852c1ffielding not end in a trailing slash, so expressions that are anchored to the
952908500d5f99f35afc5ed510391b9bdc3833farbb end of line ($) must be written with care.
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm<seealso><directive type="section" module="core">Directory</directive> for
952908500d5f99f35afc5ed510391b9bdc3833farbba description of how regular expressions are mixed in with normal
952908500d5f99f35afc5ed510391b9bdc3833farbb<directive type="section">Directory</directive>s</seealso>
952908500d5f99f35afc5ed510391b9bdc3833farbbhref="/sections.html">How <Directory>, <Location> and
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm<Files> sections work</a> for an explanation of how these different
952908500d5f99f35afc5ed510391b9bdc3833farbbsections are combined when a request is received</seealso>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Directory that forms the main document tree visible
2d2eda71267231c2526be701fe655db125852c1ffieldingfrom the web</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<default>DocumentRoot /usr/local/apache/htdocs</default>
952908500d5f99f35afc5ed510391b9bdc3833farbb<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>This directive sets the directory from which <program>httpd</program>
952908500d5f99f35afc5ed510391b9bdc3833farbb will serve files. Unless matched by a directive like <directive
952908500d5f99f35afc5ed510391b9bdc3833farbb module="mod_alias">Alias</directive>, the server appends the
952908500d5f99f35afc5ed510391b9bdc3833farbb path from the requested URL to the document root to make the
952908500d5f99f35afc5ed510391b9bdc3833farbb path to the document. Example:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>then an access to
952908500d5f99f35afc5ed510391b9bdc3833farbb <code>http://www.my.host.com/index.html</code> refers to
952908500d5f99f35afc5ed510391b9bdc3833farbb <code>/usr/web/index.html</code>. If the <var>directory-path</var> is
2d2eda71267231c2526be701fe655db125852c1ffielding not absolute then it is assumed to be relative to the <directive
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>The <directive>DocumentRoot</directive> should be specified without
2d2eda71267231c2526be701fe655db125852c1ffielding a trailing slash.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><a href="/urlmapping.html#documentroot">Mapping URLs to Filesystem
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>Use memory-mapping to read files during delivery</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>This directive controls whether the <program>httpd</program> may use
952908500d5f99f35afc5ed510391b9bdc3833farbb memory-mapping if it needs to read the contents of a file during
952908500d5f99f35afc5ed510391b9bdc3833farbb delivery. By default, when the handling of a request requires
2d2eda71267231c2526be701fe655db125852c1ffielding access to the data within a file -- for example, when delivering a
2d2eda71267231c2526be701fe655db125852c1ffielding server-parsed file using <module>mod_include</module> -- Apache httpd
2d2eda71267231c2526be701fe655db125852c1ffielding memory-maps the file if the OS supports it.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>This memory-mapping sometimes yields a performance improvement.
2d2eda71267231c2526be701fe655db125852c1ffielding But in some environments, it is better to disable the memory-mapping
952908500d5f99f35afc5ed510391b9bdc3833farbb to prevent operational problems:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>On some multiprocessor systems, memory-mapping can reduce the
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>Deleting or truncating a file while <program>httpd</program>
2d2eda71267231c2526be701fe655db125852c1ffielding has it memory-mapped can cause <program>httpd</program> to
2d2eda71267231c2526be701fe655db125852c1ffielding crash with a segmentation fault.
2d2eda71267231c2526be701fe655db125852c1ffielding <p>For server configurations that are vulnerable to these problems,
2d2eda71267231c2526be701fe655db125852c1ffielding you should disable memory-mapping of delivered files by specifying:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb EnableMMAP Off
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick <p>For NFS mounted files, this feature may be disabled explicitly for
777a2b42697cb8cb94ac4e73774862f879259c45rbb the offending files by specifying:</p>
eea18cb2519ccf7549091ec417e86d2f12e9f92ctrawick <Directory "/path-to-nfs-files">
777a2b42697cb8cb94ac4e73774862f879259c45rbb EnableMMAP Off
2d2eda71267231c2526be701fe655db125852c1ffielding </Directory>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>Use the kernel sendfile support to deliver files to the client</description>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm<contextlist><context>server config</context><context>virtual host</context>
952908500d5f99f35afc5ed510391b9bdc3833farbb</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb<compatibility>Available in version 2.0.44 and later. Default changed to Off in
2d2eda71267231c2526be701fe655db125852c1ffieldingversion 2.3.9.</compatibility>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>This directive controls whether <program>httpd</program> may use the
952908500d5f99f35afc5ed510391b9bdc3833farbb sendfile support from the kernel to transmit file contents to the client.
2d2eda71267231c2526be701fe655db125852c1ffielding By default, when the handling of a request requires no access
2d2eda71267231c2526be701fe655db125852c1ffielding to the data within a file -- for example, when delivering a
2d2eda71267231c2526be701fe655db125852c1ffielding static file -- Apache httpd uses sendfile to deliver the file contents
952908500d5f99f35afc5ed510391b9bdc3833farbb without ever reading the file if the OS supports it.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>This sendfile mechanism avoids separate read and send operations,
952908500d5f99f35afc5ed510391b9bdc3833farbb and buffer allocations. But on some platforms or within some
952908500d5f99f35afc5ed510391b9bdc3833farbb filesystems, it is better to disable this feature to avoid
952908500d5f99f35afc5ed510391b9bdc3833farbb operational problems:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>Some platforms may have broken sendfile support that the build
952908500d5f99f35afc5ed510391b9bdc3833farbb system did not detect, especially if the binaries were built on
952908500d5f99f35afc5ed510391b9bdc3833farbb another box and moved to such a machine with broken sendfile
952908500d5f99f35afc5ed510391b9bdc3833farbb support.</li>
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>On Linux the use of sendfile triggers TCP-checksum
952908500d5f99f35afc5ed510391b9bdc3833farbb offloading bugs on certain networking cards when using IPv6.</li>
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>On Linux on Itanium, sendfile may be unable to handle files
952908500d5f99f35afc5ed510391b9bdc3833farbb over 2GB in size.</li>
952908500d5f99f35afc5ed510391b9bdc3833farbb module="core">DocumentRoot</directive> (e.g., NFS, SMB, CIFS, FUSE),
952908500d5f99f35afc5ed510391b9bdc3833farbb the kernel may be unable to serve the network file through
952908500d5f99f35afc5ed510391b9bdc3833farbb its own cache.</li>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>For server configurations that are not vulnerable to these problems,
952908500d5f99f35afc5ed510391b9bdc3833farbb you may enable this feature by specifying:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb EnableSendfile On
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>For network mounted files, this feature may be disabled explicitly
952908500d5f99f35afc5ed510391b9bdc3833farbb for the offending files by specifying:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <Directory "/path-to-nfs-files">
952908500d5f99f35afc5ed510391b9bdc3833farbb EnableSendfile Off
952908500d5f99f35afc5ed510391b9bdc3833farbb </Directory>
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Please note that the per-directory and .htaccess configuration
2d2eda71267231c2526be701fe655db125852c1ffielding of <directive>EnableSendfile</directive> is not supported by
2d2eda71267231c2526be701fe655db125852c1ffielding Only global definition of <directive>EnableSendfile</directive>
2d2eda71267231c2526be701fe655db125852c1ffielding is taken into account by the module.
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>Abort configuration parsing with a custom error message</description>
169f62b04de69074b561b4e6dcf6f82572a5e367trawick<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding<context>directory</context><context>.htaccess</context>
952908500d5f99f35afc5ed510391b9bdc3833farbb</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>If an error can be detected within the configuration, this
952908500d5f99f35afc5ed510391b9bdc3833farbb directive can be used to generate a custom error message, and halt
2d2eda71267231c2526be701fe655db125852c1ffielding configuration parsing. The typical use is for reporting required
2d2eda71267231c2526be701fe655db125852c1ffielding modules which are missing from the configuration.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb # ensure that mod_include is loaded<br />
3887202241db08986e94b252fbd06a55e55d4b2dbhyde <IfModule !include_module><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb Error mod_include is required by mod_foo. Load it with LoadModule.<br />
2d2eda71267231c2526be701fe655db125852c1ffielding </IfModule><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb # ensure that exactly one of SSL,NOSSL is defined<br />
2d2eda71267231c2526be701fe655db125852c1ffielding <IfDefine SSL><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb <IfDefine NOSSL><br />
2d2eda71267231c2526be701fe655db125852c1ffielding Error Both SSL and NOSSL are defined. Define only one of them.<br />
2d2eda71267231c2526be701fe655db125852c1ffielding </IfDefine><br />
2d2eda71267231c2526be701fe655db125852c1ffielding </IfDefine><br />
2d2eda71267231c2526be701fe655db125852c1ffielding <IfDefine !SSL><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb <IfDefine !NOSSL><br />
2d2eda71267231c2526be701fe655db125852c1ffielding Error Either SSL or NOSSL must be defined.<br />
952908500d5f99f35afc5ed510391b9bdc3833farbb </IfDefine><br />
2d2eda71267231c2526be701fe655db125852c1ffielding </IfDefine><br />
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>What the server will return to the client
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmin case of an error</description>
952908500d5f99f35afc5ed510391b9bdc3833farbb<syntax>ErrorDocument <var>error-code</var> <var>document</var></syntax>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>server config</context><context>virtual host</context>
2d2eda71267231c2526be701fe655db125852c1ffielding<context>directory</context><context>.htaccess</context>
2d2eda71267231c2526be701fe655db125852c1ffielding</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>In the event of a problem or error, Apache httpd can be configured
952908500d5f99f35afc5ed510391b9bdc3833farbb to do one of four things,</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>redirect to a local <var>URL-path</var> to handle the
952908500d5f99f35afc5ed510391b9bdc3833farbb <li>redirect to an external <var>URL</var> to handle the
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>The first option is the default, while options 2-4 are
952908500d5f99f35afc5ed510391b9bdc3833farbb configured using the <directive>ErrorDocument</directive>
952908500d5f99f35afc5ed510391b9bdc3833farbb directive, which is followed by the HTTP response code and a URL
952908500d5f99f35afc5ed510391b9bdc3833farbb or a message. Apache httpd will sometimes offer additional information
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>URLs can begin with a slash (/) for local web-paths (relative
952908500d5f99f35afc5ed510391b9bdc3833farbb to the <directive module="core">DocumentRoot</directive>), or be a
952908500d5f99f35afc5ed510391b9bdc3833farbb full URL which the client can resolve. Alternatively, a message
952908500d5f99f35afc5ed510391b9bdc3833farbb can be provided to be displayed by the browser. Examples:</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorDocument 403 "Sorry can't allow you access today"
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>Additionally, the special value <code>default</code> can be used
952908500d5f99f35afc5ed510391b9bdc3833farbb to specify Apache httpd's simple hardcoded message. While not required
952908500d5f99f35afc5ed510391b9bdc3833farbb under normal circumstances, <code>default</code> will restore
952908500d5f99f35afc5ed510391b9bdc3833farbb Apache httpd's simple hardcoded message for configurations that would
952908500d5f99f35afc5ed510391b9bdc3833farbb otherwise inherit an existing <directive>ErrorDocument</directive>.</p>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb ErrorDocument 404 default<br />
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb </Directory>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb </example>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>Note that when you specify an <directive>ErrorDocument</directive>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb that points to a remote URL (ie. anything with a method such as
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb client to tell it where to find the document, even if the
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb document ends up being on the same server. This has several
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb implications, the most important being that the client will not
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb receive the original error status code, but instead will
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb receive a redirect status code. This in turn can confuse web
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb robots and other clients which try to determine if a URL is
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb valid using the status code. In addition, if you use a remote
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb URL in an <code>ErrorDocument 401</code>, the client will not
e68becff3c3ddc18723c9799b8cc2e6e9c3dbd66wrowe know to prompt the user for a password since it will not
e68becff3c3ddc18723c9799b8cc2e6e9c3dbd66wrowe receive the 401 status code. Therefore, <strong>if you use an
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <code>ErrorDocument 401</code> directive then it must refer to a local
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>Microsoft Internet Explorer (MSIE) will by default ignore
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb server-generated error messages when they are "too small" and substitute
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb its own "friendly" error messages. The size threshold varies depending on
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb the type of error, but in general, if you make your error document
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb greater than 512 bytes, then MSIE will show the server-generated
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb error rather than masking it. More information is available in
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb Microsoft Knowledge Base article <a
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807"
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Although most error messages can be overriden, there are certain
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb circumstances where the internal messages are used regardless of the
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb setting of <directive module="core">ErrorDocument</directive>. In
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb particular, if a malformed request is detected, normal request processing
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb will be immediately halted and the internal error message returned.
2d2eda71267231c2526be701fe655db125852c1ffielding This is necessary to guard against security problems caused by
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb bad requests.</p>
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <p>If you are using mod_proxy, you may wish to enable
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb <directive module="mod_proxy">ProxyErrorOverride</directive> so that you can provide
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb Apache httpd will not generate custom error documents for proxied content.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>Location where the server will log errors</description>
952908500d5f99f35afc5ed510391b9bdc3833farbb<syntax> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</syntax>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm<default>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</default>
952908500d5f99f35afc5ed510391b9bdc3833farbb<contextlist><context>server config</context><context>virtual host</context>
952908500d5f99f35afc5ed510391b9bdc3833farbb</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>The <directive>ErrorLog</directive> directive sets the name of
952908500d5f99f35afc5ed510391b9bdc3833farbb the file to which the server will log any errors it encounters. If
952908500d5f99f35afc5ed510391b9bdc3833farbb the <var>file-path</var> is not absolute then it is assumed to be
952908500d5f99f35afc5ed510391b9bdc3833farbb relative to the <directive module="core">ServerRoot</directive>.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding begins with a pipe character "<code>|</code>" then it is assumed to be a
2d2eda71267231c2526be701fe655db125852c1ffielding command to spawn to handle the error log.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>See the notes on <a href="/logs.html#piped">piped logs</a> for
952908500d5f99f35afc5ed510391b9bdc3833farbb more information.</p>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <p>Using <code>syslog</code> instead of a filename enables logging
952908500d5f99f35afc5ed510391b9bdc3833farbb via syslogd(8) if the system supports it. The default is to use
952908500d5f99f35afc5ed510391b9bdc3833farbb syslog facility <code>local7</code>, but you can override this by
952908500d5f99f35afc5ed510391b9bdc3833farbb using the <code>syslog:<var>facility</var></code> syntax where
952908500d5f99f35afc5ed510391b9bdc3833farbb <var>facility</var> can be one of the names usually documented in
952908500d5f99f35afc5ed510391b9bdc3833farbb syslog(1). The facility is effectively global, and if it is changed
952908500d5f99f35afc5ed510391b9bdc3833farbb in individual virtual hosts, the final facility specified affects the
952908500d5f99f35afc5ed510391b9bdc3833farbb entire server.</p>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm ErrorLog syslog:user
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb href="/misc/security_tips.html#serverroot">security tips</a>
952908500d5f99f35afc5ed510391b9bdc3833farbb document for details on why your security could be compromised
952908500d5f99f35afc5ed510391b9bdc3833farbb if the directory where log files are stored is writable by
952908500d5f99f35afc5ed510391b9bdc3833farbb anyone other than the user that starts the server.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>When entering a file path on non-Unix platforms, care should be taken
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm to make sure that only forward slashed are used even though the platform
952908500d5f99f35afc5ed510391b9bdc3833farbb may allow the use of back slashes. In general it is a good idea to always
952908500d5f99f35afc5ed510391b9bdc3833farbb use forward slashes throughout the configuration files.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb<seealso><directive module="core">LogLevel</directive></seealso>
952908500d5f99f35afc5ed510391b9bdc3833farbb<seealso><a href="/logs.html">Apache HTTP Server Log Files</a></seealso>
952908500d5f99f35afc5ed510391b9bdc3833farbb</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>Format specification for error log entries</description>
952908500d5f99f35afc5ed510391b9bdc3833farbb<syntax> ErrorLog [connection|request] <var>format</var></syntax>
952908500d5f99f35afc5ed510391b9bdc3833farbb<contextlist><context>server config</context><context>virtual host</context>
952908500d5f99f35afc5ed510391b9bdc3833farbb</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb<compatibility>Available in Apache httpd 2.3.9 and later</compatibility>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p><directive>ErrorLogFormat</directive> allows to specify what
952908500d5f99f35afc5ed510391b9bdc3833farbb supplementary information is logged in the error log in addition to the
952908500d5f99f35afc5ed510391b9bdc3833farbb actual log message.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>Specifying <code>connection</code> or <code>request</code> as first
952908500d5f99f35afc5ed510391b9bdc3833farbb paramter allows to specify additional formats, causing additional
952908500d5f99f35afc5ed510391b9bdc3833farbb information to be logged when the first message is logged for a specific
952908500d5f99f35afc5ed510391b9bdc3833farbb connection or request, respectivly. This additional information is only
952908500d5f99f35afc5ed510391b9bdc3833farbb logged once per connection/request. If a connection or request is processed
952908500d5f99f35afc5ed510391b9bdc3833farbb without causing any log message, the additional information is not logged
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm either.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>It can happen that some format string items do not produce output. For
952908500d5f99f35afc5ed510391b9bdc3833farbb example, the Referer header is only present if the log message is
952908500d5f99f35afc5ed510391b9bdc3833farbb associated to a request and the log message happens at a time when the
952908500d5f99f35afc5ed510391b9bdc3833farbb Referer header has already been read from the client. If no output is
952908500d5f99f35afc5ed510391b9bdc3833farbb produced, the default behaviour is to delete everything from the preceeding
952908500d5f99f35afc5ed510391b9bdc3833farbb space character to the next space character. This means the log line is
952908500d5f99f35afc5ed510391b9bdc3833farbb implicitly divided into fields on non-whitespace to whitespace transitions.
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm If a format string item does not produce output, the whole field is
952908500d5f99f35afc5ed510391b9bdc3833farbb ommitted. For example, if the remote address <code>%a</code> in the log
952908500d5f99f35afc5ed510391b9bdc3833farbb format <code>[%t] [%l] [%a] %M </code> is not available, the surrounding
952908500d5f99f35afc5ed510391b9bdc3833farbb brackets are not logged either. Space characters can be escaped with a
952908500d5f99f35afc5ed510391b9bdc3833farbb backslash to prevent them from delimiting a field. The combination '% '
952908500d5f99f35afc5ed510391b9bdc3833farbb (percent space) is a zero-witdh field delimiter that does not produce any
952908500d5f99f35afc5ed510391b9bdc3833farbb output.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>The above behaviour can be changed by adding modifiers to the format
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm string item. A <code>-</code> (minus) modifier causes a minus to be logged if the
952908500d5f99f35afc5ed510391b9bdc3833farbb respective item does not produce any output. In once-per-connection/request
952908500d5f99f35afc5ed510391b9bdc3833farbb formats, it is also possible to use the <code>+</code> (plus) modifier. If an
952908500d5f99f35afc5ed510391b9bdc3833farbb item with the plus modifier does not produce any output, the whole line is
952908500d5f99f35afc5ed510391b9bdc3833farbb ommitted.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>A number as modifier can be used to assign a log severity level to a
952908500d5f99f35afc5ed510391b9bdc3833farbb format item. The item will only be logged if the severity of the log
952908500d5f99f35afc5ed510391b9bdc3833farbb message is not higher than the specified log severity level. The number can
952908500d5f99f35afc5ed510391b9bdc3833farbb range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8).</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>Some format string items accept additional parameters in braces.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <columnspec><column width=".2"/><column width=".8"/></columnspec>
952908500d5f99f35afc5ed510391b9bdc3833farbb <tr><th>Format String</th> <th>Description</th></tr>
952908500d5f99f35afc5ed510391b9bdc3833farbb <td>Request environment variable <code>name</code></td></tr>
952908500d5f99f35afc5ed510391b9bdc3833farbb <td>Source file name and line number of the log call</td></tr>
952908500d5f99f35afc5ed510391b9bdc3833farbb <td>Number of keep-alive requests on this connection</td></tr>
952908500d5f99f35afc5ed510391b9bdc3833farbb <td>Log ID of the connection if used in connection scope, empty otherwise</td></tr>
952908500d5f99f35afc5ed510391b9bdc3833farbb <td>The current time in compact ISO 8601 format, including
952908500d5f99f35afc5ed510391b9bdc3833farbb <td>The canonical <directive module="core">ServerName</directive>
952908500d5f99f35afc5ed510391b9bdc3833farbb <td>The server name of the server serving the request according to the
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>The log ID format <code>%L</code> produces a unique id for a connection
952908500d5f99f35afc5ed510391b9bdc3833farbb or request. This can be used to correlate which log lines belong to the
2d2eda71267231c2526be701fe655db125852c1ffielding same connection or request, which request happens on which connection.
952908500d5f99f35afc5ed510391b9bdc3833farbb <module>mod_log_config</module>, to allow to correlate access log entries
952908500d5f99f35afc5ed510391b9bdc3833farbb with error log lines. If <module>mod_unique_id</module> is loaded, its
952908500d5f99f35afc5ed510391b9bdc3833farbb unique id will be used as log ID for requests.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <example><title>Example (somewhat similar to default format)</title>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P] %7F: %E: [client\ %a]
952908500d5f99f35afc5ed510391b9bdc3833farbb %M% ,\ referer\ %{Referer}i"
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb <example><title>Example (similar to the 2.2.x format)</title>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
2d2eda71267231c2526be701fe655db125852c1ffielding %M% ,\ referer\ %{Referer}i"
952908500d5f99f35afc5ed510391b9bdc3833farbb </example>
952908500d5f99f35afc5ed510391b9bdc3833farbb <example><title>Advanced example with request/connection log IDs</title>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br/>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br/>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br/>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br/>
952908500d5f99f35afc5ed510391b9bdc3833farbb ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br/>
952908500d5f99f35afc5ed510391b9bdc3833farbb<seealso><directive module="core">ErrorLog</directive></seealso>
952908500d5f99f35afc5ed510391b9bdc3833farbb<seealso><directive module="core">LogLevel</directive></seealso>
952908500d5f99f35afc5ed510391b9bdc3833farbb<seealso><a href="/logs.html">Apache HTTP Server Log Files</a></seealso>
952908500d5f99f35afc5ed510391b9bdc3833farbb</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<directivesynopsis>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm<description>Keep track of extended status information for each
2d2eda71267231c2526be701fe655db125852c1ffieldingrequest</description>
952908500d5f99f35afc5ed510391b9bdc3833farbb<contextlist><context>server config</context></contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>This option tracks additional data per worker about the
952908500d5f99f35afc5ed510391b9bdc3833farbb currently executing request, and a utilization summary; you
952908500d5f99f35afc5ed510391b9bdc3833farbb can see these variables during runtime by configuring
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <module>mod_status</module>. Note that other modules may
952908500d5f99f35afc5ed510391b9bdc3833farbb rely on this scoreboard.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>This setting applies to the entire server, and cannot be
952908500d5f99f35afc5ed510391b9bdc3833farbb enabled or disabled on a virtualhost-by-virtualhost basis.
952908500d5f99f35afc5ed510391b9bdc3833farbb The collection of extended status information can slow down
952908500d5f99f35afc5ed510391b9bdc3833farbb the server. Also note that this setting cannot be changed
952908500d5f99f35afc5ed510391b9bdc3833farbb during a graceful restart.</p>
952908500d5f99f35afc5ed510391b9bdc3833farbb <p>Note that loading <module>mod_status</module> will change
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm the default behavior to ExtendedStatus On, while other
2d2eda71267231c2526be701fe655db125852c1ffielding third party modules may do the same. Such modules rely on
952908500d5f99f35afc5ed510391b9bdc3833farbb collecting detailed information about the state of all workers.
952908500d5f99f35afc5ed510391b9bdc3833farbb The default is changed by <module>mod_status</module> beginning
952908500d5f99f35afc5ed510391b9bdc3833farbb with version 2.3.6; the previous default was always Off.</p>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm</directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<directivesynopsis>
952908500d5f99f35afc5ed510391b9bdc3833farbb<description>File attributes used to create the ETag
952908500d5f99f35afc5ed510391b9bdc3833farbbHTTP response header for static files</description>
2d2eda71267231c2526be701fe655db125852c1ffielding<contextlist><context>server config</context><context>virtual host</context>
952908500d5f99f35afc5ed510391b9bdc3833farbb</contextlist>
952908500d5f99f35afc5ed510391b9bdc3833farbb The <directive>FileETag</directive> directive configures the file
952908500d5f99f35afc5ed510391b9bdc3833farbb attributes that are used to create the <code>ETag</code> (entity
952908500d5f99f35afc5ed510391b9bdc3833farbb tag) response header field when the document is based on a static file.
2d2eda71267231c2526be701fe655db125852c1ffielding (The <code>ETag</code> value is used in cache management to save
952908500d5f99f35afc5ed510391b9bdc3833farbb network bandwidth.) The
952908500d5f99f35afc5ed510391b9bdc3833farbb <directive>FileETag</directive> directive allows you to choose
952908500d5f99f35afc5ed510391b9bdc3833farbb which of these -- if any -- should be used. The recognized keywords are:
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <dd>The file's i-node number will be included in the calculation</dd>
58619148951981bcfa5c506ad8ce745aa8831980rbb <dd>The date and time the file was last modified will be included</dd>
58619148951981bcfa5c506ad8ce745aa8831980rbb <dd>The number of bytes in the file will be included</dd>
58619148951981bcfa5c506ad8ce745aa8831980rbb <dd>All available fields will be used. This is equivalent to:
58619148951981bcfa5c506ad8ce745aa8831980rbb <dd>If a document is file-based, no <code>ETag</code> field will be
58619148951981bcfa5c506ad8ce745aa8831980rbb included in the response</dd>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
58619148951981bcfa5c506ad8ce745aa8831980rbb keywords may be prefixed with either <code>+</code> or <code>-</code>,
58619148951981bcfa5c506ad8ce745aa8831980rbb which allow changes to be made to the default setting inherited
58619148951981bcfa5c506ad8ce745aa8831980rbb from a broader scope. Any keyword appearing without such a prefix
58619148951981bcfa5c506ad8ce745aa8831980rbb immediately and completely cancels the inherited setting.</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>If a directory's configuration includes
58619148951981bcfa5c506ad8ce745aa8831980rbb <code>FileETag INode MTime Size</code>, and a
58619148951981bcfa5c506ad8ce745aa8831980rbb subdirectory's includes <code>FileETag -INode</code>,
2d2eda71267231c2526be701fe655db125852c1ffielding the setting for that subdirectory (which will be inherited by
58619148951981bcfa5c506ad8ce745aa8831980rbb any sub-subdirectories that don't override it) will be equivalent to
58619148951981bcfa5c506ad8ce745aa8831980rbb Do not change the default for directories or locations that have WebDAV
58619148951981bcfa5c506ad8ce745aa8831980rbb enabled and use <module>mod_dav_fs</module> as a storage provider.
58619148951981bcfa5c506ad8ce745aa8831980rbb <module>mod_dav_fs</module> uses <code>INode MTime Size</code>
58619148951981bcfa5c506ad8ce745aa8831980rbb as a fixed format for <code>ETag</code> comparisons on conditional requests.
58619148951981bcfa5c506ad8ce745aa8831980rbb These conditional requests will break if the <code>ETag</code> format is
58619148951981bcfa5c506ad8ce745aa8831980rbb An ETag is not generated for responses parsed by <module>mod_include</module>,
58619148951981bcfa5c506ad8ce745aa8831980rbb since the response entity can change without a change of the INode, MTime, or Size
58619148951981bcfa5c506ad8ce745aa8831980rbb of the static file with embedded SSI directives.
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
58619148951981bcfa5c506ad8ce745aa8831980rbb<description>Contains directives that apply to matched
58619148951981bcfa5c506ad8ce745aa8831980rbbfilenames</description>
58619148951981bcfa5c506ad8ce745aa8831980rbb<syntax><Files <var>filename</var>> ... </Files></syntax>
58619148951981bcfa5c506ad8ce745aa8831980rbb<contextlist><context>server config</context><context>virtual host</context>
ef7331e9f2c6fb4f671b13db21e0ac27a6dcf4f3dgaudet</contextlist>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>The <directive type="section">Files</directive> directive
58619148951981bcfa5c506ad8ce745aa8831980rbb limits the scope of the enclosed directives by filename. It is comparable
58619148951981bcfa5c506ad8ce745aa8831980rbb to the <directive module="core" type="section">Directory</directive>
58619148951981bcfa5c506ad8ce745aa8831980rbb and <directive module="core" type="section">Location</directive>
58619148951981bcfa5c506ad8ce745aa8831980rbb directives. It should be matched with a <code></Files></code>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm directive. The directives given within this section will be applied to
58619148951981bcfa5c506ad8ce745aa8831980rbb any object with a basename (last component of filename) matching the
58619148951981bcfa5c506ad8ce745aa8831980rbb specified filename. <directive type="section">Files</directive>
58619148951981bcfa5c506ad8ce745aa8831980rbb sections are processed in the order they appear in the
58619148951981bcfa5c506ad8ce745aa8831980rbb <code>.htaccess</code> files are read, but before <directive
58619148951981bcfa5c506ad8ce745aa8831980rbb type="section" module="core">Location</directive> sections. Note
58619148951981bcfa5c506ad8ce745aa8831980rbb that <directive type="section">Files</directive> can be nested
58619148951981bcfa5c506ad8ce745aa8831980rbb module="core">Directory</directive> sections to restrict the
58619148951981bcfa5c506ad8ce745aa8831980rbb portion of the filesystem they apply to.</p>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <p>The <var>filename</var> argument should include a filename, or
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm a wild-card string, where <code>?</code> matches any single character,
2d2eda71267231c2526be701fe655db125852c1ffielding and <code>*</code> matches any sequences of characters.
2d2eda71267231c2526be701fe655db125852c1ffielding can also be used, with the addition of the
58619148951981bcfa5c506ad8ce745aa8831980rbb <Files ~ "\.(gif|jpe?g|png)$">
58619148951981bcfa5c506ad8ce745aa8831980rbb </example>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>would match most common Internet graphics formats. <directive
58619148951981bcfa5c506ad8ce745aa8831980rbb module="core" type="section">FilesMatch</directive> is preferred,
58619148951981bcfa5c506ad8ce745aa8831980rbb however.</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb module="core">Directory</directive> and <directive type="section"
58619148951981bcfa5c506ad8ce745aa8831980rbb type="section">Files</directive> sections can be used inside
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <code>.htaccess</code> files. This allows users to control access to
ffba30a2a49b298bfa65151bdf61ce3e3d4636d1manoj their own files, at a file-by-file level.</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb<seealso><a href="/sections.html">How <Directory>, <Location>
58619148951981bcfa5c506ad8ce745aa8831980rbb and <Files> sections work</a> for an explanation of how these
58619148951981bcfa5c506ad8ce745aa8831980rbb different sections are combined when a request is received</seealso>
58619148951981bcfa5c506ad8ce745aa8831980rbb</directivesynopsis>
58619148951981bcfa5c506ad8ce745aa8831980rbb<description>Contains directives that apply to regular-expression matched
58619148951981bcfa5c506ad8ce745aa8831980rbbfilenames</description>
58619148951981bcfa5c506ad8ce745aa8831980rbb<syntax><FilesMatch <var>regex</var>> ... </FilesMatch></syntax>
58619148951981bcfa5c506ad8ce745aa8831980rbb<contextlist><context>server config</context><context>virtual host</context>
58619148951981bcfa5c506ad8ce745aa8831980rbb</contextlist>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>The <directive type="section">FilesMatch</directive> directive
58619148951981bcfa5c506ad8ce745aa8831980rbb limits the scope of the enclosed directives by filename, just as the
58619148951981bcfa5c506ad8ce745aa8831980rbb <directive module="core" type="section">Files</directive> directive
58619148951981bcfa5c506ad8ce745aa8831980rbb does. However, it accepts a <glossary ref="regex">regular
58619148951981bcfa5c506ad8ce745aa8831980rbb <FilesMatch "\.(gif|jpe?g|png)$">
58619148951981bcfa5c506ad8ce745aa8831980rbb </example>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>would match most common Internet graphics formats.</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb<seealso><a href="/sections.html">How <Directory>, <Location>
58619148951981bcfa5c506ad8ce745aa8831980rbb and <Files> sections work</a> for an explanation of how these
2d2eda71267231c2526be701fe655db125852c1ffielding different sections are combined when a request is received</seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding</directivesynopsis>
58619148951981bcfa5c506ad8ce745aa8831980rbb<directivesynopsis>
58619148951981bcfa5c506ad8ce745aa8831980rbb<description>Forces all matching files to be served with the specified
58619148951981bcfa5c506ad8ce745aa8831980rbbmedia type in the HTTP Content-Type header field</description>
58619148951981bcfa5c506ad8ce745aa8831980rbb<contextlist><context>directory</context><context>.htaccess</context>
58619148951981bcfa5c506ad8ce745aa8831980rbb</contextlist>
58619148951981bcfa5c506ad8ce745aa8831980rbb<compatibility>Moved to the core in Apache httpd 2.0</compatibility>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <directive type="section" module="core">Directory</directive>, or
2d2eda71267231c2526be701fe655db125852c1ffielding <directive type="section" module="core">Location</directive> or
2d2eda71267231c2526be701fe655db125852c1ffielding <directive type="section" module="core">Files</directive>
58619148951981bcfa5c506ad8ce745aa8831980rbb section, this directive forces all matching files to be served
58619148951981bcfa5c506ad8ce745aa8831980rbb with the content type identification given by
58619148951981bcfa5c506ad8ce745aa8831980rbb <var>media-type</var>. For example, if you had a directory full of
58619148951981bcfa5c506ad8ce745aa8831980rbb GIF files, but did not want to label them all with <code>.gif</code>,
58619148951981bcfa5c506ad8ce745aa8831980rbb you might want to use:</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb </example>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>Note that this directive overrides other indirect media type
58619148951981bcfa5c506ad8ce745aa8831980rbb associations defined in mime.types or via the
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>You can also override more general
58619148951981bcfa5c506ad8ce745aa8831980rbb <Location /images><br />
58619148951981bcfa5c506ad8ce745aa8831980rbb </Location><br />
58619148951981bcfa5c506ad8ce745aa8831980rbb # but normal mime-type associations here:<br />
58619148951981bcfa5c506ad8ce745aa8831980rbb ForceType None<br />
58619148951981bcfa5c506ad8ce745aa8831980rbb </Location>
58619148951981bcfa5c506ad8ce745aa8831980rbb </example>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>This directive primarily overrides the content types generated for
58619148951981bcfa5c506ad8ce745aa8831980rbb static files served out of the filesystem. For resources other than
58619148951981bcfa5c506ad8ce745aa8831980rbb static files, where the generator of the response typically specifies
58619148951981bcfa5c506ad8ce745aa8831980rbb a Content-Type, this directive has no effect.</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb</directivesynopsis>
58619148951981bcfa5c506ad8ce745aa8831980rbb<directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Directory to write gmon.out profiling data to. </description>
58619148951981bcfa5c506ad8ce745aa8831980rbb<syntax>GprofDir <var>/tmp/gprof/</var>|<var>/tmp/gprof/</var>%</syntax>
58619148951981bcfa5c506ad8ce745aa8831980rbb<contextlist><context>server config</context><context>virtual host</context>
58619148951981bcfa5c506ad8ce745aa8831980rbb</contextlist>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>When the server has been compiled with gprof profiling suppport,
2d2eda71267231c2526be701fe655db125852c1ffielding <directive>GprofDir</directive> causes <code>gmon.out</code> files to
58619148951981bcfa5c506ad8ce745aa8831980rbb be written to the specified directory when the process exits. If the
58619148951981bcfa5c506ad8ce745aa8831980rbb argument ends with a percent symbol ('%'), subdirectories are created
58619148951981bcfa5c506ad8ce745aa8831980rbb for each process id.</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>This directive currently only works with the <module>prefork</module>
58619148951981bcfa5c506ad8ce745aa8831980rbb</directivesynopsis>
58619148951981bcfa5c506ad8ce745aa8831980rbb<directivesynopsis>
58619148951981bcfa5c506ad8ce745aa8831980rbb<description>Enables DNS lookups on client IP addresses</description>
58619148951981bcfa5c506ad8ce745aa8831980rbb<contextlist><context>server config</context><context>virtual host</context>
58619148951981bcfa5c506ad8ce745aa8831980rbb <p>This directive enables DNS lookups so that host names can be
2d2eda71267231c2526be701fe655db125852c1ffielding logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
58619148951981bcfa5c506ad8ce745aa8831980rbb The value <code>Double</code> refers to doing double-reverse
58619148951981bcfa5c506ad8ce745aa8831980rbb DNS lookup. That is, after a reverse lookup is performed, a forward
58619148951981bcfa5c506ad8ce745aa8831980rbb lookup is then performed on that result. At least one of the IP
58619148951981bcfa5c506ad8ce745aa8831980rbb addresses in the forward lookup must match the original
58619148951981bcfa5c506ad8ce745aa8831980rbb address. (In "tcpwrappers" terminology this is called
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Regardless of the setting, when <module>mod_authz_host</module> is
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm used for controlling access by hostname, a double reverse lookup
2d2eda71267231c2526be701fe655db125852c1ffielding will be performed. This is necessary for security. Note that the
2d2eda71267231c2526be701fe655db125852c1ffielding result of this double-reverse isn't generally available unless you
2d2eda71267231c2526be701fe655db125852c1ffielding set <code>HostnameLookups Double</code>. For example, if only
58619148951981bcfa5c506ad8ce745aa8831980rbb <code>HostnameLookups On</code> and a request is made to an object
58619148951981bcfa5c506ad8ce745aa8831980rbb that is protected by hostname restrictions, regardless of whether
58619148951981bcfa5c506ad8ce745aa8831980rbb the double-reverse fails or not, CGIs will still be passed the
c861a36fe9c9a78c4fcb97e29fc1099a5ea81173rbb <p>The default is <code>Off</code> in order to save the network
58619148951981bcfa5c506ad8ce745aa8831980rbb traffic for those sites that don't truly need the reverse
2d2eda71267231c2526be701fe655db125852c1ffielding lookups done. It is also better for the end users because they
58619148951981bcfa5c506ad8ce745aa8831980rbb don't have to suffer the extra latency that a lookup entails.
58619148951981bcfa5c506ad8ce745aa8831980rbb Heavily loaded sites should leave this directive
58619148951981bcfa5c506ad8ce745aa8831980rbb <code>Off</code>, since DNS lookups can take considerable
58619148951981bcfa5c506ad8ce745aa8831980rbb amounts of time. The utility <program>logresolve</program>, compiled by
58619148951981bcfa5c506ad8ce745aa8831980rbb default to the <code>bin</code> subdirectory of your installation
58619148951981bcfa5c506ad8ce745aa8831980rbb directory, can be used to look up host names from logged IP addresses
58619148951981bcfa5c506ad8ce745aa8831980rbb offline.</p>
58619148951981bcfa5c506ad8ce745aa8831980rbb</directivesynopsis>
2d2eda71267231c2526be701fe655db125852c1ffielding<description>Contains directives that apply only if a condition is
58619148951981bcfa5c506ad8ce745aa8831980rbbsatisfied by a request at runtime</description>
58619148951981bcfa5c506ad8ce745aa8831980rbb<syntax><If <var>expression</var>> ... </If></syntax>
58619148951981bcfa5c506ad8ce745aa8831980rbb<contextlist><context>server config</context><context>virtual host</context>
58619148951981bcfa5c506ad8ce745aa8831980rbb</contextlist>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>The <directive type="section">If</directive> directive
2d2eda71267231c2526be701fe655db125852c1ffielding evaluates an expression at runtime, and applies the enclosed
2d2eda71267231c2526be701fe655db125852c1ffielding directives if and only if the expression evaluates to true.
2d2eda71267231c2526be701fe655db125852c1ffielding For example:</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <If "$req{Host} = ''">
2d2eda71267231c2526be701fe655db125852c1ffielding <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>You may compare the value of any variable in the request headers
2d2eda71267231c2526be701fe655db125852c1ffielding ($req), response headers ($resp) or environment ($env) in your
2d2eda71267231c2526be701fe655db125852c1ffielding expression.</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <p>Apart from <code>=</code>, <code>If</code> can use the <code>IN</code>
2d2eda71267231c2526be701fe655db125852c1ffielding operator to compare if the expression is in a given range:</p>
2d2eda71267231c2526be701fe655db125852c1ffielding <If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><a href="/expr.html">Expressions in Apache HTTP Server</a>,
2d2eda71267231c2526be701fe655db125852c1ffieldingfor a complete reference and more examples.</seealso>
2d2eda71267231c2526be701fe655db125852c1ffielding<seealso><a href="/sections.html">How <Directory>, <Location>,
2d2eda71267231c2526be701fe655db125852c1ffielding <Files> sections work</a> for an explanation of how these
2d2eda71267231c2526be701fe655db125852c1ffielding different sections are combined when a request is received.
2d2eda71267231c2526be701fe655db125852c1ffielding <directive type="section">If</directive> has the same precedence
2d2eda71267231c2526be701fe655db125852c1ffielding and usage as <directive type="section">Files</directive></seealso>
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben</directivesynopsis>
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben<description>Encloses directives that will be processed only
0e6e93183d91142d7cf9ffbf502114ff77bd9e19benif a test is true at startup</description>
5f7c351eb2a69d8cef6c3e98e27ce6158a0b1780rbb<syntax><IfDefine [!]<var>parameter-name</var>> ...
66d349e02d1a5a599a01c977d2c5b0009181f7deben </IfDefine></syntax>
5f7c351eb2a69d8cef6c3e98e27ce6158a0b1780rbb<contextlist><context>server config</context><context>virtual host</context>
dca927eafb338b9de9d0214818136c16d436e3fdrbb</contextlist>
66d349e02d1a5a599a01c977d2c5b0009181f7deben <p>The <code><IfDefine <var>test</var>>...</IfDefine>
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben </code> section is used to mark directives that are conditional. The
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben directives within an <directive type="section">IfDefine</directive>
dca927eafb338b9de9d0214818136c16d436e3fdrbb section are only processed if the <var>test</var> is true. If <var>
dca927eafb338b9de9d0214818136c16d436e3fdrbb test</var> is false, everything between the start and end markers is
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben ignored.</p>
66d349e02d1a5a599a01c977d2c5b0009181f7deben >IfDefine</directive> section directive can be one of two forms:</p>
0a09a4a642f7c0d367598394411dbdd4a6d8cd09fielding <p>In the former case, the directives between the start and end
2d2eda71267231c2526be701fe655db125852c1ffielding markers are only processed if the parameter named
2d2eda71267231c2526be701fe655db125852c1ffielding <var>parameter-name</var> is defined. The second format reverses
2d2eda71267231c2526be701fe655db125852c1ffielding the test, and only processes the directives if
2d2eda71267231c2526be701fe655db125852c1ffielding <var>parameter-name</var> is <strong>not</strong> defined.</p>
<syntax>Include [<var>optional</var>|<var>strict</var>] <var>file-path</var>|<var>directory-path</var>|<var>wildcard</var></syntax>
<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>
<p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
<p>You can also specify the protocol using the <directive module="mpm_common">Listen</directive> directive.</p>
<syntax>ServerName [<var>scheme</var>://]<var>fully-qualified-domain-name</var>[:<var>port</var>]</syntax>
ServerName www.example.com:80
settings which determine whether self-referential URLs (e.g., by the
httpd: Could not reliably determine the server's fully qualified domain name, using rocinante.local for ServerName
href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the