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" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Directivas</a> | <a href="../faq/">Preguntas Frecuentes</a> | <a href="../glossary.html">Glosario</a> | <a href="../sitemap.html">Mapa de este sitio web</a></p>
16 <p class="apache">Versión 2.3 del Servidor HTTP Apache</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <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.3</a> > <a href="./">Módulos</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Funcionalidad Básica de Apache</h1>
24 <p><span>Idiomas disponibles: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
25 <a href="../en/mod/core.html" hreflang="en" rel="alternate" title="English"> en </a> |
26 <a href="../es/mod/core.html" title="Español"> es </a> |
27 <a href="../fr/mod/core.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
28 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
29 <a href="../tr/mod/core.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
31 <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>
32 <tr><th><a href="module-dict.html#Status">Estado:</a></th><td>Core</td></tr></table>
34 <div id="quickview"><h3 class="directives">Directivas</h3>
36 <li><img alt="" src="../images/down.gif" /> <a href="#acceptfilter">AcceptFilter</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#allowencodedslashes">AllowEncodedSlashes</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverridelist">AllowOverrideList</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#define">Define</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#directory"><Directory></a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch"><DirectoryMatch></a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#else"><Else></a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#elseif"><ElseIf></a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#error">Error</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#errorlogformat">ErrorLogFormat</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#extendedstatus">ExtendedStatus</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#files"><Files></a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch"><FilesMatch></a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#gprofdir">GprofDir</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#if"><If></a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine"><IfDefine></a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule"><IfModule></a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#limit"><Limit></a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept"><LimitExcept></a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#location"><Location></a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch"><LocationMatch></a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#maxranges">MaxRanges</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#mutex">Mutex</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#protocol">Protocol</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#seerequesttail">SeeRequestTail</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
94 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
95 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
96 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
97 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
98 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
99 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
100 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
101 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
102 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
103 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
104 <li><img alt="" src="../images/down.gif" /> <a href="#traceenable">TraceEnable</a></li>
105 <li><img alt="" src="../images/down.gif" /> <a href="#undefine">UnDefine</a></li>
106 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
107 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></li>
108 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost"><VirtualHost></a></li>
112 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
113 <div class="directive-section"><h2><a name="AcceptFilter" id="AcceptFilter">AcceptFilter</a> <a name="acceptfilter" id="acceptfilter">Directiva</a></h2>
114 <table class="directive">
115 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configura mejoras para un Protocolo de Escucha de Sockets</td></tr>
116 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AcceptFilter <var>protocol</var> <var>accept_filter</var></code></td></tr>
117 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
118 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
119 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
120 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Disponible en Apache httpd 2.1.5 y posteriores.
121 En Windows desde Apache httpd 2.3.3 y posteriores.</td></tr>
123 <p>Esta directiva hace posible mejoras específicas a nivel de sistema operativo
124 y a través del tipo de Protocolo para un socket que escucha.
125 La premisa básica es que el kernel no envíe un socket al servidor
126 hasta que o bien los datos se hayan recibido o bien se haya almacenado
127 en el buffer una Respuesta HTTP completa.
128 Actualmente sólo están soportados
129 <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&sektion=9">
130 Accept Filters</a> sobre FreeBSD, <code>TCP_DEFER_ACCEPT</code> sobre Linux,
131 y AcceptEx() sobre Windows.</p>
133 <p>El uso de <code>none</code> para un argumento desactiva cualquier filtro
134 aceptado para ese protocolo. Esto es útil para protocolos que requieren que un
135 servidor envíe datos primeros, tales como <code>ftp:</code> o <code>nntp</code>:</p>
136 <div class="example"><p><code>AcceptFilter nntp none</code></p></div>
138 <p>Los nombres de protocolo por defecto son <code>https</code> para el puerto 443
139 y <code>http</code> para todos los demás puertos. Para especificar que se está
140 utilizando otro protocolo con un puerto escuchando, añade el argumento <var>protocol</var>
141 a la directiva <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
143 <p>Sobre FreeBDS los valores por defecto:</p>
144 <div class="example"><p><code>
145 AcceptFilter http httpready <br />
146 AcceptFilter https dataready
149 <p>El filtro <code>httpready</code> almacena en el buffer peticiones HTTP completas
150 a nivel de kernel. Una vez que la petición es recibida, el kernel la envía al servidor.
151 Consulta la página man de
152 <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&sektion=9">
153 accf_http(9)</a> para más detalles. Puesto que las peticiones HTTPS
154 están encriptadas, sólo se utiliza el filtro
155 <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&sektion=9">accf_data(9)</a>.</p>
157 <p>Sobre Linux los valores por defecto son:</p>
158 <div class="example"><p><code>
159 AcceptFilter http data <br />
160 AcceptFilter https data
163 <p>En Linux, <code>TCP_DEFER_ACCEPT</code> no soporta el buffering en peticiones http.
164 Cualquier valor además de <code>none</code> habilitará
165 <code>TCP_DEFER_ACCEPT</code> en ese socket. Para más detalles
166 ver la página man de Linux
167 <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
170 <p>Sobre Windows los valores por defecto son:</p>
171 <div class="example"><p><code>
172 AcceptFilter http data <br />
173 AcceptFilter https data
176 <p>Sobre Windows mpm_winnt interpreta el argumento AcceptFilter para conmutar la API
177 AcceptEx(), y no soporta el buffering sobre el protocolo http. Hay dos valores
178 que utilizan la API Windows AcceptEx() y que recuperan sockets de red
179 entre conexciones. <code>data</code> espera hasta que los datos han sido
180 transmitidos como se comentaba anteriormente, y el buffer inicial de datos y las
181 direcciones de red son recuperadas a partir de una única llamada AcceptEx().
182 <code>connect</code> utiliza la API AcceptEx() API, y recupera también
183 las direccciones de red, pero a diferencia de <code>none</code>
184 la opción <code>connect</code> no espera a la transmisión inicial de los datos.</p>
186 <p>Sobre Windows, <code>none</code> prefiere accept() antes que AcceptEx()
187 y no recuperará sockets entre las conexiones. Lo que es útil para los adaptadores de
188 red con un soporte precario de drivers, así como para algunos proveedores de red
189 tales como drivers vpn, o filtros de spam, de virus o de spyware.</p>
192 <h3>Consulte también</h3>
194 <li><code class="directive">Protocol</code></li>
197 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
198 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directiva</a></h2>
199 <table class="directive">
200 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Los recursos aceptan información sobre su ruta</td></tr>
201 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
202 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
203 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
204 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
205 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
206 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
207 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Disponible en Apache httpd 2.0.30 y posteriores</td></tr>
210 <p>Esta directiva controla si las peticiones que contienen información sobre la ruta
211 que sigue un fichero que existe (o un fichero que no existe pero en un directorio que
212 sí existe) serán aceptadas o denegadas. La información de ruta puede estar disponible
213 para los scripts en la variable de entorno <code>PATH_INFO</code>.</p>
215 <p>Por ejemplo, asumamos que la ubicación <code>/test/</code> apunta a
216 un directorio que contiene únicamente el fichero
217 <code>here.html</code>. Entonces, las peticiones tanto para
218 <code>/test/here.html/more</code> como para
219 <code>/test/nothere.html/more</code> recogen
220 <code>/more</code> como <code>PATH_INFO</code>.</p>
222 <p>Los tres posibles argumentos para la directiva
223 <code class="directive">AcceptPathInfo</code> son los siguientes:</p>
225 <dt><code>Off</code></dt><dd>Una petición sólo será aceptada si
226 se corresponde con una ruta literal que existe. Por lo tanto, una petición
227 con una información de ruta después del nombre de fichero tal como
228 <code>/test/here.html/more</code> en el ejemplo anterior devolverá
229 un error 404 NOT FOUND.</dd>
231 <dt><code>On</code></dt><dd>Una petición será aceptada si una
232 ruta principal de acceso se corresponde con un fichero que existe. El ejemplo
233 anterior <code>/test/here.html/more</code> será aceptado si
234 <code>/test/here.html</code> corresponde a un fichero válido.</dd>
236 <dt><code>Default</code></dt><dd>La gestión de las peticiones
237 con información de ruta está determinada por el <a href="../handler.html">controlador</a> responsable de la petición.
238 El controlador principal para para ficheros normales rechaza por defecto
239 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
240 <code>PATH_INFO</code> por defecto.</dd>
243 <p>El objetivo principal de la directiva <code>AcceptPathInfo</code>
244 es permitirte sobreescribir la opción del controlador
245 de aceptar or rechazar <code>PATH_INFO</code>. Este tipo de sobreescritura se necesita,
246 por ejemplo, cuando utilizas un <a href="../filter.html">filtro</a>, tal como
247 <a href="mod_include.html">INCLUDES</a>, para generar contenido
248 basado en <code>PATH_INFO</code>. El controlador principal normalmente rechazaría
249 la petición, de modo que puedes utilizar la siguiente configuración para habilitarla
252 <div class="example"><p><code>
253 <Files "mypaths.shtml"><br />
254 <span class="indent">
255 Options +Includes<br />
256 SetOutputFilter INCLUDES<br />
257 AcceptPathInfo On<br />
264 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
265 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directiva</a></h2>
266 <table class="directive">
267 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Nombre del fichero distribuido de configuración</td></tr>
268 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
269 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
270 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
271 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
272 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
274 <p>Mientras que procesa una petición el servidor busca
275 el primer fichero de configuración existente dentro de un listado de nombres en
276 cada directorio de la ruta del documento, si los ficheros distribuidos
277 de configuración están <a href="#allowoverride">habilitados para ese
278 directorio</a>. Por ejemplo:</p>
280 <div class="example"><p><code>
284 <p>antes de servir el documento
285 <code>/usr/local/web/index.html</code>, el servidor leerá
286 <code>/.acl</code>, <code>/usr/.acl</code>,
287 <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
288 para las directivas, salvo que estén deshabilitadas with</p>
290 <div class="example"><p><code>
291 <Directory /><br />
292 <span class="indent">
293 AllowOverride None<br />
298 <h3>Consulte también</h3>
300 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
301 <li><a href="../configuring.html">Configuration Files</a></li>
302 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
305 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
306 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directiva</a></h2>
307 <table class="directive">
308 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Default charset parameter to be added when a response
309 content-type is <code>text/plain</code> or <code>text/html</code></td></tr>
310 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
311 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
312 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
313 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
314 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
315 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
317 <p>This directive specifies a default value for the media type
318 charset parameter (the name of a character encoding) to be added
319 to a response if and only if the response's content-type is either
320 <code>text/plain</code> or <code>text/html</code>. This should override
321 any charset specified in the body of the response via a <code>META</code>
322 element, though the exact behavior is often dependent on the user's client
323 configuration. A setting of <code>AddDefaultCharset Off</code>
324 disables this functionality. <code>AddDefaultCharset On</code> enables
325 a default charset of <code>iso-8859-1</code>. Any other value is assumed
326 to be the <var>charset</var> to be used, which should be one of the
327 <a href="http://www.iana.org/assignments/character-sets">IANA registered
328 charset values</a> for use in Internet media types (MIME types).
331 <div class="example"><p><code>
332 AddDefaultCharset utf-8
335 <p><code class="directive">AddDefaultCharset</code> should only be used when all
336 of the text resources to which it applies are known to be in that
337 character encoding and it is too inconvenient to label their charset
338 individually. One such example is to add the charset parameter
339 to resources containing generated content, such as legacy CGI
340 scripts, that might be vulnerable to cross-site scripting attacks
341 due to user-provided data being included in the output. Note, however,
342 that a better solution is to just fix (or delete) those scripts, since
343 setting a default charset does not protect users that have enabled
344 the "auto-detect character encoding" feature on their browser.</p>
346 <h3>Consulte también</h3>
348 <li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li>
351 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
352 <div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directiva</a></h2>
353 <table class="directive">
354 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determines whether encoded path separators in URLs are allowed to
355 be passed through</td></tr>
356 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
357 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
358 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
359 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
360 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
361 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.0.46 and later</td></tr>
363 <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
364 which contain encoded path separators (<code>%2F</code> for <code>/</code>
365 and additionally <code>%5C</code> for <code>\</code> on according systems)
366 to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
368 <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
369 mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
371 <div class="note"><h3>Note</h3>
372 <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
373 Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
374 according systems) will be left as such in the otherwise decoded URL
378 <h3>Consulte también</h3>
380 <li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
383 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
384 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directiva</a></h2>
385 <table class="directive">
386 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Types of directives that are allowed in
387 <code>.htaccess</code> files</td></tr>
388 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
389 [<var>directive-type</var>] ...</code></td></tr>
390 <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>
391 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory</td></tr>
392 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
393 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
395 <p>When the server finds an <code>.htaccess</code> file (as
396 specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
397 it needs to know which directives declared in that file can override
398 earlier configuration directives.</p>
400 <div class="note"><h3>Only available in <Directory> sections</h3>
401 <code class="directive">AllowOverride</code> is valid only in
402 <code class="directive"><a href="#directory"><Directory></a></code>
403 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
404 <code class="directive"><a href="#files"><Files></a></code> sections.
407 <p>When this directive is set to <code>None</code>, then
408 <a href="#accessfilename">.htaccess</a> files are completely ignored.
409 In this case, the server will not even attempt to read
410 <code>.htaccess</code> files in the filesystem.</p>
412 <p>When this directive is set to <code>All</code>, then any
413 directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
414 <code>.htaccess</code> files.</p>
416 <p>The <var>directive-type</var> can be one of the following
417 groupings of directives.</p>
424 Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
425 <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
426 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
427 <code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code>,
428 <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>
433 Allow use of the directives controlling document types
434 (<code class="directive"><a href="#errordocument">ErrorDocument</a></code>,
435 <code class="directive"><a href="#forcetype">ForceType</a></code>,
436 <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>,
437 <code class="directive"><a href="#sethandler">SetHandler</a></code>,
438 <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>,
439 <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and
440 <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove* directives),
441 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>),
442 <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
443 <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> from
444 <code class="module"><a href="../mod/mod_actions.html">mod_actions</a></code>.
450 Allow use of the directives controlling directory indexing
451 (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
452 <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>,
453 <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
454 <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>,
460 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>
462 <dt>Options[=<var>Option</var>,...]</dt>
465 Allow use of the directives controlling specific directory
466 features (<code class="directive"><a href="#options">Options</a></code> and
467 <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).
468 An equal sign may be given followed by a comma (but no spaces)
469 separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
474 <div class="example"><p><code>
475 AllowOverride AuthConfig Indexes
478 <p>In the example above all directives that are neither in the group
479 <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
482 <div class="note"><p>For security and performance reasons, do not set
483 <code>AllowOverride</code> to anything other than <code>None</code>
484 in your <code><Directory /></code> block. Instead, find (or
485 create) the <code><Directory></code> block that refers to the
486 directory where you're actually planning to place a
487 <code>.htaccess</code> file.</p>
490 <h3>Consulte también</h3>
492 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
493 <li><a href="../configuring.html">Configuration Files</a></li>
494 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
497 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
498 <div class="directive-section"><h2><a name="AllowOverrideList" id="AllowOverrideList">AllowOverrideList</a> <a name="allowoverridelist" id="allowoverridelist">Directiva</a></h2>
499 <table class="directive">
500 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Individual directives that are allowed in
501 <code>.htaccess</code> files</td></tr>
502 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>AllowOverrideList None|<var>directive</var>
503 [<var>directive-type</var>] ...</code></td></tr>
504 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>AllowOverrideList None</code></td></tr>
505 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory</td></tr>
506 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
507 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
508 </table><p>The documentation for this directive has
509 not been translated yet. Please have a look at the English
510 version.</p><h3>Consulte también</h3>
512 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
513 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
514 <li><a href="../configuring.html">Configuration Files</a></li>
515 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
518 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
519 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directiva</a></h2>
520 <table class="directive">
521 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Technique for locating the interpreter for CGI
523 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
524 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
525 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
526 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
527 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
528 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>NetWare only</td></tr>
530 <p>This directive is used to control how Apache httpd finds the
531 interpreter used to run CGI scripts. For example, setting
532 <code>CGIMapExtension sys:\foo.nlm .foo</code> will
533 cause all CGI script files with a <code>.foo</code> extension to
534 be passed to the FOO interpreter.</p>
537 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
538 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directiva</a></h2>
539 <table class="directive">
540 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enables the generation of <code>Content-MD5</code> HTTP Response
542 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ContentDigest On|Off</code></td></tr>
543 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ContentDigest Off</code></td></tr>
544 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
545 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>Options</td></tr>
546 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
547 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
549 <p>This directive enables the generation of
550 <code>Content-MD5</code> headers as defined in RFC1864
551 respectively RFC2616.</p>
553 <p>MD5 is an algorithm for computing a "message digest"
554 (sometimes called "fingerprint") of arbitrary-length data, with
555 a high degree of confidence that any alterations in the data
556 will be reflected in alterations in the message digest.</p>
558 <p>The <code>Content-MD5</code> header provides an end-to-end
559 message integrity check (MIC) of the entity-body. A proxy or
560 client may check this header for detecting accidental
561 modification of the entity-body in transit. Example header:</p>
563 <div class="example"><p><code>
564 Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
567 <p>Note that this can cause performance problems on your server
568 since the message digest is computed on every request (the
569 values are not cached).</p>
571 <p><code>Content-MD5</code> is only sent for documents served
572 by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
573 SSI documents, output from CGI scripts, and byte range responses
574 do not have this header.</p>
577 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
578 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directiva</a></h2>
579 <table class="directive">
580 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>This directive has no effect other than to emit warnings
581 if the value is not <code>none</code>. In prior versions, DefaultType
582 would specify a default media type to assign to response content for
583 which no other media type configuration could be found.
585 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>DefaultType <var>media-type|none</var></code></td></tr>
586 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>DefaultType none</code></td></tr>
587 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
588 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
589 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
590 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
591 <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>
593 <p>This directive has been disabled. For backwards compatibility
594 of configuration files, it may be specified with the value
595 <code>none</code>, meaning no default media type. For example:</p>
597 <div class="example"><p><code>
601 <p><code>DefaultType None</code> is only available in
602 httpd-2.2.7 and later.</p>
604 <p>Use the mime.types configuration file and the
605 <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> to configure media
606 type assignments via file extensions, or the
607 <code class="directive"><a href="#forcetype">ForceType</a></code> directive to configure
608 the media type for specific resources. Otherwise, the server will
609 send the response without a Content-Type header field and the
610 recipient may attempt to guess the media type.</p>
613 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
614 <div class="directive-section"><h2><a name="Define" id="Define">Define</a> <a name="define" id="define">Directiva</a></h2>
615 <table class="directive">
616 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Define the existence of a variable</td></tr>
617 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Define <var>parameter-name</var></code></td></tr>
618 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
619 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
620 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
622 <p>Equivalent to passing the <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p>
623 <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
624 <code>-D</code> arguments in any startup scripts.</p>
627 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
628 <div class="directive-section"><h2><a name="Directory" id="Directory"><Directory></a> <a name="directory" id="directory">Directiva</a></h2>
629 <table class="directive">
630 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enclose a group of directives that apply only to the
631 named file-system directory, sub-directories, and their contents.</td></tr>
632 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Directory <var>directory-path</var>>
633 ... </Directory></code></td></tr>
634 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
635 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
636 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
638 <p><code class="directive"><Directory></code> and
639 <code></Directory></code> are used to enclose a group of
640 directives that will apply only to the named directory,
641 sub-directories of that directory, and the files within the respective
642 directories. Any directive that is allowed
643 in a directory context may be used. <var>Directory-path</var> is
644 either the full path to a directory, or a wild-card string using
645 Unix shell-style matching. In a wild-card string, <code>?</code> matches
646 any single character, and <code>*</code> matches any sequences of
647 characters. You may also use <code>[]</code> character ranges. None
648 of the wildcards match a `/' character, so <code><Directory
649 /*/public_html></code> will not match
650 <code>/home/user/public_html</code>, but <code><Directory
651 /home/*/public_html></code> will match. Example:</p>
653 <div class="example"><p><code>
654 <Directory /usr/local/httpd/htdocs><br />
655 <span class="indent">
656 Options Indexes FollowSymLinks<br />
662 <p>Be careful with the <var>directory-path</var> arguments:
663 They have to literally match the filesystem path which Apache httpd uses
664 to access the files. Directives applied to a particular
665 <code><Directory></code> will not apply to files accessed from
666 that same directory via a different path, such as via different symbolic
670 <p><a class="glossarylink" href="../glossary.html#regex" title="ver glosario">Regular
671 expressions</a> can also be used, with the addition of the
672 <code>~</code> character. For example:</p>
674 <div class="example"><p><code>
675 <Directory ~ "^/www/.*/[0-9]{3}">
678 <p>would match directories in <code>/www/</code> that consisted of
681 <p>If multiple (non-regular expression) <code class="directive"><Directory></code> sections
682 match the directory (or one of its parents) containing a document,
683 then the directives are applied in the order of shortest match
684 first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
687 <div class="example"><p><code>
688 <Directory /><br />
689 <span class="indent">
690 AllowOverride None<br />
692 </Directory><br />
694 <Directory /home/><br />
695 <span class="indent">
696 AllowOverride FileInfo<br />
701 <p>for access to the document <code>/home/web/dir/doc.html</code>
705 <li>Apply directive <code>AllowOverride None</code>
706 (disabling <code>.htaccess</code> files).</li>
708 <li>Apply directive <code>AllowOverride FileInfo</code> (for
709 directory <code>/home</code>).</li>
711 <li>Apply any <code>FileInfo</code> directives in
712 <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
713 <code>/home/web/dir/.htaccess</code> in that order.</li>
716 <p>Regular expressions are not considered until after all of the
717 normal sections have been applied. Then all of the regular
718 expressions are tested in the order they appeared in the
719 configuration file. For example, with</p>
721 <div class="example"><p><code>
722 <Directory ~ abc$><br />
723 <span class="indent">
724 # ... directives here ...<br />
729 <p>the regular expression section won't be considered until after
730 all normal <code class="directive"><Directory></code>s and
731 <code>.htaccess</code> files have been applied. Then the regular
732 expression will match on <code>/home/abc/public_html/abc</code> and
733 the corresponding <code class="directive"><Directory></code> will
736 <p><strong>Note that the default access for
737 <code><Directory /></code> is <code>Allow from All</code>.
738 This means that Apache httpd will serve any file mapped from an URL. It is
739 recommended that you change this with a block such
742 <div class="example"><p><code>
743 <Directory /><br />
744 <span class="indent">
745 Order Deny,Allow<br />
751 <p><strong>and then override this for directories you
752 <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
753 details.</strong></p>
755 <p>The directory sections occur in the <code>httpd.conf</code> file.
756 <code class="directive"><Directory></code> directives
757 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>
759 <h3>Consulte también</h3>
761 <li><a href="../sections.html">How <Directory>,
762 <Location> and <Files> sections work</a> for an
763 explanation of how these different sections are combined when a
764 request is received</li>
767 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
768 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch"><DirectoryMatch></a> <a name="directorymatch" id="directorymatch">Directiva</a></h2>
769 <table class="directive">
770 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enclose directives that apply to
771 the contents of file-system directories matching a regular expression.</td></tr>
772 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><DirectoryMatch <var>regex</var>>
773 ... </DirectoryMatch></code></td></tr>
774 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
775 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
776 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
778 <p><code class="directive"><DirectoryMatch></code> and
779 <code></DirectoryMatch></code> are used to enclose a group
780 of directives which will apply only to the named directory (and the files within),
781 the same as <code class="directive"><a href="#directory"><Directory></a></code>.
782 However, it takes as an argument a
783 <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">regular expression</a>. For example:</p>
785 <div class="example"><p><code>
786 <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
789 <p>would match directories in <code>/www/</code> that consisted of three
792 <div class="note"><h3>Compatability</h3>
793 Prior to 2.3.9, this directive implicitly applied to sub-directories
794 (like <code class="directive"><a href="#directory"><Directory></a></code>) and
795 could not match the end of line symbol ($). In 2.3.9 and later,
796 only directories that match the expression are affected by the enclosed
800 <div class="note"><h3>Trailing Slash</h3>
801 This directive applies to requests for directories that may or may
802 not end in a trailing slash, so expressions that are anchored to the
803 end of line ($) must be written with care.
806 <h3>Consulte también</h3>
808 <li><code class="directive"><a href="#directory"><Directory></a></code> for
809 a description of how regular expressions are mixed in with normal
810 <code class="directive"><Directory></code>s</li>
811 <li><a href="../sections.html">How <Directory>, <Location> and
812 <Files> sections work</a> for an explanation of how these different
813 sections are combined when a request is received</li>
816 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
817 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directiva</a></h2>
818 <table class="directive">
819 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Directory that forms the main document tree visible
820 from the web</td></tr>
821 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
822 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
823 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
824 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
825 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
827 <p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
828 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
829 path from the requested URL to the document root to make the
830 path to the document. Example:</p>
832 <div class="example"><p><code>
833 DocumentRoot /usr/web
837 <code>http://www.my.host.com/index.html</code> refers to
838 <code>/usr/web/index.html</code>. If the <var>directory-path</var> is
839 not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
841 <p>The <code class="directive">DocumentRoot</code> should be specified without
842 a trailing slash.</p>
844 <h3>Consulte también</h3>
846 <li><a href="../urlmapping.html#documentroot">Mapping URLs to Filesystem
850 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
851 <div class="directive-section"><h2><a name="Else" id="Else"><Else></a> <a name="else" id="else">Directiva</a></h2>
852 <table class="directive">
853 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only if the condition of a
854 previous <code class="directive"><a href="#if"><If></a></code> or
855 <code class="directive"><a href="#elseif"><ElseIf></a></code> section is not
856 satisfied by a request at runtime</td></tr>
857 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Else> ... </Else></code></td></tr>
858 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
859 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
860 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
861 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
862 </table><p>The documentation for this directive has
863 not been translated yet. Please have a look at the English
864 version.</p><h3>Consulte también</h3>
866 <li><code class="directive"><a href="#if"><If></a></code></li>
867 <li><code class="directive"><a href="#elseif"><ElseIf></a></code></li>
868 <li><a href="../sections.html">How <Directory>, <Location>,
869 <Files> sections work</a> for an explanation of how these
870 different sections are combined when a request is received.
871 <code class="directive"><If></code>,
872 <code class="directive"><ElseIf></code>, and
873 <code class="directive"><Else></code> are applied last.</li>
876 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
877 <div class="directive-section"><h2><a name="ElseIf" id="ElseIf"><ElseIf></a> <a name="elseif" id="elseif">Directiva</a></h2>
878 <table class="directive">
879 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only if a condition is satisfied
880 by a request at runtime while the condition of a previous
881 <code class="directive"><a href="#if"><If></a></code> or
882 <code class="directive"><ElseIf></code> section is not
884 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><ElseIf <var>expression</var>> ... </ElseIf></code></td></tr>
885 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
886 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
887 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
888 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
889 </table><p>The documentation for this directive has
890 not been translated yet. Please have a look at the English
891 version.</p><h3>Consulte también</h3>
893 <li><a href="../expr.html">Expressions in Apache HTTP Server</a>,
894 for a complete reference and more examples.</li>
895 <li><code class="directive"><a href="#if"><If></a></code></li>
896 <li><code class="directive"><a href="#else"><Else></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="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directiva</a></h2>
907 <table class="directive">
908 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
909 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
910 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>EnableMMAP On</code></td></tr>
911 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
912 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
913 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
914 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
916 <p>This directive controls whether the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use
917 memory-mapping if it needs to read the contents of a file during
918 delivery. By default, when the handling of a request requires
919 access to the data within a file -- for example, when delivering a
920 server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache httpd
921 memory-maps the file if the OS supports it.</p>
923 <p>This memory-mapping sometimes yields a performance improvement.
924 But in some environments, it is better to disable the memory-mapping
925 to prevent operational problems:</p>
928 <li>On some multiprocessor systems, memory-mapping can reduce the
929 performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
930 <li>Deleting or truncating a file while <code class="program"><a href="../programs/httpd.html">httpd</a></code>
931 has it memory-mapped can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
932 crash with a segmentation fault.
936 <p>For server configurations that are vulnerable to these problems,
937 you should disable memory-mapping of delivered files by specifying:</p>
939 <div class="example"><p><code>
943 <p>For NFS mounted files, this feature may be disabled explicitly for
944 the offending files by specifying:</p>
946 <div class="example"><p><code>
947 <Directory "/path-to-nfs-files">
948 <span class="indent">
955 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
956 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directiva</a></h2>
957 <table class="directive">
958 <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>
959 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
960 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>EnableSendfile Off</code></td></tr>
961 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
962 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
963 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
964 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
965 <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
966 version 2.3.9.</td></tr>
968 <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
969 sendfile support from the kernel to transmit file contents to the client.
970 By default, when the handling of a request requires no access
971 to the data within a file -- for example, when delivering a
972 static file -- Apache httpd uses sendfile to deliver the file contents
973 without ever reading the file if the OS supports it.</p>
975 <p>This sendfile mechanism avoids separate read and send operations,
976 and buffer allocations. But on some platforms or within some
977 filesystems, it is better to disable this feature to avoid
978 operational problems:</p>
981 <li>Some platforms may have broken sendfile support that the build
982 system did not detect, especially if the binaries were built on
983 another box and moved to such a machine with broken sendfile
985 <li>On Linux the use of sendfile triggers TCP-checksum
986 offloading bugs on certain networking cards when using IPv6.</li>
987 <li>On Linux on Itanium, sendfile may be unable to handle files
988 over 2GB in size.</li>
989 <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS, SMB, CIFS, FUSE),
990 the kernel may be unable to serve the network file through
994 <p>For server configurations that are not vulnerable to these problems,
995 you may enable this feature by specifying:</p>
997 <div class="example"><p><code>
1001 <p>For network mounted files, this feature may be disabled explicitly
1002 for the offending files by specifying:</p>
1004 <div class="example"><p><code>
1005 <Directory "/path-to-nfs-files">
1006 <span class="indent">
1011 <p>Please note that the per-directory and .htaccess configuration
1012 of <code class="directive">EnableSendfile</code> is not supported by
1013 <code class="module"><a href="../mod/mod_cache_disk.html">mod_cache_disk</a></code>.
1014 Only global definition of <code class="directive">EnableSendfile</code>
1015 is taken into account by the module.
1019 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1020 <div class="directive-section"><h2><a name="Error" id="Error">Error</a> <a name="error" id="error">Directiva</a></h2>
1021 <table class="directive">
1022 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Abort configuration parsing with a custom error message</td></tr>
1023 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Error <var>message</var></code></td></tr>
1024 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1025 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1026 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1027 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>2.3.9 and later</td></tr>
1029 <p>If an error can be detected within the configuration, this
1030 directive can be used to generate a custom error message, and halt
1031 configuration parsing. The typical use is for reporting required
1032 modules which are missing from the configuration.</p>
1034 <div class="example"><h3>Example</h3><p><code>
1035 # ensure that mod_include is loaded<br />
1036 <IfModule !include_module><br />
1037 Error mod_include is required by mod_foo. Load it with LoadModule.<br />
1038 </IfModule><br />
1040 # ensure that exactly one of SSL,NOSSL is defined<br />
1041 <IfDefine SSL><br />
1042 <IfDefine NOSSL><br />
1043 Error Both SSL and NOSSL are defined. Define only one of them.<br />
1044 </IfDefine><br />
1045 </IfDefine><br />
1046 <IfDefine !SSL><br />
1047 <IfDefine !NOSSL><br />
1048 Error Either SSL or NOSSL must be defined.<br />
1049 </IfDefine><br />
1050 </IfDefine><br />
1055 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1056 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directiva</a></h2>
1057 <table class="directive">
1058 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>What the server will return to the client
1059 in case of an error</td></tr>
1060 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
1061 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1062 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
1063 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1064 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1066 <p>In the event of a problem or error, Apache httpd can be configured
1067 to do one of four things,</p>
1070 <li>output a simple hardcoded error message</li>
1072 <li>output a customized message</li>
1074 <li>redirect to a local <var>URL-path</var> to handle the
1077 <li>redirect to an external <var>URL</var> to handle the
1081 <p>The first option is the default, while options 2-4 are
1082 configured using the <code class="directive">ErrorDocument</code>
1083 directive, which is followed by the HTTP response code and a URL
1084 or a message. Apache httpd will sometimes offer additional information
1085 regarding the problem/error.</p>
1087 <p>URLs can begin with a slash (/) for local web-paths (relative
1088 to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
1089 full URL which the client can resolve. Alternatively, a message
1090 can be provided to be displayed by the browser. Examples:</p>
1092 <div class="example"><p><code>
1093 ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
1094 ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
1095 ErrorDocument 401 /subscription_info.html<br />
1096 ErrorDocument 403 "Sorry can't allow you access today"
1099 <p>Additionally, the special value <code>default</code> can be used
1100 to specify Apache httpd's simple hardcoded message. While not required
1101 under normal circumstances, <code>default</code> will restore
1102 Apache httpd's simple hardcoded message for configurations that would
1103 otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
1105 <div class="example"><p><code>
1106 ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
1107 <Directory /web/docs><br />
1108 <span class="indent">
1109 ErrorDocument 404 default<br />
1114 <p>Note that when you specify an <code class="directive">ErrorDocument</code>
1115 that points to a remote URL (ie. anything with a method such as
1116 <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
1117 client to tell it where to find the document, even if the
1118 document ends up being on the same server. This has several
1119 implications, the most important being that the client will not
1120 receive the original error status code, but instead will
1121 receive a redirect status code. This in turn can confuse web
1122 robots and other clients which try to determine if a URL is
1123 valid using the status code. In addition, if you use a remote
1124 URL in an <code>ErrorDocument 401</code>, the client will not
1125 know to prompt the user for a password since it will not
1126 receive the 401 status code. Therefore, <strong>if you use an
1127 <code>ErrorDocument 401</code> directive then it must refer to a local
1128 document.</strong></p>
1130 <p>Microsoft Internet Explorer (MSIE) will by default ignore
1131 server-generated error messages when they are "too small" and substitute
1132 its own "friendly" error messages. The size threshold varies depending on
1133 the type of error, but in general, if you make your error document
1134 greater than 512 bytes, then MSIE will show the server-generated
1135 error rather than masking it. More information is available in
1136 Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
1138 <p>Although most error messages can be overriden, there are certain
1139 circumstances where the internal messages are used regardless of the
1140 setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>. In
1141 particular, if a malformed request is detected, normal request processing
1142 will be immediately halted and the internal error message returned.
1143 This is necessary to guard against security problems caused by
1146 <p>If you are using mod_proxy, you may wish to enable
1147 <code class="directive"><a href="../mod/mod_proxy.html#proxyerroroverride">ProxyErrorOverride</a></code> so that you can provide
1148 custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
1149 Apache httpd will not generate custom error documents for proxied content.</p>
1151 <h3>Consulte también</h3>
1153 <li><a href="../custom-error.html">documentation of
1154 customizable responses</a></li>
1157 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1158 <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directiva</a></h2>
1159 <table class="directive">
1160 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Location where the server will log errors</td></tr>
1161 <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>
1162 <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>
1163 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1164 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1165 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1167 <p>The <code class="directive">ErrorLog</code> directive sets the name of
1168 the file to which the server will log any errors it encounters. If
1169 the <var>file-path</var> is not absolute then it is assumed to be
1170 relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
1172 <div class="example"><h3>Example</h3><p><code>
1173 ErrorLog /var/log/httpd/error_log
1176 <p>If the <var>file-path</var>
1177 begins with a pipe character "<code>|</code>" then it is assumed to be a
1178 command to spawn to handle the error log.</p>
1180 <div class="example"><h3>Example</h3><p><code>
1181 ErrorLog "|/usr/local/bin/httpd_errors"
1184 <p>See the notes on <a href="../logs.html#piped">piped logs</a> for
1185 more information.</p>
1187 <p>Using <code>syslog</code> instead of a filename enables logging
1188 via syslogd(8) if the system supports it. The default is to use
1189 syslog facility <code>local7</code>, but you can override this by
1190 using the <code>syslog:<var>facility</var></code> syntax where
1191 <var>facility</var> can be one of the names usually documented in
1192 syslog(1). The facility is effectively global, and if it is changed
1193 in individual virtual hosts, the final facility specified affects the
1196 <div class="example"><h3>Example</h3><p><code>
1197 ErrorLog syslog:user
1200 <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
1201 document for details on why your security could be compromised
1202 if the directory where log files are stored is writable by
1203 anyone other than the user that starts the server.</p>
1204 <div class="warning"><h3>Note</h3>
1205 <p>When entering a file path on non-Unix platforms, care should be taken
1206 to make sure that only forward slashed are used even though the platform
1207 may allow the use of back slashes. In general it is a good idea to always
1208 use forward slashes throughout the configuration files.</p>
1211 <h3>Consulte también</h3>
1213 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1214 <li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
1217 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1218 <div class="directive-section"><h2><a name="ErrorLogFormat" id="ErrorLogFormat">ErrorLogFormat</a> <a name="errorlogformat" id="errorlogformat">Directiva</a></h2>
1219 <table class="directive">
1220 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Format specification for error log entries</td></tr>
1221 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code> ErrorLog [connection|request] <var>format</var></code></td></tr>
1222 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1223 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1224 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1225 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.3.9 and later</td></tr>
1227 <p><code class="directive">ErrorLogFormat</code> allows to specify what
1228 supplementary information is logged in the error log in addition to the
1229 actual log message.</p>
1231 <div class="example"><h3>Simple example</h3><p><code>
1232 ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
1235 <p>Specifying <code>connection</code> or <code>request</code> as first
1236 paramter allows to specify additional formats, causing additional
1237 information to be logged when the first message is logged for a specific
1238 connection or request, respectivly. This additional information is only
1239 logged once per connection/request. If a connection or request is processed
1240 without causing any log message, the additional information is not logged
1243 <p>It can happen that some format string items do not produce output. For
1244 example, the Referer header is only present if the log message is
1245 associated to a request and the log message happens at a time when the
1246 Referer header has already been read from the client. If no output is
1247 produced, the default behaviour is to delete everything from the preceeding
1248 space character to the next space character. This means the log line is
1249 implicitly divided into fields on non-whitespace to whitespace transitions.
1250 If a format string item does not produce output, the whole field is
1251 ommitted. For example, if the remote address <code>%a</code> in the log
1252 format <code>[%t] [%l] [%a] %M </code> is not available, the surrounding
1253 brackets are not logged either. Space characters can be escaped with a
1254 backslash to prevent them from delimiting a field. The combination '% '
1255 (percent space) is a zero-witdh field delimiter that does not produce any
1258 <p>The above behaviour can be changed by adding modifiers to the format
1259 string item. A <code>-</code> (minus) modifier causes a minus to be logged if the
1260 respective item does not produce any output. In once-per-connection/request
1261 formats, it is also possible to use the <code>+</code> (plus) modifier. If an
1262 item with the plus modifier does not produce any output, the whole line is
1265 <p>A number as modifier can be used to assign a log severity level to a
1266 format item. The item will only be logged if the severity of the log
1267 message is not higher than the specified log severity level. The number can
1268 range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8).</p>
1270 <p>Some format string items accept additional parameters in braces.</p>
1272 <table class="bordered"><tr class="header"><th>Format String</th> <th>Description</th></tr>
1273 <tr><td><code>%%</code></td>
1274 <td>The percent sign</td></tr>
1275 <tr class="odd"><td><code>%...a</code></td>
1276 <td>Remote IP-address and port</td></tr>
1277 <tr><td><code>%...A</code></td>
1278 <td>Local IP-address and port</td></tr>
1279 <tr class="odd"><td><code>%...{name}e</code></td>
1280 <td>Request environment variable <code>name</code></td></tr>
1281 <tr><td><code>%...E</code></td>
1282 <td>APR/OS error status code and string</td></tr>
1283 <tr class="odd"><td><code>%...F</code></td>
1284 <td>Source file name and line number of the log call</td></tr>
1285 <tr><td><code>%...{name}i</code></td>
1286 <td>Request header <code>name</code></td></tr>
1287 <tr class="odd"><td><code>%...k</code></td>
1288 <td>Number of keep-alive requests on this connection</td></tr>
1289 <tr><td><code>%...l</code></td>
1290 <td>Loglevel of the message</td></tr>
1291 <tr class="odd"><td><code>%...L</code></td>
1292 <td>Log ID of the request</td></tr>
1293 <tr><td><code>%...{c}L</code></td>
1294 <td>Log ID of the connection</td></tr>
1295 <tr class="odd"><td><code>%...{C}L</code></td>
1296 <td>Log ID of the connection if used in connection scope, empty otherwise</td></tr>
1297 <tr><td><code>%...m</code></td>
1298 <td>Name of the module logging the message</td></tr>
1299 <tr class="odd"><td><code>%M</code></td>
1300 <td>The actual log message</td></tr>
1301 <tr><td><code>%...{name}n</code></td>
1302 <td>Request note <code>name</code></td></tr>
1303 <tr class="odd"><td><code>%...P</code></td>
1304 <td>Process ID of current process</td></tr>
1305 <tr><td><code>%...T</code></td>
1306 <td>Thread ID of current thread</td></tr>
1307 <tr class="odd"><td><code>%...t</code></td>
1308 <td>The current time</td></tr>
1309 <tr><td><code>%...{u}t</code></td>
1310 <td>The current time including micro-seconds</td></tr>
1311 <tr class="odd"><td><code>%...{cu}t</code></td>
1312 <td>The current time in compact ISO 8601 format, including
1313 micro-seconds</td></tr>
1314 <tr><td><code>%...v</code></td>
1315 <td>The canonical <code class="directive"><a href="#servername">ServerName</a></code>
1316 of the current server.</td></tr>
1317 <tr class="odd"><td><code>%...V</code></td>
1318 <td>The server name of the server serving the request according to the
1319 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code>
1321 <tr><td><code>\ </code> (backslash space)</td>
1322 <td>Non-field delimiting space</td></tr>
1323 <tr class="odd"><td><code>% </code> (percent space)</td>
1324 <td>Field delimiter (no output)</td></tr>
1327 <p>The log ID format <code>%L</code> produces a unique id for a connection
1328 or request. This can be used to correlate which log lines belong to the
1329 same connection or request, which request happens on which connection.
1330 A <code>%L</code> format string is also available in
1331 <code class="module"><a href="../mod/mod_log_config.html">mod_log_config</a></code>, to allow to correlate access log entries
1332 with error log lines. If <code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code> is loaded, its
1333 unique id will be used as log ID for requests.</p>
1335 <div class="example"><h3>Example (somewhat similar to default format)</h3><p><code>
1336 ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P] %7F: %E: [client\ %a]
1337 %M% ,\ referer\ %{Referer}i"
1340 <div class="example"><h3>Example (similar to the 2.2.x format)</h3><p><code>
1341 ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
1342 %M% ,\ referer\ %{Referer}i"
1345 <div class="example"><h3>Advanced example with request/connection log IDs</h3><p><code>
1346 ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br />
1347 ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br />
1348 ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br />
1349 ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br />
1350 ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br />
1354 <h3>Consulte también</h3>
1356 <li><code class="directive"><a href="#errorlog">ErrorLog</a></code></li>
1357 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1358 <li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
1361 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1362 <div class="directive-section"><h2><a name="ExtendedStatus" id="ExtendedStatus">ExtendedStatus</a> <a name="extendedstatus" id="extendedstatus">Directiva</a></h2>
1363 <table class="directive">
1364 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Keep track of extended status information for each
1366 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ExtendedStatus On|Off</code></td></tr>
1367 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ExtendedStatus Off[*]</code></td></tr>
1368 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
1369 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1370 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1372 <p>This option tracks additional data per worker about the
1373 currently executing request, and a utilization summary; you
1374 can see these variables during runtime by configuring
1375 <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>. Note that other modules may
1376 rely on this scoreboard.</p>
1378 <p>This setting applies to the entire server, and cannot be
1379 enabled or disabled on a virtualhost-by-virtualhost basis.
1380 The collection of extended status information can slow down
1381 the server. Also note that this setting cannot be changed
1382 during a graceful restart.</p>
1385 <p>Note that loading <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> will change
1386 the default behavior to ExtendedStatus On, while other
1387 third party modules may do the same. Such modules rely on
1388 collecting detailed information about the state of all workers.
1389 The default is changed by <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> beginning
1390 with version 2.3.6; the previous default was always Off.</p>
1395 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1396 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directiva</a></h2>
1397 <table class="directive">
1398 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>File attributes used to create the ETag
1399 HTTP response header for static files</td></tr>
1400 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
1401 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
1402 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1403 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
1404 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1405 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1408 The <code class="directive">FileETag</code> directive configures the file
1409 attributes that are used to create the <code>ETag</code> (entity
1410 tag) response header field when the document is based on a static file.
1411 (The <code>ETag</code> value is used in cache management to save
1412 network bandwidth.) The
1413 <code class="directive">FileETag</code> directive allows you to choose
1414 which of these -- if any -- should be used. The recognized keywords are:
1418 <dt><strong>INode</strong></dt>
1419 <dd>The file's i-node number will be included in the calculation</dd>
1420 <dt><strong>MTime</strong></dt>
1421 <dd>The date and time the file was last modified will be included</dd>
1422 <dt><strong>Size</strong></dt>
1423 <dd>The number of bytes in the file will be included</dd>
1424 <dt><strong>All</strong></dt>
1425 <dd>All available fields will be used. This is equivalent to:
1426 <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1427 <dt><strong>None</strong></dt>
1428 <dd>If a document is file-based, no <code>ETag</code> field will be
1429 included in the response</dd>
1432 <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1433 keywords may be prefixed with either <code>+</code> or <code>-</code>,
1434 which allow changes to be made to the default setting inherited
1435 from a broader scope. Any keyword appearing without such a prefix
1436 immediately and completely cancels the inherited setting.</p>
1438 <p>If a directory's configuration includes
1439 <code>FileETag INode MTime Size</code>, and a
1440 subdirectory's includes <code>FileETag -INode</code>,
1441 the setting for that subdirectory (which will be inherited by
1442 any sub-subdirectories that don't override it) will be equivalent to
1443 <code>FileETag MTime Size</code>.</p>
1444 <div class="warning"><h3>Warning</h3>
1445 Do not change the default for directories or locations that have WebDAV
1446 enabled and use <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> as a storage provider.
1447 <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> uses <code>INode MTime Size</code>
1448 as a fixed format for <code>ETag</code> comparisons on conditional requests.
1449 These conditional requests will break if the <code>ETag</code> format is
1450 changed via <code class="directive">FileETag</code>.
1452 <div class="note"><h3>Server Side Includes</h3>
1453 An ETag is not generated for responses parsed by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>,
1454 since the response entity can change without a change of the INode, MTime, or Size
1455 of the static file with embedded SSI directives.
1460 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1461 <div class="directive-section"><h2><a name="Files" id="Files"><Files></a> <a name="files" id="files">Directiva</a></h2>
1462 <table class="directive">
1463 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply to matched
1465 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Files <var>filename</var>> ... </Files></code></td></tr>
1466 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1467 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1468 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1469 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1471 <p>The <code class="directive"><Files></code> directive
1472 limits the scope of the enclosed directives by filename. It is comparable
1473 to the <code class="directive"><a href="#directory"><Directory></a></code>
1474 and <code class="directive"><a href="#location"><Location></a></code>
1475 directives. It should be matched with a <code></Files></code>
1476 directive. The directives given within this section will be applied to
1477 any object with a basename (last component of filename) matching the
1478 specified filename. <code class="directive"><Files></code>
1479 sections are processed in the order they appear in the
1480 configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1481 <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location"><Location></a></code> sections. Note
1482 that <code class="directive"><Files></code> can be nested
1483 inside <code class="directive"><a href="#directory"><Directory></a></code> sections to restrict the
1484 portion of the filesystem they apply to.</p>
1486 <p>The <var>filename</var> argument should include a filename, or
1487 a wild-card string, where <code>?</code> matches any single character,
1488 and <code>*</code> matches any sequences of characters.
1489 <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">Regular expressions</a>
1490 can also be used, with the addition of the
1491 <code>~</code> character. For example:</p>
1493 <div class="example"><p><code>
1494 <Files ~ "\.(gif|jpe?g|png)$">
1497 <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
1500 <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
1501 <code>.htaccess</code> files. This allows users to control access to
1502 their own files, at a file-by-file level.</p>
1505 <h3>Consulte también</h3>
1507 <li><a href="../sections.html">How <Directory>, <Location>
1508 and <Files> sections work</a> for an explanation of how these
1509 different sections are combined when a request is received</li>
1512 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1513 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch"><FilesMatch></a> <a name="filesmatch" id="filesmatch">Directiva</a></h2>
1514 <table class="directive">
1515 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply to regular-expression matched
1517 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><FilesMatch <var>regex</var>> ... </FilesMatch></code></td></tr>
1518 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1519 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1520 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1521 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1523 <p>The <code class="directive"><FilesMatch></code> directive
1524 limits the scope of the enclosed directives by filename, just as the
1525 <code class="directive"><a href="#files"><Files></a></code> directive
1526 does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">regular
1527 expression</a>. For example:</p>
1529 <div class="example"><p><code>
1530 <FilesMatch "\.(gif|jpe?g|png)$">
1533 <p>would match most common Internet graphics formats.</p>
1535 <h3>Consulte también</h3>
1537 <li><a href="../sections.html">How <Directory>, <Location>
1538 and <Files> sections work</a> for an explanation of how these
1539 different sections are combined when a request is received</li>
1542 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1543 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directiva</a></h2>
1544 <table class="directive">
1545 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Forces all matching files to be served with the specified
1546 media type in the HTTP Content-Type header field</td></tr>
1547 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ForceType <var>media-type</var>|None</code></td></tr>
1548 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
1549 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
1550 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1551 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1552 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Moved to the core in Apache httpd 2.0</td></tr>
1554 <p>When placed into an <code>.htaccess</code> file or a
1555 <code class="directive"><a href="#directory"><Directory></a></code>, or
1556 <code class="directive"><a href="#location"><Location></a></code> or
1557 <code class="directive"><a href="#files"><Files></a></code>
1558 section, this directive forces all matching files to be served
1559 with the content type identification given by
1560 <var>media-type</var>. For example, if you had a directory full of
1561 GIF files, but did not want to label them all with <code>.gif</code>,
1562 you might want to use:</p>
1564 <div class="example"><p><code>
1568 <p>Note that this directive overrides other indirect media type
1569 associations defined in mime.types or via the
1570 <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code>.</p>
1572 <p>You can also override more general
1573 <code class="directive">ForceType</code> settings
1574 by using the value of <code>None</code>:</p>
1576 <div class="example"><p><code>
1577 # force all files to be image/gif:<br />
1578 <Location /images><br />
1579 <span class="indent">
1580 ForceType image/gif<br />
1582 </Location><br />
1584 # but normal mime-type associations here:<br />
1585 <Location /images/mixed><br />
1586 <span class="indent">
1587 ForceType None<br />
1592 <p>This directive primarily overrides the content types generated for
1593 static files served out of the filesystem. For resources other than
1594 static files, where the generator of the response typically specifies
1595 a Content-Type, this directive has no effect.</p>
1599 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1600 <div class="directive-section"><h2><a name="GprofDir" id="GprofDir">GprofDir</a> <a name="gprofdir" id="gprofdir">Directiva</a></h2>
1601 <table class="directive">
1602 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Directory to write gmon.out profiling data to. </td></tr>
1603 <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>
1604 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1605 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1606 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1608 <p>When the server has been compiled with gprof profiling suppport,
1609 <code class="directive">GprofDir</code> causes <code>gmon.out</code> files to
1610 be written to the specified directory when the process exits. If the
1611 argument ends with a percent symbol ('%'), subdirectories are created
1612 for each process id.</p>
1614 <p>This directive currently only works with the <code class="module"><a href="../mod/prefork.html">prefork</a></code>
1618 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1619 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directiva</a></h2>
1620 <table class="directive">
1621 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1622 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1623 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>HostnameLookups Off</code></td></tr>
1624 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
1625 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1626 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1628 <p>This directive enables DNS lookups so that host names can be
1629 logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1630 The value <code>Double</code> refers to doing double-reverse
1631 DNS lookup. That is, after a reverse lookup is performed, a forward
1632 lookup is then performed on that result. At least one of the IP
1633 addresses in the forward lookup must match the original
1634 address. (In "tcpwrappers" terminology this is called
1635 <code>PARANOID</code>.)</p>
1637 <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1638 used for controlling access by hostname, a double reverse lookup
1639 will be performed. This is necessary for security. Note that the
1640 result of this double-reverse isn't generally available unless you
1641 set <code>HostnameLookups Double</code>. For example, if only
1642 <code>HostnameLookups On</code> and a request is made to an object
1643 that is protected by hostname restrictions, regardless of whether
1644 the double-reverse fails or not, CGIs will still be passed the
1645 single-reverse result in <code>REMOTE_HOST</code>.</p>
1647 <p>The default is <code>Off</code> in order to save the network
1648 traffic for those sites that don't truly need the reverse
1649 lookups done. It is also better for the end users because they
1650 don't have to suffer the extra latency that a lookup entails.
1651 Heavily loaded sites should leave this directive
1652 <code>Off</code>, since DNS lookups can take considerable
1653 amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
1654 default to the <code>bin</code> subdirectory of your installation
1655 directory, can be used to look up host names from logged IP addresses
1659 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1660 <div class="directive-section"><h2><a name="If" id="If"><If></a> <a name="if" id="if">Directiva</a></h2>
1661 <table class="directive">
1662 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only if a condition is
1663 satisfied by a request at runtime</td></tr>
1664 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><If <var>expression</var>> ... </If></code></td></tr>
1665 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1666 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1667 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1668 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1670 <p>The <code class="directive"><If></code> directive
1671 evaluates an expression at runtime, and applies the enclosed
1672 directives if and only if the expression evaluates to true.
1675 <div class="example"><p><code>
1676 <If "$req{Host} = ''">
1679 <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>
1681 <p>You may compare the value of any variable in the request headers
1682 ($req), response headers ($resp) or environment ($env) in your
1685 <p>Apart from <code>=</code>, <code>If</code> can use the <code>IN</code>
1686 operator to compare if the expression is in a given range:</p>
1688 <div class="example"><p><code>
1689 <If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS>
1693 <h3>Consulte también</h3>
1695 <li><a href="../expr.html">Expressions in Apache HTTP Server</a>,
1696 for a complete reference and more examples.</li>
1697 <li><a href="../sections.html">How <Directory>, <Location>,
1698 <Files> sections work</a> for an explanation of how these
1699 different sections are combined when a request is received.
1700 <code class="directive"><If></code> has the same precedence
1701 and usage as <code class="directive"><Files></code></li>
1704 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1705 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine"><IfDefine></a> <a name="ifdefine" id="ifdefine">Directiva</a></h2>
1706 <table class="directive">
1707 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Encloses directives that will be processed only
1708 if a test is true at startup</td></tr>
1709 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><IfDefine [!]<var>parameter-name</var>> ...
1710 </IfDefine></code></td></tr>
1711 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1712 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1713 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1714 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1716 <p>The <code><IfDefine <var>test</var>>...</IfDefine>
1717 </code> section is used to mark directives that are conditional. The
1718 directives within an <code class="directive"><IfDefine></code>
1719 section are only processed if the <var>test</var> is true. If <var>
1720 test</var> is false, everything between the start and end markers is
1723 <p>The <var>test</var> in the <code class="directive"><IfDefine></code> section directive can be one of two forms:</p>
1726 <li><var>parameter-name</var></li>
1728 <li><code>!</code><var>parameter-name</var></li>
1731 <p>In the former case, the directives between the start and end
1732 markers are only processed if the parameter named
1733 <var>parameter-name</var> is defined. The second format reverses
1734 the test, and only processes the directives if
1735 <var>parameter-name</var> is <strong>not</strong> defined.</p>
1737 <p>The <var>parameter-name</var> argument is a define as given on the
1738 <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter</var>
1739 </code> at the time the server was started or by the <code class="directive"><a href="#define">Define</a></code> directive.</p>
1741 <p><code class="directive"><IfDefine></code> sections are
1742 nest-able, which can be used to implement simple
1743 multiple-parameter tests. Example:</p>
1745 <div class="example"><p><code>
1746 httpd -DReverseProxy -DUseCache -DMemCache ...<br />
1749 <IfDefine ReverseProxy><br />
1750 <span class="indent">
1751 LoadModule proxy_module modules/mod_proxy.so<br />
1752 LoadModule proxy_http_module modules/mod_proxy_http.so<br />
1753 <IfDefine UseCache><br />
1754 <span class="indent">
1755 LoadModule cache_module modules/mod_cache.so<br />
1756 <IfDefine MemCache><br />
1757 <span class="indent">
1758 LoadModule mem_cache_module modules/mod_mem_cache.so<br />
1760 </IfDefine><br />
1761 <IfDefine !MemCache><br />
1762 <span class="indent">
1763 LoadModule cache_disk_module modules/mod_cache_disk.so<br />
1773 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1774 <div class="directive-section"><h2><a name="IfModule" id="IfModule"><IfModule></a> <a name="ifmodule" id="ifmodule">Directiva</a></h2>
1775 <table class="directive">
1776 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Encloses directives that are processed conditional on the
1777 presence or absence of a specific module</td></tr>
1778 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><IfModule [!]<var>module-file</var>|<var>module-identifier</var>> ...
1779 </IfModule></code></td></tr>
1780 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1781 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
1782 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1783 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1784 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Module identifiers are available in version 2.1 and
1787 <p>The <code><IfModule <var>test</var>>...</IfModule></code>
1788 section is used to mark directives that are conditional on the presence of
1789 a specific module. The directives within an <code class="directive"><IfModule></code> section are only processed if the <var>test</var>
1790 is true. If <var>test</var> is false, everything between the start and
1791 end markers is ignored.</p>
1793 <p>The <var>test</var> in the <code class="directive"><IfModule></code> section directive can be one of two forms:</p>
1796 <li><var>module</var></li>
1798 <li>!<var>module</var></li>
1801 <p>In the former case, the directives between the start and end
1802 markers are only processed if the module named <var>module</var>
1803 is included in Apache httpd -- either compiled in or
1804 dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1805 and only processes the directives if <var>module</var> is
1806 <strong>not</strong> included.</p>
1808 <p>The <var>module</var> argument can be either the module identifier or
1809 the file name of the module, at the time it was compiled. For example,
1810 <code>rewrite_module</code> is the identifier and
1811 <code>mod_rewrite.c</code> is the file name. If a module consists of
1812 several source files, use the name of the file containing the string
1813 <code>STANDARD20_MODULE_STUFF</code>.</p>
1815 <p><code class="directive"><IfModule></code> sections are
1816 nest-able, which can be used to implement simple multiple-module
1819 <div class="note">This section should only be used if you need to have one
1820 configuration file that works whether or not a specific module
1821 is available. In normal operation, directives need not be
1822 placed in <code class="directive"><IfModule></code>
1826 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1827 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directiva</a></h2>
1828 <table class="directive">
1829 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Includes other configuration files from within
1830 the server configuration files</td></tr>
1831 <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>
1832 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
1833 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1834 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1835 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Wildcard matching available in 2.0.41 and later, directory
1836 wildcard matching available in 2.3.6 and later</td></tr>
1838 <p>This directive allows inclusion of other configuration files
1839 from within the server configuration files.</p>
1841 <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used
1842 in the filename or directory parts of the path to include several files
1843 at once, in alphabetical order. In addition, if
1844 <code class="directive">Include</code> points to a directory, rather than a file,
1845 Apache httpd will read all files in that directory and any subdirectory.
1846 However, including entire directories is not recommended, because it is
1847 easy to accidentally leave temporary files in a directory that can cause
1848 <code class="program"><a href="../programs/httpd.html">httpd</a></code> to fail. Instead, we encourage you to use the
1849 wildcard syntax shown below, to include files that match a particular
1850 pattern, such as *.conf, for example.</p>
1852 <p>When a wildcard is specified for a <strong>file</strong> component of
1853 the path, and no file matches the wildcard, the
1854 <code class="directive"><a href="#include">Include</a></code>
1855 directive will be <strong>silently ignored</strong>. When a wildcard is
1856 specified for a <strong>directory</strong> component of the path, and
1857 no directory matches the wildcard, the
1858 <code class="directive"><a href="#include">Include</a></code> directive will
1859 <strong>fail with an error</strong> saying the directory cannot be found.
1862 <p>For further control over the behaviour of the server when no files or
1863 directories match, prefix the path with the modifiers <var>optional</var>
1864 or <var>strict</var>. If <var>optional</var> is specified, any wildcard
1865 file or directory that does not match will be silently ignored. If
1866 <var>strict</var> is specified, any wildcard file or directory that does
1867 not match at least one file will cause server startup to fail.</p>
1869 <p>When a directory or file component of the path is
1870 specified exactly, and that directory or file does not exist,
1871 <code class="directive"><a href="#include">Include</a></code> directive will fail with an
1872 error saying the file or directory cannot be found.</p>
1874 <p>The file path specified may be an absolute path, or may be relative
1875 to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1879 <div class="example"><p><code>
1880 Include /usr/local/apache2/conf/ssl.conf<br />
1881 Include /usr/local/apache2/conf/vhosts/*.conf
1884 <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1886 <div class="example"><p><code>
1887 Include conf/ssl.conf<br />
1888 Include conf/vhosts/*.conf
1891 <p>Wildcards may be included in the directory or file portion of the
1892 path. In the following example, the server will fail to load if no
1893 directories match conf/vhosts/*, but will load successfully if no
1894 files match *.conf.</p>
1896 <div class="example"><p><code>
1897 Include conf/vhosts/*/vhost.conf<br />
1898 Include conf/vhosts/*/*.conf
1901 <p>In this example, the server will fail to load if either
1902 conf/vhosts/* matches no directories, or if *.conf matches no files:</p>
1904 <div class="example"><p><code>
1905 Include strict conf/vhosts/*/*.conf
1908 <p>In this example, the server load successfully if either conf/vhosts/*
1909 matches no directories, or if *.conf matches no files:</p>
1911 <div class="example"><p><code>
1912 Include optional conf/vhosts/*/*.conf
1916 <h3>Consulte también</h3>
1918 <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
1921 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1922 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directiva</a></h2>
1923 <table class="directive">
1924 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Enables HTTP persistent connections</td></tr>
1925 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1926 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>KeepAlive On</code></td></tr>
1927 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1928 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1929 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1931 <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1932 connection feature of HTTP/1.1 provide long-lived HTTP sessions
1933 which allow multiple requests to be sent over the same TCP
1934 connection. In some cases this has been shown to result in an
1935 almost 50% speedup in latency times for HTML documents with
1936 many images. To enable Keep-Alive connections, set
1937 <code>KeepAlive On</code>.</p>
1939 <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1940 used if they are specifically requested by a client. In
1941 addition, a Keep-Alive connection with an HTTP/1.0 client can
1942 only be used when the length of the content is known in
1943 advance. This implies that dynamic content such as CGI output,
1944 SSI pages, and server-generated directory listings will
1945 generally not use Keep-Alive connections to HTTP/1.0 clients.
1946 For HTTP/1.1 clients, persistent connections are the default
1947 unless otherwise specified. If the client requests it, chunked
1948 encoding will be used in order to send content of unknown
1949 length over persistent connections.</p>
1951 <p>When a client uses a Keep-Alive connection it will be counted
1952 as a single "request" for the <code class="directive"><a href="../mod/mpm_common.html#maxconnectionsperchild">MaxConnectionsPerChild</a></code> directive, regardless
1953 of how many requests are sent using the connection.</p>
1955 <h3>Consulte también</h3>
1957 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
1960 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1961 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directiva</a></h2>
1962 <table class="directive">
1963 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Amount of time the server will wait for subsequent
1964 requests on a persistent connection</td></tr>
1965 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>KeepAliveTimeout <var>num</var>[ms]</code></td></tr>
1966 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>KeepAliveTimeout 5</code></td></tr>
1967 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
1968 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1969 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
1970 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Specifying a value in milliseconds is available in
1971 Apache httpd 2.3.2 and later</td></tr>
1973 <p>The number of seconds Apache httpd will wait for a subsequent
1974 request before closing the connection. By adding a postfix of ms the
1975 timeout can be also set in milliseconds. Once a request has been
1976 received, the timeout value specified by the
1977 <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
1979 <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
1980 may cause performance problems in heavily loaded servers. The
1981 higher the timeout, the more server processes will be kept
1982 occupied waiting on connections with idle clients.</p>
1984 <p>In a name-based virtual host context, the value of the first
1985 defined virtual host (the default host) in a set of <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> will be used.
1986 The other values will be ignored.</p>
1989 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1990 <div class="directive-section"><h2><a name="Limit" id="Limit"><Limit></a> <a name="limit" id="limit">Directiva</a></h2>
1991 <table class="directive">
1992 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Restrict enclosed access controls to only certain HTTP
1994 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Limit <var>method</var> [<var>method</var>] ... > ...
1995 </Limit></code></td></tr>
1996 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
1997 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>AuthConfig, Limit</td></tr>
1998 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
1999 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2001 <p>Access controls are normally effective for
2002 <strong>all</strong> access methods, and this is the usual
2003 desired behavior. <strong>In the general case, access control
2004 directives should not be placed within a
2005 <code class="directive"><Limit></code> section.</strong></p>
2007 <p>The purpose of the <code class="directive"><Limit></code>
2008 directive is to restrict the effect of the access controls to the
2009 nominated HTTP methods. For all other methods, the access
2010 restrictions that are enclosed in the <code class="directive"><Limit></code> bracket <strong>will have no
2011 effect</strong>. The following example applies the access control
2012 only to the methods <code>POST</code>, <code>PUT</code>, and
2013 <code>DELETE</code>, leaving all other methods unprotected:</p>
2015 <div class="example"><p><code>
2016 <Limit POST PUT DELETE><br />
2017 <span class="indent">
2018 Require valid-user<br />
2023 <p>The method names listed can be one or more of: <code>GET</code>,
2024 <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
2025 <code>CONNECT</code>, <code>OPTIONS</code>,
2026 <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
2027 <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
2028 <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
2029 case-sensitive.</strong> If <code>GET</code> is used it will also
2030 restrict <code>HEAD</code> requests. The <code>TRACE</code> method
2031 cannot be limited (see <code class="directive"><a href="#traceenable">TraceEnable</a></code>).</p>
2033 <div class="warning">A <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section should always be
2034 used in preference to a <code class="directive"><Limit></code>
2035 section when restricting access, since a <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section provides protection
2036 against arbitrary methods.</div>
2038 <p>The <code class="directive"><Limit></code> and
2039 <code class="directive"><a href="#limitexcept"><LimitExcept></a></code>
2040 directives may be nested. In this case, each successive level of
2041 <code class="directive"><Limit></code> or <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> directives must
2042 further restrict the set of methods to which access controls apply.</p>
2044 <div class="warning">When using
2045 <code class="directive"><Limit></code> or
2046 <code class="directive"><LimitExcept></code> directives with
2047 the <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> directive,
2048 note that the first <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code>
2049 to succeed authorizes the request, regardless of the presence of other
2050 <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> directives.</div>
2052 <p>For example, given the following configuration, all users will
2053 be authorized for <code>POST</code> requests, and the
2054 <code>Require group editors</code> directive will be ignored
2057 <div class="example"><p><code>
2058 <LimitExcept GET>
2059 <span class="indent">
2062 </LimitExcept><br />
2064 <span class="indent">
2065 Require group editors
2071 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2072 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept"><LimitExcept></a> <a name="limitexcept" id="limitexcept">Directiva</a></h2>
2073 <table class="directive">
2074 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Restrict access controls to all HTTP methods
2075 except the named ones</td></tr>
2076 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><LimitExcept <var>method</var> [<var>method</var>] ... > ...
2077 </LimitExcept></code></td></tr>
2078 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directory, .htaccess</td></tr>
2079 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>AuthConfig, Limit</td></tr>
2080 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2081 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2083 <p><code class="directive"><LimitExcept></code> and
2084 <code></LimitExcept></code> are used to enclose
2085 a group of access control directives which will then apply to any
2086 HTTP access method <strong>not</strong> listed in the arguments;
2087 i.e., it is the opposite of a <code class="directive"><a href="#limit"><Limit></a></code> section and can be used to control
2088 both standard and nonstandard/unrecognized methods. See the
2089 documentation for <code class="directive"><a href="#limit"><Limit></a></code> for more details.</p>
2093 <div class="example"><p><code>
2094 <LimitExcept POST GET><br />
2095 <span class="indent">
2096 Require valid-user<br />
2098 </LimitExcept>
2103 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2104 <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directiva</a></h2>
2105 <table class="directive">
2106 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determine maximum number of internal redirects and nested
2107 subrequests</td></tr>
2108 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
2109 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
2110 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2111 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2112 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2113 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.0.47 and later</td></tr>
2115 <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
2116 redirects the original request to a CGI script. A subrequest is Apache httpd's
2117 mechanism to find out what would happen for some URI if it were requested.
2118 For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
2119 files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
2122 <p><code class="directive">LimitInternalRecursion</code> prevents the server
2123 from crashing when entering an infinite loop of internal redirects or
2124 subrequests. Such loops are usually caused by misconfigurations.</p>
2126 <p>The directive stores two different limits, which are evaluated on
2127 per-request basis. The first <var>number</var> is the maximum number of
2128 internal redirects, that may follow each other. The second <var>number</var>
2129 determines, how deep subrequests may be nested. If you specify only one
2130 <var>number</var>, it will be assigned to both limits.</p>
2132 <div class="example"><h3>Example</h3><p><code>
2133 LimitInternalRecursion 5
2137 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2138 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directiva</a></h2>
2139 <table class="directive">
2140 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Restricts the total size of the HTTP request body sent
2141 from the client</td></tr>
2142 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
2143 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestBody 0</code></td></tr>
2144 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2145 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
2146 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2147 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2149 <p>This directive specifies the number of <var>bytes</var> from 0
2150 (meaning unlimited) to 2147483647 (2GB) that are allowed in a
2151 request body. See the note below for the limited applicability
2152 to proxy requests.</p>
2154 <p>The <code class="directive">LimitRequestBody</code> directive allows
2155 the user to set a limit on the allowed size of an HTTP request
2156 message body within the context in which the directive is given
2157 (server, per-directory, per-file or per-location). If the client
2158 request exceeds that limit, the server will return an error
2159 response instead of servicing the request. The size of a normal
2160 request message body will vary greatly depending on the nature of
2161 the resource and the methods allowed on that resource. CGI scripts
2162 typically use the message body for retrieving form information.
2163 Implementations of the <code>PUT</code> method will require
2164 a value at least as large as any representation that the server
2165 wishes to accept for that resource.</p>
2167 <p>This directive gives the server administrator greater
2168 control over abnormal client request behavior, which may be
2169 useful for avoiding some forms of denial-of-service
2172 <p>If, for example, you are permitting file upload to a particular
2173 location, and wish to limit the size of the uploaded file to 100K,
2174 you might use the following directive:</p>
2176 <div class="example"><p><code>
2177 LimitRequestBody 102400
2180 <div class="note"><p>For a full description of how this directive is interpreted by
2181 proxy requests, see the <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> documentation.</p>
2186 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2187 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directiva</a></h2>
2188 <table class="directive">
2189 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the number of HTTP request header fields that
2190 will be accepted from the client</td></tr>
2191 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
2192 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestFields 100</code></td></tr>
2193 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2194 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2195 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2197 <p><var>Number</var> is an integer from 0 (meaning unlimited) to
2198 32767. The default value is defined by the compile-time
2199 constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
2202 <p>The <code class="directive">LimitRequestFields</code> directive allows
2203 the server administrator to modify the limit on the number of
2204 request header fields allowed in an HTTP request. A server needs
2205 this value to be larger than the number of fields that a normal
2206 client request might include. The number of request header fields
2207 used by a client rarely exceeds 20, but this may vary among
2208 different client implementations, often depending upon the extent
2209 to which a user has configured their browser to support detailed
2210 content negotiation. Optional HTTP extensions are often expressed
2211 using request header fields.</p>
2213 <p>This directive gives the server administrator greater
2214 control over abnormal client request behavior, which may be
2215 useful for avoiding some forms of denial-of-service attacks.
2216 The value should be increased if normal clients see an error
2217 response from the server that indicates too many fields were
2218 sent in the request.</p>
2222 <div class="example"><p><code>
2223 LimitRequestFields 50
2226 <div class="warning"><h3>Warning</h3>
2227 <p> When name-based virtual hosting is used, the value for this
2228 directive is taken from the default (first-listed) virtual host for the
2229 <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2234 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2235 <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directiva</a></h2>
2236 <table class="directive">
2237 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the size of the HTTP request header allowed from the
2239 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestFieldSize <var>bytes</var></code></td></tr>
2240 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestFieldSize 8190</code></td></tr>
2241 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2242 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2243 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2245 <p>This directive specifies the number of <var>bytes</var>
2246 that will be allowed in an HTTP request header.</p>
2248 <p>The <code class="directive">LimitRequestFieldSize</code> directive
2249 allows the server administrator to reduce or increase the limit
2250 on the allowed size of an HTTP request header field. A server
2251 needs this value to be large enough to hold any one header field
2252 from a normal client request. The size of a normal request header
2253 field will vary greatly among different client implementations,
2254 often depending upon the extent to which a user has configured
2255 their browser to support detailed content negotiation. SPNEGO
2256 authentication headers can be up to 12392 bytes.</p>
2258 <p>This directive gives the server administrator greater
2259 control over abnormal client request behavior, which may be
2260 useful for avoiding some forms of denial-of-service attacks.</p>
2264 <div class="example"><p><code>
2265 LimitRequestFieldSize 4094
2268 <div class="note">Under normal conditions, the value should not be changed from
2271 <div class="warning"><h3>Warning</h3>
2272 <p> When name-based virtual hosting is used, the value for this
2273 directive is taken from the default (first-listed) virtual host for the
2274 <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2279 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2280 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directiva</a></h2>
2281 <table class="directive">
2282 <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
2283 from the client</td></tr>
2284 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
2285 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
2286 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2287 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2288 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2290 <p>This directive sets the number of <var>bytes</var> that will be
2291 allowed on the HTTP request-line.</p>
2293 <p>The <code class="directive">LimitRequestLine</code> directive allows
2294 the server administrator to reduce or increase the limit on the allowed size
2295 of a client's HTTP request-line. Since the request-line consists of the
2296 HTTP method, URI, and protocol version, the
2297 <code class="directive">LimitRequestLine</code> directive places a
2298 restriction on the length of a request-URI allowed for a request
2299 on the server. A server needs this value to be large enough to
2300 hold any of its resource names, including any information that
2301 might be passed in the query part of a <code>GET</code> request.</p>
2303 <p>This directive gives the server administrator greater
2304 control over abnormal client request behavior, which may be
2305 useful for avoiding some forms of denial-of-service attacks.</p>
2309 <div class="example"><p><code>
2310 LimitRequestLine 4094
2313 <div class="note">Under normal conditions, the value should not be changed from
2316 <div class="warning"><h3>Warning</h3>
2317 <p> When name-based virtual hosting is used, the value for this
2318 directive is taken from the default (first-listed) virtual host for the
2319 <code class="directive">NameVirtualHost</code> the connection was mapped to.</p>
2324 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2325 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directiva</a></h2>
2326 <table class="directive">
2327 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the size of an XML-based request body</td></tr>
2328 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
2329 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
2330 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2331 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
2332 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2333 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2335 <p>Limit (in bytes) on maximum size of an XML-based request
2336 body. A value of <code>0</code> will disable any checking.</p>
2340 <div class="example"><p><code>
2341 LimitXMLRequestBody 0
2346 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2347 <div class="directive-section"><h2><a name="Location" id="Location"><Location></a> <a name="location" id="location">Directiva</a></h2>
2348 <table class="directive">
2349 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Applies the enclosed directives only to matching
2351 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><Location
2352 <var>URL-path</var>|<var>URL</var>> ... </Location></code></td></tr>
2353 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2354 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2355 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2357 <p>The <code class="directive"><Location></code> directive
2358 limits the scope of the enclosed directives by URL. It is similar to the
2359 <code class="directive"><a href="#directory"><Directory></a></code>
2360 directive, and starts a subsection which is terminated with a
2361 <code></Location></code> directive. <code class="directive"><Location></code> sections are processed in the
2362 order they appear in the configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
2363 <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files"><Files></a></code> sections.</p>
2365 <p><code class="directive"><Location></code> sections operate
2366 completely outside the filesystem. This has several consequences.
2367 Most importantly, <code class="directive"><Location></code>
2368 directives should not be used to control access to filesystem
2369 locations. Since several different URLs may map to the same
2370 filesystem location, such access controls may by circumvented.</p>
2372 <p>The enclosed directives will be applied to the request if the path component
2373 of the URL meets <em>any</em> of the following criteria:
2376 <li>The specified location matches exactly the path component of the URL.
2378 <li>The specified location, which ends in a forward slash, is a prefix
2379 of the path component of the URL (treated as a context root).
2381 <li>The specified location, with the addition of a trailing slash, is a
2382 prefix of the path component of the URL (also treated as a context root).
2386 In the example below, where no trailing slash is used, requests to
2387 /private1, /private1/ and /private1/file.txt will have the enclosed
2388 directives applied, but /private1other would not.
2390 <div class="example"><p><code>
2391 <Location /private1>
2395 In the example below, where a trailing slash is used, requests to
2396 /private2/ and /private2/file.txt will have the enclosed
2397 directives applied, but /private2 and /private2other would not.
2399 <div class="example"><p><code>
2400 <Location /private2<em>/</em>>
2404 <div class="note"><h3>When to use <code class="directive"><Location></code></h3>
2406 <p>Use <code class="directive"><Location></code> to apply
2407 directives to content that lives outside the filesystem. For
2408 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
2409 <code><Location /></code>, which is an easy way to
2410 apply a configuration to the entire server.</p>
2413 <p>For all origin (non-proxy) requests, the URL to be matched is a
2414 URL-path of the form <code>/path/</code>. <em>No scheme, hostname,
2415 port, or query string may be included.</em> For proxy requests, the
2416 URL to be matched is of the form
2417 <code>scheme://servername/path</code>, and you must include the
2420 <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
2421 any single character, and <code>*</code> matches any sequences of
2422 characters. Neither wildcard character matches a / in the URL-path.</p>
2424 <p><a class="glossarylink" href="../glossary.html#regex" title="ver glosario">Regular expressions</a>
2425 can also be used, with the addition of the <code>~</code>
2426 character. For example:</p>
2428 <div class="example"><p><code>
2429 <Location ~ "/(extra|special)/data">
2432 <p>would match URLs that contained the substring <code>/extra/data</code>
2433 or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch"><LocationMatch></a></code> behaves
2434 identical to the regex version of <code class="directive"><Location></code>, and is preferred, for the
2435 simple reason that <code>~</code> is hard to distinguish from
2436 <code>-</code> in many fonts.</p>
2438 <p>The <code class="directive"><Location></code>
2439 functionality is especially useful when combined with the
2440 <code class="directive"><a href="#sethandler">SetHandler</a></code>
2441 directive. For example, to enable status requests, but allow them
2442 only from browsers at <code>example.com</code>, you might use:</p>
2444 <div class="example"><p><code>
2445 <Location /status><br />
2446 <span class="indent">
2447 SetHandler server-status<br />
2448 Require host example.com<br />
2453 <div class="note"><h3>Note about / (slash)</h3>
2454 <p>The slash character has special meaning depending on where in a
2455 URL it appears. People may be used to its behavior in the filesystem
2456 where multiple adjacent slashes are frequently collapsed to a single
2457 slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
2458 <code>/home/foo</code>). In URL-space this is not necessarily true.
2459 The <code class="directive"><a href="#locationmatch"><LocationMatch></a></code>
2460 directive and the regex version of <code class="directive"><Location></code> require you to explicitly specify multiple
2461 slashes if that is your intention.</p>
2463 <p>For example, <code><LocationMatch ^/abc></code> would match
2464 the request URL <code>/abc</code> but not the request URL <code>
2465 //abc</code>. The (non-regex) <code class="directive"><Location></code> directive behaves similarly when used for
2466 proxy requests. But when (non-regex) <code class="directive"><Location></code> is used for non-proxy requests it will
2467 implicitly match multiple slashes with a single slash. For example,
2468 if you specify <code><Location /abc/def></code> and the
2469 request is to <code>/abc//def</code> then it will match.</p>
2472 <h3>Consulte también</h3>
2474 <li><a href="../sections.html">How <Directory>, <Location>
2475 and <Files> sections work</a> for an explanation of how these
2476 different sections are combined when a request is received.</li>
2477 <li><code class="directive"><a href="#locationmatch">LocationMatch</a></code></li>
2480 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2481 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch"><LocationMatch></a> <a name="locationmatch" id="locationmatch">Directiva</a></h2>
2482 <table class="directive">
2483 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Applies the enclosed directives only to regular-expression
2484 matching URLs</td></tr>
2485 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><LocationMatch
2486 <var>regex</var>> ... </LocationMatch></code></td></tr>
2487 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2488 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2489 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2491 <p>The <code class="directive"><LocationMatch></code> directive
2492 limits the scope of the enclosed directives by URL, in an identical manner
2493 to <code class="directive"><a href="#location"><Location></a></code>. However,
2494 it takes a <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">regular expression</a>
2495 as an argument instead of a simple string. For example:</p>
2497 <div class="example"><p><code>
2498 <LocationMatch "/(extra|special)/data">
2501 <p>would match URLs that contained the substring <code>/extra/data</code>
2502 or <code>/special/data</code>.</p>
2504 <h3>Consulte también</h3>
2506 <li><a href="../sections.html">How <Directory>, <Location>
2507 and <Files> sections work</a> for an explanation of how these
2508 different sections are combined when a request is received</li>
2511 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2512 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directiva</a></h2>
2513 <table class="directive">
2514 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
2515 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>LogLevel [<var>module</var>:]<var>level</var>
2516 [<var>module</var>:<var>level</var>] ...
2518 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>LogLevel warn</code></td></tr>
2519 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
2520 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2521 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2522 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Per-module and per-directory configuration is available in
2523 Apache HTTP Server 2.3.6 and later</td></tr>
2525 <p><code class="directive">LogLevel</code> adjusts the verbosity of the
2526 messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
2527 <var>level</var>s are available, in order of decreasing
2530 <table class="bordered">
2533 <th><strong>Level</strong> </th>
2535 <th><strong>Description</strong> </th>
2537 <th><strong>Example</strong> </th>
2541 <td><code>emerg</code> </td>
2543 <td>Emergencies - system is unusable.</td>
2545 <td>"Child cannot open lock file. Exiting"</td>
2549 <td><code>alert</code> </td>
2551 <td>Action must be taken immediately.</td>
2553 <td>"getpwuid: couldn't determine user name from uid"</td>
2557 <td><code>crit</code> </td>
2559 <td>Critical Conditions.</td>
2561 <td>"socket: Failed to get a socket, exiting child"</td>
2565 <td><code>error</code> </td>
2567 <td>Error conditions.</td>
2569 <td>"Premature end of script headers"</td>
2573 <td><code>warn</code> </td>
2575 <td>Warning conditions.</td>
2577 <td>"child process 1234 did not exit, sending another
2582 <td><code>notice</code> </td>
2584 <td>Normal but significant condition.</td>
2586 <td>"httpd: caught SIGBUS, attempting to dump core in
2591 <td><code>info</code> </td>
2593 <td>Informational.</td>
2595 <td>"Server seems busy, (you may need to increase
2596 StartServers, or Min/MaxSpareServers)..."</td>
2600 <td><code>debug</code> </td>
2602 <td>Debug-level messages</td>
2604 <td>"Opening config file ..."</td>
2607 <td><code>trace1</code> </td>
2609 <td>Trace messages</td>
2611 <td>"proxy: FTP: control connection complete"</td>
2614 <td><code>trace2</code> </td>
2616 <td>Trace messages</td>
2618 <td>"proxy: CONNECT: sending the CONNECT request to the remote proxy"</td>
2621 <td><code>trace3</code> </td>
2623 <td>Trace messages</td>
2625 <td>"openssl: Handshake: start"</td>
2628 <td><code>trace4</code> </td>
2630 <td>Trace messages</td>
2632 <td>"read from buffered SSL brigade, mode 0, 17 bytes"</td>
2635 <td><code>trace5</code> </td>
2637 <td>Trace messages</td>
2639 <td>"map lookup FAILED: map=rewritemap key=keyname"</td>
2642 <td><code>trace6</code> </td>
2644 <td>Trace messages</td>
2646 <td>"cache lookup FAILED, forcing new map lookup"</td>
2649 <td><code>trace7</code> </td>
2651 <td>Trace messages, dumping large amounts of data</td>
2653 <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2656 <td><code>trace8</code> </td>
2658 <td>Trace messages, dumping large amounts of data</td>
2660 <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
2664 <p>When a particular level is specified, messages from all
2665 other levels of higher significance will be reported as well.
2666 <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2667 then messages with log levels of <code>notice</code> and
2668 <code>warn</code> will also be posted.</p>
2670 <p>Using a level of at least <code>crit</code> is
2675 <div class="example"><p><code>
2679 <div class="note"><h3>Note</h3>
2680 <p>When logging to a regular file messages of the level
2681 <code>notice</code> cannot be suppressed and thus are always
2682 logged. However, this doesn't apply when logging is done
2683 using <code>syslog</code>.</p>
2686 <p>Specifying a level without a module name will reset the level
2687 for all modules to that level. Specifying a level with a module
2688 name will set the level for that module only. It is possible to
2689 use the module source file name, the module identifier, or the
2690 module identifier with the trailing <code>_module</code> omitted
2691 as module specification. This means the following three specifications
2694 <div class="example"><p><code>
2695 LogLevel info ssl:warn<br />
2696 LogLevel info mod_ssl.c:warn<br />
2697 LogLevel info ssl_module:warn<br />
2700 <p>It is also possible to change the level per directory:</p>
2702 <div class="example"><p><code>
2704 <Directory /usr/local/apache/htdocs/app><br />
2705 LogLevel debug<br />
2710 Per directory loglevel configuration only affects messages that are
2711 logged after the request has been parsed and that are associated with
2712 the request. Log messages which are associated with the connection or
2713 the server are not affected.
2717 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2718 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directiva</a></h2>
2719 <table class="directive">
2720 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Number of requests allowed on a persistent
2721 connection</td></tr>
2722 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
2723 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
2724 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
2725 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2726 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2728 <p>The <code class="directive">MaxKeepAliveRequests</code> directive
2729 limits the number of requests allowed per connection when
2730 <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
2731 set to <code>0</code>, unlimited requests will be allowed. We
2732 recommend that this setting be kept to a high value for maximum
2733 server performance.</p>
2737 <div class="example"><p><code>
2738 MaxKeepAliveRequests 500
2742 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2743 <div class="directive-section"><h2><a name="MaxRanges" id="MaxRanges">MaxRanges</a> <a name="maxranges" id="maxranges">Directiva</a></h2>
2744 <table class="directive">
2745 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Number of ranges allowed before returning the complete
2747 <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>
2748 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>MaxRanges 200</code></td></tr>
2749 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
2750 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2751 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2752 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache HTTP Server 2.3.15 and later</td></tr>
2753 </table><p>The documentation for this directive has
2754 not been translated yet. Please have a look at the English
2756 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2757 <div class="directive-section"><h2><a name="Mutex" id="Mutex">Mutex</a> <a name="mutex" id="mutex">Directiva</a></h2>
2758 <table class="directive">
2759 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures mutex mechanism and lock file directory for all
2760 or specified mutexes</td></tr>
2761 <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>
2762 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Mutex default</code></td></tr>
2763 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
2764 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2765 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2766 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache HTTP Server 2.3.4 and later</td></tr>
2768 <p>The <code class="directive">Mutex</code> directive sets the mechanism,
2769 and optionally the lock file location, that httpd and modules use
2770 to serialize access to resources. Specify <code>default</code> as
2771 the first argument to change the settings for all mutexes; specify
2772 a mutex name (see table below) as the first argument to override
2773 defaults only for that mutex.</p>
2775 <p>The <code class="directive">Mutex</code> directive is typically used in
2776 the following exceptional situations:</p>
2779 <li>change the mutex mechanism when the default mechanism selected
2780 by <a class="glossarylink" href="../glossary.html#apr" title="ver glosario">APR</a> has a functional or performance
2783 <li>change the directory used by file-based mutexes when the
2784 default directory does not support locking</li>
2787 <div class="note"><h3>Supported modules</h3>
2788 <p>This directive only configures mutexes which have been registered
2789 with the core server using the <code>ap_mutex_register()</code> API.
2790 All modules bundled with httpd support the <code class="directive">Mutex</code>
2791 directive, but third-party modules may not. Consult the documentation
2792 of the third-party module, which must indicate the mutex name(s) which
2793 can be configured if this directive is supported.</p>
2796 <p>The following mutex <em>mechanisms</em> are available:</p>
2798 <li><code>default | yes</code>
2799 <p>This selects the default locking implementation, as determined by
2800 <a class="glossarylink" href="../glossary.html#apr" title="ver glosario">APR</a>. The default locking implementation can
2801 be displayed by running <code class="program"><a href="../programs/httpd.html">httpd</a></code> with the
2802 <code>-V</code> option.</p></li>
2804 <li><code>none | no</code>
2805 <p>This effectively disables the mutex, and is only allowed for a
2806 mutex if the module indicates that it is a valid choice. Consult the
2807 module documentation for more information.</p></li>
2809 <li><code>posixsem</code>
2810 <p>This is a mutex variant based on a Posix semaphore.</p>
2812 <div class="warning"><h3>Warning</h3>
2813 <p>The semaphore ownership is not recovered if a thread in the process
2814 holding the mutex segfaults, resulting in a hang of the web server.</p>
2818 <li><code>sysvsem</code>
2819 <p>This is a mutex variant based on a SystemV IPC semaphore.</p>
2821 <div class="warning"><h3>Warning</h3>
2822 <p>It is possible to "leak" SysV semaphores if processes crash
2823 before the semaphore is removed.</p>
2826 <div class="warning"><h3>Security</h3>
2827 <p>The semaphore API allows for a denial of service attack by any
2828 CGIs running under the same uid as the webserver (<em>i.e.</em>,
2829 all CGIs, unless you use something like <code class="program"><a href="../programs/suexec.html">suexec</a></code>
2830 or <code>cgiwrapper</code>).</p>
2834 <li><code>sem</code>
2835 <p>This selects the "best" available semaphore implementation, choosing
2836 between Posix and SystemV IPC semaphores, in that order.</p></li>
2838 <li><code>pthread</code>
2839 <p>This is a mutex variant based on cross-process Posix thread
2842 <div class="warning"><h3>Warning</h3>
2843 <p>On most systems, if a child process terminates abnormally while
2844 holding a mutex that uses this implementation, the server will deadlock
2845 and stop responding to requests. When this occurs, the server will
2846 require a manual restart to recover.</p>
2847 <p>Solaris is a notable exception as it provides a mechanism which
2848 usually allows the mutex to be recovered after a child process
2849 terminates abnormally while holding a mutex.</p>
2850 <p>If your system implements the
2851 <code>pthread_mutexattr_setrobust_np()</code> function, you may be able
2852 to use the <code>pthread</code> option safely.</p>
2856 <li><code>fcntl:/path/to/mutex</code>
2857 <p>This is a mutex variant where a physical (lock-)file and the
2858 <code>fcntl()</code> function are used as the mutex.</p>
2860 <div class="warning"><h3>Warning</h3>
2861 <p>When multiple mutexes based on this mechanism are used within
2862 multi-threaded, multi-process environments, deadlock errors (EDEADLK)
2863 can be reported for valid mutex operations if <code>fcntl()</code>
2864 is not thread-aware, such as on Solaris.</p>
2868 <li><code>flock:/path/to/mutex</code>
2869 <p>This is similar to the <code>fcntl:/path/to/mutex</code> method
2870 with the exception that the <code>flock()</code> function is used to
2871 provide file locking.</p></li>
2873 <li><code>file:/path/to/mutex</code>
2874 <p>This selects the "best" available file locking implementation,
2875 choosing between <code>fcntl</code> and <code>flock</code>, in that
2879 <p>Most mechanisms are only available on selected platforms, where the
2880 underlying platform and <a class="glossarylink" href="../glossary.html#apr" title="ver glosario">APR</a> support it. Mechanisms
2881 which aren't available on all platforms are <em>posixsem</em>,
2882 <em>sysvsem</em>, <em>sem</em>, <em>pthread</em>, <em>fcntl</em>,
2883 <em>flock</em>, and <em>file</em>.</p>
2885 <p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
2886 the path, if provided, is a directory where the lock file will be created.
2887 The default directory is httpd's run-time file directory relative to
2888 <code class="directive"><a href="#serverroot">ServerRoot</a></code>. Always use a local disk
2889 filesystem for <code>/path/to/mutex</code> and never a directory residing
2890 on a NFS- or AFS-filesystem. The basename of the file will be the mutex
2891 type, an optional instance string provided by the module, and unless the
2892 <code>OmitPID</code> keyword is specified, the process id of the httpd
2893 parent process will be appended to to make the file name unique, avoiding
2894 conflicts when multiple httpd instances share a lock file directory. For
2895 example, if the mutex name is <code>mpm-accept</code> and the lock file
2896 directory is <code>/var/httpd/locks</code>, the lock file name for the
2897 httpd instance with parent process id 12345 would be
2898 <code>/var/httpd/locks/mpm-accept.12345</code>.</p>
2900 <div class="warning"><h3>Security</h3>
2901 <p>It is best to <em>avoid</em> putting mutex files in a world-writable
2902 directory such as <code>/var/tmp</code> because someone could create
2903 a denial of service attack and prevent the server from starting by
2904 creating a lockfile with the same name as the one the server will try
2908 <p>The following table documents the names of mutexes used by httpd
2909 and bundled modules.</p>
2911 <table class="bordered"><tr class="header">
2914 <th>Protected resource</th>
2917 <td><code>mpm-accept</code></td>
2918 <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>
2919 <td>incoming connections, to avoid the thundering herd problem;
2920 for more information, refer to the
2921 <a href="../misc/perf-tuning.html">performance tuning</a>
2925 <td><code>authdigest-client</code></td>
2926 <td><code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
2927 <td>client list in shared memory</td>
2930 <td><code>authdigest-opaque</code></td>
2931 <td><code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
2932 <td>counter in shared memory</td>
2935 <td><code>ldap-cache</code></td>
2936 <td><code class="module"><a href="../mod/mod_ldap.html">mod_ldap</a></code></td>
2937 <td>LDAP result cache</td>
2940 <td><code>rewrite-map</code></td>
2941 <td><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code></td>
2942 <td>communication with external mapping programs, to avoid
2943 intermixed I/O from multiple requests</td>
2946 <td><code>ssl-cache</code></td>
2947 <td><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></td>
2948 <td>SSL session cache</td>
2951 <td><code>ssl-stapling</code></td>
2952 <td><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></td>
2953 <td>OCSP stapling response cache</td>
2956 <td><code>watchdog-callback</code></td>
2957 <td><code class="module"><a href="../mod/mod_watchdog.html">mod_watchdog</a></code></td>
2958 <td>callback function of a particular client module</td>
2962 <p>The <code>OmitPID</code> keyword suppresses the addition of the httpd
2963 parent process id from the lock file name.</p>
2965 <p>In the following example, the mutex mechanism for the MPM accept
2966 mutex will be changed from the compiled-in default to <code>fcntl</code>,
2967 with the associated lock file created in directory
2968 <code>/var/httpd/locks</code>. The mutex mechanism for all other mutexes
2969 will be changed from the compiled-in default to <code>sysvsem</code>.</p>
2971 <div class="example"><p><code>
2972 Mutex default sysvsem<br />
2973 Mutex mpm-accept fcntl:/var/httpd/locks
2977 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2978 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directiva</a></h2>
2979 <table class="directive">
2980 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Designates an IP address for name-virtual
2982 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
2983 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
2984 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
2985 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
2988 <p>A single <code class="directive">NameVirtualHost</code> directive
2989 identifies a set of identical virtual hosts on which the server will
2990 further select from on the basis of the <em>hostname</em>
2991 requested by the client. The <code class="directive">NameVirtualHost</code>
2992 directive is a required directive if you want to configure
2993 <a href="../vhosts/">name-based virtual hosts</a>.</p>
2995 <p>This directive, and the corresponding <code class="directive">VirtualHost</code>,
2996 <em>must</em> be qualified with a port number if the server supports both HTTP
2997 and HTTPS connections.</p>
2999 <p>Although <var>addr</var> can be a hostname, it is recommended
3000 that you always use an IP address or a wildcard. A wildcard
3001 NameVirtualHost matches only virtualhosts that also have a literal wildcard
3002 as their argument.</p>
3004 <p>In cases where a firewall or other proxy receives the requests and
3005 forwards them on a different IP address to the server, you must specify the
3006 IP address of the physical interface on the machine which will be
3007 servicing the requests. </p>
3009 <p> In the example below, requests received on interface 192.0.2.1 and port 80
3010 will only select among the first two virtual hosts. Requests received on
3011 port 80 on any other interface will only select among the third and fourth
3012 virtual hosts. In the common case where the interface isn't important
3013 to the mapping, only the "*:80" NameVirtualHost and VirtualHost directives
3016 <div class="example"><p><code>
3017 NameVirtualHost 192.0.2.1:80<br />
3018 NameVirtualHost *:80<br /><br />
3020 <VirtualHost 192.0.2.1:80><br />
3021 ServerName namebased-a.example.com<br />
3022 </VirtualHost><br />
3024 <VirtualHost 192.0.2.1:80><br />
3025 Servername namebased-b.example.com<br />
3026 </VirtualHost><br />
3028 <VirtualHost *:80><br />
3029 ServerName namebased-c.example.com <br />
3030 </VirtualHost><br />
3032 <VirtualHost *:80><br />
3033 ServerName namebased-d.example.com <br />
3034 </VirtualHost><br />
3039 <p>If no matching virtual host is found, then the first listed
3040 virtual host that matches the IP address and port will be used.</p>
3043 <p>IPv6 addresses must be enclosed in square brackets, as shown
3044 in the following example:</p>
3046 <div class="example"><p><code>
3047 NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
3050 <div class="note"><h3>Argument to <code class="directive"><VirtualHost></code>
3052 <p>Note that the argument to the <code class="directive"><VirtualHost></code> directive must
3053 exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
3055 <div class="example"><p><code>
3056 NameVirtualHost 192.0.2.2:80<br />
3057 <VirtualHost 192.0.2.2:80><br />
3059 </VirtualHost><br />
3063 <h3>Consulte también</h3>
3065 <li><a href="../vhosts/">Virtual Hosts
3066 documentation</a></li>
3069 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3070 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directiva</a></h2>
3071 <table class="directive">
3072 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures what features are available in a particular
3074 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Options
3075 [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
3076 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Options All</code></td></tr>
3077 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3078 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>Options</td></tr>
3079 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3080 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3082 <p>The <code class="directive">Options</code> directive controls which
3083 server features are available in a particular directory.</p>
3085 <p><var>option</var> can be set to <code>None</code>, in which
3086 case none of the extra features are enabled, or one or more of
3090 <dt><code>All</code></dt>
3092 <dd>All options except for <code>MultiViews</code>. This is the default
3095 <dt><code>ExecCGI</code></dt>
3098 Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
3101 <dt><code>FollowSymLinks</code></dt>
3105 The server will follow symbolic links in this directory.
3107 <p>Even though the server follows the symlink it does <em>not</em>
3108 change the pathname used to match against <code class="directive"><a href="#directory"><Directory></a></code> sections.</p>
3109 <p>Note also, that this option <strong>gets ignored</strong> if set
3110 inside a <code class="directive"><a href="#location"><Location></a></code>
3112 <p>Omitting this option should not be considered a security restriction,
3113 since symlink testing is subject to race conditions that make it
3117 <dt><code>Includes</code></dt>
3120 Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
3123 <dt><code>IncludesNOEXEC</code></dt>
3127 Server-side includes are permitted, but the <code>#exec
3128 cmd</code> and <code>#exec cgi</code> are disabled. It is still
3129 possible to <code>#include virtual</code> CGI scripts from
3130 <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
3133 <dt><code>Indexes</code></dt>
3136 If a URL which maps to a directory is requested, and there
3137 is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
3138 (<em>e.g.</em>, <code>index.html</code>) in that directory, then
3139 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
3140 of the directory.</dd>
3142 <dt><code>MultiViews</code></dt>
3145 <a href="../content-negotiation.html">Content negotiated</a>
3146 "MultiViews" are allowed using
3147 <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.
3148 <div class="note"><h3>Note</h3> <p>This option gets ignored if set
3149 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>
3150 needs real resources to compare against and evaluate from.</p></div>
3153 <dt><code>SymLinksIfOwnerMatch</code></dt>
3155 <dd>The server will only follow symbolic links for which the
3156 target file or directory is owned by the same user id as the
3159 <div class="note"><h3>Note</h3> <p>This option gets ignored if
3160 set inside a <code class="directive"><a href="#location"><Location></a></code> section.</p>
3161 <p>This option should not be considered a security restriction,
3162 since symlink testing is subject to race conditions that make it
3163 circumventable.</p></div>
3167 <p>Normally, if multiple <code class="directive">Options</code> could
3168 apply to a directory, then the most specific one is used and
3169 others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
3170 However if <em>all</em> the options on the
3171 <code class="directive">Options</code> directive are preceded by a
3172 <code>+</code> or <code>-</code> symbol, the options are
3173 merged. Any options preceded by a <code>+</code> are added to the
3174 options currently in force, and any options preceded by a
3175 <code>-</code> are removed from the options currently in
3178 <div class="warning"><h3>Warning</h3>
3179 <p>Mixing <code class="directive">Options</code> with a <code>+</code> or
3180 <code>-</code> with those without is not valid syntax, and is likely
3181 to cause unexpected results.</p>
3184 <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
3186 <div class="example"><p><code>
3187 <Directory /web/docs><br />
3188 <span class="indent">
3189 Options Indexes FollowSymLinks<br />
3191 </Directory><br />
3193 <Directory /web/docs/spec><br />
3194 <span class="indent">
3195 Options Includes<br />
3200 <p>then only <code>Includes</code> will be set for the
3201 <code>/web/docs/spec</code> directory. However if the second
3202 <code class="directive">Options</code> directive uses the <code>+</code> and
3203 <code>-</code> symbols:</p>
3205 <div class="example"><p><code>
3206 <Directory /web/docs><br />
3207 <span class="indent">
3208 Options Indexes FollowSymLinks<br />
3210 </Directory><br />
3212 <Directory /web/docs/spec><br />
3213 <span class="indent">
3214 Options +Includes -Indexes<br />
3219 <p>then the options <code>FollowSymLinks</code> and
3220 <code>Includes</code> are set for the <code>/web/docs/spec</code>
3223 <div class="note"><h3>Note</h3>
3224 <p>Using <code>-IncludesNOEXEC</code> or
3225 <code>-Includes</code> disables server-side includes completely
3226 regardless of the previous setting.</p>
3229 <p>The default in the absence of any other settings is
3230 <code>All</code>.</p>
3233 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3234 <div class="directive-section"><h2><a name="Protocol" id="Protocol">Protocol</a> <a name="protocol" id="protocol">Directiva</a></h2>
3235 <table class="directive">
3236 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Protocol for a listening socket</td></tr>
3237 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Protocol <var>protocol</var></code></td></tr>
3238 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3239 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3240 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3241 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache 2.1.5 and later.
3242 On Windows from Apache 2.3.3 and later.</td></tr>
3244 <p>This directive specifies the protocol used for a specific listening socket.
3245 The protocol is used to determine which module should handle a request, and
3246 to apply protocol specific optimizations with the <code class="directive">AcceptFilter</code>
3249 <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>
3251 <p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
3253 <div class="example"><p><code>
3257 <p>You can also specify the protocol using the <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> directive.</p>
3259 <h3>Consulte también</h3>
3261 <li><code class="directive">AcceptFilter</code></li>
3262 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3265 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3266 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directiva</a></h2>
3267 <table class="directive">
3268 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the CPU consumption of processes launched
3269 by Apache httpd children</td></tr>
3270 <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>
3271 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3272 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3273 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3274 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3275 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3277 <p>Takes 1 or 2 parameters. The first parameter sets the soft
3278 resource limit for all processes and the second parameter sets
3279 the maximum resource limit. Either parameter can be a number,
3280 or <code>max</code> to indicate to the server that the limit should
3281 be set to the maximum allowed by the operating system
3282 configuration. Raising the maximum resource limit requires that
3283 the server is running as <code>root</code>, or in the initial startup
3286 <p>This applies to processes forked off from Apache httpd children
3287 servicing requests, not the Apache httpd children themselves. This
3288 includes CGI scripts and SSI exec commands, but not any
3289 processes forked off from the Apache httpd parent such as piped
3292 <p>CPU resource limits are expressed in seconds per
3295 <h3>Consulte también</h3>
3297 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
3298 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
3301 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3302 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directiva</a></h2>
3303 <table class="directive">
3304 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the memory consumption of processes launched
3305 by Apache httpd children</td></tr>
3306 <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>
3307 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3308 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3309 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3310 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3311 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3313 <p>Takes 1 or 2 parameters. The first parameter sets the soft
3314 resource limit for all processes and the second parameter sets
3315 the maximum resource limit. Either parameter can be a number,
3316 or <code>max</code> to indicate to the server that the limit should
3317 be set to the maximum allowed by the operating system
3318 configuration. Raising the maximum resource limit requires that
3319 the server is running as <code>root</code>, or in the initial startup
3322 <p>This applies to processes forked off from Apache httpd children
3323 servicing requests, not the Apache httpd children themselves. This
3324 includes CGI scripts and SSI exec commands, but not any
3325 processes forked off from the Apache httpd parent such as piped
3328 <p>Memory resource limits are expressed in bytes per
3331 <h3>Consulte también</h3>
3333 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
3334 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
3337 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3338 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directiva</a></h2>
3339 <table class="directive">
3340 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Limits the number of processes that can be launched by
3341 processes launched by Apache httpd children</td></tr>
3342 <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>
3343 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
3344 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3345 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3346 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3347 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3349 <p>Takes 1 or 2 parameters. The first parameter sets the soft
3350 resource limit for all processes and the second parameter sets
3351 the maximum resource limit. Either parameter can be a number,
3352 or <code>max</code> to indicate to the server that the limit
3353 should be set to the maximum allowed by the operating system
3354 configuration. Raising the maximum resource limit requires that
3355 the server is running as <code>root</code>, or in the initial startup
3358 <p>This applies to processes forked off from Apache httpd children
3359 servicing requests, not the Apache httpd children themselves. This
3360 includes CGI scripts and SSI exec commands, but not any
3361 processes forked off from the Apache httpd parent such as piped
3364 <p>Process limits control the number of processes per user.</p>
3366 <div class="note"><h3>Note</h3>
3367 <p>If CGI processes are <strong>not</strong> running
3368 under user ids other than the web server user id, this directive
3369 will limit the number of processes that the server itself can
3370 create. Evidence of this situation will be indicated by
3371 <strong><code>cannot fork</code></strong> messages in the
3372 <code>error_log</code>.</p>
3375 <h3>Consulte también</h3>
3377 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
3378 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
3381 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3382 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directiva</a></h2>
3383 <table class="directive">
3384 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Technique for locating the interpreter for CGI
3386 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
3387 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
3388 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3389 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3390 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3391 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3392 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Win32 only;
3393 option <code>Registry-Strict</code> is available in Apache HTTP Server 2.0 and
3396 <p>This directive is used to control how Apache httpd finds the
3397 interpreter used to run CGI scripts. The default setting is
3398 <code>Script</code>. This causes Apache httpd to use the interpreter pointed to
3399 by the shebang line (first line, starting with <code>#!</code>) in the
3400 script. On Win32 systems this line usually looks like:</p>
3402 <div class="example"><p><code>
3403 #!C:/Perl/bin/perl.exe
3406 <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
3408 <div class="example"><p><code>
3412 <p>Setting <code>ScriptInterpreterSource Registry</code> will
3413 cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
3414 searched using the script file extension (e.g., <code>.pl</code>) as a
3415 search key. The command defined by the registry subkey
3416 <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
3417 <code>Shell\Open\Command</code> is used to open the script file. If the
3418 registry keys cannot be found, Apache httpd falls back to the behavior of the
3419 <code>Script</code> option.</p>
3421 <div class="warning"><h3>Security</h3>
3422 <p>Be careful when using <code>ScriptInterpreterSource
3423 Registry</code> with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
3424 Apache httpd will try to execute <strong>every</strong> file within this
3425 directory. The <code>Registry</code> setting may cause undesired
3426 program calls on files which are typically not executed. For
3427 example, the default open command on <code>.htm</code> files on
3428 most Windows systems will execute Microsoft Internet Explorer, so
3429 any HTTP request for an <code>.htm</code> file existing within the
3430 script directory would start the browser in the background on the
3431 server. This is a good way to crash your system within a minute or
3435 <p>The option <code>Registry-Strict</code> which is new in Apache HTTP Server
3436 2.0 does the same thing as <code>Registry</code> but uses only the
3437 subkey <code>Shell\ExecCGI\Command</code>. The
3438 <code>ExecCGI</code> key is not a common one. It must be
3439 configured manually in the windows registry and hence prevents
3440 accidental program calls on your system.</p>
3443 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3444 <div class="directive-section"><h2><a name="SeeRequestTail" id="SeeRequestTail">SeeRequestTail</a> <a name="seerequesttail" id="seerequesttail">Directiva</a></h2>
3445 <table class="directive">
3446 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determine if mod_status displays the first 63 characters
3447 of a request or the last 63, assuming the request itself is greater than
3449 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SeeRequestTail On|Off</code></td></tr>
3450 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>SeeRequestTail Off</code></td></tr>
3451 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3452 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3453 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3454 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.2.7 and later.</td></tr>
3456 <p>mod_status with <code>ExtendedStatus On</code>
3457 displays the actual request being handled.
3458 For historical purposes, only 63 characters of the request
3459 are actually stored for display purposes. This directive
3460 controls whether the 1st 63 characters are stored (the previous
3461 behavior and the default) or if the last 63 characters are. This
3462 is only applicable, of course, if the length of the request is
3463 64 characters or greater.</p>
3465 <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:
3468 <table class="bordered">
3470 <th>Off (default)</th>
3471 <td>GET /disk1/storage/apache/htdocs/images/imagestore1/food/apples</td>
3475 <td>orage/apache/htdocs/images/imagestore1/food/apples.jpg HTTP/1.1</td>
3481 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3482 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directiva</a></h2>
3483 <table class="directive">
3484 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Email address that the server includes in error
3485 messages sent to the client</td></tr>
3486 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
3487 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3488 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3489 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3491 <p>The <code class="directive">ServerAdmin</code> sets the contact address
3492 that the server includes in any error messages it returns to the
3493 client. If the <code>httpd</code> doesn't recognize the supplied argument
3495 assumes, that it's an <var>email-address</var> and prepends it with
3496 <code>mailto:</code> in hyperlink targets. However, it's recommended to
3497 actually use an email address, since there are a lot of CGI scripts that
3498 make that assumption. If you want to use an URL, it should point to another
3499 server under your control. Otherwise users may not be able to contact you in
3502 <p>It may be worth setting up a dedicated address for this, e.g.</p>
3504 <div class="example"><p><code>
3505 ServerAdmin www-admin@foo.example.com
3507 <p>as users do not always mention that they are talking about the
3511 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3512 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directiva</a></h2>
3513 <table class="directive">
3514 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Alternate names for a host used when matching requests
3515 to name-virtual hosts</td></tr>
3516 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
3517 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>virtual host</td></tr>
3518 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3519 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3521 <p>The <code class="directive">ServerAlias</code> directive sets the
3522 alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>. The
3523 <code class="directive">ServerAlias</code> may include wildcards, if appropriate.</p>
3525 <div class="example"><p><code>
3526 <VirtualHost *:80><br />
3527 ServerName server.domain.com<br />
3528 ServerAlias server server2.domain.com server2<br />
3529 ServerAlias *.example.com<br />
3530 UseCanonicalName Off<br />
3532 </VirtualHost>
3535 <h3>Consulte también</h3>
3537 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3538 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
3541 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3542 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directiva</a></h2>
3543 <table class="directive">
3544 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Hostname and port that the server uses to identify
3546 <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>
3547 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3548 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3549 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3551 <p>The <code class="directive">ServerName</code> directive sets the
3552 request scheme, hostname and
3553 port that the server uses to identify itself. This is used when
3554 creating redirection URLs.</p>
3556 <p>Additionally, <code class="directive">ServerName</code> is used (possibly
3557 in conjunction with <code class="directive">ServerAlias</code>) to uniquely
3558 identify a virtual host, when using <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
3560 <p>For example, if the name of the
3561 machine hosting the web server is <code>simple.example.com</code>,
3562 but the machine also has the DNS alias <code>www.example.com</code>
3563 and you wish the web server to be so identified, the following
3564 directive should be used:</p>
3566 <div class="example"><p><code>
3567 ServerName www.example.com:80
3570 <p>The <code class="directive">ServerName</code> directive
3571 may appear anywhere within the definition of a server. However,
3572 each appearance overrides the previous appearance (within that
3575 <p>If no <code class="directive">ServerName</code> is specified, then the
3576 server attempts to deduce the hostname by performing a reverse
3577 lookup on the IP address. If no port is specified in the
3578 <code class="directive">ServerName</code>, then the server will use the
3579 port from the incoming request. For optimal reliability and
3580 predictability, you should specify an explicit hostname and port
3581 using the <code class="directive">ServerName</code> directive.</p>
3583 <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
3584 the <code class="directive">ServerName</code> inside a
3585 <code class="directive"><a href="#virtualhost"><VirtualHost></a></code>
3586 section specifies what hostname must appear in the request's
3587 <code>Host:</code> header to match this virtual host.</p>
3589 <p>Sometimes, the server runs behind a device that processes SSL,
3590 such as a reverse proxy, load balancer or SSL offload
3591 appliance. When this is the case, specify the
3592 <code>https://</code> scheme and the port number to which the
3593 clients connect in the <code class="directive">ServerName</code> directive
3594 to make sure that the server generates the correct
3595 self-referential URLs.
3598 <p>See the description of the
3599 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> and
3600 <code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code> directives for
3601 settings which determine whether self-referential URLs (e.g., by the
3602 <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
3603 specified port, or to the port number given in the client's request.
3606 <div class="warning">
3607 <p>Failure to set <code class="directive">ServerName</code> to a name that
3608 your server can resolve to an IP address will result in a startup
3609 warning. <code>httpd</code> will then use whatever hostname it can
3610 determine, using the system's <code>hostname</code> command. This
3611 will almost never be the hostname you actually want.</p>
3612 <div class="example"><p><code>
3613 httpd: Could not reliably determine the server's fully qualified domain name, using rocinante.local for ServerName
3618 <h3>Consulte también</h3>
3620 <li><a href="../dns-caveats.html">Issues Regarding DNS and
3621 Apache HTTP Server</a></li>
3622 <li><a href="../vhosts/">Apache HTTP Server virtual host
3623 documentation</a></li>
3624 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3625 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
3626 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
3627 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
3630 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3631 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directiva</a></h2>
3632 <table class="directive">
3633 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Legacy URL pathname for a name-based virtual host that
3634 is accessed by an incompatible browser</td></tr>
3635 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
3636 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>virtual host</td></tr>
3637 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3638 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3640 <p>The <code class="directive">ServerPath</code> directive sets the legacy
3641 URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
3643 <h3>Consulte también</h3>
3645 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
3648 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3649 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directiva</a></h2>
3650 <table class="directive">
3651 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Base directory for the server installation</td></tr>
3652 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
3653 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
3654 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3655 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3656 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3658 <p>The <code class="directive">ServerRoot</code> directive sets the
3659 directory in which the server lives. Typically it will contain the
3660 subdirectories <code>conf/</code> and <code>logs/</code>. Relative
3661 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
3662 relative to this directory.</p>
3664 <div class="example"><h3>Example</h3><p><code>
3665 ServerRoot /home/httpd
3669 <h3>Consulte también</h3>
3671 <li><a href="../invoking.html">the <code>-d</code>
3672 option to <code>httpd</code></a></li>
3673 <li><a href="../misc/security_tips.html#serverroot">the
3674 security tips</a> for information on how to properly set
3675 permissions on the <code class="directive">ServerRoot</code></li>
3678 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3679 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directiva</a></h2>
3680 <table class="directive">
3681 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures the footer on server-generated documents</td></tr>
3682 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
3683 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ServerSignature Off</code></td></tr>
3684 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3685 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
3686 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3687 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3689 <p>The <code class="directive">ServerSignature</code> directive allows the
3690 configuration of a trailing footer line under server-generated
3691 documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
3692 listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
3693 would want to enable such a footer line is that in a chain of proxies,
3694 the user often has no possibility to tell which of the chained servers
3695 actually produced a returned error message.</p>
3697 <p>The <code>Off</code>
3698 setting, which is the default, suppresses the footer line (and is
3699 therefore compatible with the behavior of Apache-1.2 and
3700 below). The <code>On</code> setting simply adds a line with the
3701 server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
3702 and the <code>EMail</code> setting additionally creates a
3703 "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
3706 <p>After version 2.0.44, the details of the server version number
3707 presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
3709 <h3>Consulte también</h3>
3711 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
3714 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3715 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directiva</a></h2>
3716 <table class="directive">
3717 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures the <code>Server</code> HTTP response
3719 <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>
3720 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ServerTokens Full</code></td></tr>
3721 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3722 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3723 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3725 <p>This directive controls whether <code>Server</code> response
3726 header field which is sent back to clients includes a
3727 description of the generic OS-type of the server as well as
3728 information about compiled-in modules.</p>
3731 <dt><code>ServerTokens Full</code> (or not specified)</dt>
3733 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3734 (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
3736 <dt><code>ServerTokens Prod[uctOnly]</code></dt>
3738 <dd>Server sends (<em>e.g.</em>): <code>Server:
3741 <dt><code>ServerTokens Major</code></dt>
3743 <dd>Server sends (<em>e.g.</em>): <code>Server:
3744 Apache/2</code></dd>
3746 <dt><code>ServerTokens Minor</code></dt>
3748 <dd>Server sends (<em>e.g.</em>): <code>Server:
3749 Apache/2.4</code></dd>
3751 <dt><code>ServerTokens Min[imal]</code></dt>
3753 <dd>Server sends (<em>e.g.</em>): <code>Server:
3754 Apache/2.4.1</code></dd>
3756 <dt><code>ServerTokens OS</code></dt>
3758 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
3763 <p>This setting applies to the entire server, and cannot be
3764 enabled or disabled on a virtualhost-by-virtualhost basis.</p>
3766 <p>After version 2.0.44, this directive also controls the
3767 information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
3769 <div class="note">Setting <code class="directive">ServerTokens</code> to less than
3770 <code>minimal</code> is not recommended because it makes it more
3771 difficult to debug interoperational problems. Also note that
3772 disabling the Server: header does nothing at all to make your
3773 server more secure; the idea of "security through obscurity"
3774 is a myth and leads to a false sense of safety.</div>
3777 <h3>Consulte también</h3>
3779 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
3782 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3783 <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directiva</a></h2>
3784 <table class="directive">
3785 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Forces all matching files to be processed by a
3787 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
3788 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3789 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3790 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3791 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3792 <tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Moved into the core in Apache httpd 2.0</td></tr>
3794 <p>When placed into an <code>.htaccess</code> file or a
3795 <code class="directive"><a href="#directory"><Directory></a></code> or
3796 <code class="directive"><a href="#location"><Location></a></code>
3797 section, this directive forces all matching files to be parsed
3798 through the <a href="../handler.html">handler</a> given by
3799 <var>handler-name</var>. For example, if you had a directory you
3800 wanted to be parsed entirely as imagemap rule files, regardless
3801 of extension, you might put the following into an
3802 <code>.htaccess</code> file in that directory:</p>
3804 <div class="example"><p><code>
3805 SetHandler imap-file
3808 <p>Another example: if you wanted to have the server display a
3809 status report whenever a URL of
3810 <code>http://servername/status</code> was called, you might put
3811 the following into <code>httpd.conf</code>:</p>
3813 <div class="example"><p><code>
3814 <Location /status><br />
3815 <span class="indent">
3816 SetHandler server-status<br />
3821 <p>You can override an earlier defined <code class="directive">SetHandler</code>
3822 directive by using the value <code>None</code>.</p>
3823 <p><strong>Note:</strong> because SetHandler overrides default handlers,
3824 normal behaviour such as handling of URLs ending in a slash (/) as
3825 directories or index files is suppressed.</p>
3827 <h3>Consulte también</h3>
3829 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
3832 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3833 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directiva</a></h2>
3834 <table class="directive">
3835 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Sets the filters that will process client requests and POST
3837 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
3838 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3839 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3840 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3841 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3843 <p>The <code class="directive">SetInputFilter</code> directive sets the
3844 filter or filters which will process client requests and POST
3845 input when they are received by the server. This is in addition to
3846 any filters defined elsewhere, including the
3847 <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
3850 <p>If more than one filter is specified, they must be separated
3851 by semicolons in the order in which they should process the
3854 <h3>Consulte también</h3>
3856 <li><a href="../filter.html">Filters</a> documentation</li>
3859 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3860 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directiva</a></h2>
3861 <table class="directive">
3862 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Sets the filters that will process responses from the
3864 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
3865 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3866 <tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
3867 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3868 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3870 <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
3871 which will process responses from the server before they are
3872 sent to the client. This is in addition to any filters defined
3873 elsewhere, including the
3874 <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
3877 <p>For example, the following configuration will process all files
3878 in the <code>/www/data/</code> directory for server-side
3881 <div class="example"><p><code>
3882 <Directory /www/data/><br />
3883 <span class="indent">
3884 SetOutputFilter INCLUDES<br />
3889 <p>If more than one filter is specified, they must be separated
3890 by semicolons in the order in which they should process the
3893 <h3>Consulte también</h3>
3895 <li><a href="../filter.html">Filters</a> documentation</li>
3898 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3899 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directiva</a></h2>
3900 <table class="directive">
3901 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Amount of time the server will wait for
3902 certain events before failing a request</td></tr>
3903 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
3904 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>TimeOut 300</code></td></tr>
3905 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
3906 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3907 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3909 <p>The <code class="directive">TimeOut</code> directive defines the length
3910 of time Apache httpd will wait for I/O in various circumstances:</p>
3913 <li>When reading data from the client, the length of time to
3914 wait for a TCP packet to arrive if the read buffer is
3917 <li>When writing data to the client, the length of time to wait
3918 for an acknowledgement of a packet if the send buffer is
3921 <li>In <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>, the length of time to wait for
3922 output from a CGI script.</li>
3924 <li>In <code class="module"><a href="../mod/mod_ext_filter.html">mod_ext_filter</a></code>, the length of time to
3925 wait for output from a filtering process.</li>
3927 <li>In <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, the default timeout value if
3928 <code class="directive"><a href="../mod/mod_proxy.html#proxytimeout">ProxyTimeout</a></code> is not
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="TraceEnable" id="TraceEnable">TraceEnable</a> <a name="traceenable" id="traceenable">Directiva</a></h2>
3936 <table class="directive">
3937 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Determines the behaviour on <code>TRACE</code> requests</td></tr>
3938 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>TraceEnable <var>[on|off|extended]</var></code></td></tr>
3939 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>TraceEnable on</code></td></tr>
3940 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3941 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3942 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3943 <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>
3945 <p>This directive overrides the behavior of <code>TRACE</code> for both
3946 the core server and <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>. The default
3947 <code>TraceEnable on</code> permits <code>TRACE</code> requests per
3948 RFC 2616, which disallows any request body to accompany the request.
3949 <code>TraceEnable off</code> causes the core server and
3950 <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> to return a <code>405</code> (Method not
3951 allowed) error to the client.</p>
3953 <p>Finally, for testing and diagnostic purposes only, request
3954 bodies may be allowed using the non-compliant <code>TraceEnable
3955 extended</code> directive. The core (as an origin server) will
3956 restrict the request body to 64k (plus 8k for chunk headers if
3957 <code>Transfer-Encoding: chunked</code> is used). The core will
3958 reflect the full headers and all chunk headers with the response
3959 body. As a proxy server, the request body is not restricted to 64k.</p>
3962 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3963 <div class="directive-section"><h2><a name="UnDefine" id="UnDefine">UnDefine</a> <a name="undefine" id="undefine">Directiva</a></h2>
3964 <table class="directive">
3965 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Undefine the existence of a variable</td></tr>
3966 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>UnDefine <var>parameter-name</var></code></td></tr>
3967 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
3968 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3969 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3971 <p>Undoes the effect of a <code class="directive"><a href="#define">Define</a></code> or
3972 of passing a <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p>
3973 <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
3974 <code>-D</code> arguments in any startup scripts.</p>
3977 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3978 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directiva</a></h2>
3979 <table class="directive">
3980 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures how the server determines its own name and
3982 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
3983 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>UseCanonicalName Off</code></td></tr>
3984 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
3985 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
3986 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
3988 <p>In many situations Apache httpd must construct a <em>self-referential</em>
3989 URL -- that is, a URL that refers back to the same server. With
3990 <code>UseCanonicalName On</code> Apache httpd will use the hostname and port
3991 specified in the <code class="directive"><a href="#servername">ServerName</a></code>
3992 directive to construct the canonical name for the server. This name
3993 is used in all self-referential URLs, and for the values of
3994 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
3996 <p>With <code>UseCanonicalName Off</code> Apache httpd will form
3997 self-referential URLs using the hostname and port supplied by
3998 the client if any are supplied (otherwise it will use the
3999 canonical name, as defined above). These values are the same
4000 that are used to implement <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
4001 and are available with the same clients. The CGI variables
4002 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
4003 constructed from the client supplied values as well.</p>
4005 <p>An example where this may be useful is on an intranet server
4006 where you have users connecting to the machine using short
4007 names such as <code>www</code>. You'll notice that if the users
4008 type a shortname, and a URL which is a directory, such as
4009 <code>http://www/splat</code>, <em>without the trailing
4010 slash</em> then Apache httpd will redirect them to
4011 <code>http://www.domain.com/splat/</code>. If you have
4012 authentication enabled, this will cause the user to have to
4013 authenticate twice (once for <code>www</code> and once again
4014 for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
4015 FAQ on this subject for more information</a>). But if
4016 <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
4017 Apache httpd will redirect to <code>http://www/splat/</code>.</p>
4019 <p>There is a third option, <code>UseCanonicalName DNS</code>,
4020 which is intended for use with mass IP-based virtual hosting to
4021 support ancient clients that do not provide a
4022 <code>Host:</code> header. With this option Apache httpd does a
4023 reverse DNS lookup on the server IP address that the client
4024 connected to in order to work out self-referential URLs.</p>
4026 <div class="warning"><h3>Warning</h3>
4027 <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
4028 they may be broken by this option. The client is essentially free
4029 to give whatever value they want as a hostname. But if the CGI is
4030 only using <code>SERVER_NAME</code> to construct self-referential URLs
4031 then it should be just fine.</p>
4034 <h3>Consulte también</h3>
4036 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
4037 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
4038 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
4041 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4042 <div class="directive-section"><h2><a name="UseCanonicalPhysicalPort" id="UseCanonicalPhysicalPort">UseCanonicalPhysicalPort</a> <a name="usecanonicalphysicalport" id="usecanonicalphysicalport">Directiva</a></h2>
4043 <table class="directive">
4044 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Configures how the server determines its own name and
4046 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>UseCanonicalPhysicalPort On|Off</code></td></tr>
4047 <tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>UseCanonicalPhysicalPort Off</code></td></tr>
4048 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directory</td></tr>
4049 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
4050 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
4052 <p>In many situations Apache httpd must construct a <em>self-referential</em>
4053 URL -- that is, a URL that refers back to the same server. With
4054 <code>UseCanonicalPhysicalPort On</code> Apache httpd will, when
4055 constructing the canonical port for the server to honor
4056 the <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive,
4057 provide the actual physical port number being used by this request
4058 as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
4059 Apache httpd will not ever use the actual physical port number, instead
4060 relying on all configured information to construct a valid port number.</p>
4062 <div class="note"><h3>Note</h3>
4063 <p>The ordering of when the physical port is used is as follows:<br /><br />
4064 <code>UseCanonicalName On</code></p>
4066 <li>Port provided in <code>Servername</code></li>
4067 <li>Physical port</li>
4068 <li>Default port</li>
4070 <code>UseCanonicalName Off | DNS</code>
4072 <li>Parsed port from <code>Host:</code> header</li>
4073 <li>Physical port</li>
4074 <li>Port provided in <code>Servername</code></li>
4075 <li>Default port</li>
4078 <p>With <code>UseCanonicalPhysicalPort Off</code>, the
4079 physical ports are removed from the ordering.</p>
4083 <h3>Consulte también</h3>
4085 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
4086 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
4087 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
4090 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
4091 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost"><VirtualHost></a> <a name="virtualhost" id="virtualhost">Directiva</a></h2>
4092 <table class="directive">
4093 <tr><th><a href="directive-dict.html#Description">Descripción:</a></th><td>Contains directives that apply only to a specific
4094 hostname or IP address</td></tr>
4095 <tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code><VirtualHost
4096 <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
4097 ...> ... </VirtualHost></code></td></tr>
4098 <tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
4099 <tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
4100 <tr><th><a href="directive-dict.html#Module">Módulo:</a></th><td>core</td></tr>
4102 <p><code class="directive"><VirtualHost></code> and
4103 <code></VirtualHost></code> are used to enclose a group of
4104 directives that will apply only to a particular virtual host. Any
4105 directive that is allowed in a virtual host context may be
4106 used. When the server receives a request for a document on a
4107 particular virtual host, it uses the configuration directives
4108 enclosed in the <code class="directive"><VirtualHost></code>
4109 section. <var>Addr</var> can be:</p>
4112 <li>The IP address of the virtual host;</li>
4114 <li>A fully qualified domain name for the IP address of the
4115 virtual host (not recommended);</li>
4117 <li>The character <code>*</code>, which is used only in combination with
4118 <code>NameVirtualHost *</code> to match all IP addresses; or</li>
4120 <li>The string <code>_default_</code>, which is used only
4121 with IP virtual hosting to catch unmatched IP addresses.</li>
4124 <div class="example"><h3>Example</h3><p><code>
4125 <VirtualHost 10.1.2.3><br />
4126 <span class="indent">
4127 ServerAdmin webmaster@host.example.com<br />
4128 DocumentRoot /www/docs/host.example.com<br />
4129 ServerName host.example.com<br />
4130 ErrorLog logs/host.example.com-error_log<br />
4131 TransferLog logs/host.example.com-access_log<br />
4133 </VirtualHost>
4137 <p>IPv6 addresses must be specified in square brackets because
4138 the optional port number could not be determined otherwise. An
4139 IPv6 example is shown below:</p>
4141 <div class="example"><p><code>
4142 <VirtualHost [2001:db8::a00:20ff:fea7:ccea]><br />
4143 <span class="indent">
4144 ServerAdmin webmaster@host.example.com<br />
4145 DocumentRoot /www/docs/host.example.com<br />
4146 ServerName host.example.com<br />
4147 ErrorLog logs/host.example.com-error_log<br />
4148 TransferLog logs/host.example.com-access_log<br />
4150 </VirtualHost>
4153 <p>Each Virtual Host must correspond to a different IP address,
4154 different port number or a different host name for the server,
4155 in the former case the server machine must be configured to
4156 accept IP packets for multiple addresses. (If the machine does
4157 not have multiple network interfaces, then this can be
4158 accomplished with the <code>ifconfig alias</code> command -- if
4159 your OS supports it).</p>
4161 <div class="note"><h3>Note</h3>
4162 <p>The use of <code class="directive"><VirtualHost></code> does
4163 <strong>not</strong> affect what addresses Apache httpd listens on. You
4164 may need to ensure that Apache httpd is listening on the correct addresses
4165 using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
4168 <p>When using IP-based virtual hosting, the special name
4169 <code>_default_</code> can be specified in
4170 which case this virtual host will match any IP address that is
4171 not explicitly listed in another virtual host. In the absence
4172 of any <code>_default_</code> virtual host the "main" server config,
4173 consisting of all those definitions outside any VirtualHost
4174 section, is used when no IP-match occurs.</p>
4176 <p>You can specify a <code>:port</code> to change the port that is
4177 matched. If unspecified then it defaults to the same port as the
4178 most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
4179 statement of the main server. You may also specify <code>:*</code>
4180 to match all ports on that address. (This is recommended when used
4181 with <code>_default_</code>.)</p>
4183 <p>A <code class="directive"><a href="#servername">ServerName</a></code> should be
4184 specified inside each <code class="directive"><VirtualHost></code> block. If it is absent, the
4185 <code class="directive"><a href="#servername">ServerName</a></code> from the "main"
4186 server configuration will be inherited.</p>
4188 <p>If no matching virtual host is found, then the first listed
4189 virtual host that matches the IP address will be used. As a
4190 consequence, the first listed virtual host is the default virtual
4193 <div class="warning"><h3>Security</h3>
4194 <p>See the <a href="../misc/security_tips.html">security tips</a>
4195 document for details on why your security could be compromised if the
4196 directory where log files are stored is writable by anyone other
4197 than the user that starts the server.</p>
4200 <h3>Consulte también</h3>
4202 <li><a href="../vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
4203 <li><a href="../dns-caveats.html">Issues Regarding DNS and
4204 Apache HTTP Server</a></li>
4205 <li><a href="../bind.html">Setting
4206 which addresses and ports Apache HTTP Server uses</a></li>
4207 <li><a href="../sections.html">How <Directory>, <Location>
4208 and <Files> sections work</a> for an explanation of how these
4209 different sections are combined when a request is received</li>
4213 <div class="bottomlang">
4214 <p><span>Idiomas disponibles: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
4215 <a href="../en/mod/core.html" hreflang="en" rel="alternate" title="English"> en </a> |
4216 <a href="../es/mod/core.html" title="Español"> es </a> |
4217 <a href="../fr/mod/core.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
4218 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
4219 <a href="../tr/mod/core.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
4220 </div><div id="footer">
4221 <p class="apache">Copyright 2011 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>
4222 <p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Directivas</a> | <a href="../faq/">Preguntas Frecuentes</a> | <a href="../glossary.html">Glosario</a> | <a href="../sitemap.html">Mapa de este sitio web</a></p></div>