1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>core - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.3</a> > <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Core Features</h1>
24 <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
25 <a href="../en/mod/core.html" title="English"> en </a> |
26 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
28 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Core Apache HTTP Server features that are always
30 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Core</td></tr></table>
32 <div id="quickview"><h3 class="directives">Directives</h3>
34 <li><img alt="" src="../images/down.gif" /> <a href="#acceptfilter">AcceptFilter</a></li>
35 <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#addoutputfilterbytype">AddOutputFilterByType</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#allowencodedslashes">AllowEncodedSlashes</a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#directory"><Directory></a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch"><DirectoryMatch></a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#files"><Files></a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch"><FilesMatch></a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine"><IfDefine></a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule"><IfModule></a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#limit"><Limit></a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept"><LimitExcept></a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#location"><Location></a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch"><LocationMatch></a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#traceenable">TraceEnable</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost"><VirtualHost></a></li>
97 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
98 <div class="directive-section"><h2><a name="AcceptFilter" id="AcceptFilter">AcceptFilter</a> <a name="acceptfilter" id="acceptfilter">Directive</a></h2>
99 <table class="directive">
100 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures optimizations for a Protocol's Listener Sockets</td></tr>
101 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptFilter <var>protocol</var> <var>accept_filter</var></code></td></tr>
102 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
103 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
104 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
105 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.1.5 and later</td></tr>
107 <p>This directive enables operating system specific optimizations for a
108 listening socket by the Protocol type. The basic premise is for the
109 kernel to not send a socket to the server process until either data
110 is received or an entire HTTP Request is buffered. Only
111 <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&sektion=9">
112 FreeBSD's Accept Filters</a> and Linux's more primitive
113 <code>TCP_DEFER_ACCEPT</code> are currently supported.</p>
115 <p>The default values on FreeBSD are:</p>
116 <div class="example"><p><code>
117 AcceptFilter http httpready <br />
118 AcceptFilter https dataready
121 <p>The <code>httpready</code> accept filter buffers entire HTTP requests at
122 the kernel level. Once an entire request is recieved, the kernel then
123 sends it to the server. See the
124 <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&sektion=9">
125 accf_http(9)</a> man page for more details. Since HTTPS requests are
126 encrypted only the <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&sektion=9">
127 accf_data(9)</a> filter is used.</p>
129 <p>The default values on Linux are:</p>
130 <div class="example"><p><code>
131 AcceptFilter http data <br />
132 AcceptFilter https data
135 <p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http
136 requests. Any value besides <code>none</code> will enable
137 <code>TCP_DEFER_ACCEPT</code> on that listener. For more details
139 <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
140 tcp(7)</a> man page.</p>
142 <p>Using <code>none</code> for an argument will disable any accept filters
143 for that protocol. This is useful for protocols that require a server
144 send data first, such as <code>nntp</code>:</p>
145 <div class="example"><p><code>AcceptFilter nttp none</code></p></div>
149 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
150 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
151 <table class="directive">
152 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
153 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
154 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
155 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
156 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
157 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
158 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
159 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.30 and later</td></tr>
162 <p>This directive controls whether requests that contain trailing
163 pathname information that follows an actual filename (or
164 non-existent file in an existing directory) will be accepted or
165 rejected. The trailing pathname information can be made
166 available to scripts in the <code>PATH_INFO</code> environment
169 <p>For example, assume the location <code>/test/</code> points to
170 a directory that contains only the single file
171 <code>here.html</code>. Then requests for
172 <code>/test/here.html/more</code> and
173 <code>/test/nothere.html/more</code> both collect
174 <code>/more</code> as <code>PATH_INFO</code>.</p>
176 <p>The three possible arguments for the
177 <code class="directive">AcceptPathInfo</code> directive are:</p>
179 <dt><code>Off</code></dt><dd>A request will only be accepted if it
180 maps to a literal path that exists. Therefore a request with
181 trailing pathname information after the true filename such as
182 <code>/test/here.html/more</code> in the above example will return
183 a 404 NOT FOUND error.</dd>
185 <dt><code>On</code></dt><dd>A request will be accepted if a
186 leading path component maps to a file that exists. The above
187 example <code>/test/here.html/more</code> will be accepted if
188 <code>/test/here.html</code> maps to a valid file.</dd>
190 <dt><code>Default</code></dt><dd>The treatment of requests with
191 trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
192 The core handler for normal files defaults to rejecting
193 <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-isa</a>, generally accept
194 <code>PATH_INFO</code> by default.</dd>
197 <p>The primary purpose of the <code>AcceptPathInfo</code>
198 directive is to allow you to override the handler's choice of
199 accepting or rejecting <code>PATH_INFO</code>. This override is required,
200 for example, when you use a <a href="../filter.html">filter</a>, such
201 as <a href="mod_include.html">INCLUDES</a>, to generate content
202 based on <code>PATH_INFO</code>. The core handler would usually reject
203 the request, so you can use the following configuration to enable
206 <div class="example"><p><code>
207 <Files "mypaths.shtml"><br />
208 <span class="indent">
209 Options +Includes<br />
210 SetOutputFilter INCLUDES<br />
211 AcceptPathInfo On<br />
218 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
219 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
220 <table class="directive">
221 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
222 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
223 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
224 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
225 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
226 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
228 <p>While processing a request the server looks for
229 the first existing configuration file from this list of names in
230 every directory of the path to the document, if distributed
231 configuration files are <a href="#allowoverride">enabled for that
232 directory</a>. For example:</p>
234 <div class="example"><p><code>
238 <p>before returning the document
239 <code>/usr/local/web/index.html</code>, the server will read
240 <code>/.acl</code>, <code>/usr/.acl</code>,
241 <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
242 for directives, unless they have been disabled with</p>
244 <div class="example"><p><code>
245 <Directory /><br />
246 <span class="indent">
247 AllowOverride None<br />
254 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
255 <li><a href="../configuring.html">Configuration Files</a></li>
256 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
259 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
260 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
261 <table class="directive">
262 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default charset parameter to be added when a response
263 content-type is <code>text/plain</code> or <code>text/html</code></td></tr>
264 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
265 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
266 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
267 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
268 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
269 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
271 <p>This directive specifies a default value for the media type
272 charset parameter (the name of a character encoding) to be added
273 to a response if and only if the response's content-type is either
274 <code>text/plain</code> or <code>text/html</code>. This should override
275 any charset specified in the body of the response via a <code>META</code>
276 element, though the exact behavior is often dependent on the user's client
277 configuration. A setting of <code>AddDefaultCharset Off</code>
278 disables this functionality. <code>AddDefaultCharset On</code> enables
279 a default charset of <code>iso-8859-1</code>. Any other value is assumed
280 to be the <var>charset</var> to be used, which should be one of the
281 <a href="http://www.iana.org/assignments/character-sets">IANA registered
282 charset values</a> for use in MIME media types.
285 <div class="example"><p><code>
286 AddDefaultCharset utf-8
289 <p><code class="directive">AddDefaultCharset</code> should only be used when all
290 of the text resources to which it applies are known to be in that
291 character encoding and it is too inconvenient to label their charset
292 individually. One such example is to add the charset parameter
293 to resources containing generated content, such as legacy CGI
294 scripts, that might be vulnerable to cross-site scripting attacks
295 due to user-provided data being included in the output. Note, however,
296 that a better solution is to just fix (or delete) those scripts, since
297 setting a default charset does not protect users that have enabled
298 the "auto-detect character encoding" feature on their browser.</p>
302 <li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li>
305 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
306 <div class="directive-section"><h2><a name="AddOutputFilterByType" id="AddOutputFilterByType">AddOutputFilterByType</a> <a name="addoutputfilterbytype" id="addoutputfilterbytype">Directive</a></h2>
307 <table class="directive">
308 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>assigns an output filter to a particular MIME-type</td></tr>
309 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
310 <var>MIME-type</var> [<var>MIME-type</var>] ...</code></td></tr>
311 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
312 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
313 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
314 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
315 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later; deprecated in Apache 2.1 and later</td></tr>
317 <p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the
318 response <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a>. Because of certain
319 problems discussed below, this directive is deprecated. The same
320 functionality is available using <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>.</p>
322 <p>The following example uses the <code>DEFLATE</code> filter, which
323 is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all
324 output (either static or dynamic) which is labeled as
325 <code>text/html</code> or <code>text/plain</code> before it is sent
328 <div class="example"><p><code>
329 AddOutputFilterByType DEFLATE text/html text/plain
332 <p>If you want the content to be processed by more than one filter, their
333 names have to be separated by semicolons. It's also possible to use one
334 <code class="directive">AddOutputFilterByType</code> directive for each of
337 <p>The configuration below causes all script output labeled as
338 <code>text/html</code> to be processed at first by the
339 <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
342 <div class="example"><p><code>
343 <Location /cgi-bin/><br />
344 <span class="indent">
345 Options Includes<br />
346 AddOutputFilterByType INCLUDES;DEFLATE text/html<br />
351 <div class="warning"><h3>Note</h3>
352 <p>Enabling filters with <code class="directive">AddOutputFilterByType</code>
353 may fail partially or completely in some cases. For example, no
354 filters are applied if the <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a> could not be determined and falls
355 back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting,
356 even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the
359 <p>However, if you want to make sure, that the filters will be
360 applied, assign the content type to a resource explicitly, for
361 example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or
362 <code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the
363 content type within a (non-nph) CGI script is also safe.</p>
365 <p>The by-type output filters are never applied on proxy requests.</p>
370 <li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li>
371 <li><code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code></li>
372 <li><a href="../filter.html">filters</a></li>
375 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
376 <div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directive</a></h2>
377 <table class="directive">
378 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether encoded path separators in URLs are allowed to
379 be passed through</td></tr>
380 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
381 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
382 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
383 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
384 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
385 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.46 and later</td></tr>
387 <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
388 which contain encoded path separators (<code>%2F</code> for <code>/</code>
389 and additionally <code>%5C</code> for <code>\</code> on according systems)
390 to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
392 <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
393 mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
395 <div class="note"><h3>Note</h3>
396 <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
397 Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
398 according systems) will be left as such in the otherwise decoded URL
404 <li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
407 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
408 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
409 <table class="directive">
410 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
411 <code>.htaccess</code> files</td></tr>
412 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
413 [<var>directive-type</var>] ...</code></td></tr>
414 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr>
415 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
416 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
417 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
419 <p>When the server finds an <code>.htaccess</code> file (as
420 specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
421 it needs to know which directives declared in that file can override
422 earlier configuration directives.</p>
424 <div class="note"><h3>Only available in <Directory> sections</h3>
425 <code class="directive">AllowOverride</code> is valid only in
426 <code class="directive"><a href="#directory"><Directory></a></code>
427 sections specified without regular expressions, not in <code class="directive"><a href="#location"><Location></a></code>, <code class="directive"><a href="#directorymatch"><DirectoryMatch></a></code> or
428 <code class="directive"><a href="#files"><Files></a></code> sections.
431 <p>When this directive is set to <code>None</code>, then
432 <a href="#accessfilename">.htaccess</a> files are completely ignored.
433 In this case, the server will not even attempt to read
434 <code>.htaccess</code> files in the filesystem.</p>
436 <p>When this directive is set to <code>All</code>, then any
437 directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
438 <code>.htaccess</code> files.</p>
440 <p>The <var>directive-type</var> can be one of the following
441 groupings of directives.</p>
448 Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
449 <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
450 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
451 <code class="directive"><a href="#authname">AuthName</a></code>,
452 <code class="directive"><a href="#authtype">AuthType</a></code>, <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>, <code class="directive"><a href="#require">Require</a></code>, <em>etc.</em>).</dd>
457 Allow use of the directives controlling document types (<code class="directive"><a href="#defaulttype">DefaultType</a></code>, <code class="directive"><a href="#errordocument">ErrorDocument</a></code>, <code class="directive"><a href="#forcetype">ForceType</a></code>, <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>,
458 <code class="directive"><a href="#sethandler">SetHandler</a></code>, <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>, <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and
459 <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove*
460 directives, <em>etc.</em>), 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>),
461 <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> directives <code class="directive"><a href="../mod/mod_rewrite.html#rewriteengine">RewriteEngine</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewriteoptions">RewriteOptions</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewritebase">RewriteBase</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewritecond">RewriteCond</a></code>, <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>) and
462 <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> from
463 <code class="module"><a href="../mod/mod_actions.html">mod_actions</a></code>.
469 Allow use of the directives controlling directory indexing
470 (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
471 <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>,
472 <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
473 <code class="directive"><a href="../mod/mod_autoindex.html#defaulticon">DefaultIcon</a></code>, <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#fancyindexing">FancyIndexing</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#headername">HeaderName</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexignore">IndexIgnore</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexoptions">IndexOptions</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#readmename">ReadmeName</a></code>,
479 Allow use of the directives controlling host access (<code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code>, <code class="directive"><a href="../mod/mod_authz_host.html#deny">Deny</a></code> and <code class="directive"><a href="../mod/mod_authz_host.html#order">Order</a></code>).</dd>
481 <dt>Options[=<var>Option</var>,...]</dt>
484 Allow use of the directives controlling specific directory
485 features (<code class="directive"><a href="#options">Options</a></code> and
486 <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).
487 An equal sign may be given followed by a comma (but no spaces)
488 separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
493 <div class="example"><p><code>
494 AllowOverride AuthConfig Indexes
497 <p>In the example above all directives that are neither in the group
498 <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
503 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
504 <li><a href="../configuring.html">Configuration Files</a></li>
505 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
508 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
509 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
510 <table class="directive">
511 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
513 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
514 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
515 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
516 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
517 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
518 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
520 <p>This directive is used to control how Apache finds the
521 interpreter used to run CGI scripts. For example, setting
522 <code>CGIMapExtension sys:\foo.nlm .foo</code> will
523 cause all CGI script files with a <code>.foo</code> extension to
524 be passed to the FOO interpreter.</p>
527 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
528 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
529 <table class="directive">
530 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of <code>Content-MD5</code> HTTP Response
532 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
533 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
534 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
535 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
536 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
537 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
539 <p>This directive enables the generation of
540 <code>Content-MD5</code> headers as defined in RFC1864
541 respectively RFC2068.</p>
543 <p>MD5 is an algorithm for computing a "message digest"
544 (sometimes called "fingerprint") of arbitrary-length data, with
545 a high degree of confidence that any alterations in the data
546 will be reflected in alterations in the message digest.</p>
548 <p>The <code>Content-MD5</code> header provides an end-to-end
549 message integrity check (MIC) of the entity-body. A proxy or
550 client may check this header for detecting accidental
551 modification of the entity-body in transit. Example header:</p>
553 <div class="example"><p><code>
554 Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
557 <p>Note that this can cause performance problems on your server
558 since the message digest is computed on every request (the
559 values are not cached).</p>
561 <p><code>Content-MD5</code> is only sent for documents served
562 by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
563 SSI documents, output from CGI scripts, and byte range responses
564 do not have this header.</p>
567 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
568 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
569 <table class="directive">
570 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>MIME content-type that will be sent if the
571 server cannot determine a type in any other way</td></tr>
572 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>MIME-type</var></code></td></tr>
573 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType text/plain</code></td></tr>
574 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
575 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
576 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
577 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
579 <p>There will be times when the server is asked to provide a
580 document whose type cannot be determined by its <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME types</a> mappings.</p>
582 <p>The server must inform the client of the content-type of the
583 document, so in the event of an unknown type it uses the
584 <code>DefaultType</code>. For example:</p>
586 <div class="example"><p><code>
587 DefaultType image/gif
590 <p>would be appropriate for a directory which contained many GIF
591 images with filenames missing the <code>.gif</code> extension.</p>
593 <p>Note that unlike <code class="directive"><a href="#forcetype">ForceType</a></code>, this directive only
594 provides the default mime-type. All other mime-type definitions,
595 including filename extensions, that might identify the media type
596 will override this default.</p>
599 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
600 <div class="directive-section"><h2><a name="Directory" id="Directory"><Directory></a> <a name="directory" id="directory">Directive</a></h2>
601 <table class="directive">
602 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
603 named file-system directory and sub-directories</td></tr>
604 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Directory <var>directory-path</var>>
605 ... </Directory></code></td></tr>
606 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
607 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
608 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
610 <p><code class="directive"><Directory></code> and
611 <code></Directory></code> are used to enclose a group of
612 directives that will apply only to the named directory and
613 sub-directories of that directory. Any directive that is allowed
614 in a directory context may be used. <var>Directory-path</var> is
615 either the full path to a directory, or a wild-card string using
616 Unix shell-style matching. In a wild-card string, <code>?</code> matches
617 any single character, and <code>*</code> matches any sequences of
618 characters. You may also use <code>[]</code> character ranges. None
619 of the wildcards match a `/' character, so <code><Directory
620 /*/public_html></code> will not match
621 <code>/home/user/public_html</code>, but <code><Directory
622 /home/*/public_html></code> will match. Example:</p>
624 <div class="example"><p><code>
625 <Directory /usr/local/httpd/htdocs><br />
626 <span class="indent">
627 Options Indexes FollowSymLinks<br />
633 <p>Be careful with the <var>directory-path</var> arguments:
634 They have to literally match the filesystem path which Apache uses
635 to access the files. Directives applied to a particular
636 <code><Directory></code> will not apply to files accessed from
637 that same directory via a different path, such as via different symbolic
641 <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular
642 expressions</a> can also be used, with the addition of the
643 <code>~</code> character. For example:</p>
645 <div class="example"><p><code>
646 <Directory ~ "^/www/.*/[0-9]{3}">
649 <p>would match directories in <code>/www/</code> that consisted of
652 <p>If multiple (non-regular expression) <code class="directive"><Directory></code> sections
653 match the directory (or one of its parents) containing a document,
654 then the directives are applied in the order of shortest match
655 first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
658 <div class="example"><p><code>
659 <Directory /><br />
660 <span class="indent">
661 AllowOverride None<br />
663 </Directory><br />
665 <Directory /home/><br />
666 <span class="indent">
667 AllowOverride FileInfo<br />
672 <p>for access to the document <code>/home/web/dir/doc.html</code>
676 <li>Apply directive <code>AllowOverride None</code>
677 (disabling <code>.htaccess</code> files).</li>
679 <li>Apply directive <code>AllowOverride FileInfo</code> (for
680 directory <code>/home</code>).</li>
682 <li>Apply any <code>FileInfo</code> directives in
683 <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
684 <code>/home/web/dir/.htaccess</code> in that order.</li>
687 <p>Regular expressions are not considered until after all of the
688 normal sections have been applied. Then all of the regular
689 expressions are tested in the order they appeared in the
690 configuration file. For example, with</p>
692 <div class="example"><p><code>
693 <Directory ~ abc$><br />
694 <span class="indent">
695 # ... directives here ...<br />
700 <p>the regular expression section won't be considered until after
701 all normal <code class="directive"><Directory></code>s and
702 <code>.htaccess</code> files have been applied. Then the regular
703 expression will match on <code>/home/abc/public_html/abc</code> and
704 the corresponding <code class="directive"><Directory></code> will
707 <p><strong>Note that the default Apache access for
708 <code><Directory /></code> is <code>Allow from All</code>.
709 This means that Apache will serve any file mapped from an URL. It is
710 recommended that you change this with a block such
713 <div class="example"><p><code>
714 <Directory /><br />
715 <span class="indent">
716 Order Deny,Allow<br />
722 <p><strong>and then override this for directories you
723 <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
724 details.</strong></p>
726 <p>The directory sections occur in the <code>httpd.conf</code> file.
727 <code class="directive"><Directory></code> directives
728 cannot nest, and cannot appear in a <code class="directive"><a href="#limit"><Limit></a></code> or <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section.</p>
732 <li><a href="../sections.html">How <Directory>,
733 <Location> and <Files> sections work</a> for an
734 explanation of how these different sections are combined when a
735 request is received</li>
738 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
739 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch"><DirectoryMatch></a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
740 <table class="directive">
741 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
742 file-system directories matching a regular expression and their
743 subdirectories</td></tr>
744 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><DirectoryMatch <var>regex</var>>
745 ... </DirectoryMatch></code></td></tr>
746 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
747 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
748 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
750 <p><code class="directive"><DirectoryMatch></code> and
751 <code></DirectoryMatch></code> are used to enclose a group
752 of directives which will apply only to the named directory and
753 sub-directories of that directory, the same as <code class="directive"><a href="#directory"><Directory></a></code>. However, it
754 takes as an argument a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular
755 expression</a>. For example:</p>
757 <div class="example"><p><code>
758 <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
761 <p>would match directories in <code>/www/</code> that consisted of three
766 <li><code class="directive"><a href="#directory"><Directory></a></code> for
767 a description of how regular expressions are mixed in with normal
768 <code class="directive"><Directory></code>s</li>
769 <li><a href="../sections.html">How <Directory>, <Location> and
770 <Files> sections work</a> for an explanation of how these different
771 sections are combined when a request is received</li>
774 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
775 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
776 <table class="directive">
777 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
778 from the web</td></tr>
779 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
780 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
781 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</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>
785 <p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
786 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
787 path from the requested URL to the document root to make the
788 path to the document. Example:</p>
790 <div class="example"><p><code>
791 DocumentRoot /usr/web
795 <code>http://www.my.host.com/index.html</code> refers to
796 <code>/usr/web/index.html</code>. If the <var>directory-path</var> is
797 not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
799 <p>The <code class="directive">DocumentRoot</code> should be specified without
800 a trailing slash.</p>
804 <li><a href="../urlmapping.html">Mapping URLs to Filesystem
808 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
809 <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
810 <table class="directive">
811 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
812 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
813 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
814 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
815 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
816 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
817 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
819 <p>This directive controls whether the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use
820 memory-mapping if it needs to read the contents of a file during
821 delivery. By default, when the handling of a request requires
822 access to the data within a file -- for example, when delivering a
823 server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache
824 memory-maps the file if the OS supports it.</p>
826 <p>This memory-mapping sometimes yields a performance improvement.
827 But in some environments, it is better to disable the memory-mapping
828 to prevent operational problems:</p>
831 <li>On some multiprocessor systems, memory-mapping can reduce the
832 performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
833 <li>With an NFS-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code>,
834 the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may crash due to a segmentation fault if a file
835 is deleted or truncated while the <code class="program"><a href="../programs/httpd.html">httpd</a></code> has it
839 <p>For server configurations that are vulnerable to these problems,
840 you should disable memory-mapping of delivered files by specifying:</p>
842 <div class="example"><p><code>
846 <p>For NFS mounted files, this feature may be disabled explicitly for
847 the offending files by specifying:</p>
849 <div class="example"><p><code>
850 <Directory "/path-to-nfs-files">
851 <span class="indent">
858 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
859 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
860 <table class="directive">
861 <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>
862 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
863 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile On</code></td></tr>
864 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
865 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
866 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
867 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
868 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later</td></tr>
870 <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
871 sendfile support from the kernel to transmit file contents to the client.
872 By default, when the handling of a request requires no access
873 to the data within a file -- for example, when delivering a
874 static file -- Apache uses sendfile to deliver the file contents
875 without ever reading the file if the OS supports it.</p>
877 <p>This sendfile mechanism avoids separate read and send operations,
878 and buffer allocations. But on some platforms or within some
879 filesystems, it is better to disable this feature to avoid
880 operational problems:</p>
883 <li>Some platforms may have broken sendfile support that the build
884 system did not detect, especially if the binaries were built on
885 another box and moved to such a machine with broken sendfile
887 <li>On Linux the use of sendfile triggers TCP-checksum
888 offloading bugs on certain networking cards when using IPv6.</li>
889 <li>On Linux on Itanium, sendfile may be unable to handle files
890 over 2GB in size.</li>
891 <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS or SMB),
892 the kernel may be unable to serve the network file through
896 <p>For server configurations that are vulnerable to these problems,
897 you should disable this feature by specifying:</p>
899 <div class="example"><p><code>
903 <p>For NFS or SMB mounted files, this feature may be disabled explicitly
904 for the offending files by specifying:</p>
906 <div class="example"><p><code>
907 <Directory "/path-to-nfs-files">
908 <span class="indent">
915 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
916 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
917 <table class="directive">
918 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
919 in case of an error</td></tr>
920 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
921 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
922 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
923 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
924 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
925 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Quoting syntax for text messages is different in Apache
928 <p>In the event of a problem or error, Apache can be configured
929 to do one of four things,</p>
932 <li>output a simple hardcoded error message</li>
934 <li>output a customized message</li>
936 <li>redirect to a local <var>URL-path</var> to handle the
939 <li>redirect to an external <var>URL</var> to handle the
943 <p>The first option is the default, while options 2-4 are
944 configured using the <code class="directive">ErrorDocument</code>
945 directive, which is followed by the HTTP response code and a URL
946 or a message. Apache will sometimes offer additional information
947 regarding the problem/error.</p>
949 <p>URLs can begin with a slash (/) for local web-paths (relative
950 to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
951 full URL which the client can resolve. Alternatively, a message
952 can be provided to be displayed by the browser. Examples:</p>
954 <div class="example"><p><code>
955 ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
956 ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
957 ErrorDocument 401 /subscription_info.html<br />
958 ErrorDocument 403 "Sorry can't allow you access today"
961 <p>Additionally, the special value <code>default</code> can be used
962 to specify Apache's simple hardcoded message. While not required
963 under normal circumstances, <code>default</code> will restore
964 Apache's simple hardcoded message for configurations that would
965 otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
967 <div class="example"><p><code>
968 ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
969 <Directory /web/docs><br />
970 <span class="indent">
971 ErrorDocument 404 default<br />
976 <p>Note that when you specify an <code class="directive">ErrorDocument</code>
977 that points to a remote URL (ie. anything with a method such as
978 <code>http</code> in front of it), Apache will send a redirect to the
979 client to tell it where to find the document, even if the
980 document ends up being on the same server. This has several
981 implications, the most important being that the client will not
982 receive the original error status code, but instead will
983 receive a redirect status code. This in turn can confuse web
984 robots and other clients which try to determine if a URL is
985 valid using the status code. In addition, if you use a remote
986 URL in an <code>ErrorDocument 401</code>, the client will not
987 know to prompt the user for a password since it will not
988 receive the 401 status code. Therefore, <strong>if you use an
989 <code>ErrorDocument 401</code> directive then it must refer to a local
990 document.</strong></p>
992 <p>Microsoft Internet Explorer (MSIE) will by default ignore
993 server-generated error messages when they are "too small" and substitute
994 its own "friendly" error messages. The size threshold varies depending on
995 the type of error, but in general, if you make your error document
996 greater than 512 bytes, then MSIE will show the server-generated
997 error rather than masking it. More information is available in
998 Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
1000 <p>Although most error messages can be overriden, there are certain
1001 circumstances where the internal messages are used regardless of the
1002 setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>. In
1003 particular, if a malformed request is detected, normal request processing
1004 will be immediately halted and the internal error message returned.
1005 This is necessary to guard against security problems caused by
1008 <p>Prior to version 2.0, messages were indicated by prefixing
1009 them with a single unmatched double quote character.</p>
1013 <li><a href="../custom-error.html">documentation of
1014 customizable responses</a></li>
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="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
1019 <table class="directive">
1020 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
1021 <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>
1022 <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>
1023 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1024 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1025 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1027 <p>The <code class="directive">ErrorLog</code> directive sets the name of
1028 the file to which the server will log any errors it encounters. If
1029 the <var>file-path</var> is not absolute then it is assumed to be
1030 relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
1032 <div class="example"><h3>Example</h3><p><code>
1033 ErrorLog /var/log/httpd/error_log
1036 <p>If the <var>file-path</var>
1037 begins with a pipe (|) then it is assumed to be a command to spawn
1038 to handle the error log.</p>
1040 <div class="example"><h3>Example</h3><p><code>
1041 ErrorLog "|/usr/local/bin/httpd_errors"
1044 <p>Using <code>syslog</code> instead of a filename enables logging
1045 via syslogd(8) if the system supports it. The default is to use
1046 syslog facility <code>local7</code>, but you can override this by
1047 using the <code>syslog:<var>facility</var></code> syntax where
1048 <var>facility</var> can be one of the names usually documented in
1051 <div class="example"><h3>Example</h3><p><code>
1052 ErrorLog syslog:user
1055 <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
1056 document for details on why your security could be compromised
1057 if the directory where log files are stored is writable by
1058 anyone other than the user that starts the server.</p>
1059 <div class="warning"><h3>Note</h3>
1060 <p>When entering a file path on non-Unix platforms, care should be taken
1061 to make sure that only forward slashed are used even though the platform
1062 may allow the use of back slashes. In general it is a good idea to always
1063 use forward slashes throughout the configuration files.</p>
1068 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1069 <li><a href="../logs.html">Apache Log Files</a></li>
1072 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1073 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
1074 <table class="directive">
1075 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
1076 HTTP response header</td></tr>
1077 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
1078 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
1079 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1080 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1081 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1082 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1085 The <code class="directive">FileETag</code> directive configures the file
1086 attributes that are used to create the <code>ETag</code> (entity
1087 tag) response header field when the document is based on a file.
1088 (The <code>ETag</code> value is used in cache management to save
1089 network bandwidth.) In Apache 1.3.22 and earlier, the
1090 <code>ETag</code> value was <em>always</em> formed
1091 from the file's inode, size, and last-modified time (mtime). The
1092 <code class="directive">FileETag</code> directive allows you to choose
1093 which of these -- if any -- should be used. The recognized keywords are:
1097 <dt><strong>INode</strong></dt>
1098 <dd>The file's i-node number will be included in the calculation</dd>
1099 <dt><strong>MTime</strong></dt>
1100 <dd>The date and time the file was last modified will be included</dd>
1101 <dt><strong>Size</strong></dt>
1102 <dd>The number of bytes in the file will be included</dd>
1103 <dt><strong>All</strong></dt>
1104 <dd>All available fields will be used. This is equivalent to:
1105 <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1106 <dt><strong>None</strong></dt>
1107 <dd>If a document is file-based, no <code>ETag</code> field will be
1108 included in the response</dd>
1111 <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1112 keywords may be prefixed with either <code>+</code> or <code>-</code>,
1113 which allow changes to be made to the default setting inherited
1114 from a broader scope. Any keyword appearing without such a prefix
1115 immediately and completely cancels the inherited setting.</p>
1117 <p>If a directory's configuration includes
1118 <code>FileETag INode MTime Size</code>, and a
1119 subdirectory's includes <code>FileETag -INode</code>,
1120 the setting for that subdirectory (which will be inherited by
1121 any sub-subdirectories that don't override it) will be equivalent to
1122 <code>FileETag MTime Size</code>.</p>
1125 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1126 <div class="directive-section"><h2><a name="Files" id="Files"><Files></a> <a name="files" id="files">Directive</a></h2>
1127 <table class="directive">
1128 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
1130 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Files <var>filename</var>> ... </Files></code></td></tr>
1131 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1132 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1133 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1134 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1136 <p>The <code class="directive"><Files></code> directive
1137 limits the scope of the enclosed directives by filename. It is comparable
1138 to the <code class="directive"><a href="#directory"><Directory></a></code>
1139 and <code class="directive"><a href="#location"><Location></a></code>
1140 directives. It should be matched with a <code></Files></code>
1141 directive. The directives given within this section will be applied to
1142 any object with a basename (last component of filename) matching the
1143 specified filename. <code class="directive"><Files></code>
1144 sections are processed in the order they appear in the
1145 configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1146 <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location"><Location></a></code> sections. Note
1147 that <code class="directive"><Files></code> can be nested
1148 inside <code class="directive"><a href="#directory"><Directory></a></code> sections to restrict the
1149 portion of the filesystem they apply to.</p>
1151 <p>The <var>filename</var> argument should include a filename, or
1152 a wild-card string, where <code>?</code> matches any single character,
1153 and <code>*</code> matches any sequences of characters.
1154 <a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a>
1155 can also be used, with the addition of the
1156 <code>~</code> character. For example:</p>
1158 <div class="example"><p><code>
1159 <Files ~ "\.(gif|jpe?g|png)$">
1162 <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
1165 <p>Note that unlike <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#location"><Location></a></code> sections, <code class="directive"><Files></code> sections can be used inside
1166 <code>.htaccess</code> files. This allows users to control access to
1167 their own files, at a file-by-file level.</p>
1172 <li><a href="../sections.html">How <Directory>, <Location>
1173 and <Files> sections work</a> for an explanation of how these
1174 different sections are combined when a request is received</li>
1177 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1178 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch"><FilesMatch></a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
1179 <table class="directive">
1180 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
1182 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><FilesMatch <var>regex</var>> ... </FilesMatch></code></td></tr>
1183 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1184 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1185 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1186 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1188 <p>The <code class="directive"><FilesMatch></code> directive
1189 limits the scope of the enclosed directives by filename, just as the
1190 <code class="directive"><a href="#files"><Files></a></code> directive
1191 does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular
1192 expression</a>. For example:</p>
1194 <div class="example"><p><code>
1195 <FilesMatch "\.(gif|jpe?g|png)$">
1198 <p>would match most common Internet graphics formats.</p>
1202 <li><a href="../sections.html">How <Directory>, <Location>
1203 and <Files> sections work</a> for an explanation of how these
1204 different sections are combined when a request is received</li>
1207 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1208 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
1209 <table class="directive">
1210 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
1211 MIME content-type</td></tr>
1212 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>MIME-type</var>|None</code></td></tr>
1213 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1214 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1215 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1216 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1217 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache 2.0</td></tr>
1219 <p>When placed into an <code>.htaccess</code> file or a
1220 <code class="directive"><a href="#directory"><Directory></a></code>, or
1221 <code class="directive"><a href="#location"><Location></a></code> or
1222 <code class="directive"><a href="#files"><Files></a></code>
1223 section, this directive forces all matching files to be served
1224 with the content type identification given by
1225 <var>MIME-type</var>. For example, if you had a directory full of
1226 GIF files, but did not want to label them all with <code>.gif</code>,
1227 you might want to use:</p>
1229 <div class="example"><p><code>
1233 <p>Note that unlike <code class="directive"><a href="#defaulttype">DefaultType</a></code>,
1234 this directive overrides all mime-type associations, including
1235 filename extensions, that might identify the media type.</p>
1237 <p>You can override any <code class="directive">ForceType</code> setting
1238 by using the value of <code>None</code>:</p>
1240 <div class="example"><p><code>
1241 # force all files to be image/gif:<br />
1242 <Location /images><br />
1243 <span class="indent">
1244 ForceType image/gif<br />
1246 </Location><br />
1248 # but normal mime-type associations here:<br />
1249 <Location /images/mixed><br />
1250 <span class="indent">
1251 ForceType None<br />
1257 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1258 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
1259 <table class="directive">
1260 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1261 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1262 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
1263 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1264 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1265 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1267 <p>This directive enables DNS lookups so that host names can be
1268 logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1269 The value <code>Double</code> refers to doing double-reverse
1270 DNS lookup. That is, after a reverse lookup is performed, a forward
1271 lookup is then performed on that result. At least one of the IP
1272 addresses in the forward lookup must match the original
1273 address. (In "tcpwrappers" terminology this is called
1274 <code>PARANOID</code>.)</p>
1276 <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1277 used for controlling access by hostname, a double reverse lookup
1278 will be performed. This is necessary for security. Note that the
1279 result of this double-reverse isn't generally available unless you
1280 set <code>HostnameLookups Double</code>. For example, if only
1281 <code>HostnameLookups On</code> and a request is made to an object
1282 that is protected by hostname restrictions, regardless of whether
1283 the double-reverse fails or not, CGIs will still be passed the
1284 single-reverse result in <code>REMOTE_HOST</code>.</p>
1286 <p>The default is <code>Off</code> in order to save the network
1287 traffic for those sites that don't truly need the reverse
1288 lookups done. It is also better for the end users because they
1289 don't have to suffer the extra latency that a lookup entails.
1290 Heavily loaded sites should leave this directive
1291 <code>Off</code>, since DNS lookups can take considerable
1292 amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
1293 default to the <code>bin</code> subdirectory of your installation
1294 directory, can be used to look up host names from logged IP addresses
1298 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1299 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine"><IfDefine></a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
1300 <table class="directive">
1301 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
1302 if a test is true at startup</td></tr>
1303 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfDefine [!]<var>parameter-name</var>> ...
1304 </IfDefine></code></td></tr>
1305 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1306 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1307 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1308 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1310 <p>The <code><IfDefine <var>test</var>>...</IfDefine>
1311 </code> section is used to mark directives that are conditional. The
1312 directives within an <code class="directive"><IfDefine></code>
1313 section are only processed if the <var>test</var> is true. If <var>
1314 test</var> is false, everything between the start and end markers is
1317 <p>The <var>test</var> in the <code class="directive"><IfDefine></code> section directive can be one of two forms:</p>
1320 <li><var>parameter-name</var></li>
1322 <li><code>!</code><var>parameter-name</var></li>
1325 <p>In the former case, the directives between the start and end
1326 markers are only processed if the parameter named
1327 <var>parameter-name</var> is defined. The second format reverses
1328 the test, and only processes the directives if
1329 <var>parameter-name</var> is <strong>not</strong> defined.</p>
1331 <p>The <var>parameter-name</var> argument is a define as given on
1332 the <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter-</var>
1333 </code>, at the time the server was started.</p>
1335 <p><code class="directive"><IfDefine></code> sections are
1336 nest-able, which can be used to implement simple
1337 multiple-parameter tests. Example:</p>
1339 <div class="example"><p><code>
1340 httpd -DReverseProxy ...<br />
1343 <IfDefine ReverseProxy><br />
1344 <span class="indent">
1345 LoadModule rewrite_module modules/mod_rewrite.so<br />
1346 LoadModule proxy_module modules/libproxy.so<br />
1352 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1353 <div class="directive-section"><h2><a name="IfModule" id="IfModule"><IfModule></a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
1354 <table class="directive">
1355 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
1356 presence or absence of a specific module</td></tr>
1357 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfModule [!]<var>module-file</var>|<var>module-identifier</var>> ...
1358 </IfModule></code></td></tr>
1359 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1360 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1361 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1362 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1363 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Module identifiers are available in version 2.1 and
1366 <p>The <code><IfModule <var>test</var>>...</IfModule></code>
1367 section is used to mark directives that are conditional on the presence of
1368 a specific module. The directives within an <code class="directive"><IfModule></code> section are only processed if the <var>test</var>
1369 is true. If <var>test</var> is false, everything between the start and
1370 end markers is ignored.</p>
1372 <p>The <var>test</var> in the <code class="directive"><IfModule></code> section directive can be one of two forms:</p>
1375 <li><var>module</var></li>
1377 <li>!<var>module</var></li>
1380 <p>In the former case, the directives between the start and end
1381 markers are only processed if the module named <var>module</var>
1382 is included in Apache -- either compiled in or
1383 dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1384 and only processes the directives if <var>module</var> is
1385 <strong>not</strong> included.</p>
1387 <p>The <var>module</var> argument can be either the module identifier or
1388 the file name of the module, at the time it was compiled. For example,
1389 <code>rewrite_module</code> is the identifier and
1390 <code>mod_rewrite.c</code> is the file name. If a module consists of
1391 several source files, use the name of the file containing the string
1392 <code>STANDARD20_MODULE_STUFF</code>.</p>
1394 <p><code class="directive"><IfModule></code> sections are
1395 nest-able, which can be used to implement simple multiple-module
1398 <div class="note">This section should only be used if you need to have one
1399 configuration file that works whether or not a specific module
1400 is available. In normal operation, directives need not be
1401 placed in <code class="directive"><IfModule></code>
1405 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1406 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
1407 <table class="directive">
1408 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
1409 the server configuration files</td></tr>
1410 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Include <var>file-path</var>|<var>directory-path</var></code></td></tr>
1411 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1412 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1413 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1414 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later</td></tr>
1416 <p>This directive allows inclusion of other configuration files
1417 from within the server configuration files.</p>
1419 <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used to
1420 include several files at once, in alphabetical order. In
1421 addition, if <code class="directive">Include</code> points to a directory,
1422 rather than a file, Apache will read all files in that directory
1423 and any subdirectory. But including entire directories is not
1424 recommended, because it is easy to accidentally leave temporary
1425 files in a directory that can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
1428 <p>The file path specified may be an absolute path, or may be relative
1429 to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1433 <div class="example"><p><code>
1434 Include /usr/local/apache2/conf/ssl.conf<br />
1435 Include /usr/local/apache2/conf/vhosts/*.conf
1438 <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1440 <div class="example"><p><code>
1441 Include conf/ssl.conf<br />
1442 Include conf/vhosts/*.conf
1445 <p>Running <code>apachectl configtest</code> will give you a list
1446 of the files that are being processed during the configuration
1449 <div class="example"><p><code>
1450 root@host# apachectl configtest<br />
1451 Processing config file: /usr/local/apache2/conf/ssl.conf<br />
1452 Processing config file: /usr/local/apache2/conf/vhosts/vhost1.conf<br />
1453 Processing config file: /usr/local/apache2/conf/vhosts/vhost2.conf<br />
1459 <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
1462 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1463 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
1464 <table class="directive">
1465 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
1466 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1467 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
1468 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1469 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1470 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1472 <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1473 connection feature of HTTP/1.1 provide long-lived HTTP sessions
1474 which allow multiple requests to be sent over the same TCP
1475 connection. In some cases this has been shown to result in an
1476 almost 50% speedup in latency times for HTML documents with
1477 many images. To enable Keep-Alive connections, set
1478 <code>KeepAlive On</code>.</p>
1480 <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1481 used if they are specifically requested by a client. In
1482 addition, a Keep-Alive connection with an HTTP/1.0 client can
1483 only be used when the length of the content is known in
1484 advance. This implies that dynamic content such as CGI output,
1485 SSI pages, and server-generated directory listings will
1486 generally not use Keep-Alive connections to HTTP/1.0 clients.
1487 For HTTP/1.1 clients, persistent connections are the default
1488 unless otherwise specified. If the client requests it, chunked
1489 encoding will be used in order to send content of unknown
1490 length over persistent connections.</p>
1492 <p>When a client uses a Keep-Alive connection it will be counted
1493 as a single "request" for the MaxRequestsPerChild directive, regardless
1494 of how many requests are sent using the connection.</p>
1498 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
1501 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1502 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
1503 <table class="directive">
1504 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
1505 requests on a persistent connection</td></tr>
1506 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>seconds</var></code></td></tr>
1507 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 5</code></td></tr>
1508 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1509 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1510 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1512 <p>The number of seconds Apache will wait for a subsequent
1513 request before closing the connection. Once a request has been
1514 received, the timeout value specified by the
1515 <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
1517 <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
1518 may cause performance problems in heavily loaded servers. The
1519 higher the timeout, the more server processes will be kept
1520 occupied waiting on connections with idle clients.</p>
1523 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1524 <div class="directive-section"><h2><a name="Limit" id="Limit"><Limit></a> <a name="limit" id="limit">Directive</a></h2>
1525 <table class="directive">
1526 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
1528 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Limit <var>method</var> [<var>method</var>] ... > ...
1529 </Limit></code></td></tr>
1530 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1531 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1532 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1533 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1535 <p>Access controls are normally effective for
1536 <strong>all</strong> access methods, and this is the usual
1537 desired behavior. <strong>In the general case, access control
1538 directives should not be placed within a
1539 <code class="directive"><Limit></code> section.</strong></p>
1541 <p>The purpose of the <code class="directive"><Limit></code>
1542 directive is to restrict the effect of the access controls to the
1543 nominated HTTP methods. For all other methods, the access
1544 restrictions that are enclosed in the <code class="directive"><Limit></code> bracket <strong>will have no
1545 effect</strong>. The following example applies the access control
1546 only to the methods <code>POST</code>, <code>PUT</code>, and
1547 <code>DELETE</code>, leaving all other methods unprotected:</p>
1549 <div class="example"><p><code>
1550 <Limit POST PUT DELETE><br />
1551 <span class="indent">
1552 Require valid-user<br />
1557 <p>The method names listed can be one or more of: <code>GET</code>,
1558 <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1559 <code>CONNECT</code>, <code>OPTIONS</code>,
1560 <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1561 <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1562 <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1563 case-sensitive.</strong> If <code>GET</code> is used it will also
1564 restrict <code>HEAD</code> requests. The <code>TRACE</code> method
1565 cannot be limited.</p>
1567 <div class="warning">A <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section should always be
1568 used in preference to a <code class="directive"><a href="#limit"><Limit></a></code> section when restricting access,
1569 since a <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section provides protection
1570 against arbitrary methods.</div>
1574 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1575 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept"><LimitExcept></a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
1576 <table class="directive">
1577 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
1578 except the named ones</td></tr>
1579 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LimitExcept <var>method</var> [<var>method</var>] ... > ...
1580 </LimitExcept></code></td></tr>
1581 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1582 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1583 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1584 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1586 <p><code class="directive"><LimitExcept></code> and
1587 <code></LimitExcept></code> are used to enclose
1588 a group of access control directives which will then apply to any
1589 HTTP access method <strong>not</strong> listed in the arguments;
1590 i.e., it is the opposite of a <code class="directive"><a href="#limit"><Limit></a></code> section and can be used to control
1591 both standard and nonstandard/unrecognized methods. See the
1592 documentation for <code class="directive"><a href="#limit"><Limit></a></code> for more details.</p>
1596 <div class="example"><p><code>
1597 <LimitExcept POST GET><br />
1598 <span class="indent">
1599 Require valid-user<br />
1601 </LimitExcept>
1606 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1607 <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directive</a></h2>
1608 <table class="directive">
1609 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine maximum number of internal redirects and nested
1610 subrequests</td></tr>
1611 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
1612 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
1613 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1614 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1615 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1616 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.47 and later</td></tr>
1618 <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
1619 redirects the original request to a CGI script. A subrequest is Apache's
1620 mechanism to find out what would happen for some URI if it were requested.
1621 For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
1622 files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
1625 <p><code class="directive">LimitInternalRecursion</code> prevents the server
1626 from crashing when entering an infinite loop of internal redirects or
1627 subrequests. Such loops are usually caused by misconfigurations.</p>
1629 <p>The directive stores two different limits, which are evaluated on
1630 per-request basis. The first <var>number</var> is the maximum number of
1631 internal redirects, that may follow each other. The second <var>number</var>
1632 determines, how deep subrequests may be nested. If you specify only one
1633 <var>number</var>, it will be assigned to both limits.</p>
1635 <div class="example"><h3>Example</h3><p><code>
1636 LimitInternalRecursion 5
1640 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1641 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
1642 <table class="directive">
1643 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
1644 from the client</td></tr>
1645 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
1646 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
1647 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1648 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1649 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1650 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1652 <p>This directive specifies the number of <var>bytes</var> from 0
1653 (meaning unlimited) to 2147483647 (2GB) that are allowed in a
1656 <p>The <code class="directive">LimitRequestBody</code> directive allows
1657 the user to set a limit on the allowed size of an HTTP request
1658 message body within the context in which the directive is given
1659 (server, per-directory, per-file or per-location). If the client
1660 request exceeds that limit, the server will return an error
1661 response instead of servicing the request. The size of a normal
1662 request message body will vary greatly depending on the nature of
1663 the resource and the methods allowed on that resource. CGI scripts
1664 typically use the message body for retrieving form information.
1665 Implementations of the <code>PUT</code> method will require
1666 a value at least as large as any representation that the server
1667 wishes to accept for that resource.</p>
1669 <p>This directive gives the server administrator greater
1670 control over abnormal client request behavior, which may be
1671 useful for avoiding some forms of denial-of-service
1674 <p>If, for example, you are permitting file upload to a particular
1675 location, and wish to limit the size of the uploaded file to 100K,
1676 you might use the following directive:</p>
1678 <div class="example"><p><code>
1679 LimitRequestBody 102400
1684 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1685 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
1686 <table class="directive">
1687 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
1688 will be accepted from the client</td></tr>
1689 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
1690 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
1691 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1692 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1693 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1695 <p><var>Number</var> is an integer from 0 (meaning unlimited) to
1696 32767. The default value is defined by the compile-time
1697 constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
1700 <p>The <code class="directive">LimitRequestFields</code> directive allows
1701 the server administrator to modify the limit on the number of
1702 request header fields allowed in an HTTP request. A server needs
1703 this value to be larger than the number of fields that a normal
1704 client request might include. The number of request header fields
1705 used by a client rarely exceeds 20, but this may vary among
1706 different client implementations, often depending upon the extent
1707 to which a user has configured their browser to support detailed
1708 content negotiation. Optional HTTP extensions are often expressed
1709 using request header fields.</p>
1711 <p>This directive gives the server administrator greater
1712 control over abnormal client request behavior, which may be
1713 useful for avoiding some forms of denial-of-service attacks.
1714 The value should be increased if normal clients see an error
1715 response from the server that indicates too many fields were
1716 sent in the request.</p>
1720 <div class="example"><p><code>
1721 LimitRequestFields 50
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="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
1728 <table class="directive">
1729 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
1731 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldsize <var>bytes</var></code></td></tr>
1732 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldsize 8190</code></td></tr>
1733 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1734 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1735 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1737 <p>This directive specifies the number of <var>bytes</var>
1738 that will be allowed in an HTTP request header.</p>
1740 <p>The <code class="directive">LimitRequestFieldSize</code> directive
1741 allows the server administrator to reduce or increase the limit
1742 on the allowed size of an HTTP request header field. A server
1743 needs this value to be large enough to hold any one header field
1744 from a normal client request. The size of a normal request header
1745 field will vary greatly among different client implementations,
1746 often depending upon the extent to which a user has configured
1747 their browser to support detailed content negotiation. SPNEGO
1748 authentication headers can be up to 12392 bytes.</p>
1750 <p>This directive gives the server administrator greater
1751 control over abnormal client request behavior, which may be
1752 useful for avoiding some forms of denial-of-service attacks.</p>
1756 <div class="example"><p><code>
1757 LimitRequestFieldSize 4094
1760 <div class="note">Under normal conditions, the value should not be changed from
1765 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1766 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
1767 <table class="directive">
1768 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
1769 from the client</td></tr>
1770 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
1771 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
1772 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1773 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1774 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1776 <p>This directive sets the number of <var>bytes</var> that will be
1777 allowed on the HTTP request-line.</p>
1779 <p>The <code class="directive">LimitRequestLine</code> directive allows
1780 the server administrator to reduce or increase the limit on the allowed size
1781 of a client's HTTP request-line. Since the request-line consists of the
1782 HTTP method, URI, and protocol version, the
1783 <code class="directive">LimitRequestLine</code> directive places a
1784 restriction on the length of a request-URI allowed for a request
1785 on the server. A server needs this value to be large enough to
1786 hold any of its resource names, including any information that
1787 might be passed in the query part of a <code>GET</code> request.</p>
1789 <p>This directive gives the server administrator greater
1790 control over abnormal client request behavior, which may be
1791 useful for avoiding some forms of denial-of-service attacks.</p>
1795 <div class="example"><p><code>
1796 LimitRequestLine 4094
1799 <div class="note">Under normal conditions, the value should not be changed from
1803 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1804 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
1805 <table class="directive">
1806 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
1807 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
1808 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
1809 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1810 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1811 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1812 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1814 <p>Limit (in bytes) on maximum size of an XML-based request
1815 body. A value of <code>0</code> will disable any checking.</p>
1819 <div class="example"><p><code>
1820 LimitXMLRequestBody 0
1825 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1826 <div class="directive-section"><h2><a name="Location" id="Location"><Location></a> <a name="location" id="location">Directive</a></h2>
1827 <table class="directive">
1828 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
1830 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Location
1831 <var>URL-path</var>|<var>URL</var>> ... </Location></code></td></tr>
1832 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1833 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1834 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1836 <p>The <code class="directive"><Location></code> directive
1837 limits the scope of the enclosed directives by URL. It is similar to the
1838 <code class="directive"><a href="#directory"><Directory></a></code>
1839 directive, and starts a subsection which is terminated with a
1840 <code></Location></code> directive. <code class="directive"><Location></code> sections are processed in the
1841 order they appear in the configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1842 <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files"><Files></a></code> sections.</p>
1844 <p><code class="directive"><Location></code> sections operate
1845 completely outside the filesystem. This has several consequences.
1846 Most importantly, <code class="directive"><Location></code>
1847 directives should not be used to control access to filesystem
1848 locations. Since several different URLs may map to the same
1849 filesystem location, such access controls may by circumvented.</p>
1851 <div class="note"><h3>When to use <code class="directive"><Location></code></h3>
1853 <p>Use <code class="directive"><Location></code> to apply
1854 directives to content that lives outside the filesystem. For
1855 content that lives in the filesystem, use <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#files"><Files></a></code>. An exception is
1856 <code><Location /></code>, which is an easy way to
1857 apply a configuration to the entire server.</p>
1860 <p>For all origin (non-proxy) requests, the URL to be matched is a
1861 URL-path of the form <code>/path/</code>. No scheme, hostname,
1862 port, or query string may be included. For proxy requests, the
1863 URL to be matched is of the form
1864 <code>scheme://servername/path</code>, and you must include the
1867 <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
1868 any single character, and <code>*</code> matches any sequences of
1871 <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a>
1872 can also be used, with the addition of the
1873 <code>~</code> character. For example:</p>
1875 <div class="example"><p><code>
1876 <Location ~ "/(extra|special)/data">
1879 <p>would match URLs that contained the substring <code>/extra/data</code>
1880 or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch"><LocationMatch></a></code> behaves
1881 identical to the regex version of <code class="directive"><Location></code>.</p>
1883 <p>The <code class="directive"><Location></code>
1884 functionality is especially useful when combined with the
1885 <code class="directive"><a href="#sethandler">SetHandler</a></code>
1886 directive. For example, to enable status requests, but allow them
1887 only from browsers at <code>foo.com</code>, you might use:</p>
1889 <div class="example"><p><code>
1890 <Location /status><br />
1891 <span class="indent">
1892 SetHandler server-status<br />
1893 Order Deny,Allow<br />
1895 Allow from .foo.com<br />
1900 <div class="note"><h3>Note about / (slash)</h3>
1901 <p>The slash character has special meaning depending on where in a
1902 URL it appears. People may be used to its behavior in the filesystem
1903 where multiple adjacent slashes are frequently collapsed to a single
1904 slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
1905 <code>/home/foo</code>). In URL-space this is not necessarily true.
1906 The <code class="directive"><a href="#locationmatch"><LocationMatch></a></code>
1907 directive and the regex version of <code class="directive"><Location></code> require you to explicitly specify multiple
1908 slashes if that is your intention.</p>
1910 <p>For example, <code><LocationMatch ^/abc></code> would match
1911 the request URL <code>/abc</code> but not the request URL <code>
1912 //abc</code>. The (non-regex) <code class="directive"><Location></code> directive behaves similarly when used for
1913 proxy requests. But when (non-regex) <code class="directive"><Location></code> is used for non-proxy requests it will
1914 implicitly match multiple slashes with a single slash. For example,
1915 if you specify <code><Location /abc/def></code> and the
1916 request is to <code>/abc//def</code> then it will match.</p>
1921 <li><a href="../sections.html">How <Directory>, <Location>
1922 and <Files> sections work</a> for an explanation of how these
1923 different sections are combined when a request is received</li>
1926 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1927 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch"><LocationMatch></a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
1928 <table class="directive">
1929 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
1930 matching URLs</td></tr>
1931 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LocationMatch
1932 <var>regex</var>> ... </LocationMatch></code></td></tr>
1933 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1934 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1935 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1937 <p>The <code class="directive"><LocationMatch></code> directive
1938 limits the scope of the enclosed directives by URL, in an identical manner
1939 to <code class="directive"><a href="#location"><Location></a></code>. However,
1940 it takes a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
1941 as an argument instead of a simple string. For example:</p>
1943 <div class="example"><p><code>
1944 <LocationMatch "/(extra|special)/data">
1947 <p>would match URLs that contained the substring <code>/extra/data</code>
1948 or <code>/special/data</code>.</p>
1952 <li><a href="../sections.html">How <Directory>, <Location>
1953 and <Files> sections work</a> for an explanation of how these
1954 different sections are combined when a request is received</li>
1957 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1958 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
1959 <table class="directive">
1960 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
1961 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel <var>level</var></code></td></tr>
1962 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
1963 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1964 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1965 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1967 <p><code class="directive">LogLevel</code> adjusts the verbosity of the
1968 messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
1969 <var>level</var>s are available, in order of decreasing
1972 <table class="bordered">
1975 <th><strong>Level</strong> </th>
1977 <th><strong>Description</strong> </th>
1979 <th><strong>Example</strong> </th>
1983 <td><code>emerg</code> </td>
1985 <td>Emergencies - system is unusable.</td>
1987 <td>"Child cannot open lock file. Exiting"</td>
1991 <td><code>alert</code> </td>
1993 <td>Action must be taken immediately.</td>
1995 <td>"getpwuid: couldn't determine user name from uid"</td>
1999 <td><code>crit</code> </td>
2001 <td>Critical Conditions.</td>
2003 <td>"socket: Failed to get a socket, exiting child"</td>
2007 <td><code>error</code> </td>
2009 <td>Error conditions.</td>
2011 <td>"Premature end of script headers"</td>
2015 <td><code>warn</code> </td>
2017 <td>Warning conditions.</td>
2019 <td>"child process 1234 did not exit, sending another
2024 <td><code>notice</code> </td>
2026 <td>Normal but significant condition.</td>
2028 <td>"httpd: caught SIGBUS, attempting to dump core in
2033 <td><code>info</code> </td>
2035 <td>Informational.</td>
2037 <td>"Server seems busy, (you may need to increase
2038 StartServers, or Min/MaxSpareServers)..."</td>
2042 <td><code>debug</code> </td>
2044 <td>Debug-level messages</td>
2046 <td>"Opening config file ..."</td>
2050 <p>When a particular level is specified, messages from all
2051 other levels of higher significance will be reported as well.
2052 <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2053 then messages with log levels of <code>notice</code> and
2054 <code>warn</code> will also be posted.</p>
2056 <p>Using a level of at least <code>crit</code> is
2061 <div class="example"><p><code>
2065 <div class="note"><h3>Note</h3>
2066 <p>When logging to a regular file messages of the level
2067 <code>notice</code> cannot be suppressed and thus are always
2068 logged. However, this doesn't apply when logging is done
2069 using <code>syslog</code>.</p>
2073 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2074 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
2075 <table class="directive">
2076 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
2077 connection</td></tr>
2078 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
2079 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
2080 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2081 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2082 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2084 <p>The <code class="directive">MaxKeepAliveRequests</code> directive
2085 limits the number of requests allowed per connection when
2086 <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
2087 set to <code>0</code>, unlimited requests will be allowed. We
2088 recommend that this setting be kept to a high value for maximum
2089 server performance.</p>
2093 <div class="example"><p><code>
2094 MaxKeepAliveRequests 500
2098 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2099 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
2100 <table class="directive">
2101 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
2103 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
2104 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2105 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2106 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2108 <p>The <code class="directive">NameVirtualHost</code> directive is a
2109 required directive if you want to configure <a href="../vhosts/">name-based virtual hosts</a>.</p>
2111 <p>Although <var>addr</var> can be hostname it is recommended
2112 that you always use an IP address, e.g.</p>
2114 <div class="example"><p><code>
2115 NameVirtualHost 111.22.33.44
2118 <p>With the <code class="directive">NameVirtualHost</code> directive you
2119 specify the IP address on which the server will receive requests
2120 for the name-based virtual hosts. This will usually be the address
2121 to which your name-based virtual host names resolve. In cases
2122 where a firewall or other proxy receives the requests and forwards
2123 them on a different IP address to the server, you must specify the
2124 IP address of the physical interface on the machine which will be
2125 servicing the requests. If you have multiple name-based hosts on
2126 multiple addresses, repeat the directive for each address.</p>
2128 <div class="note"><h3>Note</h3>
2129 <p>Note, that the "main server" and any <code>_default_</code> servers
2130 will <strong>never</strong> be served for a request to a
2131 <code class="directive">NameVirtualHost</code> IP address (unless for some
2132 reason you specify <code class="directive">NameVirtualHost</code> but then
2133 don't define any <code class="directive">VirtualHost</code>s for that
2137 <p>Optionally you can specify a port number on which the
2138 name-based virtual hosts should be used, e.g.</p>
2140 <div class="example"><p><code>
2141 NameVirtualHost 111.22.33.44:8080
2144 <p>IPv6 addresses must be enclosed in square brackets, as shown
2145 in the following example:</p>
2147 <div class="example"><p><code>
2148 NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
2151 <p>To receive requests on all interfaces, you can use an argument of
2154 <div class="example"><p><code>
2158 <div class="note"><h3>Argument to <code class="directive"><VirtualHost></code>
2160 <p>Note that the argument to the <code class="directive"><VirtualHost></code> directive must
2161 exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
2163 <div class="example"><p><code>
2164 NameVirtualHost 1.2.3.4<br />
2165 <VirtualHost 1.2.3.4><br />
2167 </VirtualHost><br />
2173 <li><a href="../vhosts/">Virtual Hosts
2174 documentation</a></li>
2177 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2178 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
2179 <table class="directive">
2180 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
2182 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
2183 [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
2184 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
2185 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2186 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
2187 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2188 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2190 <p>The <code class="directive">Options</code> directive controls which
2191 server features are available in a particular directory.</p>
2193 <p><var>option</var> can be set to <code>None</code>, in which
2194 case none of the extra features are enabled, or one or more of
2198 <dt><code>All</code></dt>
2200 <dd>All options except for <code>MultiViews</code>. This is the default
2203 <dt><code>ExecCGI</code></dt>
2206 Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
2209 <dt><code>FollowSymLinks</code></dt>
2213 The server will follow symbolic links in this directory.
2215 <p>Even though the server follows the symlink it does <em>not</em>
2216 change the pathname used to match against <code class="directive"><a href="#directory"><Directory></a></code> sections.</p>
2217 <p>Note also, that this option <strong>gets ignored</strong> if set
2218 inside a <code class="directive"><a href="#location"><Location></a></code>
2222 <dt><code>Includes</code></dt>
2225 Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
2228 <dt><code>IncludesNOEXEC</code></dt>
2232 Server-side includes are permitted, but the <code>#exec
2233 cmd</code> and <code>#exec cgi</code> are disabled. It is still
2234 possible to <code>#include virtual</code> CGI scripts from
2235 <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
2238 <dt><code>Indexes</code></dt>
2241 If a URL which maps to a directory is requested, and there
2242 is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
2243 (<em>e.g.</em>, <code>index.html</code>) in that directory, then
2244 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
2245 of the directory.</dd>
2247 <dt><code>MultiViews</code></dt>
2250 <a href="../content-negotiation.html">Content negotiated</a>
2251 "MultiViews" are allowed using
2252 <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.</dd>
2254 <dt><code>SymLinksIfOwnerMatch</code></dt>
2256 <dd>The server will only follow symbolic links for which the
2257 target file or directory is owned by the same user id as the
2260 <div class="note"><h3>Note</h3> This option gets ignored if
2261 set inside a <code class="directive"><a href="#location"><Location></a></code> section.</div>
2265 <p>Normally, if multiple <code class="directive">Options</code> could
2266 apply to a directory, then the most specific one is used and
2267 others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
2268 However if <em>all</em> the options on the
2269 <code class="directive">Options</code> directive are preceded by a
2270 <code>+</code> or <code>-</code> symbol, the options are
2271 merged. Any options preceded by a <code>+</code> are added to the
2272 options currently in force, and any options preceded by a
2273 <code>-</code> are removed from the options currently in
2276 <div class="warning"><h3>Warning</h3>
2277 <p>Mixing <code class="directive">Options</code> with a <code>+</code> or
2278 <code>-</code> with those without is not valid syntax, and is likely
2279 to cause unexpected results.</p>
2282 <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
2284 <div class="example"><p><code>
2285 <Directory /web/docs><br />
2286 <span class="indent">
2287 Options Indexes FollowSymLinks<br />
2289 </Directory><br />
2291 <Directory /web/docs/spec><br />
2292 <span class="indent">
2293 Options Includes<br />
2298 <p>then only <code>Includes</code> will be set for the
2299 <code>/web/docs/spec</code> directory. However if the second
2300 <code class="directive">Options</code> directive uses the <code>+</code> and
2301 <code>-</code> symbols:</p>
2303 <div class="example"><p><code>
2304 <Directory /web/docs><br />
2305 <span class="indent">
2306 Options Indexes FollowSymLinks<br />
2308 </Directory><br />
2310 <Directory /web/docs/spec><br />
2311 <span class="indent">
2312 Options +Includes -Indexes<br />
2317 <p>then the options <code>FollowSymLinks</code> and
2318 <code>Includes</code> are set for the <code>/web/docs/spec</code>
2321 <div class="note"><h3>Note</h3>
2322 <p>Using <code>-IncludesNOEXEC</code> or
2323 <code>-Includes</code> disables server-side includes completely
2324 regardless of the previous setting.</p>
2327 <p>The default in the absence of any other settings is
2328 <code>All</code>.</p>
2331 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2332 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
2333 <table class="directive">
2334 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
2335 by Apache children</td></tr>
2336 <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>
2337 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2338 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2339 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2340 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2341 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2343 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2344 resource limit for all processes and the second parameter sets
2345 the maximum resource limit. Either parameter can be a number,
2346 or <code>max</code> to indicate to the server that the limit should
2347 be set to the maximum allowed by the operating system
2348 configuration. Raising the maximum resource limit requires that
2349 the server is running as <code>root</code>, or in the initial startup
2352 <p>This applies to processes forked off from Apache children
2353 servicing requests, not the Apache children themselves. This
2354 includes CGI scripts and SSI exec commands, but not any
2355 processes forked off from the Apache parent such as piped
2358 <p>CPU resource limits are expressed in seconds per
2363 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2364 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2367 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2368 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
2369 <table class="directive">
2370 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
2371 by Apache children</td></tr>
2372 <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>
2373 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2374 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2375 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2376 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2377 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2379 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2380 resource limit for all processes and the second parameter sets
2381 the maximum resource limit. Either parameter can be a number,
2382 or <code>max</code> to indicate to the server that the limit should
2383 be set to the maximum allowed by the operating system
2384 configuration. Raising the maximum resource limit requires that
2385 the server is running as <code>root</code>, or in the initial startup
2388 <p>This applies to processes forked off from Apache children
2389 servicing requests, not the Apache children themselves. This
2390 includes CGI scripts and SSI exec commands, but not any
2391 processes forked off from the Apache parent such as piped
2394 <p>Memory resource limits are expressed in bytes per
2399 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2400 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2403 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2404 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
2405 <table class="directive">
2406 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
2407 processes launched by Apache children</td></tr>
2408 <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>
2409 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2410 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2411 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2412 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2413 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2415 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2416 resource limit for all processes and the second parameter sets
2417 the maximum resource limit. Either parameter can be a number,
2418 or <code>max</code> to indicate to the server that the limit
2419 should be set to the maximum allowed by the operating system
2420 configuration. Raising the maximum resource limit requires that
2421 the server is running as <code>root</code>, or in the initial startup
2424 <p>This applies to processes forked off from Apache children
2425 servicing requests, not the Apache children themselves. This
2426 includes CGI scripts and SSI exec commands, but not any
2427 processes forked off from the Apache parent such as piped
2430 <p>Process limits control the number of processes per user.</p>
2432 <div class="note"><h3>Note</h3>
2433 <p>If CGI processes are <strong>not</strong> running
2434 under user ids other than the web server user id, this directive
2435 will limit the number of processes that the server itself can
2436 create. Evidence of this situation will be indicated by
2437 <strong><code>cannot fork</code></strong> messages in the
2438 <code>error_log</code>.</p>
2443 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2444 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2447 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2448 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
2449 <table class="directive">
2450 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
2452 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
2453 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
2454 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2455 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2456 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2457 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2458 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only;
2459 option <code>Registry-Strict</code> is available in Apache 2.0 and
2462 <p>This directive is used to control how Apache finds the
2463 interpreter used to run CGI scripts. The default setting is
2464 <code>Script</code>. This causes Apache to use the interpreter pointed to
2465 by the shebang line (first line, starting with <code>#!</code>) in the
2466 script. On Win32 systems this line usually looks like:</p>
2468 <div class="example"><p><code>
2469 #!C:/Perl/bin/perl.exe
2472 <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
2474 <div class="example"><p><code>
2478 <p>Setting <code>ScriptInterpreterSource Registry</code> will
2479 cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
2480 searched using the script file extension (e.g., <code>.pl</code>) as a
2481 search key. The command defined by the registry subkey
2482 <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
2483 <code>Shell\Open\Command</code> is used to open the script file. If the
2484 registry keys cannot be found, Apache falls back to the behavior of the
2485 <code>Script</code> option.</p>
2487 <div class="warning"><h3>Security</h3>
2488 <p>Be careful when using <code>ScriptInterpreterSource
2489 Registry</code> with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
2490 Apache will try to execute <strong>every</strong> file within this
2491 directory. The <code>Registry</code> setting may cause undesired
2492 program calls on files which are typically not executed. For
2493 example, the default open command on <code>.htm</code> files on
2494 most Windows systems will execute Microsoft Internet Explorer, so
2495 any HTTP request for an <code>.htm</code> file existing within the
2496 script directory would start the browser in the background on the
2497 server. This is a good way to crash your system within a minute or
2501 <p>The option <code>Registry-Strict</code> which is new in Apache
2502 2.0 does the same thing as <code>Registry</code> but uses only the
2503 subkey <code>Shell\ExecCGI\Command</code>. The
2504 <code>ExecCGI</code> key is not a common one. It must be
2505 configured manually in the windows registry and hence prevents
2506 accidental program calls on your system.</p>
2509 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2510 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
2511 <table class="directive">
2512 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
2513 messages sent to the client</td></tr>
2514 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
2515 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2516 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2517 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2519 <p>The <code class="directive">ServerAdmin</code> sets the contact address
2520 that the server includes in any error messages it returns to the
2521 client. If the <code>httpd</code> doesn't recognize the supplied argument
2523 assumes, that it's an <var>email-address</var> and prepends it with
2524 <code>mailto:</code> in hyperlink targets. However, it's recommended to
2525 actually use an email address, since there are a lot of CGI scripts that
2526 make that assumption. If you want to use an URL, it should point to another
2527 server under your control. Otherwise users may not be able to contact you in
2530 <p>It may be worth setting up a dedicated address for this, e.g.</p>
2532 <div class="example"><p><code>
2533 ServerAdmin www-admin@foo.example.com
2535 <p>as users do not always mention that they are talking about the
2539 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2540 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
2541 <table class="directive">
2542 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
2543 to name-virtual hosts</td></tr>
2544 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
2545 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2546 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2547 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2549 <p>The <code class="directive">ServerAlias</code> directive sets the
2550 alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
2552 <div class="example"><p><code>
2553 <VirtualHost *><br />
2554 ServerName server.domain.com<br />
2555 ServerAlias server server2.domain.com server2<br />
2557 </VirtualHost>
2562 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2565 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2566 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
2567 <table class="directive">
2568 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
2570 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerName <var>fully-qualified-domain-name</var>[:<var>port</var>]</code></td></tr>
2571 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2572 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2573 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2574 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>In version 2.0, this
2575 directive supersedes the functionality of the <code class="directive">Port</code>
2576 directive from version 1.3.</td></tr>
2578 <p>The <code class="directive">ServerName</code> directive sets the hostname and
2579 port that the server uses to identify itself. This is used when
2580 creating redirection URLs. For example, if the name of the
2581 machine hosting the web server is <code>simple.example.com</code>,
2582 but the machine also has the DNS alias <code>www.example.com</code>
2583 and you wish the web server to be so identified, the following
2584 directive should be used:</p>
2586 <div class="example"><p><code>
2587 ServerName www.example.com:80
2590 <p>If no <code class="directive">ServerName</code> is specified, then the
2591 server attempts to deduce the hostname by performing a reverse
2592 lookup on the IP address. If no port is specified in the
2593 <code class="directive">ServerName</code>, then the server will use the port
2595 request. For optimal reliability and predictability, you should
2596 specify an explicit hostname and port using the
2597 <code class="directive">ServerName</code> directive.</p>
2599 <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
2600 the <code class="directive">ServerName</code> inside a
2601 <code class="directive"><a href="#virtualhost"><VirtualHost></a></code>
2602 section specifies what hostname must appear in the request's
2603 <code>Host:</code> header to match this virtual host.</p>
2605 <p>See the description of the
2606 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> and
2607 <code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code>directives for
2608 settings which determine whether self-referential URL's (e.g., by the
2609 <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
2610 specified port, or to the port number given in the client's request.
2615 <li><a href="../dns-caveats.html">Issues Regarding DNS and
2617 <li><a href="../vhosts/">Apache virtual host
2618 documentation</a></li>
2619 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
2620 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
2621 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
2622 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
2625 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2626 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
2627 <table class="directive">
2628 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
2629 is accessed by an incompatible browser</td></tr>
2630 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
2631 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2632 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2633 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2635 <p>The <code class="directive">ServerPath</code> directive sets the legacy
2636 URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
2640 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2643 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2644 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
2645 <table class="directive">
2646 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
2647 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
2648 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
2649 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2650 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2651 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2653 <p>The <code class="directive">ServerRoot</code> directive sets the
2654 directory in which the server lives. Typically it will contain the
2655 subdirectories <code>conf/</code> and <code>logs/</code>. Relative
2656 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
2657 relative to this directory.</p>
2659 <div class="example"><h3>Example</h3><p><code>
2660 ServerRoot /home/httpd
2666 <li><a href="../invoking.html">the <code>-d</code>
2667 option to <code>httpd</code></a></li>
2668 <li><a href="../misc/security_tips.html#serverroot">the
2669 security tips</a> for information on how to properly set
2670 permissions on the <code class="directive">ServerRoot</code></li>
2673 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2674 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
2675 <table class="directive">
2676 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
2677 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
2678 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
2679 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2680 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2681 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2682 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2684 <p>The <code class="directive">ServerSignature</code> directive allows the
2685 configuration of a trailing footer line under server-generated
2686 documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
2687 listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
2688 would want to enable such a footer line is that in a chain of proxies,
2689 the user often has no possibility to tell which of the chained servers
2690 actually produced a returned error message.</p>
2692 <p>The <code>Off</code>
2693 setting, which is the default, suppresses the footer line (and is
2694 therefore compatible with the behavior of Apache-1.2 and
2695 below). The <code>On</code> setting simply adds a line with the
2696 server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
2697 and the <code>EMail</code> setting additionally creates a
2698 "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
2701 <p>After version 2.0.44, the details of the server version number
2702 presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
2706 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
2709 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2710 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
2711 <table class="directive">
2712 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the <code>Server</code> HTTP response
2714 <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>
2715 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
2716 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2717 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2718 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2720 <p>This directive controls whether <code>Server</code> response
2721 header field which is sent back to clients includes a
2722 description of the generic OS-type of the server as well as
2723 information about compiled-in modules.</p>
2726 <dt><code>ServerTokens Prod[uctOnly]</code></dt>
2728 <dd>Server sends (<em>e.g.</em>): <code>Server:
2731 <dt><code>ServerTokens Major</code></dt>
2733 <dd>Server sends (<em>e.g.</em>): <code>Server:
2734 Apache/2</code></dd>
2736 <dt><code>ServerTokens Minor</code></dt>
2738 <dd>Server sends (<em>e.g.</em>): <code>Server:
2739 Apache/2.0</code></dd>
2741 <dt><code>ServerTokens Min[imal]</code></dt>
2743 <dd>Server sends (<em>e.g.</em>): <code>Server:
2744 Apache/2.0.41</code></dd>
2746 <dt><code>ServerTokens OS</code></dt>
2748 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2751 <dt><code>ServerTokens Full</code> (or not specified)</dt>
2753 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2754 (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
2757 <p>This setting applies to the entire server, and cannot be
2758 enabled or disabled on a virtualhost-by-virtualhost basis.</p>
2760 <p>After version 2.0.44, this directive also controls the
2761 information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
2765 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
2768 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2769 <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
2770 <table class="directive">
2771 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
2773 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
2774 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2775 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2776 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2777 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2778 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved into the core in Apache 2.0</td></tr>
2780 <p>When placed into an <code>.htaccess</code> file or a
2781 <code class="directive"><a href="#directory"><Directory></a></code> or
2782 <code class="directive"><a href="#location"><Location></a></code>
2783 section, this directive forces all matching files to be parsed
2784 through the <a href="../handler.html">handler</a> given by
2785 <var>handler-name</var>. For example, if you had a directory you
2786 wanted to be parsed entirely as imagemap rule files, regardless
2787 of extension, you might put the following into an
2788 <code>.htaccess</code> file in that directory:</p>
2790 <div class="example"><p><code>
2791 SetHandler imap-file
2794 <p>Another example: if you wanted to have the server display a
2795 status report whenever a URL of
2796 <code>http://servername/status</code> was called, you might put
2797 the following into <code>httpd.conf</code>:</p>
2799 <div class="example"><p><code>
2800 <Location /status><br />
2801 <span class="indent">
2802 SetHandler server-status<br />
2807 <p>You can override an earlier defined <code class="directive">SetHandler</code>
2808 directive by using the value <code>None</code>.</p>
2809 <p><strong>Note:</strong> because SetHandler overrides default handlers,
2810 normal behaviour such as handling of URLs ending in a slash (/) as
2811 directories or index files is suppressed.</p>
2815 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
2818 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2819 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
2820 <table class="directive">
2821 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
2823 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2824 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2825 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2826 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2827 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2829 <p>The <code class="directive">SetInputFilter</code> directive sets the
2830 filter or filters which will process client requests and POST
2831 input when they are received by the server. This is in addition to
2832 any filters defined elsewhere, including the
2833 <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
2836 <p>If more than one filter is specified, they must be separated
2837 by semicolons in the order in which they should process the
2842 <li><a href="../filter.html">Filters</a> documentation</li>
2845 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2846 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
2847 <table class="directive">
2848 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
2850 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2851 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2852 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2853 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2854 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2856 <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
2857 which will process responses from the server before they are
2858 sent to the client. This is in addition to any filters defined
2859 elsewhere, including the
2860 <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
2863 <p>For example, the following configuration will process all files
2864 in the <code>/www/data/</code> directory for server-side
2867 <div class="example"><p><code>
2868 <Directory /www/data/><br />
2869 <span class="indent">
2870 SetOutputFilter INCLUDES<br />
2875 <p>If more than one filter is specified, they must be separated
2876 by semicolons in the order in which they should process the
2881 <li><a href="../filter.html">Filters</a> documentation</li>
2884 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2885 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
2886 <table class="directive">
2887 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
2888 certain events before failing a request</td></tr>
2889 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
2890 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
2891 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2892 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2893 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2895 <p>The <code class="directive">TimeOut</code> directive currently defines
2896 the amount of time Apache will wait for three things:</p>
2899 <li>The total amount of time it takes to receive a GET
2902 <li>The amount of time between receipt of TCP packets on a
2903 POST or PUT request.</li>
2905 <li>The amount of time between ACKs on transmissions of TCP
2906 packets in responses.</li>
2909 <p>We plan on making these separately configurable at some point
2910 down the road. The timer used to default to 1200 before 1.2,
2911 but has been lowered to 300 which is still far more than
2912 necessary in most situations. It is not set any lower by
2913 default because there may still be odd places in the code where
2914 the timer is not reset when a packet is sent. </p>
2917 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2918 <div class="directive-section"><h2><a name="TraceEnable" id="TraceEnable">TraceEnable</a> <a name="traceenable" id="traceenable">Directive</a></h2>
2919 <table class="directive">
2920 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines the behaviour on <code>TRACE</code>
2922 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TraceEnable <var>[on|off|extended]</var></code></td></tr>
2923 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TraceEnable on</code></td></tr>
2924 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2925 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2926 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2927 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 1.3.34, 2.0.55 and later</td></tr>
2929 <p>This directive overrides the behavior of <code>TRACE</code> for both
2930 the core server and <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>. The default
2931 <code>TraceEnable on</code> permits <code>TRACE</code> requests per
2932 RFC 2616, which disallows any request body to accompany the request.
2933 <code>TraceEnable off</code> causes the core server and
2934 <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> to return a <code>405</code> (Method not
2935 allowed) error to the client.</p>
2937 <p>Finally, for testing and diagnostic purposes only, request
2938 bodies may be allowed using the non-compliant <code>TraceEnable
2939 extended</code> directive. The core (as an origin server) will
2940 restrict the request body to 64k (plus 8k for chunk headers if
2941 <code>Transfer-Encoding: chunked</code> is used). The core will
2942 reflect the full headers and all chunk headers with the response
2943 body. As a proxy server, the request body is not restricted to 64k.</p>
2946 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2947 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
2948 <table class="directive">
2949 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
2951 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
2952 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName Off</code></td></tr>
2953 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
2954 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2955 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2957 <p>In many situations Apache must construct a <em>self-referential</em>
2958 URL -- that is, a URL that refers back to the same server. With
2959 <code>UseCanonicalName On</code> Apache will use the hostname and port
2960 specified in the <code class="directive"><a href="#servername">ServerName</a></code>
2961 directive to construct the canonical name for the server. This name
2962 is used in all self-referential URLs, and for the values of
2963 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
2965 <p>With <code>UseCanonicalName Off</code> Apache will form
2966 self-referential URLs using the hostname and port supplied by
2967 the client if any are supplied (otherwise it will use the
2968 canonical name, as defined above). These values are the same
2969 that are used to implement <a href="../vhosts/name-based.html">name based virtual hosts</a>,
2970 and are available with the same clients. The CGI variables
2971 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
2972 constructed from the client supplied values as well.</p>
2974 <p>An example where this may be useful is on an intranet server
2975 where you have users connecting to the machine using short
2976 names such as <code>www</code>. You'll notice that if the users
2977 type a shortname, and a URL which is a directory, such as
2978 <code>http://www/splat</code>, <em>without the trailing
2979 slash</em> then Apache will redirect them to
2980 <code>http://www.domain.com/splat/</code>. If you have
2981 authentication enabled, this will cause the user to have to
2982 authenticate twice (once for <code>www</code> and once again
2983 for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
2984 FAQ on this subject for more information</a>). But if
2985 <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
2986 Apache will redirect to <code>http://www/splat/</code>.</p>
2988 <p>There is a third option, <code>UseCanonicalName DNS</code>,
2989 which is intended for use with mass IP-based virtual hosting to
2990 support ancient clients that do not provide a
2991 <code>Host:</code> header. With this option Apache does a
2992 reverse DNS lookup on the server IP address that the client
2993 connected to in order to work out self-referential URLs.</p>
2995 <div class="warning"><h3>Warning</h3>
2996 <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
2997 they may be broken by this option. The client is essentially free
2998 to give whatever value they want as a hostname. But if the CGI is
2999 only using <code>SERVER_NAME</code> to construct self-referential URLs
3000 then it should be just fine.</p>
3005 <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
3006 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
3007 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3010 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3011 <div class="directive-section"><h2><a name="UseCanonicalPhysicalPort" id="UseCanonicalPhysicalPort">UseCanonicalPhysicalPort</a> <a name="usecanonicalphysicalport" id="usecanonicalphysicalport">Directive</a></h2>
3012 <table class="directive">
3013 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
3015 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalPhysicalPort On|Off</code></td></tr>
3016 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalPhysicalPort Off</code></td></tr>
3017 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
3018 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3019 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3021 <p>In many situations Apache must construct a <em>self-referential</em>
3022 URL -- that is, a URL that refers back to the same server. With
3023 <code>UseCanonicalPhysicalPort On</code> Apache will, when
3024 constructing the canonical port for the server to honor
3025 the <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive,
3026 provide the actual physical port number being used by this request
3027 as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
3028 Apache will not ever use the actual physical port number, instead
3029 relying on all configured information to construct a valid port number.</p>
3031 <div class="note"><h3>Note</h3>
3032 <p>The ordering of when the physical port is used is as follows:<br /><br />
3033 <code>UseCanonicalName On</code></p>
3035 <li>Port provided in <code>Servername</code></li>
3036 <li>Physical port</li>
3037 <li>Default port</li>
3039 <code>UseCanonicalName Off | DNS</code>
3041 <li>Parsed port from <code>Host:</code> header</li>
3042 <li>Physical port</li>
3043 <li>Port provided in <code>Servername</code></li>
3044 <li>Default port</li>
3047 <p>With <code>UseCanonicalPhysicalPort Off</code>, the
3048 physical ports are removed from the ordering.</p>
3054 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
3055 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
3056 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3059 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3060 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost"><VirtualHost></a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
3061 <table class="directive">
3062 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
3063 hostname or IP address</td></tr>
3064 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><VirtualHost
3065 <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
3066 ...> ... </VirtualHost></code></td></tr>
3067 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3068 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3069 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3071 <p><code class="directive"><VirtualHost></code> and
3072 <code></VirtualHost></code> are used to enclose a group of
3073 directives that will apply only to a particular virtual host. Any
3074 directive that is allowed in a virtual host context may be
3075 used. When the server receives a request for a document on a
3076 particular virtual host, it uses the configuration directives
3077 enclosed in the <code class="directive"><VirtualHost></code>
3078 section. <var>Addr</var> can be:</p>
3081 <li>The IP address of the virtual host;</li>
3083 <li>A fully qualified domain name for the IP address of the
3086 <li>The character <code>*</code>, which is used only in combination with
3087 <code>NameVirtualHost *</code> to match all IP addresses; or</li>
3089 <li>The string <code>_default_</code>, which is used only
3090 with IP virtual hosting to catch unmatched IP addresses.</li>
3093 <div class="example"><h3>Example</h3><p><code>
3094 <VirtualHost 10.1.2.3><br />
3095 <span class="indent">
3096 ServerAdmin webmaster@host.foo.com<br />
3097 DocumentRoot /www/docs/host.foo.com<br />
3098 ServerName host.foo.com<br />
3099 ErrorLog logs/host.foo.com-error_log<br />
3100 TransferLog logs/host.foo.com-access_log<br />
3102 </VirtualHost>
3106 <p>IPv6 addresses must be specified in square brackets because
3107 the optional port number could not be determined otherwise. An
3108 IPv6 example is shown below:</p>
3110 <div class="example"><p><code>
3111 <VirtualHost [2001:db8::a00:20ff:fea7:ccea]><br />
3112 <span class="indent">
3113 ServerAdmin webmaster@host.example.com<br />
3114 DocumentRoot /www/docs/host.example.com<br />
3115 ServerName host.example.com<br />
3116 ErrorLog logs/host.example.com-error_log<br />
3117 TransferLog logs/host.example.com-access_log<br />
3119 </VirtualHost>
3122 <p>Each Virtual Host must correspond to a different IP address,
3123 different port number or a different host name for the server,
3124 in the former case the server machine must be configured to
3125 accept IP packets for multiple addresses. (If the machine does
3126 not have multiple network interfaces, then this can be
3127 accomplished with the <code>ifconfig alias</code> command -- if
3128 your OS supports it).</p>
3130 <div class="note"><h3>Note</h3>
3131 <p>The use of <code class="directive"><VirtualHost></code> does
3132 <strong>not</strong> affect what addresses Apache listens on. You
3133 may need to ensure that Apache is listening on the correct addresses
3134 using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
3137 <p>When using IP-based virtual hosting, the special name
3138 <code>_default_</code> can be specified in
3139 which case this virtual host will match any IP address that is
3140 not explicitly listed in another virtual host. In the absence
3141 of any <code>_default_</code> virtual host the "main" server config,
3142 consisting of all those definitions outside any VirtualHost
3143 section, is used when no IP-match occurs. (But note that any IP
3144 address that matches a <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> directive will use neither
3145 the "main" server config nor the <code>_default_</code> virtual host.
3146 See the <a href="../vhosts/name-based.html">name-based virtual hosting</a>
3147 documentation for further details.)</p>
3149 <p>You can specify a <code>:port</code> to change the port that is
3150 matched. If unspecified then it defaults to the same port as the
3151 most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
3152 statement of the main server. You may also specify <code>:*</code>
3153 to match all ports on that address. (This is recommended when used
3154 with <code>_default_</code>.)</p>
3156 <div class="warning"><h3>Security</h3>
3157 <p>See the <a href="../misc/security_tips.html">security tips</a>
3158 document for details on why your security could be compromised if the
3159 directory where log files are stored is writable by anyone other
3160 than the user that starts the server.</p>
3165 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
3166 <li><a href="../dns-caveats.html">Issues Regarding DNS and
3168 <li><a href="../bind.html">Setting
3169 which addresses and ports Apache uses</a></li>
3170 <li><a href="../sections.html">How <Directory>, <Location>
3171 and <Files> sections work</a> for an explanation of how these
3172 different sections are combined when a request is received</li>
3176 <div class="bottomlang">
3177 <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
3178 <a href="../en/mod/core.html" title="English"> en </a> |
3179 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
3180 </div><div id="footer">
3181 <p class="apache">Copyright 1995-2006 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
3182 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>