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