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