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