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