1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>core - Servidor HTTP Apache</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
17 <div id="page-header">
18 <p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Directivas</a> | <a href="http://wiki.apache.org/httpd/FAQ">Preguntas Frecuentes</a> | <a href="../glossary.html">Glosario</a> | <a href="../sitemap.html">Mapa de este sitio web</a></p>
19 <p class="apache">Versión 2.5 del Servidor HTTP Apache</p>
20 <img alt="" src="../images/feather.gif" /></div>
21 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
23 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Servidor HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentación</a> > <a href="../">Versión 2.5</a> > <a href="./">Módulos</a></div>
24 <div id="page-content">
25 <div id="preamble"><h1>Funcionalidad Básica de Apache</h1>
27 <p><span>Idiomas disponibles: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
28 <a href="../en/mod/core.html" hreflang="en" rel="alternate" title="English"> en </a> |
29 <a href="../es/mod/core.html" title="Español"> es </a> |
30 <a href="../fr/mod/core.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
31 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
32 <a href="../tr/mod/core.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
34 <div class="outofdate">Esta traducción podría estar
35 obsoleta. Consulte la versión en inglés de la
36 documentación para comprobar si se han producido cambios
38 <table class="module"><tr><th><a href="module-dict.html#Description">Descripción:</a></th><td>Funcionalides básicas del Servidor HTTP Apache que siempre están presentes.</td></tr>
39 <tr><th><a href="module-dict.html#Status">Estado:</a></th><td>Core</td></tr></table>
41 <div id="quickview"><h3 class="directives">Directivas</h3>
43 <li><img alt="" src="../images/down.gif" /> <a href="#acceptfilter">AcceptFilter</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#allowencodedslashes">AllowEncodedSlashes</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverridelist">AllowOverrideList</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#defaultruntimedir">DefaultRuntimeDir</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#define">Define</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#directory"><Directory></a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch"><DirectoryMatch></a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#else"><Else></a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#elseif"><ElseIf></a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#error">Error</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#errorlogformat">ErrorLogFormat</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#extendedstatus">ExtendedStatus</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#files"><Files></a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch"><FilesMatch></a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#gprofdir">GprofDir</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#if"><If></a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine"><IfDefine></a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule"><IfModule></a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#includeoptional">IncludeOptional</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#limit"><Limit></a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept"><LimitExcept></a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#location"><Location></a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch"><LocationMatch></a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#maxrangeoverlaps">MaxRangeOverlaps</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#maxrangereversals">MaxRangeReversals</a></li>
94 <li><img alt="" src="../images/down.gif" /> <a href="#maxranges">MaxRanges</a></li>
95 <li><img alt="" src="../images/down.gif" /> <a href="#mutex">Mutex</a></li>
96 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
97 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
98 <li><img alt="" src="../images/down.gif" /> <a href="#protocol">Protocol</a></li>
99 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
100 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
101 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
102 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
103 <li><img alt="" src="../images/down.gif" /> <a href="#seerequesttail">SeeRequestTail</a></li>
104 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
105 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
106 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
107 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
108 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
109 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
110 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
111 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
112 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
113 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
114 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
115 <li><img alt="" src="../images/down.gif" /> <a href="#traceenable">TraceEnable</a></li>
116 <li><img alt="" src="../images/down.gif" /> <a href="#undefine">UnDefine</a></li>
117 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
118 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></li>
119 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost"><VirtualHost></a></li>
121 <ul class="seealso"><li><a href="#comments_section">Comentarios</a></li></ul></div>
123 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
124 <div class="directive-section"><h2><a name="AcceptFilter" id="AcceptFilter">AcceptFilter</a> <a name="acceptfilter" id="acceptfilter">Directiva</a></h2>
125 <table class="directive">
126 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configura mejoras para un Protocolo de Escucha de Sockets</td></tr>
127 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AcceptFilter <var>protocol</var> <var>accept_filter</var></code></td></tr>
128 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
129 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
130 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
131 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Disponible en Apache httpd 2.1.5 y posteriores.
132 En Windows desde Apache httpd 2.3.3 y posteriores.</td></tr>
134 <p>Esta directiva hace posible mejoras específicas a nivel de sistema operativo
135 y a través del tipo de Protocolo para un socket que escucha.
136 La premisa básica es que el kernel no envíe un socket al servidor
137 hasta que o bien los datos se hayan recibido o bien se haya almacenado
138 en el buffer una Respuesta HTTP completa.
139 Actualmente sólo están soportados
140 <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&sektion=9">
141 Accept Filters</a> sobre FreeBSD, <code>TCP_DEFER_ACCEPT</code> sobre Linux,
142 y AcceptEx() sobre Windows.</p>
144 <p>El uso de <code>none</code> para un argumento desactiva cualquier filtro
145 aceptado para ese protocolo. Esto es útil para protocolos que requieren que un
146 servidor envíe datos primeros, tales como <code>ftp:</code> o <code>nntp</code>:</p>
147 <div class="example"><p><code>AcceptFilter nntp none</code></p></div>
149 <p>Los nombres de protocolo por defecto son <code>https</code> para el puerto 443
150 y <code>http</code> para todos los demás puertos. Para especificar que se está
151 utilizando otro protocolo con un puerto escuchando, añade el argumento <var>protocol</var>
152 a la directiva <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
154 <p>Sobre FreeBDS los valores por defecto:</p>
155 <div class="example"><p><code>
156 AcceptFilter http httpready <br />
157 AcceptFilter https dataready
160 <p>El filtro <code>httpready</code> almacena en el buffer peticiones HTTP completas
161 a nivel de kernel. Una vez que la petición es recibida, el kernel la envía al servidor.
162 Consulta la página man de
163 <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&sektion=9">
164 accf_http(9)</a> para más detalles. Puesto que las peticiones HTTPS
165 están encriptadas, sólo se utiliza el filtro
166 <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&sektion=9">accf_data(9)</a>.</p>
168 <p>Sobre Linux los valores por defecto son:</p>
169 <div class="example"><p><code>
170 AcceptFilter http data <br />
171 AcceptFilter https data
174 <p>En Linux, <code>TCP_DEFER_ACCEPT</code> no soporta el buffering en peticiones http.
175 Cualquier valor además de <code>none</code> habilitará
176 <code>TCP_DEFER_ACCEPT</code> en ese socket. Para más detalles
177 ver la página man de Linux
178 <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
181 <p>Sobre Windows los valores por defecto son:</p>
182 <div class="example"><p><code>
183 AcceptFilter http data <br />
184 AcceptFilter https data
187 <p>Sobre Windows mpm_winnt interpreta el argumento AcceptFilter para conmutar la API
188 AcceptEx(), y no soporta el buffering sobre el protocolo http. Hay dos valores
189 que utilizan la API Windows AcceptEx() y que recuperan sockets de red
190 entre conexciones. <code>data</code> espera hasta que los datos han sido
191 transmitidos como se comentaba anteriormente, y el buffer inicial de datos y las
192 direcciones de red son recuperadas a partir de una única llamada AcceptEx().
193 <code>connect</code> utiliza la API AcceptEx() API, y recupera también
194 las direccciones de red, pero a diferencia de <code>none</code>
195 la opción <code>connect</code> no espera a la transmisión inicial de los datos.</p>
197 <p>Sobre Windows, <code>none</code> prefiere accept() antes que AcceptEx()
198 y no recuperará sockets entre las conexiones. Lo que es útil para los adaptadores de
199 red con un soporte precario de drivers, así como para algunos proveedores de red
200 tales como drivers vpn, o filtros de spam, de virus o de spyware.</p>
203 <h3>Consulte también</h3>
205 <li><code class="directive">Protocol</code></li>
208 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
209 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directiva</a></h2>
210 <table class="directive">
211 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Los recursos aceptan información sobre su ruta</td></tr>
212 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
213 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
214 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
215 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
216 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
217 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
218 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Disponible en Apache httpd 2.0.30 y posteriores</td></tr>
221 <p>Esta directiva controla si las peticiones que contienen información sobre la ruta
222 que sigue un fichero que existe (o un fichero que no existe pero en un directorio que
223 sí existe) serán aceptadas o denegadas. La información de ruta puede estar disponible
224 para los scripts en la variable de entorno <code>PATH_INFO</code>.</p>
226 <p>Por ejemplo, asumamos que la ubicación <code>/test/</code> apunta a
227 un directorio que contiene únicamente el fichero
228 <code>here.html</code>. Entonces, las peticiones tanto para
229 <code>/test/here.html/more</code> como para
230 <code>/test/nothere.html/more</code> recogen
231 <code>/more</code> como <code>PATH_INFO</code>.</p>
233 <p>Los tres posibles argumentos para la directiva
234 <code class="directive">AcceptPathInfo</code> son los siguientes:</p>
236 <dt><code>Off</code></dt><dd>Una petición sólo será aceptada si
237 se corresponde con una ruta literal que existe. Por lo tanto, una petición
238 con una información de ruta después del nombre de fichero tal como
239 <code>/test/here.html/more</code> en el ejemplo anterior devolverá
240 un error 404 NOT FOUND.</dd>
242 <dt><code>On</code></dt><dd>Una petición será aceptada si una
243 ruta principal de acceso se corresponde con un fichero que existe. El ejemplo
244 anterior <code>/test/here.html/more</code> será aceptado si
245 <code>/test/here.html</code> corresponde a un fichero válido.</dd>
247 <dt><code>Default</code></dt><dd>La gestión de las peticiones
248 con información de ruta está determinada por el <a href="../handler.html">controlador</a> responsable de la petición.
249 El controlador principal para para ficheros normales rechaza por defecto
250 peticiones <code>PATH_INFO</code>. Los controladores que sirven scripts, tales como <a href="mod_cgi.html">cgi-script</a> e <a href="mod_isapi.html">isapi-handler</a>, normalmente aceptan
251 <code>PATH_INFO</code> por defecto.</dd>
254 <p>El objetivo principal de la directiva <code>AcceptPathInfo</code>
255 es permitirte sobreescribir la opción del controlador
256 de aceptar or rechazar <code>PATH_INFO</code>. Este tipo de sobreescritura se necesita,
257 por ejemplo, cuando utilizas un <a href="../filter.html">filtro</a>, tal como
258 <a href="mod_include.html">INCLUDES</a>, para generar contenido
259 basado en <code>PATH_INFO</code>. El controlador principal normalmente rechazaría
260 la petición, de modo que puedes utilizar la siguiente configuración para habilitarla
263 <div class="example"><p><code>
264 <Files "mypaths.shtml"><br />
265 <span class="indent">
266 Options +Includes<br />
267 SetOutputFilter INCLUDES<br />
268 AcceptPathInfo On<br />
275 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
276 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directiva</a></h2>
277 <table class="directive">
278 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Nombre del fichero distribuido de configuración</td></tr>
279 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
280 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
281 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
282 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
283 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
285 <p>Mientras que procesa una petición el servidor busca
286 el primer fichero de configuración existente dentro de un listado de nombres en
287 cada directorio de la ruta del documento, si los ficheros distribuidos
288 de configuración están <a href="#allowoverride">habilitados para ese
289 directorio</a>. Por ejemplo:</p>
291 <div class="example"><p><code>
295 <p>antes de servir el documento
296 <code>/usr/local/web/index.html</code>, el servidor leerá
297 <code>/.acl</code>, <code>/usr/.acl</code>,
298 <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
299 para las directivas, salvo que estén deshabilitadas with</p>
301 <div class="example"><p><code>
302 <Directory /><br />
303 <span class="indent">
304 AllowOverride None<br />
309 <h3>Consulte también</h3>
311 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
312 <li><a href="../configuring.html">Configuration Files</a></li>
313 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
316 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
317 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directiva</a></h2>
318 <table class="directive">
319 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Default charset parameter to be added when a response
320 content-type is <code>text/plain</code> or <code>text/html</code></td></tr>
321 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
322 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
323 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
324 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
325 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
326 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
328 <p>This directive specifies a default value for the media type
329 charset parameter (the name of a character encoding) to be added
330 to a response if and only if the response's content-type is either
331 <code>text/plain</code> or <code>text/html</code>. This should override
332 any charset specified in the body of the response via a <code>META</code>
333 element, though the exact behavior is often dependent on the user's client
334 configuration. A setting of <code>AddDefaultCharset Off</code>
335 disables this functionality. <code>AddDefaultCharset On</code> enables
336 a default charset of <code>iso-8859-1</code>. Any other value is assumed
337 to be the <var>charset</var> to be used, which should be one of the
338 <a href="http://www.iana.org/assignments/character-sets">IANA registered
339 charset values</a> for use in Internet media types (MIME types).
342 <div class="example"><p><code>
343 AddDefaultCharset utf-8
346 <p><code class="directive">AddDefaultCharset</code> should only be used when all
347 of the text resources to which it applies are known to be in that
348 character encoding and it is too inconvenient to label their charset
349 individually. One such example is to add the charset parameter
350 to resources containing generated content, such as legacy CGI
351 scripts, that might be vulnerable to cross-site scripting attacks
352 due to user-provided data being included in the output. Note, however,
353 that a better solution is to just fix (or delete) those scripts, since
354 setting a default charset does not protect users that have enabled
355 the "auto-detect character encoding" feature on their browser.</p>
357 <h3>Consulte también</h3>
359 <li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li>
362 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
363 <div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directiva</a></h2>
364 <table class="directive">
365 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determines whether encoded path separators in URLs are allowed to
366 be passed through</td></tr>
367 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
368 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
369 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
370 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
371 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
372 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.0.46 and later</td></tr>
374 <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
375 which contain encoded path separators (<code>%2F</code> for <code>/</code>
376 and additionally <code>%5C</code> for <code>\</code> on according systems)
377 to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
379 <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
380 mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
382 <div class="note"><h3>Note</h3>
383 <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
384 Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
385 according systems) will be left as such in the otherwise decoded URL
389 <h3>Consulte también</h3>
391 <li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
394 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
395 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directiva</a></h2>
396 <table class="directive">
397 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Types of directives that are allowed in
398 <code>.htaccess</code> files</td></tr>
399 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
400 [<var>directive-type</var>] ...</code></td></tr>
401 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AllowOverride None (2.3.9 and later), AllowOverride All (2.3.8 and earlier)</code></td></tr>
402 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory</td></tr>
403 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
404 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
406 <p>When the server finds an <code>.htaccess</code> file (as
407 specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
408 it needs to know which directives declared in that file can override
409 earlier configuration directives.</p>
411 <div class="note"><h3>Only available in <Directory> sections</h3>
412 <code class="directive">AllowOverride</code> is valid only in
413 <code class="directive"><a href="#directory"><Directory></a></code>
414 sections specified without regular expressions, not in <code class="directive"><a href="#location"><Location></a></code>, <code class="directive"><a href="#directorymatch"><DirectoryMatch></a></code> or
415 <code class="directive"><a href="#files"><Files></a></code> sections.
418 <p>When this directive is set to <code>None</code>, then
419 <a href="#accessfilename">.htaccess</a> files are completely ignored.
420 In this case, the server will not even attempt to read
421 <code>.htaccess</code> files in the filesystem.</p>
423 <p>When this directive is set to <code>All</code>, then any
424 directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
425 <code>.htaccess</code> files.</p>
427 <p>The <var>directive-type</var> can be one of the following
428 groupings of directives.</p>
435 Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
436 <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
437 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
438 <code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code>,
439 <code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code>, <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>, <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code>, <em>etc.</em>).</dd>
444 Allow use of the directives controlling document types
445 (<code class="directive"><a href="#errordocument">ErrorDocument</a></code>,
446 <code class="directive"><a href="#forcetype">ForceType</a></code>,
447 <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>,
448 <code class="directive"><a href="#sethandler">SetHandler</a></code>,
449 <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>,
450 <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and
451 <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove* directives),
452 document meta data (<code class="directive"><a href="../mod/mod_headers.html#header">Header</a></code>, <code class="directive"><a href="../mod/mod_headers.html#requestheader">RequestHeader</a></code>, <code class="directive"><a href="../mod/mod_setenvif.html#setenvif">SetEnvIf</a></code>, <code class="directive"><a href="../mod/mod_setenvif.html#setenvifnocase">SetEnvIfNoCase</a></code>, <code class="directive"><a href="../mod/mod_setenvif.html#browsermatch">BrowserMatch</a></code>, <code class="directive"><a href="../mod/mod_usertrack.html#cookieexpires">CookieExpires</a></code>, <code class="directive"><a href="../mod/mod_usertrack.html#cookiedomain">CookieDomain</a></code>, <code class="directive"><a href="../mod/mod_usertrack.html#cookiestyle">CookieStyle</a></code>, <code class="directive"><a href="../mod/mod_usertrack.html#cookietracking">CookieTracking</a></code>, <code class="directive"><a href="../mod/mod_usertrack.html#cookiename">CookieName</a></code>),
453 <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> directives <code class="directive"><a href="../mod/mod_rewrite.html#rewriteengine">RewriteEngine</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewriteoptions">RewriteOptions</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewritebase">RewriteBase</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewritecond">RewriteCond</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>) and
454 <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> from
455 <code class="module"><a href="../mod/mod_actions.html">mod_actions</a></code>.
461 Allow use of the directives controlling directory indexing
462 (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
463 <code class="directive"><a href="../mod/mod_autoindex.html#addicon">AddIcon</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#addiconbyencoding">AddIconByEncoding</a></code>,
464 <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
465 <code class="directive"><a href="../mod/mod_autoindex.html#defaulticon">DefaultIcon</a></code>, <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#fancyindexing">FancyIndexing</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#headername">HeaderName</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexignore">IndexIgnore</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexoptions">IndexOptions</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#readmename">ReadmeName</a></code>,
471 Allow use of the directives controlling host access (<code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code>, <code class="directive"><a href="../mod/mod_authz_host.html#deny">Deny</a></code> and <code class="directive"><a href="../mod/mod_authz_host.html#order">Order</a></code>).</dd>
473 <dt>Options[=<var>Option</var>,...]</dt>
476 Allow use of the directives controlling specific directory
477 features (<code class="directive"><a href="#options">Options</a></code> and
478 <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).
479 An equal sign may be given followed by a comma (but no spaces)
480 separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
485 <div class="example"><p><code>
486 AllowOverride AuthConfig Indexes
489 <p>In the example above all directives that are neither in the group
490 <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
493 <div class="note"><p>For security and performance reasons, do not set
494 <code>AllowOverride</code> to anything other than <code>None</code>
495 in your <code><Directory /></code> block. Instead, find (or
496 create) the <code><Directory></code> block that refers to the
497 directory where you're actually planning to place a
498 <code>.htaccess</code> file.</p>
501 <h3>Consulte también</h3>
503 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
504 <li><a href="../configuring.html">Configuration Files</a></li>
505 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
508 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
509 <div class="directive-section"><h2><a name="AllowOverrideList" id="AllowOverrideList">AllowOverrideList</a> <a name="allowoverridelist" id="allowoverridelist">Directiva</a></h2>
510 <table class="directive">
511 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Individual directives that are allowed in
512 <code>.htaccess</code> files</td></tr>
513 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AllowOverrideList None|<var>directive</var>
514 [<var>directive-type</var>] ...</code></td></tr>
515 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AllowOverrideList None</code></td></tr>
516 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory</td></tr>
517 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
518 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
519 </table><p>The documentation for this directive has
520 not been translated yet. Please have a look at the English
521 version.</p><h3>Consulte también</h3>
523 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
524 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
525 <li><a href="../configuring.html">Configuration Files</a></li>
526 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
529 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
530 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directiva</a></h2>
531 <table class="directive">
532 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Technique for locating the interpreter for CGI
534 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
535 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
536 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
537 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
538 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
539 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>NetWare only</td></tr>
541 <p>This directive is used to control how Apache httpd finds the
542 interpreter used to run CGI scripts. For example, setting
543 <code>CGIMapExtension sys:\foo.nlm .foo</code> will
544 cause all CGI script files with a <code>.foo</code> extension to
545 be passed to the FOO interpreter.</p>
548 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
549 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directiva</a></h2>
550 <table class="directive">
551 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enables the generation of <code>Content-MD5</code> HTTP Response
553 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ContentDigest On|Off</code></td></tr>
554 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ContentDigest Off</code></td></tr>
555 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
556 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>Options</td></tr>
557 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
558 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
560 <p>This directive enables the generation of
561 <code>Content-MD5</code> headers as defined in RFC1864
562 respectively RFC2616.</p>
564 <p>MD5 is an algorithm for computing a "message digest"
565 (sometimes called "fingerprint") of arbitrary-length data, with
566 a high degree of confidence that any alterations in the data
567 will be reflected in alterations in the message digest.</p>
569 <p>The <code>Content-MD5</code> header provides an end-to-end
570 message integrity check (MIC) of the entity-body. A proxy or
571 client may check this header for detecting accidental
572 modification of the entity-body in transit. Example header:</p>
574 <div class="example"><p><code>
575 Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
578 <p>Note that this can cause performance problems on your server
579 since the message digest is computed on every request (the
580 values are not cached).</p>
582 <p><code>Content-MD5</code> is only sent for documents served
583 by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
584 SSI documents, output from CGI scripts, and byte range responses
585 do not have this header.</p>
588 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
589 <div class="directive-section"><h2><a name="DefaultRuntimeDir" id="DefaultRuntimeDir">DefaultRuntimeDir</a> <a name="defaultruntimedir" id="defaultruntimedir">Directiva</a></h2>
590 <table class="directive">
591 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Base directory for the server run-time files</td></tr>
592 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>DefaultRuntimeDir <var>directory-path</var></code></td></tr>
593 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>DefaultRuntimeDir DEFAULT_REL_RUNTIMEDIR (logs/)</code></td></tr>
594 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
595 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
596 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
597 </table><p>The documentation for this directive has
598 not been translated yet. Please have a look at the English
599 version.</p><h3>Consulte también</h3>
601 <li><a href="../misc/security_tips.html#serverroot">the
602 security tips</a> for information on how to properly set
603 permissions on the <code class="directive">ServerRoot</code></li>
606 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
607 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directiva</a></h2>
608 <table class="directive">
609 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>This directive has no effect other than to emit warnings
610 if the value is not <code>none</code>. In prior versions, DefaultType
611 would specify a default media type to assign to response content for
612 which no other media type configuration could be found.
614 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>DefaultType <var>media-type|none</var></code></td></tr>
615 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>DefaultType none</code></td></tr>
616 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
617 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
618 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
619 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
620 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>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.</td></tr>
622 <p>This directive has been disabled. For backwards compatibility
623 of configuration files, it may be specified with the value
624 <code>none</code>, meaning no default media type. For example:</p>
626 <div class="example"><p><code>
630 <p><code>DefaultType None</code> is only available in
631 httpd-2.2.7 and later.</p>
633 <p>Use the mime.types configuration file and the
634 <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> to configure media
635 type assignments via file extensions, or the
636 <code class="directive"><a href="#forcetype">ForceType</a></code> directive to configure
637 the media type for specific resources. Otherwise, the server will
638 send the response without a Content-Type header field and the
639 recipient may attempt to guess the media type.</p>
642 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
643 <div class="directive-section"><h2><a name="Define" id="Define">Define</a> <a name="define" id="define">Directiva</a></h2>
644 <table class="directive">
645 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Define the existence of a variable</td></tr>
646 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Define <var>parameter-name</var></code></td></tr>
647 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
648 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
649 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
651 <p>Equivalent to passing the <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p>
652 <p>This directive can be used to toggle the use of <code class="directive"><a href="#ifdefine"><IfDefine></a></code> sections without needing to alter
653 <code>-D</code> arguments in any startup scripts.</p>
656 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
657 <div class="directive-section"><h2><a name="Directory" id="Directory"><Directory></a> <a name="directory" id="directory">Directiva</a></h2>
658 <table class="directive">
659 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enclose a group of directives that apply only to the
660 named file-system directory, sub-directories, and their contents.</td></tr>
661 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Directory <var>directory-path</var>>
662 ... </Directory></code></td></tr>
663 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
664 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
665 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
667 <p><code class="directive"><Directory></code> and
668 <code></Directory></code> are used to enclose a group of
669 directives that will apply only to the named directory,
670 sub-directories of that directory, and the files within the respective
671 directories. Any directive that is allowed
672 in a directory context may be used. <var>Directory-path</var> is
673 either the full path to a directory, or a wild-card string using
674 Unix shell-style matching. In a wild-card string, <code>?</code> matches
675 any single character, and <code>*</code> matches any sequences of
676 characters. You may also use <code>[]</code> character ranges. None
677 of the wildcards match a `/' character, so <code><Directory
678 /*/public_html></code> will not match
679 <code>/home/user/public_html</code>, but <code><Directory
680 /home/*/public_html></code> will match. Example:</p>
682 <div class="example"><p><code>
683 <Directory /usr/local/httpd/htdocs><br />
684 <span class="indent">
685 Options Indexes FollowSymLinks<br />
691 <p>Be careful with the <var>directory-path</var> arguments:
692 They have to literally match the filesystem path which Apache httpd uses
693 to access the files. Directives applied to a particular
694 <code><Directory></code> will not apply to files accessed from
695 that same directory via a different path, such as via different symbolic
699 <p><a class="glossarylink" href="../glossary.html#regex" title="ver glosario">Regular
700 expressions</a> can also be used, with the addition of the
701 <code>~</code> character. For example:</p>
703 <div class="example"><p><code>
704 <Directory ~ "^/www/.*/[0-9]{3}">
707 <p>would match directories in <code>/www/</code> that consisted of
710 <p>If multiple (non-regular expression) <code class="directive"><Directory></code> sections
711 match the directory (or one of its parents) containing a document,
712 then the directives are applied in the order of shortest match
713 first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
716 <div class="example"><p><code>
717 <Directory /><br />
718 <span class="indent">
719 AllowOverride None<br />
721 </Directory><br />
723 <Directory /home/><br />
724 <span class="indent">
725 AllowOverride FileInfo<br />
730 <p>for access to the document <code>/home/web/dir/doc.html</code>
734 <li>Apply directive <code>AllowOverride None</code>
735 (disabling <code>.htaccess</code> files).</li>
737 <li>Apply directive <code>AllowOverride FileInfo</code> (for
738 directory <code>/home</code>).</li>
740 <li>Apply any <code>FileInfo</code> directives in
741 <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
742 <code>/home/web/dir/.htaccess</code> in that order.</li>
745 <p>Regular expressions are not considered until after all of the
746 normal sections have been applied. Then all of the regular
747 expressions are tested in the order they appeared in the
748 configuration file. For example, with</p>
750 <div class="example"><p><code>
751 <Directory ~ abc$><br />
752 <span class="indent">
753 # ... directives here ...<br />
758 <p>the regular expression section won't be considered until after
759 all normal <code class="directive"><Directory></code>s and
760 <code>.htaccess</code> files have been applied. Then the regular
761 expression will match on <code>/home/abc/public_html/abc</code> and
762 the corresponding <code class="directive"><Directory></code> will
765 <p><strong>Note that the default access for
766 <code><Directory /></code> is <code>Allow from All</code>.
767 This means that Apache httpd will serve any file mapped from an URL. It is
768 recommended that you change this with a block such
771 <div class="example"><p><code>
772 <Directory /><br />
773 <span class="indent">
774 Order Deny,Allow<br />
780 <p><strong>and then override this for directories you
781 <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
782 details.</strong></p>
784 <p>The directory sections occur in the <code>httpd.conf</code> file.
785 <code class="directive"><Directory></code> directives
786 cannot nest, and cannot appear in a <code class="directive"><a href="#limit"><Limit></a></code> or <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section.</p>
788 <h3>Consulte también</h3>
790 <li><a href="../sections.html">How <Directory>,
791 <Location> and <Files> sections work</a> for an
792 explanation of how these different sections are combined when a
793 request is received</li>
796 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
797 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch"><DirectoryMatch></a> <a name="directorymatch" id="directorymatch">Directiva</a></h2>
798 <table class="directive">
799 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enclose directives that apply to
800 the contents of file-system directories matching a regular expression.</td></tr>
801 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><DirectoryMatch <var>regex</var>>
802 ... </DirectoryMatch></code></td></tr>
803 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
804 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
805 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
807 <p><code class="directive"><DirectoryMatch></code> and
808 <code></DirectoryMatch></code> are used to enclose a group
809 of directives which will apply only to the named directory (and the files within),
810 the same as <code class="directive"><a href="#directory"><Directory></a></code>.
811 However, it takes as an argument a
812 <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">regular expression</a>. For example:</p>
814 <div class="example"><p><code>
815 <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
818 <p>would match directories in <code>/www/</code> that consisted of three
821 <div class="note"><h3>Compatability</h3>
822 Prior to 2.3.9, this directive implicitly applied to sub-directories
823 (like <code class="directive"><a href="#directory"><Directory></a></code>) and
824 could not match the end of line symbol ($). In 2.3.9 and later,
825 only directories that match the expression are affected by the enclosed
829 <div class="note"><h3>Trailing Slash</h3>
830 This directive applies to requests for directories that may or may
831 not end in a trailing slash, so expressions that are anchored to the
832 end of line ($) must be written with care.
835 <h3>Consulte también</h3>
837 <li><code class="directive"><a href="#directory"><Directory></a></code> for
838 a description of how regular expressions are mixed in with normal
839 <code class="directive"><Directory></code>s</li>
840 <li><a href="../sections.html">How <Directory>, <Location> and
841 <Files> sections work</a> for an explanation of how these different
842 sections are combined when a request is received</li>
845 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
846 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directiva</a></h2>
847 <table class="directive">
848 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Directory that forms the main document tree visible
849 from the web</td></tr>
850 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
851 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
852 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
853 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
854 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
856 <p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
857 will serve files. Unless matched by a directive like <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code>, the server appends the
858 path from the requested URL to the document root to make the
859 path to the document. Example:</p>
861 <div class="example"><p><code>
862 DocumentRoot /usr/web
866 <code>http://www.my.host.com/index.html</code> refers to
867 <code>/usr/web/index.html</code>. If the <var>directory-path</var> is
868 not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
870 <p>The <code class="directive">DocumentRoot</code> should be specified without
871 a trailing slash.</p>
873 <h3>Consulte también</h3>
875 <li><a href="../urlmapping.html#documentroot">Mapping URLs to Filesystem
879 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
880 <div class="directive-section"><h2><a name="Else" id="Else"><Else></a> <a name="else" id="else">Directiva</a></h2>
881 <table class="directive">
882 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only if the condition of a
883 previous <code class="directive"><a href="#if"><If></a></code> or
884 <code class="directive"><a href="#elseif"><ElseIf></a></code> section is not
885 satisfied by a request at runtime</td></tr>
886 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Else> ... </Else></code></td></tr>
887 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
888 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
889 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
890 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
891 </table><p>The documentation for this directive has
892 not been translated yet. Please have a look at the English
893 version.</p><h3>Consulte también</h3>
895 <li><code class="directive"><a href="#if"><If></a></code></li>
896 <li><code class="directive"><a href="#elseif"><ElseIf></a></code></li>
897 <li><a href="../sections.html">How <Directory>, <Location>,
898 <Files> sections work</a> for an explanation of how these
899 different sections are combined when a request is received.
900 <code class="directive"><If></code>,
901 <code class="directive"><ElseIf></code>, and
902 <code class="directive"><Else></code> are applied last.</li>
905 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
906 <div class="directive-section"><h2><a name="ElseIf" id="ElseIf"><ElseIf></a> <a name="elseif" id="elseif">Directiva</a></h2>
907 <table class="directive">
908 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only if a condition is satisfied
909 by a request at runtime while the condition of a previous
910 <code class="directive"><a href="#if"><If></a></code> or
911 <code class="directive"><ElseIf></code> section is not
913 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><ElseIf <var>expression</var>> ... </ElseIf></code></td></tr>
914 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
915 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
916 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
917 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
918 </table><p>The documentation for this directive has
919 not been translated yet. Please have a look at the English
920 version.</p><h3>Consulte también</h3>
922 <li><a href="../expr.html">Expressions in Apache HTTP Server</a>,
923 for a complete reference and more examples.</li>
924 <li><code class="directive"><a href="#if"><If></a></code></li>
925 <li><code class="directive"><a href="#else"><Else></a></code></li>
926 <li><a href="../sections.html">How <Directory>, <Location>,
927 <Files> sections work</a> for an explanation of how these
928 different sections are combined when a request is received.
929 <code class="directive"><If></code>,
930 <code class="directive"><ElseIf></code>, and
931 <code class="directive"><Else></code> are applied last.</li>
934 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
935 <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directiva</a></h2>
936 <table class="directive">
937 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
938 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
939 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>EnableMMAP On</code></td></tr>
940 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
941 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
942 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
943 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
945 <p>This directive controls whether the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use
946 memory-mapping if it needs to read the contents of a file during
947 delivery. By default, when the handling of a request requires
948 access to the data within a file -- for example, when delivering a
949 server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache httpd
950 memory-maps the file if the OS supports it.</p>
952 <p>This memory-mapping sometimes yields a performance improvement.
953 But in some environments, it is better to disable the memory-mapping
954 to prevent operational problems:</p>
957 <li>On some multiprocessor systems, memory-mapping can reduce the
958 performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
959 <li>Deleting or truncating a file while <code class="program"><a href="../programs/httpd.html">httpd</a></code>
960 has it memory-mapped can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
961 crash with a segmentation fault.
965 <p>For server configurations that are vulnerable to these problems,
966 you should disable memory-mapping of delivered files by specifying:</p>
968 <div class="example"><p><code>
972 <p>For NFS mounted files, this feature may be disabled explicitly for
973 the offending files by specifying:</p>
975 <div class="example"><p><code>
976 <Directory "/path-to-nfs-files">
977 <span class="indent">
984 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
985 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directiva</a></h2>
986 <table class="directive">
987 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Use the kernel sendfile support to deliver files to the client</td></tr>
988 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
989 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>EnableSendfile Off</code></td></tr>
990 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
991 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
992 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
993 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
994 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in version 2.0.44 and later. Default changed to Off in
995 version 2.3.9.</td></tr>
997 <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
998 sendfile support from the kernel to transmit file contents to the client.
999 By default, when the handling of a request requires no access
1000 to the data within a file -- for example, when delivering a
1001 static file -- Apache httpd uses sendfile to deliver the file contents
1002 without ever reading the file if the OS supports it.</p>
1004 <p>This sendfile mechanism avoids separate read and send operations,
1005 and buffer allocations. But on some platforms or within some
1006 filesystems, it is better to disable this feature to avoid
1007 operational problems:</p>
1010 <li>Some platforms may have broken sendfile support that the build
1011 system did not detect, especially if the binaries were built on
1012 another box and moved to such a machine with broken sendfile
1014 <li>On Linux the use of sendfile triggers TCP-checksum
1015 offloading bugs on certain networking cards when using IPv6.</li>
1016 <li>On Linux on Itanium, sendfile may be unable to handle files
1017 over 2GB in size.</li>
1018 <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS, SMB, CIFS, FUSE),
1019 the kernel may be unable to serve the network file through
1023 <p>For server configurations that are not vulnerable to these problems,
1024 you may enable this feature by specifying:</p>
1026 <div class="example"><p><code>
1030 <p>For network mounted files, this feature may be disabled explicitly
1031 for the offending files by specifying:</p>
1033 <div class="example"><p><code>
1034 <Directory "/path-to-nfs-files">
1035 <span class="indent">
1040 <p>Please note that the per-directory and .htaccess configuration
1041 of <code class="directive">EnableSendfile</code> is not supported by
1042 <code class="module"><a href="../mod/mod_cache_disk.html">mod_cache_disk</a></code>.
1043 Only global definition of <code class="directive">EnableSendfile</code>
1044 is taken into account by the module.
1048 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1049 <div class="directive-section"><h2><a name="Error" id="Error">Error</a> <a name="error" id="error">Directiva</a></h2>
1050 <table class="directive">
1051 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Abort configuration parsing with a custom error message</td></tr>
1052 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Error <var>message</var></code></td></tr>
1053 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1054 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1055 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1056 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>2.3.9 and later</td></tr>
1058 <p>If an error can be detected within the configuration, this
1059 directive can be used to generate a custom error message, and halt
1060 configuration parsing. The typical use is for reporting required
1061 modules which are missing from the configuration.</p>
1063 <div class="example"><h3>Example</h3><p><code>
1064 # ensure that mod_include is loaded<br />
1065 <IfModule !include_module><br />
1066 Error mod_include is required by mod_foo. Load it with LoadModule.<br />
1067 </IfModule><br />
1069 # ensure that exactly one of SSL,NOSSL is defined<br />
1070 <IfDefine SSL><br />
1071 <IfDefine NOSSL><br />
1072 Error Both SSL and NOSSL are defined. Define only one of them.<br />
1073 </IfDefine><br />
1074 </IfDefine><br />
1075 <IfDefine !SSL><br />
1076 <IfDefine !NOSSL><br />
1077 Error Either SSL or NOSSL must be defined.<br />
1078 </IfDefine><br />
1079 </IfDefine><br />
1084 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1085 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directiva</a></h2>
1086 <table class="directive">
1087 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>What the server will return to the client
1088 in case of an error</td></tr>
1089 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
1090 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1091 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
1092 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1093 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1095 <p>In the event of a problem or error, Apache httpd can be configured
1096 to do one of four things,</p>
1099 <li>output a simple hardcoded error message</li>
1101 <li>output a customized message</li>
1103 <li>redirect to a local <var>URL-path</var> to handle the
1106 <li>redirect to an external <var>URL</var> to handle the
1110 <p>The first option is the default, while options 2-4 are
1111 configured using the <code class="directive">ErrorDocument</code>
1112 directive, which is followed by the HTTP response code and a URL
1113 or a message. Apache httpd will sometimes offer additional information
1114 regarding the problem/error.</p>
1116 <p>URLs can begin with a slash (/) for local web-paths (relative
1117 to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
1118 full URL which the client can resolve. Alternatively, a message
1119 can be provided to be displayed by the browser. Examples:</p>
1121 <div class="example"><p><code>
1122 ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
1123 ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
1124 ErrorDocument 401 /subscription_info.html<br />
1125 ErrorDocument 403 "Sorry can't allow you access today"
1128 <p>Additionally, the special value <code>default</code> can be used
1129 to specify Apache httpd's simple hardcoded message. While not required
1130 under normal circumstances, <code>default</code> will restore
1131 Apache httpd's simple hardcoded message for configurations that would
1132 otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
1134 <div class="example"><p><code>
1135 ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
1136 <Directory /web/docs><br />
1137 <span class="indent">
1138 ErrorDocument 404 default<br />
1143 <p>Note that when you specify an <code class="directive">ErrorDocument</code>
1144 that points to a remote URL (ie. anything with a method such as
1145 <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
1146 client to tell it where to find the document, even if the
1147 document ends up being on the same server. This has several
1148 implications, the most important being that the client will not
1149 receive the original error status code, but instead will
1150 receive a redirect status code. This in turn can confuse web
1151 robots and other clients which try to determine if a URL is
1152 valid using the status code. In addition, if you use a remote
1153 URL in an <code>ErrorDocument 401</code>, the client will not
1154 know to prompt the user for a password since it will not
1155 receive the 401 status code. Therefore, <strong>if you use an
1156 <code>ErrorDocument 401</code> directive then it must refer to a local
1157 document.</strong></p>
1159 <p>Microsoft Internet Explorer (MSIE) will by default ignore
1160 server-generated error messages when they are "too small" and substitute
1161 its own "friendly" error messages. The size threshold varies depending on
1162 the type of error, but in general, if you make your error document
1163 greater than 512 bytes, then MSIE will show the server-generated
1164 error rather than masking it. More information is available in
1165 Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
1167 <p>Although most error messages can be overriden, there are certain
1168 circumstances where the internal messages are used regardless of the
1169 setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>. In
1170 particular, if a malformed request is detected, normal request processing
1171 will be immediately halted and the internal error message returned.
1172 This is necessary to guard against security problems caused by
1175 <p>If you are using mod_proxy, you may wish to enable
1176 <code class="directive"><a href="../mod/mod_proxy.html#proxyerroroverride">ProxyErrorOverride</a></code> so that you can provide
1177 custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
1178 Apache httpd will not generate custom error documents for proxied content.</p>
1180 <h3>Consulte también</h3>
1182 <li><a href="../custom-error.html">documentation of
1183 customizable responses</a></li>
1186 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1187 <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directiva</a></h2>
1188 <table class="directive">
1189 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Location where the server will log errors</td></tr>
1190 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</code></td></tr>
1191 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</code></td></tr>
1192 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1193 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1194 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1196 <p>The <code class="directive">ErrorLog</code> directive sets the name of
1197 the file to which the server will log any errors it encounters. If
1198 the <var>file-path</var> is not absolute then it is assumed to be
1199 relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
1201 <div class="example"><h3>Example</h3><p><code>
1202 ErrorLog /var/log/httpd/error_log
1205 <p>If the <var>file-path</var>
1206 begins with a pipe character "<code>|</code>" then it is assumed to be a
1207 command to spawn to handle the error log.</p>
1209 <div class="example"><h3>Example</h3><p><code>
1210 ErrorLog "|/usr/local/bin/httpd_errors"
1213 <p>See the notes on <a href="../logs.html#piped">piped logs</a> for
1214 more information.</p>
1216 <p>Using <code>syslog</code> instead of a filename enables logging
1217 via syslogd(8) if the system supports it. The default is to use
1218 syslog facility <code>local7</code>, but you can override this by
1219 using the <code>syslog:<var>facility</var></code> syntax where
1220 <var>facility</var> can be one of the names usually documented in
1221 syslog(1). The facility is effectively global, and if it is changed
1222 in individual virtual hosts, the final facility specified affects the
1225 <div class="example"><h3>Example</h3><p><code>
1226 ErrorLog syslog:user
1229 <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
1230 document for details on why your security could be compromised
1231 if the directory where log files are stored is writable by
1232 anyone other than the user that starts the server.</p>
1233 <div class="warning"><h3>Note</h3>
1234 <p>When entering a file path on non-Unix platforms, care should be taken
1235 to make sure that only forward slashed are used even though the platform
1236 may allow the use of back slashes. In general it is a good idea to always
1237 use forward slashes throughout the configuration files.</p>
1240 <h3>Consulte también</h3>
1242 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1243 <li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
1246 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1247 <div class="directive-section"><h2><a name="ErrorLogFormat" id="ErrorLogFormat">ErrorLogFormat</a> <a name="errorlogformat" id="errorlogformat">Directiva</a></h2>
1248 <table class="directive">
1249 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Format specification for error log entries</td></tr>
1250 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code> ErrorLog [connection|request] <var>format</var></code></td></tr>
1251 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1252 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1253 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1254 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.3.9 and later</td></tr>
1256 <p><code class="directive">ErrorLogFormat</code> allows to specify what
1257 supplementary information is logged in the error log in addition to the
1258 actual log message.</p>
1260 <div class="example"><h3>Simple example</h3><p><code>
1261 ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
1264 <p>Specifying <code>connection</code> or <code>request</code> as first
1265 paramter allows to specify additional formats, causing additional
1266 information to be logged when the first message is logged for a specific
1267 connection or request, respectivly. This additional information is only
1268 logged once per connection/request. If a connection or request is processed
1269 without causing any log message, the additional information is not logged
1272 <p>It can happen that some format string items do not produce output. For
1273 example, the Referer header is only present if the log message is
1274 associated to a request and the log message happens at a time when the
1275 Referer header has already been read from the client. If no output is
1276 produced, the default behaviour is to delete everything from the preceeding
1277 space character to the next space character. This means the log line is
1278 implicitly divided into fields on non-whitespace to whitespace transitions.
1279 If a format string item does not produce output, the whole field is
1280 ommitted. For example, if the remote address <code>%a</code> in the log
1281 format <code>[%t] [%l] [%a] %M </code> is not available, the surrounding
1282 brackets are not logged either. Space characters can be escaped with a
1283 backslash to prevent them from delimiting a field. The combination '% '
1284 (percent space) is a zero-witdh field delimiter that does not produce any
1287 <p>The above behaviour can be changed by adding modifiers to the format
1288 string item. A <code>-</code> (minus) modifier causes a minus to be logged if the
1289 respective item does not produce any output. In once-per-connection/request
1290 formats, it is also possible to use the <code>+</code> (plus) modifier. If an
1291 item with the plus modifier does not produce any output, the whole line is
1294 <p>A number as modifier can be used to assign a log severity level to a
1295 format item. The item will only be logged if the severity of the log
1296 message is not higher than the specified log severity level. The number can
1297 range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8).</p>
1299 <p>Some format string items accept additional parameters in braces.</p>
1301 <table class="bordered"><tr class="header"><th>Format String</th> <th>Description</th></tr>
1302 <tr><td><code>%%</code></td>
1303 <td>The percent sign</td></tr>
1304 <tr class="odd"><td><code>%...a</code></td>
1305 <td>Remote IP-address and port</td></tr>
1306 <tr><td><code>%...A</code></td>
1307 <td>Local IP-address and port</td></tr>
1308 <tr class="odd"><td><code>%...{name}e</code></td>
1309 <td>Request environment variable <code>name</code></td></tr>
1310 <tr><td><code>%...E</code></td>
1311 <td>APR/OS error status code and string</td></tr>
1312 <tr class="odd"><td><code>%...F</code></td>
1313 <td>Source file name and line number of the log call</td></tr>
1314 <tr><td><code>%...{name}i</code></td>
1315 <td>Request header <code>name</code></td></tr>
1316 <tr class="odd"><td><code>%...k</code></td>
1317 <td>Number of keep-alive requests on this connection</td></tr>
1318 <tr><td><code>%...l</code></td>
1319 <td>Loglevel of the message</td></tr>
1320 <tr class="odd"><td><code>%...L</code></td>
1321 <td>Log ID of the request</td></tr>
1322 <tr><td><code>%...{c}L</code></td>
1323 <td>Log ID of the connection</td></tr>
1324 <tr class="odd"><td><code>%...{C}L</code></td>
1325 <td>Log ID of the connection if used in connection scope, empty otherwise</td></tr>
1326 <tr><td><code>%...m</code></td>
1327 <td>Name of the module logging the message</td></tr>
1328 <tr class="odd"><td><code>%M</code></td>
1329 <td>The actual log message</td></tr>
1330 <tr><td><code>%...{name}n</code></td>
1331 <td>Request note <code>name</code></td></tr>
1332 <tr class="odd"><td><code>%...P</code></td>
1333 <td>Process ID of current process</td></tr>
1334 <tr><td><code>%...T</code></td>
1335 <td>Thread ID of current thread</td></tr>
1336 <tr class="odd"><td><code>%...t</code></td>
1337 <td>The current time</td></tr>
1338 <tr><td><code>%...{u}t</code></td>
1339 <td>The current time including micro-seconds</td></tr>
1340 <tr class="odd"><td><code>%...{cu}t</code></td>
1341 <td>The current time in compact ISO 8601 format, including
1342 micro-seconds</td></tr>
1343 <tr><td><code>%...v</code></td>
1344 <td>The canonical <code class="directive"><a href="#servername">ServerName</a></code>
1345 of the current server.</td></tr>
1346 <tr class="odd"><td><code>%...V</code></td>
1347 <td>The server name of the server serving the request according to the
1348 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code>
1350 <tr><td><code>\ </code> (backslash space)</td>
1351 <td>Non-field delimiting space</td></tr>
1352 <tr class="odd"><td><code>% </code> (percent space)</td>
1353 <td>Field delimiter (no output)</td></tr>
1356 <p>The log ID format <code>%L</code> produces a unique id for a connection
1357 or request. This can be used to correlate which log lines belong to the
1358 same connection or request, which request happens on which connection.
1359 A <code>%L</code> format string is also available in
1360 <code class="module"><a href="../mod/mod_log_config.html">mod_log_config</a></code>, to allow to correlate access log entries
1361 with error log lines. If <code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code> is loaded, its
1362 unique id will be used as log ID for requests.</p>
1364 <div class="example"><h3>Example (somewhat similar to default format)</h3><p><code>
1365 ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P] %7F: %E: [client\ %a]
1366 %M% ,\ referer\ %{Referer}i"
1369 <div class="example"><h3>Example (similar to the 2.2.x format)</h3><p><code>
1370 ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
1371 %M% ,\ referer\ %{Referer}i"
1374 <div class="example"><h3>Advanced example with request/connection log IDs</h3><p><code>
1375 ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br />
1376 ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br />
1377 ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br />
1378 ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br />
1379 ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br />
1383 <h3>Consulte también</h3>
1385 <li><code class="directive"><a href="#errorlog">ErrorLog</a></code></li>
1386 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1387 <li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
1390 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1391 <div class="directive-section"><h2><a name="ExtendedStatus" id="ExtendedStatus">ExtendedStatus</a> <a name="extendedstatus" id="extendedstatus">Directiva</a></h2>
1392 <table class="directive">
1393 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Keep track of extended status information for each
1395 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ExtendedStatus On|Off</code></td></tr>
1396 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ExtendedStatus Off[*]</code></td></tr>
1397 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
1398 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1399 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1401 <p>This option tracks additional data per worker about the
1402 currently executing request, and a utilization summary; you
1403 can see these variables during runtime by configuring
1404 <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>. Note that other modules may
1405 rely on this scoreboard.</p>
1407 <p>This setting applies to the entire server, and cannot be
1408 enabled or disabled on a virtualhost-by-virtualhost basis.
1409 The collection of extended status information can slow down
1410 the server. Also note that this setting cannot be changed
1411 during a graceful restart.</p>
1414 <p>Note that loading <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> will change
1415 the default behavior to ExtendedStatus On, while other
1416 third party modules may do the same. Such modules rely on
1417 collecting detailed information about the state of all workers.
1418 The default is changed by <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> beginning
1419 with version 2.3.6; the previous default was always Off.</p>
1424 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1425 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directiva</a></h2>
1426 <table class="directive">
1427 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>File attributes used to create the ETag
1428 HTTP response header for static files</td></tr>
1429 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
1430 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
1431 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1432 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
1433 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1434 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1437 The <code class="directive">FileETag</code> directive configures the file
1438 attributes that are used to create the <code>ETag</code> (entity
1439 tag) response header field when the document is based on a static file.
1440 (The <code>ETag</code> value is used in cache management to save
1441 network bandwidth.) The
1442 <code class="directive">FileETag</code> directive allows you to choose
1443 which of these -- if any -- should be used. The recognized keywords are:
1447 <dt><strong>INode</strong></dt>
1448 <dd>The file's i-node number will be included in the calculation</dd>
1449 <dt><strong>MTime</strong></dt>
1450 <dd>The date and time the file was last modified will be included</dd>
1451 <dt><strong>Size</strong></dt>
1452 <dd>The number of bytes in the file will be included</dd>
1453 <dt><strong>All</strong></dt>
1454 <dd>All available fields will be used. This is equivalent to:
1455 <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1456 <dt><strong>None</strong></dt>
1457 <dd>If a document is file-based, no <code>ETag</code> field will be
1458 included in the response</dd>
1461 <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1462 keywords may be prefixed with either <code>+</code> or <code>-</code>,
1463 which allow changes to be made to the default setting inherited
1464 from a broader scope. Any keyword appearing without such a prefix
1465 immediately and completely cancels the inherited setting.</p>
1467 <p>If a directory's configuration includes
1468 <code>FileETag INode MTime Size</code>, and a
1469 subdirectory's includes <code>FileETag -INode</code>,
1470 the setting for that subdirectory (which will be inherited by
1471 any sub-subdirectories that don't override it) will be equivalent to
1472 <code>FileETag MTime Size</code>.</p>
1473 <div class="warning"><h3>Warning</h3>
1474 Do not change the default for directories or locations that have WebDAV
1475 enabled and use <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> as a storage provider.
1476 <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> uses <code>INode MTime Size</code>
1477 as a fixed format for <code>ETag</code> comparisons on conditional requests.
1478 These conditional requests will break if the <code>ETag</code> format is
1479 changed via <code class="directive">FileETag</code>.
1481 <div class="note"><h3>Server Side Includes</h3>
1482 An ETag is not generated for responses parsed by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>,
1483 since the response entity can change without a change of the INode, MTime, or Size
1484 of the static file with embedded SSI directives.
1489 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1490 <div class="directive-section"><h2><a name="Files" id="Files"><Files></a> <a name="files" id="files">Directiva</a></h2>
1491 <table class="directive">
1492 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply to matched
1494 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Files <var>filename</var>> ... </Files></code></td></tr>
1495 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1496 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1497 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1498 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1500 <p>The <code class="directive"><Files></code> directive
1501 limits the scope of the enclosed directives by filename. It is comparable
1502 to the <code class="directive"><a href="#directory"><Directory></a></code>
1503 and <code class="directive"><a href="#location"><Location></a></code>
1504 directives. It should be matched with a <code></Files></code>
1505 directive. The directives given within this section will be applied to
1506 any object with a basename (last component of filename) matching the
1507 specified filename. <code class="directive"><Files></code>
1508 sections are processed in the order they appear in the
1509 configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1510 <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location"><Location></a></code> sections. Note
1511 that <code class="directive"><Files></code> can be nested
1512 inside <code class="directive"><a href="#directory"><Directory></a></code> sections to restrict the
1513 portion of the filesystem they apply to.</p>
1515 <p>The <var>filename</var> argument should include a filename, or
1516 a wild-card string, where <code>?</code> matches any single character,
1517 and <code>*</code> matches any sequences of characters.
1518 <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">Regular expressions</a>
1519 can also be used, with the addition of the
1520 <code>~</code> character. For example:</p>
1522 <div class="example"><p><code>
1523 <Files ~ "\.(gif|jpe?g|png)$">
1526 <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
1529 <p>Note that unlike <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#location"><Location></a></code> sections, <code class="directive"><Files></code> sections can be used inside
1530 <code>.htaccess</code> files. This allows users to control access to
1531 their own files, at a file-by-file level.</p>
1534 <h3>Consulte también</h3>
1536 <li><a href="../sections.html">How <Directory>, <Location>
1537 and <Files> sections work</a> for an explanation of how these
1538 different sections are combined when a request is received</li>
1541 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1542 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch"><FilesMatch></a> <a name="filesmatch" id="filesmatch">Directiva</a></h2>
1543 <table class="directive">
1544 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply to regular-expression matched
1546 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><FilesMatch <var>regex</var>> ... </FilesMatch></code></td></tr>
1547 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1548 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1549 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1550 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1552 <p>The <code class="directive"><FilesMatch></code> directive
1553 limits the scope of the enclosed directives by filename, just as the
1554 <code class="directive"><a href="#files"><Files></a></code> directive
1555 does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">regular
1556 expression</a>. For example:</p>
1558 <div class="example"><p><code>
1559 <FilesMatch "\.(gif|jpe?g|png)$">
1562 <p>would match most common Internet graphics formats.</p>
1564 <h3>Consulte también</h3>
1566 <li><a href="../sections.html">How <Directory>, <Location>
1567 and <Files> sections work</a> for an explanation of how these
1568 different sections are combined when a request is received</li>
1571 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1572 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directiva</a></h2>
1573 <table class="directive">
1574 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Forces all matching files to be served with the specified
1575 media type in the HTTP Content-Type header field</td></tr>
1576 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ForceType <var>media-type</var>|None</code></td></tr>
1577 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
1578 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
1579 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1580 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1581 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Moved to the core in Apache httpd 2.0</td></tr>
1583 <p>When placed into an <code>.htaccess</code> file or a
1584 <code class="directive"><a href="#directory"><Directory></a></code>, or
1585 <code class="directive"><a href="#location"><Location></a></code> or
1586 <code class="directive"><a href="#files"><Files></a></code>
1587 section, this directive forces all matching files to be served
1588 with the content type identification given by
1589 <var>media-type</var>. For example, if you had a directory full of
1590 GIF files, but did not want to label them all with <code>.gif</code>,
1591 you might want to use:</p>
1593 <div class="example"><p><code>
1597 <p>Note that this directive overrides other indirect media type
1598 associations defined in mime.types or via the
1599 <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code>.</p>
1601 <p>You can also override more general
1602 <code class="directive">ForceType</code> settings
1603 by using the value of <code>None</code>:</p>
1605 <div class="example"><p><code>
1606 # force all files to be image/gif:<br />
1607 <Location /images><br />
1608 <span class="indent">
1609 ForceType image/gif<br />
1611 </Location><br />
1613 # but normal mime-type associations here:<br />
1614 <Location /images/mixed><br />
1615 <span class="indent">
1616 ForceType None<br />
1621 <p>This directive primarily overrides the content types generated for
1622 static files served out of the filesystem. For resources other than
1623 static files, where the generator of the response typically specifies
1624 a Content-Type, this directive has no effect.</p>
1628 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1629 <div class="directive-section"><h2><a name="GprofDir" id="GprofDir">GprofDir</a> <a name="gprofdir" id="gprofdir">Directiva</a></h2>
1630 <table class="directive">
1631 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Directory to write gmon.out profiling data to. </td></tr>
1632 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>GprofDir <var>/tmp/gprof/</var>|<var>/tmp/gprof/</var>%</code></td></tr>
1633 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1634 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1635 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1637 <p>When the server has been compiled with gprof profiling suppport,
1638 <code class="directive">GprofDir</code> causes <code>gmon.out</code> files to
1639 be written to the specified directory when the process exits. If the
1640 argument ends with a percent symbol ('%'), subdirectories are created
1641 for each process id.</p>
1643 <p>This directive currently only works with the <code class="module"><a href="../mod/prefork.html">prefork</a></code>
1647 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1648 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directiva</a></h2>
1649 <table class="directive">
1650 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1651 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1652 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>HostnameLookups Off</code></td></tr>
1653 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
1654 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1655 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1657 <p>This directive enables DNS lookups so that host names can be
1658 logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1659 The value <code>Double</code> refers to doing double-reverse
1660 DNS lookup. That is, after a reverse lookup is performed, a forward
1661 lookup is then performed on that result. At least one of the IP
1662 addresses in the forward lookup must match the original
1663 address. (In "tcpwrappers" terminology this is called
1664 <code>PARANOID</code>.)</p>
1666 <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1667 used for controlling access by hostname, a double reverse lookup
1668 will be performed. This is necessary for security. Note that the
1669 result of this double-reverse isn't generally available unless you
1670 set <code>HostnameLookups Double</code>. For example, if only
1671 <code>HostnameLookups On</code> and a request is made to an object
1672 that is protected by hostname restrictions, regardless of whether
1673 the double-reverse fails or not, CGIs will still be passed the
1674 single-reverse result in <code>REMOTE_HOST</code>.</p>
1676 <p>The default is <code>Off</code> in order to save the network
1677 traffic for those sites that don't truly need the reverse
1678 lookups done. It is also better for the end users because they
1679 don't have to suffer the extra latency that a lookup entails.
1680 Heavily loaded sites should leave this directive
1681 <code>Off</code>, since DNS lookups can take considerable
1682 amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
1683 default to the <code>bin</code> subdirectory of your installation
1684 directory, can be used to look up host names from logged IP addresses
1688 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1689 <div class="directive-section"><h2><a name="If" id="If"><If></a> <a name="if" id="if">Directiva</a></h2>
1690 <table class="directive">
1691 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only if a condition is
1692 satisfied by a request at runtime</td></tr>
1693 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><If <var>expression</var>> ... </If></code></td></tr>
1694 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1695 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1696 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1697 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1699 <p>The <code class="directive"><If></code> directive
1700 evaluates an expression at runtime, and applies the enclosed
1701 directives if and only if the expression evaluates to true.
1704 <div class="example"><p><code>
1705 <If "$req{Host} = ''">
1708 <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>
1710 <p>You may compare the value of any variable in the request headers
1711 ($req), response headers ($resp) or environment ($env) in your
1714 <p>Apart from <code>=</code>, <code>If</code> can use the <code>IN</code>
1715 operator to compare if the expression is in a given range:</p>
1717 <div class="example"><p><code>
1718 <If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS>
1722 <h3>Consulte también</h3>
1724 <li><a href="../expr.html">Expressions in Apache HTTP Server</a>,
1725 for a complete reference and more examples.</li>
1726 <li><a href="../sections.html">How <Directory>, <Location>,
1727 <Files> sections work</a> for an explanation of how these
1728 different sections are combined when a request is received.
1729 <code class="directive"><If></code> has the same precedence
1730 and usage as <code class="directive"><Files></code></li>
1733 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1734 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine"><IfDefine></a> <a name="ifdefine" id="ifdefine">Directiva</a></h2>
1735 <table class="directive">
1736 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Encloses directives that will be processed only
1737 if a test is true at startup</td></tr>
1738 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><IfDefine [!]<var>parameter-name</var>> ...
1739 </IfDefine></code></td></tr>
1740 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1741 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1742 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1743 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1745 <p>The <code><IfDefine <var>test</var>>...</IfDefine>
1746 </code> section is used to mark directives that are conditional. The
1747 directives within an <code class="directive"><IfDefine></code>
1748 section are only processed if the <var>test</var> is true. If <var>
1749 test</var> is false, everything between the start and end markers is
1752 <p>The <var>test</var> in the <code class="directive"><IfDefine></code> section directive can be one of two forms:</p>
1755 <li><var>parameter-name</var></li>
1757 <li><code>!</code><var>parameter-name</var></li>
1760 <p>In the former case, the directives between the start and end
1761 markers are only processed if the parameter named
1762 <var>parameter-name</var> is defined. The second format reverses
1763 the test, and only processes the directives if
1764 <var>parameter-name</var> is <strong>not</strong> defined.</p>
1766 <p>The <var>parameter-name</var> argument is a define as given on the
1767 <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter</var>
1768 </code> at the time the server was started or by the <code class="directive"><a href="#define">Define</a></code> directive.</p>
1770 <p><code class="directive"><IfDefine></code> sections are
1771 nest-able, which can be used to implement simple
1772 multiple-parameter tests. Example:</p>
1774 <div class="example"><p><code>
1775 httpd -DReverseProxy -DUseCache -DMemCache ...<br />
1778 <IfDefine ReverseProxy><br />
1779 <span class="indent">
1780 LoadModule proxy_module modules/mod_proxy.so<br />
1781 LoadModule proxy_http_module modules/mod_proxy_http.so<br />
1782 <IfDefine UseCache><br />
1783 <span class="indent">
1784 LoadModule cache_module modules/mod_cache.so<br />
1785 <IfDefine MemCache><br />
1786 <span class="indent">
1787 LoadModule mem_cache_module modules/mod_mem_cache.so<br />
1789 </IfDefine><br />
1790 <IfDefine !MemCache><br />
1791 <span class="indent">
1792 LoadModule cache_disk_module modules/mod_cache_disk.so<br />
1802 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1803 <div class="directive-section"><h2><a name="IfModule" id="IfModule"><IfModule></a> <a name="ifmodule" id="ifmodule">Directiva</a></h2>
1804 <table class="directive">
1805 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Encloses directives that are processed conditional on the
1806 presence or absence of a specific module</td></tr>
1807 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><IfModule [!]<var>module-file</var>|<var>module-identifier</var>> ...
1808 </IfModule></code></td></tr>
1809 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1810 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1811 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1812 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1813 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Module identifiers are available in version 2.1 and
1816 <p>The <code><IfModule <var>test</var>>...</IfModule></code>
1817 section is used to mark directives that are conditional on the presence of
1818 a specific module. The directives within an <code class="directive"><IfModule></code> section are only processed if the <var>test</var>
1819 is true. If <var>test</var> is false, everything between the start and
1820 end markers is ignored.</p>
1822 <p>The <var>test</var> in the <code class="directive"><IfModule></code> section directive can be one of two forms:</p>
1825 <li><var>module</var></li>
1827 <li>!<var>module</var></li>
1830 <p>In the former case, the directives between the start and end
1831 markers are only processed if the module named <var>module</var>
1832 is included in Apache httpd -- either compiled in or
1833 dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1834 and only processes the directives if <var>module</var> is
1835 <strong>not</strong> included.</p>
1837 <p>The <var>module</var> argument can be either the module identifier or
1838 the file name of the module, at the time it was compiled. For example,
1839 <code>rewrite_module</code> is the identifier and
1840 <code>mod_rewrite.c</code> is the file name. If a module consists of
1841 several source files, use the name of the file containing the string
1842 <code>STANDARD20_MODULE_STUFF</code>.</p>
1844 <p><code class="directive"><IfModule></code> sections are
1845 nest-able, which can be used to implement simple multiple-module
1848 <div class="note">This section should only be used if you need to have one
1849 configuration file that works whether or not a specific module
1850 is available. In normal operation, directives need not be
1851 placed in <code class="directive"><IfModule></code>
1855 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1856 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directiva</a></h2>
1857 <table class="directive">
1858 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Includes other configuration files from within
1859 the server configuration files</td></tr>
1860 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Include [<var>optional</var>|<var>strict</var>] <var>file-path</var>|<var>directory-path</var>|<var>wildcard</var></code></td></tr>
1861 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
1862 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1863 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1864 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Wildcard matching available in 2.0.41 and later, directory
1865 wildcard matching available in 2.3.6 and later</td></tr>
1867 <p>This directive allows inclusion of other configuration files
1868 from within the server configuration files.</p>
1870 <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used
1871 in the filename or directory parts of the path to include several files
1872 at once, in alphabetical order. In addition, if
1873 <code class="directive">Include</code> points to a directory, rather than a file,
1874 Apache httpd will read all files in that directory and any subdirectory.
1875 However, including entire directories is not recommended, because it is
1876 easy to accidentally leave temporary files in a directory that can cause
1877 <code class="program"><a href="../programs/httpd.html">httpd</a></code> to fail. Instead, we encourage you to use the
1878 wildcard syntax shown below, to include files that match a particular
1879 pattern, such as *.conf, for example.</p>
1881 <p>When a wildcard is specified for a <strong>file</strong> component of
1882 the path, and no file matches the wildcard, the
1883 <code class="directive"><a href="#include">Include</a></code>
1884 directive will be <strong>silently ignored</strong>. When a wildcard is
1885 specified for a <strong>directory</strong> component of the path, and
1886 no directory matches the wildcard, the
1887 <code class="directive"><a href="#include">Include</a></code> directive will
1888 <strong>fail with an error</strong> saying the directory cannot be found.
1891 <p>For further control over the behaviour of the server when no files or
1892 directories match, prefix the path with the modifiers <var>optional</var>
1893 or <var>strict</var>. If <var>optional</var> is specified, any wildcard
1894 file or directory that does not match will be silently ignored. If
1895 <var>strict</var> is specified, any wildcard file or directory that does
1896 not match at least one file will cause server startup to fail.</p>
1898 <p>When a directory or file component of the path is
1899 specified exactly, and that directory or file does not exist,
1900 <code class="directive"><a href="#include">Include</a></code> directive will fail with an
1901 error saying the file or directory cannot be found.</p>
1903 <p>The file path specified may be an absolute path, or may be relative
1904 to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1908 <div class="example"><p><code>
1909 Include /usr/local/apache2/conf/ssl.conf<br />
1910 Include /usr/local/apache2/conf/vhosts/*.conf
1913 <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1915 <div class="example"><p><code>
1916 Include conf/ssl.conf<br />
1917 Include conf/vhosts/*.conf
1920 <p>Wildcards may be included in the directory or file portion of the
1921 path. In the following example, the server will fail to load if no
1922 directories match conf/vhosts/*, but will load successfully if no
1923 files match *.conf.</p>
1925 <div class="example"><p><code>
1926 Include conf/vhosts/*/vhost.conf<br />
1927 Include conf/vhosts/*/*.conf
1930 <p>In this example, the server will fail to load if either
1931 conf/vhosts/* matches no directories, or if *.conf matches no files:</p>
1933 <div class="example"><p><code>
1934 Include strict conf/vhosts/*/*.conf
1937 <p>In this example, the server load successfully if either conf/vhosts/*
1938 matches no directories, or if *.conf matches no files:</p>
1940 <div class="example"><p><code>
1941 Include optional conf/vhosts/*/*.conf
1945 <h3>Consulte también</h3>
1947 <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
1950 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1951 <div class="directive-section"><h2><a name="IncludeOptional" id="IncludeOptional">IncludeOptional</a> <a name="includeoptional" id="includeoptional">Directiva</a></h2>
1952 <table class="directive">
1953 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Includes other configuration files from within
1954 the server configuration files</td></tr>
1955 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>IncludeOptional <var>file-path</var>|<var>directory-path</var>|<var>wildcard</var></code></td></tr>
1956 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
1957 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1958 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1959 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in 2.3.6 and later</td></tr>
1960 </table><p>The documentation for this directive has
1961 not been translated yet. Please have a look at the English
1962 version.</p><h3>Consulte también</h3>
1964 <li><code class="directive"><a href="#include">Include</a></code></li>
1965 <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
1968 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1969 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directiva</a></h2>
1970 <table class="directive">
1971 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enables HTTP persistent connections</td></tr>
1972 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1973 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>KeepAlive On</code></td></tr>
1974 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1975 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1976 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1978 <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1979 connection feature of HTTP/1.1 provide long-lived HTTP sessions
1980 which allow multiple requests to be sent over the same TCP
1981 connection. In some cases this has been shown to result in an
1982 almost 50% speedup in latency times for HTML documents with
1983 many images. To enable Keep-Alive connections, set
1984 <code>KeepAlive On</code>.</p>
1986 <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1987 used if they are specifically requested by a client. In
1988 addition, a Keep-Alive connection with an HTTP/1.0 client can
1989 only be used when the length of the content is known in
1990 advance. This implies that dynamic content such as CGI output,
1991 SSI pages, and server-generated directory listings will
1992 generally not use Keep-Alive connections to HTTP/1.0 clients.
1993 For HTTP/1.1 clients, persistent connections are the default
1994 unless otherwise specified. If the client requests it, chunked
1995 encoding will be used in order to send content of unknown
1996 length over persistent connections.</p>
1998 <p>When a client uses a Keep-Alive connection it will be counted
1999 as a single "request" for the <code class="directive"><a href="../mod/mpm_common.html#maxconnectionsperchild">MaxConnectionsPerChild</a></code> directive, regardless
2000 of how many requests are sent using the connection.</p>
2002 <h3>Consulte también</h3>
2004 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
2007 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2008 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directiva</a></h2>
2009 <table class="directive">
2010 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Amount of time the server will wait for subsequent
2011 requests on a persistent connection</td></tr>
2012 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>KeepAliveTimeout <var>num</var>[ms]</code></td></tr>
2013 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>KeepAliveTimeout 5</code></td></tr>
2014 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2015 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2016 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2017 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Specifying a value in milliseconds is available in
2018 Apache httpd 2.3.2 and later</td></tr>
2020 <p>The number of seconds Apache httpd will wait for a subsequent
2021 request before closing the connection. By adding a postfix of ms the
2022 timeout can be also set in milliseconds. Once a request has been
2023 received, the timeout value specified by the
2024 <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
2026 <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
2027 may cause performance problems in heavily loaded servers. The
2028 higher the timeout, the more server processes will be kept
2029 occupied waiting on connections with idle clients.</p>
2031 <p>In a name-based virtual host context, the value of the first
2032 defined virtual host (the default host) in a set of <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> will be used.
2033 The other values will be ignored.</p>
2036 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2037 <div class="directive-section"><h2><a name="Limit" id="Limit"><Limit></a> <a name="limit" id="limit">Directiva</a></h2>
2038 <table class="directive">
2039 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Restrict enclosed access controls to only certain HTTP
2041 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Limit <var>method</var> [<var>method</var>] ... > ...
2042 </Limit></code></td></tr>
2043 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
2044 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>AuthConfig, Limit</td></tr>
2045 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2046 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2048 <p>Access controls are normally effective for
2049 <strong>all</strong> access methods, and this is the usual
2050 desired behavior. <strong>In the general case, access control
2051 directives should not be placed within a
2052 <code class="directive"><Limit></code> section.</strong></p>
2054 <p>The purpose of the <code class="directive"><Limit></code>
2055 directive is to restrict the effect of the access controls to the
2056 nominated HTTP methods. For all other methods, the access
2057 restrictions that are enclosed in the <code class="directive"><Limit></code> bracket <strong>will have no
2058 effect</strong>. The following example applies the access control
2059 only to the methods <code>POST</code>, <code>PUT</code>, and
2060 <code>DELETE</code>, leaving all other methods unprotected:</p>
2062 <div class="example"><p><code>
2063 <Limit POST PUT DELETE><br />
2064 <span class="indent">
2065 Require valid-user<br />
2070 <p>The method names listed can be one or more of: <code>GET</code>,
2071 <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
2072 <code>CONNECT</code>, <code>OPTIONS</code>,
2073 <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
2074 <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
2075 <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
2076 case-sensitive.</strong> If <code>GET</code> is used it will also
2077 restrict <code>HEAD</code> requests. The <code>TRACE</code> method
2078 cannot be limited (see <code class="directive"><a href="#traceenable">TraceEnable</a></code>).</p>
2080 <div class="warning">A <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section should always be
2081 used in preference to a <code class="directive"><Limit></code>
2082 section when restricting access, since a <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section provides protection
2083 against arbitrary methods.</div>
2085 <p>The <code class="directive"><Limit></code> and
2086 <code class="directive"><a href="#limitexcept"><LimitExcept></a></code>
2087 directives may be nested. In this case, each successive level of
2088 <code class="directive"><Limit></code> or <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> directives must
2089 further restrict the set of methods to which access controls apply.</p>
2091 <div class="warning">When using
2092 <code class="directive"><Limit></code> or
2093 <code class="directive"><LimitExcept></code> directives with
2094 the <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> directive,
2095 note that the first <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code>
2096 to succeed authorizes the request, regardless of the presence of other
2097 <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> directives.</div>
2099 <p>For example, given the following configuration, all users will
2100 be authorized for <code>POST</code> requests, and the
2101 <code>Require group editors</code> directive will be ignored
2104 <div class="example"><p><code>
2105 <LimitExcept GET>
2106 <span class="indent">
2109 </LimitExcept><br />
2111 <span class="indent">
2112 Require group editors
2118 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2119 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept"><LimitExcept></a> <a name="limitexcept" id="limitexcept">Directiva</a></h2>
2120 <table class="directive">
2121 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Restrict access controls to all HTTP methods
2122 except the named ones</td></tr>
2123 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><LimitExcept <var>method</var> [<var>method</var>] ... > ...
2124 </LimitExcept></code></td></tr>
2125 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
2126 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>AuthConfig, Limit</td></tr>
2127 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2128 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2130 <p><code class="directive"><LimitExcept></code> and
2131 <code></LimitExcept></code> are used to enclose
2132 a group of access control directives which will then apply to any
2133 HTTP access method <strong>not</strong> listed in the arguments;
2134 i.e., it is the opposite of a <code class="directive"><a href="#limit"><Limit></a></code> section and can be used to control
2135 both standard and nonstandard/unrecognized methods. See the
2136 documentation for <code class="directive"><a href="#limit"><Limit></a></code> for more details.</p>
2140 <div class="example"><p><code>
2141 <LimitExcept POST GET><br />
2142 <span class="indent">
2143 Require valid-user<br />
2145 </LimitExcept>
2150 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2151 <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directiva</a></h2>
2152 <table class="directive">
2153 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determine maximum number of internal redirects and nested
2154 subrequests</td></tr>
2155 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
2156 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
2157 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2158 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2159 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2160 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.0.47 and later</td></tr>
2162 <p>An internal redirect happens, for example, when using the <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> directive, which internally
2163 redirects the original request to a CGI script. A subrequest is Apache httpd's
2164 mechanism to find out what would happen for some URI if it were requested.
2165 For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
2166 files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
2169 <p><code class="directive">LimitInternalRecursion</code> prevents the server
2170 from crashing when entering an infinite loop of internal redirects or
2171 subrequests. Such loops are usually caused by misconfigurations.</p>
2173 <p>The directive stores two different limits, which are evaluated on
2174 per-request basis. The first <var>number</var> is the maximum number of
2175 internal redirects, that may follow each other. The second <var>number</var>
2176 determines, how deep subrequests may be nested. If you specify only one
2177 <var>number</var>, it will be assigned to both limits.</p>
2179 <div class="example"><h3>Example</h3><p><code>
2180 LimitInternalRecursion 5
2184 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2185 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directiva</a></h2>
2186 <table class="directive">
2187 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Restricts the total size of the HTTP request body sent
2188 from the client</td></tr>
2189 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
2190 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestBody 0</code></td></tr>
2191 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2192 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
2193 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2194 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2196 <p>This directive specifies the number of <var>bytes</var> from 0
2197 (meaning unlimited) to 2147483647 (2GB) that are allowed in a
2198 request body. See the note below for the limited applicability
2199 to proxy requests.</p>
2201 <p>The <code class="directive">LimitRequestBody</code> directive allows
2202 the user to set a limit on the allowed size of an HTTP request
2203 message body within the context in which the directive is given
2204 (server, per-directory, per-file or per-location). If the client
2205 request exceeds that limit, the server will return an error
2206 response instead of servicing the request. The size of a normal
2207 request message body will vary greatly depending on the nature of
2208 the resource and the methods allowed on that resource. CGI scripts
2209 typically use the message body for retrieving form information.
2210 Implementations of the <code>PUT</code> method will require
2211 a value at least as large as any representation that the server
2212 wishes to accept for that resource.</p>
2214 <p>This directive gives the server administrator greater
2215 control over abnormal client request behavior, which may be
2216 useful for avoiding some forms of denial-of-service
2219 <p>If, for example, you are permitting file upload to a particular
2220 location, and wish to limit the size of the uploaded file to 100K,
2221 you might use the following directive:</p>
2223 <div class="example"><p><code>
2224 LimitRequestBody 102400
2227 <div class="note"><p>For a full description of how this directive is interpreted by
2228 proxy requests, see the <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> documentation.</p>
2233 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2234 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directiva</a></h2>
2235 <table class="directive">
2236 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the number of HTTP request header fields that
2237 will be accepted from the client</td></tr>
2238 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
2239 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestFields 100</code></td></tr>
2240 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2241 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2242 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2244 <p><var>Number</var> is an integer from 0 (meaning unlimited) to
2245 32767. The default value is defined by the compile-time
2246 constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
2249 <p>The <code class="directive">LimitRequestFields</code> directive allows
2250 the server administrator to modify the limit on the number of
2251 request header fields allowed in an HTTP request. A server needs
2252 this value to be larger than the number of fields that a normal
2253 client request might include. The number of request header fields
2254 used by a client rarely exceeds 20, but this may vary among
2255 different client implementations, often depending upon the extent
2256 to which a user has configured their browser to support detailed
2257 content negotiation. Optional HTTP extensions are often expressed
2258 using request header fields.</p>
2260 <p>This directive gives the server administrator greater
2261 control over abnormal client request behavior, which may be
2262 useful for avoiding some forms of denial-of-service attacks.
2263 The value should be increased if normal clients see an error
2264 response from the server that indicates too many fields were
2265 sent in the request.</p>
2269 <div class="example"><p><code>
2270 LimitRequestFields 50
2273 <div class="warning"><h3>Warning</h3>
2274 <p> When name-based virtual hosting is used, the value for this
2275 directive is taken from the default (first-listed) virtual host for the
2276 <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2281 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2282 <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directiva</a></h2>
2283 <table class="directive">
2284 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the size of the HTTP request header allowed from the
2286 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestFieldSize <var>bytes</var></code></td></tr>
2287 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestFieldSize 8190</code></td></tr>
2288 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2289 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2290 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2292 <p>This directive specifies the number of <var>bytes</var>
2293 that will be allowed in an HTTP request header.</p>
2295 <p>The <code class="directive">LimitRequestFieldSize</code> directive
2296 allows the server administrator to reduce or increase the limit
2297 on the allowed size of an HTTP request header field. A server
2298 needs this value to be large enough to hold any one header field
2299 from a normal client request. The size of a normal request header
2300 field will vary greatly among different client implementations,
2301 often depending upon the extent to which a user has configured
2302 their browser to support detailed content negotiation. SPNEGO
2303 authentication headers can be up to 12392 bytes.</p>
2305 <p>This directive gives the server administrator greater
2306 control over abnormal client request behavior, which may be
2307 useful for avoiding some forms of denial-of-service attacks.</p>
2311 <div class="example"><p><code>
2312 LimitRequestFieldSize 4094
2315 <div class="note">Under normal conditions, the value should not be changed from
2318 <div class="warning"><h3>Warning</h3>
2319 <p> When name-based virtual hosting is used, the value for this
2320 directive is taken from the default (first-listed) virtual host for the
2321 <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2326 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2327 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directiva</a></h2>
2328 <table class="directive">
2329 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limit the size of the HTTP request line that will be accepted
2330 from the client</td></tr>
2331 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
2332 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
2333 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2334 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2335 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2337 <p>This directive sets the number of <var>bytes</var> that will be
2338 allowed on the HTTP request-line.</p>
2340 <p>The <code class="directive">LimitRequestLine</code> directive allows
2341 the server administrator to reduce or increase the limit on the allowed size
2342 of a client's HTTP request-line. Since the request-line consists of the
2343 HTTP method, URI, and protocol version, the
2344 <code class="directive">LimitRequestLine</code> directive places a
2345 restriction on the length of a request-URI allowed for a request
2346 on the server. A server needs this value to be large enough to
2347 hold any of its resource names, including any information that
2348 might be passed in the query part of a <code>GET</code> request.</p>
2350 <p>This directive gives the server administrator greater
2351 control over abnormal client request behavior, which may be
2352 useful for avoiding some forms of denial-of-service attacks.</p>
2356 <div class="example"><p><code>
2357 LimitRequestLine 4094
2360 <div class="note">Under normal conditions, the value should not be changed from
2363 <div class="warning"><h3>Warning</h3>
2364 <p> When name-based virtual hosting is used, the value for this
2365 directive is taken from the default (first-listed) virtual host for the
2366 <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2371 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2372 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directiva</a></h2>
2373 <table class="directive">
2374 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the size of an XML-based request body</td></tr>
2375 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
2376 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
2377 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2378 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
2379 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2380 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2382 <p>Limit (in bytes) on maximum size of an XML-based request
2383 body. A value of <code>0</code> will disable any checking.</p>
2387 <div class="example"><p><code>
2388 LimitXMLRequestBody 0
2393 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2394 <div class="directive-section"><h2><a name="Location" id="Location"><Location></a> <a name="location" id="location">Directiva</a></h2>
2395 <table class="directive">
2396 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Applies the enclosed directives only to matching
2398 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Location
2399 <var>URL-path</var>|<var>URL</var>> ... </Location></code></td></tr>
2400 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2401 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2402 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2404 <p>The <code class="directive"><Location></code> directive
2405 limits the scope of the enclosed directives by URL. It is similar to the
2406 <code class="directive"><a href="#directory"><Directory></a></code>
2407 directive, and starts a subsection which is terminated with a
2408 <code></Location></code> directive. <code class="directive"><Location></code> sections are processed in the
2409 order they appear in the configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
2410 <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files"><Files></a></code> sections.</p>
2412 <p><code class="directive"><Location></code> sections operate
2413 completely outside the filesystem. This has several consequences.
2414 Most importantly, <code class="directive"><Location></code>
2415 directives should not be used to control access to filesystem
2416 locations. Since several different URLs may map to the same
2417 filesystem location, such access controls may by circumvented.</p>
2419 <p>The enclosed directives will be applied to the request if the path component
2420 of the URL meets <em>any</em> of the following criteria:
2423 <li>The specified location matches exactly the path component of the URL.
2425 <li>The specified location, which ends in a forward slash, is a prefix
2426 of the path component of the URL (treated as a context root).
2428 <li>The specified location, with the addition of a trailing slash, is a
2429 prefix of the path component of the URL (also treated as a context root).
2433 In the example below, where no trailing slash is used, requests to
2434 /private1, /private1/ and /private1/file.txt will have the enclosed
2435 directives applied, but /private1other would not.
2437 <div class="example"><p><code>
2438 <Location /private1>
2442 In the example below, where a trailing slash is used, requests to
2443 /private2/ and /private2/file.txt will have the enclosed
2444 directives applied, but /private2 and /private2other would not.
2446 <div class="example"><p><code>
2447 <Location /private2<em>/</em>>
2451 <div class="note"><h3>When to use <code class="directive"><Location></code></h3>
2453 <p>Use <code class="directive"><Location></code> to apply
2454 directives to content that lives outside the filesystem. For
2455 content that lives in the filesystem, use <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#files"><Files></a></code>. An exception is
2456 <code><Location /></code>, which is an easy way to
2457 apply a configuration to the entire server.</p>
2460 <p>For all origin (non-proxy) requests, the URL to be matched is a
2461 URL-path of the form <code>/path/</code>. <em>No scheme, hostname,
2462 port, or query string may be included.</em> For proxy requests, the
2463 URL to be matched is of the form
2464 <code>scheme://servername/path</code>, and you must include the
2467 <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
2468 any single character, and <code>*</code> matches any sequences of
2469 characters. Neither wildcard character matches a / in the URL-path.</p>
2471 <p><a class="glossarylink" href="../glossary.html#regex" title="ver glosario">Regular expressions</a>
2472 can also be used, with the addition of the <code>~</code>
2473 character. For example:</p>
2475 <div class="example"><p><code>
2476 <Location ~ "/(extra|special)/data">
2479 <p>would match URLs that contained the substring <code>/extra/data</code>
2480 or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch"><LocationMatch></a></code> behaves
2481 identical to the regex version of <code class="directive"><Location></code>, and is preferred, for the
2482 simple reason that <code>~</code> is hard to distinguish from
2483 <code>-</code> in many fonts.</p>
2485 <p>The <code class="directive"><Location></code>
2486 functionality is especially useful when combined with the
2487 <code class="directive"><a href="#sethandler">SetHandler</a></code>
2488 directive. For example, to enable status requests, but allow them
2489 only from browsers at <code>example.com</code>, you might use:</p>
2491 <div class="example"><p><code>
2492 <Location /status><br />
2493 <span class="indent">
2494 SetHandler server-status<br />
2495 Require host example.com<br />
2500 <div class="note"><h3>Note about / (slash)</h3>
2501 <p>The slash character has special meaning depending on where in a
2502 URL it appears. People may be used to its behavior in the filesystem
2503 where multiple adjacent slashes are frequently collapsed to a single
2504 slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
2505 <code>/home/foo</code>). In URL-space this is not necessarily true.
2506 The <code class="directive"><a href="#locationmatch"><LocationMatch></a></code>
2507 directive and the regex version of <code class="directive"><Location></code> require you to explicitly specify multiple
2508 slashes if that is your intention.</p>
2510 <p>For example, <code><LocationMatch ^/abc></code> would match
2511 the request URL <code>/abc</code> but not the request URL <code>
2512 //abc</code>. The (non-regex) <code class="directive"><Location></code> directive behaves similarly when used for
2513 proxy requests. But when (non-regex) <code class="directive"><Location></code> is used for non-proxy requests it will
2514 implicitly match multiple slashes with a single slash. For example,
2515 if you specify <code><Location /abc/def></code> and the
2516 request is to <code>/abc//def</code> then it will match.</p>
2519 <h3>Consulte también</h3>
2521 <li><a href="../sections.html">How <Directory>, <Location>
2522 and <Files> sections work</a> for an explanation of how these
2523 different sections are combined when a request is received.</li>
2524 <li><code class="directive"><a href="#locationmatch">LocationMatch</a></code></li>
2527 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2528 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch"><LocationMatch></a> <a name="locationmatch" id="locationmatch">Directiva</a></h2>
2529 <table class="directive">
2530 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Applies the enclosed directives only to regular-expression
2531 matching URLs</td></tr>
2532 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><LocationMatch
2533 <var>regex</var>> ... </LocationMatch></code></td></tr>
2534 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2535 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2536 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2538 <p>The <code class="directive"><LocationMatch></code> directive
2539 limits the scope of the enclosed directives by URL, in an identical manner
2540 to <code class="directive"><a href="#location"><Location></a></code>. However,
2541 it takes a <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">regular expression</a>
2542 as an argument instead of a simple string. For example:</p>
2544 <div class="example"><p><code>
2545 <LocationMatch "/(extra|special)/data">
2548 <p>would match URLs that contained the substring <code>/extra/data</code>
2549 or <code>/special/data</code>.</p>
2551 <h3>Consulte también</h3>
2553 <li><a href="../sections.html">How <Directory>, <Location>
2554 and <Files> sections work</a> for an explanation of how these
2555 different sections are combined when a request is received</li>
2558 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2559 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directiva</a></h2>
2560 <table class="directive">
2561 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
2562 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LogLevel [<var>module</var>:]<var>level</var>
2563 [<var>module</var>:<var>level</var>] ...
2565 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LogLevel warn</code></td></tr>
2566 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
2567 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2568 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2569 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Per-module and per-directory configuration is available in
2570 Apache HTTP Server 2.3.6 and later</td></tr>
2572 <p><code class="directive">LogLevel</code> adjusts the verbosity of the
2573 messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
2574 <var>level</var>s are available, in order of decreasing
2577 <table class="bordered">
2580 <th><strong>Level</strong> </th>
2582 <th><strong>Description</strong> </th>
2584 <th><strong>Example</strong> </th>
2588 <td><code>emerg</code> </td>
2590 <td>Emergencies - system is unusable.</td>
2592 <td>"Child cannot open lock file. Exiting"</td>
2596 <td><code>alert</code> </td>
2598 <td>Action must be taken immediately.</td>
2600 <td>"getpwuid: couldn't determine user name from uid"</td>
2604 <td><code>crit</code> </td>
2606 <td>Critical Conditions.</td>
2608 <td>"socket: Failed to get a socket, exiting child"</td>
2612 <td><code>error</code> </td>
2614 <td>Error conditions.</td>
2616 <td>"Premature end of script headers"</td>
2620 <td><code>warn</code> </td>
2622 <td>Warning conditions.</td>
2624 <td>"child process 1234 did not exit, sending another
2629 <td><code>notice</code> </td>
2631 <td>Normal but significant condition.</td>
2633 <td>"httpd: caught SIGBUS, attempting to dump core in
2638 <td><code>info</code> </td>
2640 <td>Informational.</td>
2642 <td>"Server seems busy, (you may need to increase
2643 StartServers, or Min/MaxSpareServers)..."</td>
2647 <td><code>debug</code> </td>
2649 <td>Debug-level messages</td>
2651 <td>"Opening config file ..."</td>
2654 <td><code>trace1</code> </td>
2656 <td>Trace messages</td>
2658 <td>"proxy: FTP: control connection complete"</td>
2661 <td><code>trace2</code> </td>
2663 <td>Trace messages</td>
2665 <td>"proxy: CONNECT: sending the CONNECT request to the remote proxy"</td>
2668 <td><code>trace3</code> </td>
2670 <td>Trace messages</td>
2672 <td>"openssl: Handshake: start"</td>
2675 <td><code>trace4</code> </td>
2677 <td>Trace messages</td>
2679 <td>"read from buffered SSL brigade, mode 0, 17 bytes"</td>
2682 <td><code>trace5</code> </td>
2684 <td>Trace messages</td>
2686 <td>"map lookup FAILED: map=rewritemap key=keyname"</td>
2689 <td><code>trace6</code> </td>
2691 <td>Trace messages</td>
2693 <td>"cache lookup FAILED, forcing new map lookup"</td>
2696 <td><code>trace7</code> </td>
2698 <td>Trace messages, dumping large amounts of data</td>
2700 <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2703 <td><code>trace8</code> </td>
2705 <td>Trace messages, dumping large amounts of data</td>
2707 <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2711 <p>When a particular level is specified, messages from all
2712 other levels of higher significance will be reported as well.
2713 <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2714 then messages with log levels of <code>notice</code> and
2715 <code>warn</code> will also be posted.</p>
2717 <p>Using a level of at least <code>crit</code> is
2722 <div class="example"><p><code>
2726 <div class="note"><h3>Note</h3>
2727 <p>When logging to a regular file messages of the level
2728 <code>notice</code> cannot be suppressed and thus are always
2729 logged. However, this doesn't apply when logging is done
2730 using <code>syslog</code>.</p>
2733 <p>Specifying a level without a module name will reset the level
2734 for all modules to that level. Specifying a level with a module
2735 name will set the level for that module only. It is possible to
2736 use the module source file name, the module identifier, or the
2737 module identifier with the trailing <code>_module</code> omitted
2738 as module specification. This means the following three specifications
2741 <div class="example"><p><code>
2742 LogLevel info ssl:warn<br />
2743 LogLevel info mod_ssl.c:warn<br />
2744 LogLevel info ssl_module:warn<br />
2747 <p>It is also possible to change the level per directory:</p>
2749 <div class="example"><p><code>
2751 <Directory /usr/local/apache/htdocs/app><br />
2752 LogLevel debug<br />
2757 Per directory loglevel configuration only affects messages that are
2758 logged after the request has been parsed and that are associated with
2759 the request. Log messages which are associated with the connection or
2760 the server are not affected.
2764 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2765 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directiva</a></h2>
2766 <table class="directive">
2767 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Number of requests allowed on a persistent
2768 connection</td></tr>
2769 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
2770 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
2771 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2772 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2773 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2775 <p>The <code class="directive">MaxKeepAliveRequests</code> directive
2776 limits the number of requests allowed per connection when
2777 <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
2778 set to <code>0</code>, unlimited requests will be allowed. We
2779 recommend that this setting be kept to a high value for maximum
2780 server performance.</p>
2784 <div class="example"><p><code>
2785 MaxKeepAliveRequests 500
2789 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2790 <div class="directive-section"><h2><a name="MaxRangeOverlaps" id="MaxRangeOverlaps">MaxRangeOverlaps</a> <a name="maxrangeoverlaps" id="maxrangeoverlaps">Directiva</a></h2>
2791 <table class="directive">
2792 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Number of overlapping ranges (eg: <code>100-200,150-300</code>) allowed before returning the complete
2794 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>MaxRangeOverlaps default | unlimited | none | <var>number-of-ranges</var></code></td></tr>
2795 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>MaxRangeOverlaps 20</code></td></tr>
2796 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
2797 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2798 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2799 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache HTTP Server 2.3.15 and later</td></tr>
2800 </table><p>The documentation for this directive has
2801 not been translated yet. Please have a look at the English
2803 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2804 <div class="directive-section"><h2><a name="MaxRangeReversals" id="MaxRangeReversals">MaxRangeReversals</a> <a name="maxrangereversals" id="maxrangereversals">Directiva</a></h2>
2805 <table class="directive">
2806 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Number of range reversals (eg: <code>100-200,50-70</code>) allowed before returning the complete
2808 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>MaxRangeReversals default | unlimited | none | <var>number-of-ranges</var></code></td></tr>
2809 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>MaxRangeReversals 20</code></td></tr>
2810 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
2811 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2812 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2813 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache HTTP Server 2.3.15 and later</td></tr>
2814 </table><p>The documentation for this directive has
2815 not been translated yet. Please have a look at the English
2817 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2818 <div class="directive-section"><h2><a name="MaxRanges" id="MaxRanges">MaxRanges</a> <a name="maxranges" id="maxranges">Directiva</a></h2>
2819 <table class="directive">
2820 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Number of ranges allowed before returning the complete
2822 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>MaxRanges default | unlimited | none | <var>number-of-ranges</var></code></td></tr>
2823 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>MaxRanges 200</code></td></tr>
2824 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
2825 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2826 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2827 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache HTTP Server 2.3.15 and later</td></tr>
2828 </table><p>The documentation for this directive has
2829 not been translated yet. Please have a look at the English
2831 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2832 <div class="directive-section"><h2><a name="Mutex" id="Mutex">Mutex</a> <a name="mutex" id="mutex">Directiva</a></h2>
2833 <table class="directive">
2834 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures mutex mechanism and lock file directory for all
2835 or specified mutexes</td></tr>
2836 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Mutex <var>mechanism</var> [default|<var>mutex-name</var>] ... [OmitPID]</code></td></tr>
2837 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Mutex default</code></td></tr>
2838 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
2839 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2840 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2841 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache HTTP Server 2.3.4 and later</td></tr>
2843 <p>The <code class="directive">Mutex</code> directive sets the mechanism,
2844 and optionally the lock file location, that httpd and modules use
2845 to serialize access to resources. Specify <code>default</code> as
2846 the first argument to change the settings for all mutexes; specify
2847 a mutex name (see table below) as the first argument to override
2848 defaults only for that mutex.</p>
2850 <p>The <code class="directive">Mutex</code> directive is typically used in
2851 the following exceptional situations:</p>
2854 <li>change the mutex mechanism when the default mechanism selected
2855 by <a class="glossarylink" href="../glossary.html#apr" title="ver glosario">APR</a> has a functional or performance
2858 <li>change the directory used by file-based mutexes when the
2859 default directory does not support locking</li>
2862 <div class="note"><h3>Supported modules</h3>
2863 <p>This directive only configures mutexes which have been registered
2864 with the core server using the <code>ap_mutex_register()</code> API.
2865 All modules bundled with httpd support the <code class="directive">Mutex</code>
2866 directive, but third-party modules may not. Consult the documentation
2867 of the third-party module, which must indicate the mutex name(s) which
2868 can be configured if this directive is supported.</p>
2871 <p>The following mutex <em>mechanisms</em> are available:</p>
2873 <li><code>default | yes</code>
2874 <p>This selects the default locking implementation, as determined by
2875 <a class="glossarylink" href="../glossary.html#apr" title="ver glosario">APR</a>. The default locking implementation can
2876 be displayed by running <code class="program"><a href="../programs/httpd.html">httpd</a></code> with the
2877 <code>-V</code> option.</p></li>
2879 <li><code>none | no</code>
2880 <p>This effectively disables the mutex, and is only allowed for a
2881 mutex if the module indicates that it is a valid choice. Consult the
2882 module documentation for more information.</p></li>
2884 <li><code>posixsem</code>
2885 <p>This is a mutex variant based on a Posix semaphore.</p>
2887 <div class="warning"><h3>Warning</h3>
2888 <p>The semaphore ownership is not recovered if a thread in the process
2889 holding the mutex segfaults, resulting in a hang of the web server.</p>
2893 <li><code>sysvsem</code>
2894 <p>This is a mutex variant based on a SystemV IPC semaphore.</p>
2896 <div class="warning"><h3>Warning</h3>
2897 <p>It is possible to "leak" SysV semaphores if processes crash
2898 before the semaphore is removed.</p>
2901 <div class="warning"><h3>Security</h3>
2902 <p>The semaphore API allows for a denial of service attack by any
2903 CGIs running under the same uid as the webserver (<em>i.e.</em>,
2904 all CGIs, unless you use something like <code class="program"><a href="../programs/suexec.html">suexec</a></code>
2905 or <code>cgiwrapper</code>).</p>
2909 <li><code>sem</code>
2910 <p>This selects the "best" available semaphore implementation, choosing
2911 between Posix and SystemV IPC semaphores, in that order.</p></li>
2913 <li><code>pthread</code>
2914 <p>This is a mutex variant based on cross-process Posix thread
2917 <div class="warning"><h3>Warning</h3>
2918 <p>On most systems, if a child process terminates abnormally while
2919 holding a mutex that uses this implementation, the server will deadlock
2920 and stop responding to requests. When this occurs, the server will
2921 require a manual restart to recover.</p>
2922 <p>Solaris is a notable exception as it provides a mechanism which
2923 usually allows the mutex to be recovered after a child process
2924 terminates abnormally while holding a mutex.</p>
2925 <p>If your system implements the
2926 <code>pthread_mutexattr_setrobust_np()</code> function, you may be able
2927 to use the <code>pthread</code> option safely.</p>
2931 <li><code>fcntl:/path/to/mutex</code>
2932 <p>This is a mutex variant where a physical (lock-)file and the
2933 <code>fcntl()</code> function are used as the mutex.</p>
2935 <div class="warning"><h3>Warning</h3>
2936 <p>When multiple mutexes based on this mechanism are used within
2937 multi-threaded, multi-process environments, deadlock errors (EDEADLK)
2938 can be reported for valid mutex operations if <code>fcntl()</code>
2939 is not thread-aware, such as on Solaris.</p>
2943 <li><code>flock:/path/to/mutex</code>
2944 <p>This is similar to the <code>fcntl:/path/to/mutex</code> method
2945 with the exception that the <code>flock()</code> function is used to
2946 provide file locking.</p></li>
2948 <li><code>file:/path/to/mutex</code>
2949 <p>This selects the "best" available file locking implementation,
2950 choosing between <code>fcntl</code> and <code>flock</code>, in that
2954 <p>Most mechanisms are only available on selected platforms, where the
2955 underlying platform and <a class="glossarylink" href="../glossary.html#apr" title="ver glosario">APR</a> support it. Mechanisms
2956 which aren't available on all platforms are <em>posixsem</em>,
2957 <em>sysvsem</em>, <em>sem</em>, <em>pthread</em>, <em>fcntl</em>,
2958 <em>flock</em>, and <em>file</em>.</p>
2960 <p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
2961 the path, if provided, is a directory where the lock file will be created.
2962 The default directory is httpd's run-time file directory relative to
2963 <code class="directive"><a href="#serverroot">ServerRoot</a></code>. Always use a local disk
2964 filesystem for <code>/path/to/mutex</code> and never a directory residing
2965 on a NFS- or AFS-filesystem. The basename of the file will be the mutex
2966 type, an optional instance string provided by the module, and unless the
2967 <code>OmitPID</code> keyword is specified, the process id of the httpd
2968 parent process will be appended to to make the file name unique, avoiding
2969 conflicts when multiple httpd instances share a lock file directory. For
2970 example, if the mutex name is <code>mpm-accept</code> and the lock file
2971 directory is <code>/var/httpd/locks</code>, the lock file name for the
2972 httpd instance with parent process id 12345 would be
2973 <code>/var/httpd/locks/mpm-accept.12345</code>.</p>
2975 <div class="warning"><h3>Security</h3>
2976 <p>It is best to <em>avoid</em> putting mutex files in a world-writable
2977 directory such as <code>/var/tmp</code> because someone could create
2978 a denial of service attack and prevent the server from starting by
2979 creating a lockfile with the same name as the one the server will try
2983 <p>The following table documents the names of mutexes used by httpd
2984 and bundled modules.</p>
2986 <table class="bordered"><tr class="header">
2989 <th>Protected resource</th>
2992 <td><code>mpm-accept</code></td>
2993 <td><code class="module"><a href="../mod/prefork.html">prefork</a></code> and <code class="module"><a href="../mod/worker.html">worker</a></code> MPMs</td>
2994 <td>incoming connections, to avoid the thundering herd problem;
2995 for more information, refer to the
2996 <a href="../misc/perf-tuning.html">performance tuning</a>
3000 <td><code>authdigest-client</code></td>
3001 <td><code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
3002 <td>client list in shared memory</td>
3005 <td><code>authdigest-opaque</code></td>
3006 <td><code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
3007 <td>counter in shared memory</td>
3010 <td><code>ldap-cache</code></td>
3011 <td><code class="module"><a href="../mod/mod_ldap.html">mod_ldap</a></code></td>
3012 <td>LDAP result cache</td>
3015 <td><code>rewrite-map</code></td>
3016 <td><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code></td>
3017 <td>communication with external mapping programs, to avoid
3018 intermixed I/O from multiple requests</td>
3021 <td><code>ssl-cache</code></td>
3022 <td><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></td>
3023 <td>SSL session cache</td>
3026 <td><code>ssl-stapling</code></td>
3027 <td><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></td>
3028 <td>OCSP stapling response cache</td>
3031 <td><code>watchdog-callback</code></td>
3032 <td><code class="module"><a href="../mod/mod_watchdog.html">mod_watchdog</a></code></td>
3033 <td>callback function of a particular client module</td>
3037 <p>The <code>OmitPID</code> keyword suppresses the addition of the httpd
3038 parent process id from the lock file name.</p>
3040 <p>In the following example, the mutex mechanism for the MPM accept
3041 mutex will be changed from the compiled-in default to <code>fcntl</code>,
3042 with the associated lock file created in directory
3043 <code>/var/httpd/locks</code>. The mutex mechanism for all other mutexes
3044 will be changed from the compiled-in default to <code>sysvsem</code>.</p>
3046 <div class="example"><p><code>
3047 Mutex default sysvsem<br />
3048 Mutex mpm-accept fcntl:/var/httpd/locks
3052 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3053 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directiva</a></h2>
3054 <table class="directive">
3055 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Designates an IP address for name-virtual
3057 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
3058 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3059 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3060 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3063 <p>A single <code class="directive">NameVirtualHost</code> directive
3064 identifies a set of identical virtual hosts on which the server will
3065 further select from on the basis of the <em>hostname</em>
3066 requested by the client. The <code class="directive">NameVirtualHost</code>
3067 directive is a required directive if you want to configure
3068 <a href="../vhosts/">name-based virtual hosts</a>.</p>
3070 <p>This directive, and the corresponding <code class="directive">VirtualHost</code>,
3071 <em>must</em> be qualified with a port number if the server supports both HTTP
3072 and HTTPS connections.</p>
3074 <p>Although <var>addr</var> can be a hostname, it is recommended
3075 that you always use an IP address or a wildcard. A wildcard
3076 NameVirtualHost matches only virtualhosts that also have a literal wildcard
3077 as their argument.</p>
3079 <p>In cases where a firewall or other proxy receives the requests and
3080 forwards them on a different IP address to the server, you must specify the
3081 IP address of the physical interface on the machine which will be
3082 servicing the requests. </p>
3084 <p> In the example below, requests received on interface 192.0.2.1 and port 80
3085 will only select among the first two virtual hosts. Requests received on
3086 port 80 on any other interface will only select among the third and fourth
3087 virtual hosts. In the common case where the interface isn't important
3088 to the mapping, only the "*:80" NameVirtualHost and VirtualHost directives
3091 <div class="example"><p><code>
3092 NameVirtualHost 192.0.2.1:80<br />
3093 NameVirtualHost *:80<br /><br />
3095 <VirtualHost 192.0.2.1:80><br />
3096 ServerName namebased-a.example.com<br />
3097 </VirtualHost><br />
3099 <VirtualHost 192.0.2.1:80><br />
3100 Servername namebased-b.example.com<br />
3101 </VirtualHost><br />
3103 <VirtualHost *:80><br />
3104 ServerName namebased-c.example.com <br />
3105 </VirtualHost><br />
3107 <VirtualHost *:80><br />
3108 ServerName namebased-d.example.com <br />
3109 </VirtualHost><br />
3114 <p>If no matching virtual host is found, then the first listed
3115 virtual host that matches the IP address and port will be used.</p>
3118 <p>IPv6 addresses must be enclosed in square brackets, as shown
3119 in the following example:</p>
3121 <div class="example"><p><code>
3122 NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
3125 <div class="note"><h3>Argument to <code class="directive"><VirtualHost></code>
3127 <p>Note that the argument to the <code class="directive"><VirtualHost></code> directive must
3128 exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
3130 <div class="example"><p><code>
3131 NameVirtualHost 192.0.2.2:80<br />
3132 <VirtualHost 192.0.2.2:80><br />
3134 </VirtualHost><br />
3138 <h3>Consulte también</h3>
3140 <li><a href="../vhosts/">Virtual Hosts
3141 documentation</a></li>
3144 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3145 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directiva</a></h2>
3146 <table class="directive">
3147 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures what features are available in a particular
3149 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Options
3150 [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
3151 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Options All</code></td></tr>
3152 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3153 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>Options</td></tr>
3154 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3155 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3157 <p>The <code class="directive">Options</code> directive controls which
3158 server features are available in a particular directory.</p>
3160 <p><var>option</var> can be set to <code>None</code>, in which
3161 case none of the extra features are enabled, or one or more of
3165 <dt><code>All</code></dt>
3167 <dd>All options except for <code>MultiViews</code>. This is the default
3170 <dt><code>ExecCGI</code></dt>
3173 Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
3176 <dt><code>FollowSymLinks</code></dt>
3180 The server will follow symbolic links in this directory.
3182 <p>Even though the server follows the symlink it does <em>not</em>
3183 change the pathname used to match against <code class="directive"><a href="#directory"><Directory></a></code> sections.</p>
3184 <p>Note also, that this option <strong>gets ignored</strong> if set
3185 inside a <code class="directive"><a href="#location"><Location></a></code>
3187 <p>Omitting this option should not be considered a security restriction,
3188 since symlink testing is subject to race conditions that make it
3192 <dt><code>Includes</code></dt>
3195 Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
3198 <dt><code>IncludesNOEXEC</code></dt>
3202 Server-side includes are permitted, but the <code>#exec
3203 cmd</code> and <code>#exec cgi</code> are disabled. It is still
3204 possible to <code>#include virtual</code> CGI scripts from
3205 <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
3208 <dt><code>Indexes</code></dt>
3211 If a URL which maps to a directory is requested, and there
3212 is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
3213 (<em>e.g.</em>, <code>index.html</code>) in that directory, then
3214 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
3215 of the directory.</dd>
3217 <dt><code>MultiViews</code></dt>
3220 <a href="../content-negotiation.html">Content negotiated</a>
3221 "MultiViews" are allowed using
3222 <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.
3223 <div class="note"><h3>Note</h3> <p>This option gets ignored if set
3224 anywhere other than <code class="directive"><a href="#directory"><Directory></a></code>, as <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>
3225 needs real resources to compare against and evaluate from.</p></div>
3228 <dt><code>SymLinksIfOwnerMatch</code></dt>
3230 <dd>The server will only follow symbolic links for which the
3231 target file or directory is owned by the same user id as the
3234 <div class="note"><h3>Note</h3> <p>This option gets ignored if
3235 set inside a <code class="directive"><a href="#location"><Location></a></code> section.</p>
3236 <p>This option should not be considered a security restriction,
3237 since symlink testing is subject to race conditions that make it
3238 circumventable.</p></div>
3242 <p>Normally, if multiple <code class="directive">Options</code> could
3243 apply to a directory, then the most specific one is used and
3244 others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
3245 However if <em>all</em> the options on the
3246 <code class="directive">Options</code> directive are preceded by a
3247 <code>+</code> or <code>-</code> symbol, the options are
3248 merged. Any options preceded by a <code>+</code> are added to the
3249 options currently in force, and any options preceded by a
3250 <code>-</code> are removed from the options currently in
3253 <div class="warning"><h3>Warning</h3>
3254 <p>Mixing <code class="directive">Options</code> with a <code>+</code> or
3255 <code>-</code> with those without is not valid syntax, and is likely
3256 to cause unexpected results.</p>
3259 <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
3261 <div class="example"><p><code>
3262 <Directory /web/docs><br />
3263 <span class="indent">
3264 Options Indexes FollowSymLinks<br />
3266 </Directory><br />
3268 <Directory /web/docs/spec><br />
3269 <span class="indent">
3270 Options Includes<br />
3275 <p>then only <code>Includes</code> will be set for the
3276 <code>/web/docs/spec</code> directory. However if the second
3277 <code class="directive">Options</code> directive uses the <code>+</code> and
3278 <code>-</code> symbols:</p>
3280 <div class="example"><p><code>
3281 <Directory /web/docs><br />
3282 <span class="indent">
3283 Options Indexes FollowSymLinks<br />
3285 </Directory><br />
3287 <Directory /web/docs/spec><br />
3288 <span class="indent">
3289 Options +Includes -Indexes<br />
3294 <p>then the options <code>FollowSymLinks</code> and
3295 <code>Includes</code> are set for the <code>/web/docs/spec</code>
3298 <div class="note"><h3>Note</h3>
3299 <p>Using <code>-IncludesNOEXEC</code> or
3300 <code>-Includes</code> disables server-side includes completely
3301 regardless of the previous setting.</p>
3304 <p>The default in the absence of any other settings is
3305 <code>All</code>.</p>
3308 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3309 <div class="directive-section"><h2><a name="Protocol" id="Protocol">Protocol</a> <a name="protocol" id="protocol">Directiva</a></h2>
3310 <table class="directive">
3311 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Protocol for a listening socket</td></tr>
3312 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Protocol <var>protocol</var></code></td></tr>
3313 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3314 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3315 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3316 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache 2.1.5 and later.
3317 On Windows from Apache 2.3.3 and later.</td></tr>
3319 <p>This directive specifies the protocol used for a specific listening socket.
3320 The protocol is used to determine which module should handle a request, and
3321 to apply protocol specific optimizations with the <code class="directive">AcceptFilter</code>
3324 <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>
3326 <p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
3328 <div class="example"><p><code>
3332 <p>You can also specify the protocol using the <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> directive.</p>
3334 <h3>Consulte también</h3>
3336 <li><code class="directive">AcceptFilter</code></li>
3337 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3340 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3341 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directiva</a></h2>
3342 <table class="directive">
3343 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the CPU consumption of processes launched
3344 by Apache httpd children</td></tr>
3345 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>RLimitCPU <var>seconds</var>|max [<var>seconds</var>|max]</code></td></tr>
3346 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3347 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3348 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3349 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3350 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3352 <p>Takes 1 or 2 parameters. The first parameter sets the soft
3353 resource limit for all processes and the second parameter sets
3354 the maximum resource limit. Either parameter can be a number,
3355 or <code>max</code> to indicate to the server that the limit should
3356 be set to the maximum allowed by the operating system
3357 configuration. Raising the maximum resource limit requires that
3358 the server is running as <code>root</code>, or in the initial startup
3361 <p>This applies to processes forked off from Apache httpd children
3362 servicing requests, not the Apache httpd children themselves. This
3363 includes CGI scripts and SSI exec commands, but not any
3364 processes forked off from the Apache httpd parent such as piped
3367 <p>CPU resource limits are expressed in seconds per
3370 <h3>Consulte también</h3>
3372 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
3373 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
3376 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3377 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directiva</a></h2>
3378 <table class="directive">
3379 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the memory consumption of processes launched
3380 by Apache httpd children</td></tr>
3381 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>RLimitMEM <var>bytes</var>|max [<var>bytes</var>|max]</code></td></tr>
3382 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3383 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3384 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3385 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3386 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3388 <p>Takes 1 or 2 parameters. The first parameter sets the soft
3389 resource limit for all processes and the second parameter sets
3390 the maximum resource limit. Either parameter can be a number,
3391 or <code>max</code> to indicate to the server that the limit should
3392 be set to the maximum allowed by the operating system
3393 configuration. Raising the maximum resource limit requires that
3394 the server is running as <code>root</code>, or in the initial startup
3397 <p>This applies to processes forked off from Apache httpd children
3398 servicing requests, not the Apache httpd children themselves. This
3399 includes CGI scripts and SSI exec commands, but not any
3400 processes forked off from the Apache httpd parent such as piped
3403 <p>Memory resource limits are expressed in bytes per
3406 <h3>Consulte también</h3>
3408 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
3409 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
3412 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3413 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directiva</a></h2>
3414 <table class="directive">
3415 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the number of processes that can be launched by
3416 processes launched by Apache httpd children</td></tr>
3417 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>RLimitNPROC <var>number</var>|max [<var>number</var>|max]</code></td></tr>
3418 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3419 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3420 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3421 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3422 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3424 <p>Takes 1 or 2 parameters. The first parameter sets the soft
3425 resource limit for all processes and the second parameter sets
3426 the maximum resource limit. Either parameter can be a number,
3427 or <code>max</code> to indicate to the server that the limit
3428 should be set to the maximum allowed by the operating system
3429 configuration. Raising the maximum resource limit requires that
3430 the server is running as <code>root</code>, or in the initial startup
3433 <p>This applies to processes forked off from Apache httpd children
3434 servicing requests, not the Apache httpd children themselves. This
3435 includes CGI scripts and SSI exec commands, but not any
3436 processes forked off from the Apache httpd parent such as piped
3439 <p>Process limits control the number of processes per user.</p>
3441 <div class="note"><h3>Note</h3>
3442 <p>If CGI processes are <strong>not</strong> running
3443 under user ids other than the web server user id, this directive
3444 will limit the number of processes that the server itself can
3445 create. Evidence of this situation will be indicated by
3446 <strong><code>cannot fork</code></strong> messages in the
3447 <code>error_log</code>.</p>
3450 <h3>Consulte también</h3>
3452 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
3453 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
3456 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3457 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directiva</a></h2>
3458 <table class="directive">
3459 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Technique for locating the interpreter for CGI
3461 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
3462 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
3463 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3464 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3465 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3466 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3467 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Win32 only;
3468 option <code>Registry-Strict</code> is available in Apache HTTP Server 2.0 and
3471 <p>This directive is used to control how Apache httpd finds the
3472 interpreter used to run CGI scripts. The default setting is
3473 <code>Script</code>. This causes Apache httpd to use the interpreter pointed to
3474 by the shebang line (first line, starting with <code>#!</code>) in the
3475 script. On Win32 systems this line usually looks like:</p>
3477 <div class="example"><p><code>
3478 #!C:/Perl/bin/perl.exe
3481 <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
3483 <div class="example"><p><code>
3487 <p>Setting <code>ScriptInterpreterSource Registry</code> will
3488 cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
3489 searched using the script file extension (e.g., <code>.pl</code>) as a
3490 search key. The command defined by the registry subkey
3491 <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
3492 <code>Shell\Open\Command</code> is used to open the script file. If the
3493 registry keys cannot be found, Apache httpd falls back to the behavior of the
3494 <code>Script</code> option.</p>
3496 <div class="warning"><h3>Security</h3>
3497 <p>Be careful when using <code>ScriptInterpreterSource
3498 Registry</code> with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
3499 Apache httpd will try to execute <strong>every</strong> file within this
3500 directory. The <code>Registry</code> setting may cause undesired
3501 program calls on files which are typically not executed. For
3502 example, the default open command on <code>.htm</code> files on
3503 most Windows systems will execute Microsoft Internet Explorer, so
3504 any HTTP request for an <code>.htm</code> file existing within the
3505 script directory would start the browser in the background on the
3506 server. This is a good way to crash your system within a minute or
3510 <p>The option <code>Registry-Strict</code> which is new in Apache HTTP Server
3511 2.0 does the same thing as <code>Registry</code> but uses only the
3512 subkey <code>Shell\ExecCGI\Command</code>. The
3513 <code>ExecCGI</code> key is not a common one. It must be
3514 configured manually in the windows registry and hence prevents
3515 accidental program calls on your system.</p>
3518 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3519 <div class="directive-section"><h2><a name="SeeRequestTail" id="SeeRequestTail">SeeRequestTail</a> <a name="seerequesttail" id="seerequesttail">Directiva</a></h2>
3520 <table class="directive">
3521 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determine if mod_status displays the first 63 characters
3522 of a request or the last 63, assuming the request itself is greater than
3524 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SeeRequestTail On|Off</code></td></tr>
3525 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>SeeRequestTail Off</code></td></tr>
3526 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3527 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3528 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3529 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.2.7 and later.</td></tr>
3531 <p>mod_status with <code>ExtendedStatus On</code>
3532 displays the actual request being handled.
3533 For historical purposes, only 63 characters of the request
3534 are actually stored for display purposes. This directive
3535 controls whether the 1st 63 characters are stored (the previous
3536 behavior and the default) or if the last 63 characters are. This
3537 is only applicable, of course, if the length of the request is
3538 64 characters or greater.</p>
3540 <p>If Apache httpd is handling <code>GET /disk1/storage/apache/htdocs/images/imagestore1/food/apples.jpg HTTP/1.1</code> mod_status displays as follows:
3543 <table class="bordered">
3545 <th>Off (default)</th>
3546 <td>GET /disk1/storage/apache/htdocs/images/imagestore1/food/apples</td>
3550 <td>orage/apache/htdocs/images/imagestore1/food/apples.jpg HTTP/1.1</td>
3556 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3557 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directiva</a></h2>
3558 <table class="directive">
3559 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Email address that the server includes in error
3560 messages sent to the client</td></tr>
3561 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
3562 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3563 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3564 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3566 <p>The <code class="directive">ServerAdmin</code> sets the contact address
3567 that the server includes in any error messages it returns to the
3568 client. If the <code>httpd</code> doesn't recognize the supplied argument
3570 assumes, that it's an <var>email-address</var> and prepends it with
3571 <code>mailto:</code> in hyperlink targets. However, it's recommended to
3572 actually use an email address, since there are a lot of CGI scripts that
3573 make that assumption. If you want to use an URL, it should point to another
3574 server under your control. Otherwise users may not be able to contact you in
3577 <p>It may be worth setting up a dedicated address for this, e.g.</p>
3579 <div class="example"><p><code>
3580 ServerAdmin www-admin@foo.example.com
3582 <p>as users do not always mention that they are talking about the
3586 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3587 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directiva</a></h2>
3588 <table class="directive">
3589 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Alternate names for a host used when matching requests
3590 to name-virtual hosts</td></tr>
3591 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
3592 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>virtual host</td></tr>
3593 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3594 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3596 <p>The <code class="directive">ServerAlias</code> directive sets the
3597 alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>. The
3598 <code class="directive">ServerAlias</code> may include wildcards, if appropriate.</p>
3600 <div class="example"><p><code>
3601 <VirtualHost *:80><br />
3602 ServerName server.domain.com<br />
3603 ServerAlias server server2.domain.com server2<br />
3604 ServerAlias *.example.com<br />
3605 UseCanonicalName Off<br />
3607 </VirtualHost>
3610 <h3>Consulte también</h3>
3612 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3613 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
3616 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3617 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directiva</a></h2>
3618 <table class="directive">
3619 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Hostname and port that the server uses to identify
3621 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerName [<var>scheme</var>://]<var>fully-qualified-domain-name</var>[:<var>port</var>]</code></td></tr>
3622 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3623 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3624 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3626 <p>The <code class="directive">ServerName</code> directive sets the
3627 request scheme, hostname and
3628 port that the server uses to identify itself. This is used when
3629 creating redirection URLs.</p>
3631 <p>Additionally, <code class="directive">ServerName</code> is used (possibly
3632 in conjunction with <code class="directive">ServerAlias</code>) to uniquely
3633 identify a virtual host, when using <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
3635 <p>For example, if the name of the
3636 machine hosting the web server is <code>simple.example.com</code>,
3637 but the machine also has the DNS alias <code>www.example.com</code>
3638 and you wish the web server to be so identified, the following
3639 directive should be used:</p>
3641 <div class="example"><p><code>
3642 ServerName www.example.com:80
3645 <p>The <code class="directive">ServerName</code> directive
3646 may appear anywhere within the definition of a server. However,
3647 each appearance overrides the previous appearance (within that
3650 <p>If no <code class="directive">ServerName</code> is specified, then the
3651 server attempts to deduce the hostname by performing a reverse
3652 lookup on the IP address. If no port is specified in the
3653 <code class="directive">ServerName</code>, then the server will use the
3654 port from the incoming request. For optimal reliability and
3655 predictability, you should specify an explicit hostname and port
3656 using the <code class="directive">ServerName</code> directive.</p>
3658 <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
3659 the <code class="directive">ServerName</code> inside a
3660 <code class="directive"><a href="#virtualhost"><VirtualHost></a></code>
3661 section specifies what hostname must appear in the request's
3662 <code>Host:</code> header to match this virtual host.</p>
3664 <p>Sometimes, the server runs behind a device that processes SSL,
3665 such as a reverse proxy, load balancer or SSL offload
3666 appliance. When this is the case, specify the
3667 <code>https://</code> scheme and the port number to which the
3668 clients connect in the <code class="directive">ServerName</code> directive
3669 to make sure that the server generates the correct
3670 self-referential URLs.
3673 <p>See the description of the
3674 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> and
3675 <code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code> directives for
3676 settings which determine whether self-referential URLs (e.g., by the
3677 <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
3678 specified port, or to the port number given in the client's request.
3681 <div class="warning">
3682 <p>Failure to set <code class="directive">ServerName</code> to a name that
3683 your server can resolve to an IP address will result in a startup
3684 warning. <code>httpd</code> will then use whatever hostname it can
3685 determine, using the system's <code>hostname</code> command. This
3686 will almost never be the hostname you actually want.</p>
3687 <div class="example"><p><code>
3688 httpd: Could not reliably determine the server's fully qualified domain name, using rocinante.local for ServerName
3693 <h3>Consulte también</h3>
3695 <li><a href="../dns-caveats.html">Issues Regarding DNS and
3696 Apache HTTP Server</a></li>
3697 <li><a href="../vhosts/">Apache HTTP Server virtual host
3698 documentation</a></li>
3699 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3700 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
3701 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
3702 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
3705 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3706 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directiva</a></h2>
3707 <table class="directive">
3708 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Legacy URL pathname for a name-based virtual host that
3709 is accessed by an incompatible browser</td></tr>
3710 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
3711 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>virtual host</td></tr>
3712 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3713 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3715 <p>The <code class="directive">ServerPath</code> directive sets the legacy
3716 URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
3718 <h3>Consulte también</h3>
3720 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
3723 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3724 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directiva</a></h2>
3725 <table class="directive">
3726 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Base directory for the server installation</td></tr>
3727 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
3728 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
3729 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3730 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3731 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3733 <p>The <code class="directive">ServerRoot</code> directive sets the
3734 directory in which the server lives. Typically it will contain the
3735 subdirectories <code>conf/</code> and <code>logs/</code>. Relative
3736 paths in other configuration directives (such as <code class="directive"><a href="#include">Include</a></code> or <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>, for example) are taken as
3737 relative to this directory.</p>
3739 <div class="example"><h3>Example</h3><p><code>
3740 ServerRoot /home/httpd
3744 <h3>Consulte también</h3>
3746 <li><a href="../invoking.html">the <code>-d</code>
3747 option to <code>httpd</code></a></li>
3748 <li><a href="../misc/security_tips.html#serverroot">the
3749 security tips</a> for information on how to properly set
3750 permissions on the <code class="directive">ServerRoot</code></li>
3753 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3754 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directiva</a></h2>
3755 <table class="directive">
3756 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures the footer on server-generated documents</td></tr>
3757 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
3758 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ServerSignature Off</code></td></tr>
3759 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3760 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3761 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3762 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3764 <p>The <code class="directive">ServerSignature</code> directive allows the
3765 configuration of a trailing footer line under server-generated
3766 documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
3767 listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
3768 would want to enable such a footer line is that in a chain of proxies,
3769 the user often has no possibility to tell which of the chained servers
3770 actually produced a returned error message.</p>
3772 <p>The <code>Off</code>
3773 setting, which is the default, suppresses the footer line (and is
3774 therefore compatible with the behavior of Apache-1.2 and
3775 below). The <code>On</code> setting simply adds a line with the
3776 server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
3777 and the <code>EMail</code> setting additionally creates a
3778 "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
3781 <p>After version 2.0.44, the details of the server version number
3782 presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
3784 <h3>Consulte también</h3>
3786 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
3789 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3790 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directiva</a></h2>
3791 <table class="directive">
3792 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures the <code>Server</code> HTTP response
3794 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerTokens Major|Minor|Min[imal]|Prod[uctOnly]|OS|Full</code></td></tr>
3795 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ServerTokens Full</code></td></tr>
3796 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3797 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3798 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3800 <p>This directive controls whether <code>Server</code> response
3801 header field which is sent back to clients includes a
3802 description of the generic OS-type of the server as well as
3803 information about compiled-in modules.</p>
3806 <dt><code>ServerTokens Full</code> (or not specified)</dt>
3808 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3809 (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
3811 <dt><code>ServerTokens Prod[uctOnly]</code></dt>
3813 <dd>Server sends (<em>e.g.</em>): <code>Server:
3816 <dt><code>ServerTokens Major</code></dt>
3818 <dd>Server sends (<em>e.g.</em>): <code>Server:
3819 Apache/2</code></dd>
3821 <dt><code>ServerTokens Minor</code></dt>
3823 <dd>Server sends (<em>e.g.</em>): <code>Server:
3824 Apache/2.4</code></dd>
3826 <dt><code>ServerTokens Min[imal]</code></dt>
3828 <dd>Server sends (<em>e.g.</em>): <code>Server:
3829 Apache/2.4.1</code></dd>
3831 <dt><code>ServerTokens OS</code></dt>
3833 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3838 <p>This setting applies to the entire server, and cannot be
3839 enabled or disabled on a virtualhost-by-virtualhost basis.</p>
3841 <p>After version 2.0.44, this directive also controls the
3842 information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
3844 <div class="note">Setting <code class="directive">ServerTokens</code> to less than
3845 <code>minimal</code> is not recommended because it makes it more
3846 difficult to debug interoperational problems. Also note that
3847 disabling the Server: header does nothing at all to make your
3848 server more secure; the idea of "security through obscurity"
3849 is a myth and leads to a false sense of safety.</div>
3852 <h3>Consulte también</h3>
3854 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
3857 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3858 <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directiva</a></h2>
3859 <table class="directive">
3860 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Forces all matching files to be processed by a
3862 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
3863 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3864 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3865 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3866 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3867 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Moved into the core in Apache httpd 2.0</td></tr>
3869 <p>When placed into an <code>.htaccess</code> file or a
3870 <code class="directive"><a href="#directory"><Directory></a></code> or
3871 <code class="directive"><a href="#location"><Location></a></code>
3872 section, this directive forces all matching files to be parsed
3873 through the <a href="../handler.html">handler</a> given by
3874 <var>handler-name</var>. For example, if you had a directory you
3875 wanted to be parsed entirely as imagemap rule files, regardless
3876 of extension, you might put the following into an
3877 <code>.htaccess</code> file in that directory:</p>
3879 <div class="example"><p><code>
3880 SetHandler imap-file
3883 <p>Another example: if you wanted to have the server display a
3884 status report whenever a URL of
3885 <code>http://servername/status</code> was called, you might put
3886 the following into <code>httpd.conf</code>:</p>
3888 <div class="example"><p><code>
3889 <Location /status><br />
3890 <span class="indent">
3891 SetHandler server-status<br />
3896 <p>You can override an earlier defined <code class="directive">SetHandler</code>
3897 directive by using the value <code>None</code>.</p>
3898 <p><strong>Note:</strong> because SetHandler overrides default handlers,
3899 normal behaviour such as handling of URLs ending in a slash (/) as
3900 directories or index files is suppressed.</p>
3902 <h3>Consulte también</h3>
3904 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
3907 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3908 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directiva</a></h2>
3909 <table class="directive">
3910 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Sets the filters that will process client requests and POST
3912 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
3913 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3914 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3915 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3916 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3918 <p>The <code class="directive">SetInputFilter</code> directive sets the
3919 filter or filters which will process client requests and POST
3920 input when they are received by the server. This is in addition to
3921 any filters defined elsewhere, including the
3922 <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
3925 <p>If more than one filter is specified, they must be separated
3926 by semicolons in the order in which they should process the
3929 <h3>Consulte también</h3>
3931 <li><a href="../filter.html">Filters</a> documentation</li>
3934 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3935 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directiva</a></h2>
3936 <table class="directive">
3937 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Sets the filters that will process responses from the
3939 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
3940 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3941 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3942 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3943 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3945 <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
3946 which will process responses from the server before they are
3947 sent to the client. This is in addition to any filters defined
3948 elsewhere, including the
3949 <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
3952 <p>For example, the following configuration will process all files
3953 in the <code>/www/data/</code> directory for server-side
3956 <div class="example"><p><code>
3957 <Directory /www/data/><br />
3958 <span class="indent">
3959 SetOutputFilter INCLUDES<br />
3964 <p>If more than one filter is specified, they must be separated
3965 by semicolons in the order in which they should process the
3968 <h3>Consulte también</h3>
3970 <li><a href="../filter.html">Filters</a> documentation</li>
3973 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3974 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directiva</a></h2>
3975 <table class="directive">
3976 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Amount of time the server will wait for
3977 certain events before failing a request</td></tr>
3978 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
3979 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>TimeOut 60</code></td></tr>
3980 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3981 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3982 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3984 <p>The <code class="directive">TimeOut</code> directive defines the length
3985 of time Apache httpd will wait for I/O in various circumstances:</p>
3988 <li>When reading data from the client, the length of time to
3989 wait for a TCP packet to arrive if the read buffer is
3992 <li>When writing data to the client, the length of time to wait
3993 for an acknowledgement of a packet if the send buffer is
3996 <li>In <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>, the length of time to wait for
3997 output from a CGI script.</li>
3999 <li>In <code class="module"><a href="../mod/mod_ext_filter.html">mod_ext_filter</a></code>, the length of time to
4000 wait for output from a filtering process.</li>
4002 <li>In <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, the default timeout value if
4003 <code class="directive"><a href="../mod/mod_proxy.html#proxytimeout">ProxyTimeout</a></code> is not
4009 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4010 <div class="directive-section"><h2><a name="TraceEnable" id="TraceEnable">TraceEnable</a> <a name="traceenable" id="traceenable">Directiva</a></h2>
4011 <table class="directive">
4012 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determines the behaviour on <code>TRACE</code> requests</td></tr>
4013 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>TraceEnable <var>[on|off|extended]</var></code></td></tr>
4014 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>TraceEnable on</code></td></tr>
4015 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
4016 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
4017 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
4018 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache HTTP Server 1.3.34, 2.0.55 and later</td></tr>
4020 <p>This directive overrides the behavior of <code>TRACE</code> for both
4021 the core server and <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>. The default
4022 <code>TraceEnable on</code> permits <code>TRACE</code> requests per
4023 RFC 2616, which disallows any request body to accompany the request.
4024 <code>TraceEnable off</code> causes the core server and
4025 <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> to return a <code>405</code> (Method not
4026 allowed) error to the client.</p>
4028 <p>Finally, for testing and diagnostic purposes only, request
4029 bodies may be allowed using the non-compliant <code>TraceEnable
4030 extended</code> directive. The core (as an origin server) will
4031 restrict the request body to 64k (plus 8k for chunk headers if
4032 <code>Transfer-Encoding: chunked</code> is used). The core will
4033 reflect the full headers and all chunk headers with the response
4034 body. As a proxy server, the request body is not restricted to 64k.</p>
4037 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4038 <div class="directive-section"><h2><a name="UnDefine" id="UnDefine">UnDefine</a> <a name="undefine" id="undefine">Directiva</a></h2>
4039 <table class="directive">
4040 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Undefine the existence of a variable</td></tr>
4041 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>UnDefine <var>parameter-name</var></code></td></tr>
4042 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
4043 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
4044 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
4046 <p>Undoes the effect of a <code class="directive"><a href="#define">Define</a></code> or
4047 of passing a <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p>
4048 <p>This directive can be used to toggle the use of <code class="directive"><a href="#ifdefine"><IfDefine></a></code> sections without needing to alter
4049 <code>-D</code> arguments in any startup scripts.</p>
4052 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4053 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directiva</a></h2>
4054 <table class="directive">
4055 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures how the server determines its own name and
4057 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
4058 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>UseCanonicalName Off</code></td></tr>
4059 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
4060 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
4061 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
4063 <p>In many situations Apache httpd must construct a <em>self-referential</em>
4064 URL -- that is, a URL that refers back to the same server. With
4065 <code>UseCanonicalName On</code> Apache httpd will use the hostname and port
4066 specified in the <code class="directive"><a href="#servername">ServerName</a></code>
4067 directive to construct the canonical name for the server. This name
4068 is used in all self-referential URLs, and for the values of
4069 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
4071 <p>With <code>UseCanonicalName Off</code> Apache httpd will form
4072 self-referential URLs using the hostname and port supplied by
4073 the client if any are supplied (otherwise it will use the
4074 canonical name, as defined above). These values are the same
4075 that are used to implement <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
4076 and are available with the same clients. The CGI variables
4077 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
4078 constructed from the client supplied values as well.</p>
4080 <p>An example where this may be useful is on an intranet server
4081 where you have users connecting to the machine using short
4082 names such as <code>www</code>. You'll notice that if the users
4083 type a shortname, and a URL which is a directory, such as
4084 <code>http://www/splat</code>, <em>without the trailing
4085 slash</em> then Apache httpd will redirect them to
4086 <code>http://www.domain.com/splat/</code>. If you have
4087 authentication enabled, this will cause the user to have to
4088 authenticate twice (once for <code>www</code> and once again
4089 for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
4090 FAQ on this subject for more information</a>). But if
4091 <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
4092 Apache httpd will redirect to <code>http://www/splat/</code>.</p>
4094 <p>There is a third option, <code>UseCanonicalName DNS</code>,
4095 which is intended for use with mass IP-based virtual hosting to
4096 support ancient clients that do not provide a
4097 <code>Host:</code> header. With this option Apache httpd does a
4098 reverse DNS lookup on the server IP address that the client
4099 connected to in order to work out self-referential URLs.</p>
4101 <div class="warning"><h3>Warning</h3>
4102 <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
4103 they may be broken by this option. The client is essentially free
4104 to give whatever value they want as a hostname. But if the CGI is
4105 only using <code>SERVER_NAME</code> to construct self-referential URLs
4106 then it should be just fine.</p>
4109 <h3>Consulte también</h3>
4111 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
4112 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
4113 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
4116 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4117 <div class="directive-section"><h2><a name="UseCanonicalPhysicalPort" id="UseCanonicalPhysicalPort">UseCanonicalPhysicalPort</a> <a name="usecanonicalphysicalport" id="usecanonicalphysicalport">Directiva</a></h2>
4118 <table class="directive">
4119 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures how the server determines its own name and
4121 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>UseCanonicalPhysicalPort On|Off</code></td></tr>
4122 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>UseCanonicalPhysicalPort Off</code></td></tr>
4123 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
4124 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
4125 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
4127 <p>In many situations Apache httpd must construct a <em>self-referential</em>
4128 URL -- that is, a URL that refers back to the same server. With
4129 <code>UseCanonicalPhysicalPort On</code> Apache httpd will, when
4130 constructing the canonical port for the server to honor
4131 the <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive,
4132 provide the actual physical port number being used by this request
4133 as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
4134 Apache httpd will not ever use the actual physical port number, instead
4135 relying on all configured information to construct a valid port number.</p>
4137 <div class="note"><h3>Note</h3>
4138 <p>The ordering of when the physical port is used is as follows:<br /><br />
4139 <code>UseCanonicalName On</code></p>
4141 <li>Port provided in <code>Servername</code></li>
4142 <li>Physical port</li>
4143 <li>Default port</li>
4145 <code>UseCanonicalName Off | DNS</code>
4147 <li>Parsed port from <code>Host:</code> header</li>
4148 <li>Physical port</li>
4149 <li>Port provided in <code>Servername</code></li>
4150 <li>Default port</li>
4153 <p>With <code>UseCanonicalPhysicalPort Off</code>, the
4154 physical ports are removed from the ordering.</p>
4158 <h3>Consulte también</h3>
4160 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
4161 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
4162 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
4165 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4166 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost"><VirtualHost></a> <a name="virtualhost" id="virtualhost">Directiva</a></h2>
4167 <table class="directive">
4168 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only to a specific
4169 hostname or IP address</td></tr>
4170 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><VirtualHost
4171 <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
4172 ...> ... </VirtualHost></code></td></tr>
4173 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
4174 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
4175 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
4177 <p><code class="directive"><VirtualHost></code> and
4178 <code></VirtualHost></code> are used to enclose a group of
4179 directives that will apply only to a particular virtual host. Any
4180 directive that is allowed in a virtual host context may be
4181 used. When the server receives a request for a document on a
4182 particular virtual host, it uses the configuration directives
4183 enclosed in the <code class="directive"><VirtualHost></code>
4184 section. <var>Addr</var> can be:</p>
4187 <li>The IP address of the virtual host;</li>
4189 <li>A fully qualified domain name for the IP address of the
4190 virtual host (not recommended);</li>
4192 <li>The character <code>*</code>, which is used only in combination with
4193 <code>NameVirtualHost *</code> to match all IP addresses; or</li>
4195 <li>The string <code>_default_</code>, which is used only
4196 with IP virtual hosting to catch unmatched IP addresses.</li>
4199 <div class="example"><h3>Example</h3><p><code>
4200 <VirtualHost 10.1.2.3><br />
4201 <span class="indent">
4202 ServerAdmin webmaster@host.example.com<br />
4203 DocumentRoot /www/docs/host.example.com<br />
4204 ServerName host.example.com<br />
4205 ErrorLog logs/host.example.com-error_log<br />
4206 TransferLog logs/host.example.com-access_log<br />
4208 </VirtualHost>
4212 <p>IPv6 addresses must be specified in square brackets because
4213 the optional port number could not be determined otherwise. An
4214 IPv6 example is shown below:</p>
4216 <div class="example"><p><code>
4217 <VirtualHost [2001:db8::a00:20ff:fea7:ccea]><br />
4218 <span class="indent">
4219 ServerAdmin webmaster@host.example.com<br />
4220 DocumentRoot /www/docs/host.example.com<br />
4221 ServerName host.example.com<br />
4222 ErrorLog logs/host.example.com-error_log<br />
4223 TransferLog logs/host.example.com-access_log<br />
4225 </VirtualHost>
4228 <p>Each Virtual Host must correspond to a different IP address,
4229 different port number or a different host name for the server,
4230 in the former case the server machine must be configured to
4231 accept IP packets for multiple addresses. (If the machine does
4232 not have multiple network interfaces, then this can be
4233 accomplished with the <code>ifconfig alias</code> command -- if
4234 your OS supports it).</p>
4236 <div class="note"><h3>Note</h3>
4237 <p>The use of <code class="directive"><VirtualHost></code> does
4238 <strong>not</strong> affect what addresses Apache httpd listens on. You
4239 may need to ensure that Apache httpd is listening on the correct addresses
4240 using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
4243 <p>When using IP-based virtual hosting, the special name
4244 <code>_default_</code> can be specified in
4245 which case this virtual host will match any IP address that is
4246 not explicitly listed in another virtual host. In the absence
4247 of any <code>_default_</code> virtual host the "main" server config,
4248 consisting of all those definitions outside any VirtualHost
4249 section, is used when no IP-match occurs.</p>
4251 <p>You can specify a <code>:port</code> to change the port that is
4252 matched. If unspecified then it defaults to the same port as the
4253 most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
4254 statement of the main server. You may also specify <code>:*</code>
4255 to match all ports on that address. (This is recommended when used
4256 with <code>_default_</code>.)</p>
4258 <p>A <code class="directive"><a href="#servername">ServerName</a></code> should be
4259 specified inside each <code class="directive"><VirtualHost></code> block. If it is absent, the
4260 <code class="directive"><a href="#servername">ServerName</a></code> from the "main"
4261 server configuration will be inherited.</p>
4263 <p>If no matching virtual host is found, then the first listed
4264 virtual host that matches the IP address will be used. As a
4265 consequence, the first listed virtual host is the default virtual
4268 <div class="warning"><h3>Security</h3>
4269 <p>See the <a href="../misc/security_tips.html">security tips</a>
4270 document for details on why your security could be compromised if the
4271 directory where log files are stored is writable by anyone other
4272 than the user that starts the server.</p>
4275 <h3>Consulte también</h3>
4277 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
4278 <li><a href="../dns-caveats.html">Issues Regarding DNS and
4279 Apache HTTP Server</a></li>
4280 <li><a href="../bind.html">Setting
4281 which addresses and ports Apache HTTP Server uses</a></li>
4282 <li><a href="../sections.html">How <Directory>, <Location>
4283 and <Files> sections work</a> for an explanation of how these
4284 different sections are combined when a request is received</li>
4288 <div class="bottomlang">
4289 <p><span>Idiomas disponibles: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
4290 <a href="../en/mod/core.html" hreflang="en" rel="alternate" title="English"> en </a> |
4291 <a href="../es/mod/core.html" title="Español"> es </a> |
4292 <a href="../fr/mod/core.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
4293 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
4294 <a href="../tr/mod/core.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
4295 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comentarios</a></h2><div class="warning"><strong>This section is experimental!</strong><br />Comments placed here should not be expected
4296 to last beyond the testing phase of this system, nor do we in any way guarantee that we'll read them.</div>
4297 <script type="text/javascript"><!--//--><![CDATA[//><!--
4298 var disqus_shortname = 'httpd';
4299 var disqus_identifier = 'http://httpd.apache.org/docs/2.4/mod/core.html.es';
4301 var disabled = true;
4302 if (w.location.hostname.toLowerCase() == "httpd.apache.org" && disabled !== true) {
4303 d.write('<div id="disqus_thread"><\/div>');
4304 var s = d.createElement('script');
4305 s.type = 'text/javascript';
4307 s.src = 'http' + '://' + disqus_shortname + '.disqus.com/embed.js';
4308 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
4311 d.write('<div id="disqus_thread">Comments are disabled for this page at the moment.<\/div>');
4313 })(window, document);
4314 //--><!]]></script></div><div id="footer">
4315 <p class="apache">Copyright 2012 The Apache Software Foundation.<br />Licencia bajo los términos de la <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
4316 <p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Directivas</a> | <a href="http://wiki.apache.org/httpd/FAQ">Preguntas Frecuentes</a> | <a href="../glossary.html">Glosario</a> | <a href="../sitemap.html">Mapa de este sitio web</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
4317 if (typeof(prettyPrint) !== 'undefined') {