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.1</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-project/">Documentation</a> > <a href="../">Version 2.1</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="#authname">AuthName</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#authtype">AuthType</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#directory"><Directory></a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch"><DirectoryMatch></a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#files"><Files></a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch"><FilesMatch></a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine"><IfDefine></a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule"><IfModule></a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#limit"><Limit></a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept"><LimitExcept></a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#location"><Location></a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch"><LocationMatch></a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#require">Require</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#satisfy">Satisfy</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
94 <li><img alt="" src="../images/down.gif" /> <a href="#traceenable">TraceEnable</a></li>
95 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
96 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost"><VirtualHost></a></li>
100 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
101 <div class="directive-section"><h2><a name="AcceptFilter" id="AcceptFilter">AcceptFilter</a> <a name="acceptfilter" id="acceptfilter">Directive</a></h2>
102 <table class="directive">
103 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures optimizations for a Protocol's Listener Sockets</td></tr>
104 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptFilter <var>protocol</var> <var>accept_filter</var></code></td></tr>
105 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
106 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
107 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
108 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.1.5 and later</td></tr>
110 <p>This directive enables operating system specific optimizations for a
111 listening socket by the Protocol type. The basic premise is for the
112 kernel to not send a socket to the server process until either data
113 is received or an entire HTTP Request is buffered. Only
114 <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&sektion=9">
115 FreeBSD's Accept Filters</a> and Linux's more primitive
116 <code>TCP_DEFER_ACCEPT</code> are currently supported.</p>
118 <p>The default values on FreeBSD are:</p>
119 <div class="example"><p><code>
120 AcceptFilter http httpready <br />
121 AcceptFilter https dataready
124 <p>The <code>httpready</code> accept filter buffers entire HTTP requests at
125 the kernel level. Once an entire request is recieved, the kernel then
126 sends it to the server. See the
127 <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&sektion=9">
128 accf_http(9)</a> man page for more details. Since HTTPS requests are
129 encrypted only the <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&sektion=9">
130 accf_data(9)</a> filter is used.</p>
132 <p>The default values on Linux are:</p>
133 <div class="example"><p><code>
134 AcceptFilter http data <br />
135 AcceptFilter https data
138 <p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http
139 requests. Any value besides <code>none</code> will enable
140 <code>TCP_DEFER_ACCEPT</code> on that listener. For more details
142 <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
143 tcp(7)</a> man page.</p>
145 <p>Using <code>none</code> for an argument will disable any accept filters
146 for that protocol. This is useful for protocols that require a server
147 send data first, such as <code>nntp</code>:</p>
148 <div class="example"><p><code>AcceptFilter nttp none</code></p></div>
152 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
153 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
154 <table class="directive">
155 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
156 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
157 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
158 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
159 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
160 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
161 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
162 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.30 and later</td></tr>
165 <p>This directive controls whether requests that contain trailing
166 pathname information that follows an actual filename (or
167 non-existent file in an existing directory) will be accepted or
168 rejected. The trailing pathname information can be made
169 available to scripts in the <code>PATH_INFO</code> environment
172 <p>For example, assume the location <code>/test/</code> points to
173 a directory that contains only the single file
174 <code>here.html</code>. Then requests for
175 <code>/test/here.html/more</code> and
176 <code>/test/nothere.html/more</code> both collect
177 <code>/more</code> as <code>PATH_INFO</code>.</p>
179 <p>The three possible arguments for the
180 <code class="directive">AcceptPathInfo</code> directive are:</p>
182 <dt><code>Off</code></dt><dd>A request will only be accepted if it
183 maps to a literal path that exists. Therefore a request with
184 trailing pathname information after the true filename such as
185 <code>/test/here.html/more</code> in the above example will return
186 a 404 NOT FOUND error.</dd>
188 <dt><code>On</code></dt><dd>A request will be accepted if a
189 leading path component maps to a file that exists. The above
190 example <code>/test/here.html/more</code> will be accepted if
191 <code>/test/here.html</code> maps to a valid file.</dd>
193 <dt><code>Default</code></dt><dd>The treatment of requests with
194 trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
195 The core handler for normal files defaults to rejecting
196 <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
197 <code>PATH_INFO</code> by default.</dd>
200 <p>The primary purpose of the <code>AcceptPathInfo</code>
201 directive is to allow you to override the handler's choice of
202 accepting or rejecting <code>PATH_INFO</code>. This override is required,
203 for example, when you use a <a href="../filter.html">filter</a>, such
204 as <a href="mod_include.html">INCLUDES</a>, to generate content
205 based on <code>PATH_INFO</code>. The core handler would usually reject
206 the request, so you can use the following configuration to enable
209 <div class="example"><p><code>
210 <Files "mypaths.shtml"><br />
211 <span class="indent">
212 Options +Includes<br />
213 SetOutputFilter INCLUDES<br />
214 AcceptPathInfo On<br />
221 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
222 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
223 <table class="directive">
224 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
225 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
226 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
227 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
228 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
229 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
231 <p>While processing a request the server looks for
232 the first existing configuration file from this list of names in
233 every directory of the path to the document, if distributed
234 configuration files are <a href="#allowoverride">enabled for that
235 directory</a>. For example:</p>
237 <div class="example"><p><code>
241 <p>before returning the document
242 <code>/usr/local/web/index.html</code>, the server will read
243 <code>/.acl</code>, <code>/usr/.acl</code>,
244 <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
245 for directives, unless they have been disabled with</p>
247 <div class="example"><p><code>
248 <Directory /><br />
249 <span class="indent">
250 AllowOverride None<br />
257 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
258 <li><a href="../configuring.html">Configuration Files</a></li>
259 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
262 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
263 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
264 <table class="directive">
265 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default charset parameter to be added when a response
266 content-type is <code>text/plain</code> or <code>text/html</code></td></tr>
267 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
268 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
269 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
270 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
271 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
272 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
274 <p>This directive specifies a default value for the media type
275 charset parameter (the name of a character encoding) to be added
276 to a response if and only if the response's content-type is either
277 <code>text/plain</code> or <code>text/html</code>. This should override
278 any charset specified in the body of the response via a <code>META</code>
279 element, though the exact behavior is often dependent on the user's client
280 configuration. A setting of <code>AddDefaultCharset Off</code>
281 disables this functionality. <code>AddDefaultCharset On</code> enables
282 a default charset of <code>iso-8859-1</code>. Any other value is assumed
283 to be the <var>charset</var> to be used, which should be one of the
284 <a href="http://www.iana.org/assignments/character-sets">IANA registered
285 charset values</a> for use in MIME media types.
288 <div class="example"><p><code>
289 AddDefaultCharset utf-8
292 <p><code class="directive">AddDefaultCharset</code> should only be used when all
293 of the text resources to which it applies are known to be in that
294 character encoding and it is too inconvenient to label their charset
295 individually. One such example is to add the charset parameter
296 to resources containing generated content, such as legacy CGI
297 scripts, that might be vulnerable to cross-site scripting attacks
298 due to user-provided data being included in the output. Note, however,
299 that a better solution is to just fix (or delete) those scripts, since
300 setting a default charset does not protect users that have enabled
301 the "auto-detect character encoding" feature on their browser.</p>
305 <li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li>
308 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
309 <div class="directive-section"><h2><a name="AddOutputFilterByType" id="AddOutputFilterByType">AddOutputFilterByType</a> <a name="addoutputfilterbytype" id="addoutputfilterbytype">Directive</a></h2>
310 <table class="directive">
311 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>assigns an output filter to a particular MIME-type</td></tr>
312 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
313 <var>MIME-type</var> [<var>MIME-type</var>] ...</code></td></tr>
314 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
315 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
316 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
317 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
318 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later</td></tr>
320 <p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the
321 response <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a>.</p>
323 <p>The following example uses the <code>DEFLATE</code> filter, which
324 is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all
325 output (either static or dynamic) which is labeled as
326 <code>text/html</code> or <code>text/plain</code> before it is sent
329 <div class="example"><p><code>
330 AddOutputFilterByType DEFLATE text/html text/plain
333 <p>If you want the content to be processed by more than one filter, their
334 names have to be separated by semicolons. It's also possible to use one
335 <code class="directive">AddOutputFilterByType</code> directive for each of
338 <p>The configuration below causes all script output labeled as
339 <code>text/html</code> to be processed at first by the
340 <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
343 <div class="example"><p><code>
344 <Location /cgi-bin/><br />
345 <span class="indent">
346 Options Includes<br />
347 AddOutputFilterByType INCLUDES;DEFLATE text/html<br />
352 <div class="warning"><h3>Note</h3>
353 <p>Enabling filters with <code class="directive">AddOutputFilterByType</code>
354 may fail partially or completely in some cases. For example, no
355 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
356 back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting,
357 even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the
360 <p>However, if you want to make sure, that the filters will be
361 applied, assign the content type to a resource explicitly, for
362 example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or
363 <code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the
364 content type within a (non-nph) CGI script is also safe.</p>
366 <p>The by-type output filters are never applied on proxy requests.</p>
371 <li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li>
372 <li><code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code></li>
373 <li><a href="../filter.html">filters</a></li>
376 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
377 <div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directive</a></h2>
378 <table class="directive">
379 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether encoded path separators in URLs are allowed to
380 be passed through</td></tr>
381 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
382 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
383 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
384 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
385 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
386 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.46 and later</td></tr>
388 <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
389 which contain encoded path separators (<code>%2F</code> for <code>/</code>
390 and additionally <code>%5C</code> for <code>\</code> on according systems)
391 to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
393 <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
394 mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
396 <div class="note"><h3>Note</h3>
397 <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
398 Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
399 according systems) will be left as such in the otherwise decoded URL
405 <li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
408 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
409 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
410 <table class="directive">
411 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
412 <code>.htaccess</code> files</td></tr>
413 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
414 [<var>directive-type</var>] ...</code></td></tr>
415 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr>
416 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
417 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
418 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
420 <p>When the server finds an <code>.htaccess</code> file (as
421 specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
422 it needs to know which directives declared in that file can override
423 earlier configuration directives.</p>
425 <div class="note"><h3>Only available in <Directory> sections</h3>
426 <code class="directive">AllowOverride</code> is valid only in
427 <code class="directive"><a href="#directory"><Directory></a></code>
428 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
429 <code class="directive"><a href="#files"><Files></a></code> sections.
432 <p>When this directive is set to <code>None</code>, then
433 <a href="#accessfilename">.htaccess</a> files are completely ignored.
434 In this case, the server will not even attempt to read
435 <code>.htaccess</code> files in the filesystem.</p>
437 <p>When this directive is set to <code>All</code>, then any
438 directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
439 <code>.htaccess</code> files.</p>
441 <p>The <var>directive-type</var> can be one of the following
442 groupings of directives.</p>
449 Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
450 <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
451 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
452 <code class="directive"><a href="#authname">AuthName</a></code>,
453 <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>
458 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>,
459 <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
460 <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove*
461 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>),
462 <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
463 <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> from
464 <code class="module"><a href="../mod/mod_actions.html">mod_actions</a></code>.
470 Allow use of the directives controlling directory indexing
471 (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
472 <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>,
473 <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
474 <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>,
480 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>
482 <dt>Options[=<var>Option</var>,...]</dt>
485 Allow use of the directives controlling specific directory
486 features (<code class="directive"><a href="#options">Options</a></code> and
487 <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).
488 An equal sign may be given followed by a comma (but no spaces)
489 separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
494 <div class="example"><p><code>
495 AllowOverride AuthConfig Indexes
498 <p>In the example above all directives that are neither in the group
499 <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
504 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
505 <li><a href="../configuring.html">Configuration Files</a></li>
506 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
509 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
510 <div class="directive-section"><h2><a name="AuthName" id="AuthName">AuthName</a> <a name="authname" id="authname">Directive</a></h2>
511 <table class="directive">
512 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Authorization realm for use in HTTP
513 authentication</td></tr>
514 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthName <var>auth-domain</var></code></td></tr>
515 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
516 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
517 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
518 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
520 <p>This directive sets the name of the authorization realm for a
521 directory. This realm is given to the client so that the user
522 knows which username and password to send.
523 <code class="directive">AuthName</code> takes a single argument; if the
524 realm name contains spaces, it must be enclosed in quotation
525 marks. It must be accompanied by <code class="directive"><a href="#authtype">AuthType</a></code> and <code class="directive"><a href="#require">Require</a></code> directives, and directives such
526 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
527 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
532 <div class="example"><p><code>
533 AuthName "Top Secret"
536 <p>The string provided for the <code>AuthName</code> is what will
537 appear in the password dialog provided by most browsers.</p>
541 <li><a href="../howto/auth.html">Authentication, Authorization, and
542 Access Control</a></li>
545 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
546 <div class="directive-section"><h2><a name="AuthType" id="AuthType">AuthType</a> <a name="authtype" id="authtype">Directive</a></h2>
547 <table class="directive">
548 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Type of user authentication</td></tr>
549 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthType Basic|Digest</code></td></tr>
550 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
551 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
552 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
553 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
555 <p>This directive selects the type of user authentication for a
556 directory. Only <code>Basic</code> and <code>Digest</code> are
557 currently implemented.
559 It must be accompanied by <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#require">Require</a></code> directives, and directives such
560 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
561 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
566 <li><a href="../howto/auth.html">Authentication, Authorization,
567 and Access Control</a></li>
570 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
571 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
572 <table class="directive">
573 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
575 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
576 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
577 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
578 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
579 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
580 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
582 <p>This directive is used to control how Apache finds the
583 interpreter used to run CGI scripts. For example, setting
584 <code>CGIMapExtension sys:\foo.nlm .foo</code> will
585 cause all CGI script files with a <code>.foo</code> extension to
586 be passed to the FOO interpreter.</p>
589 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
590 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
591 <table class="directive">
592 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of <code>Content-MD5</code> HTTP Response
594 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
595 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
596 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
597 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
598 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
599 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
601 <p>This directive enables the generation of
602 <code>Content-MD5</code> headers as defined in RFC1864
603 respectively RFC2068.</p>
605 <p>MD5 is an algorithm for computing a "message digest"
606 (sometimes called "fingerprint") of arbitrary-length data, with
607 a high degree of confidence that any alterations in the data
608 will be reflected in alterations in the message digest.</p>
610 <p>The <code>Content-MD5</code> header provides an end-to-end
611 message integrity check (MIC) of the entity-body. A proxy or
612 client may check this header for detecting accidental
613 modification of the entity-body in transit. Example header:</p>
615 <div class="example"><p><code>
616 Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
619 <p>Note that this can cause performance problems on your server
620 since the message digest is computed on every request (the
621 values are not cached).</p>
623 <p><code>Content-MD5</code> is only sent for documents served
624 by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
625 SSI documents, output from CGI scripts, and byte range responses
626 do not have this header.</p>
629 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
630 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
631 <table class="directive">
632 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>MIME content-type that will be sent if the
633 server cannot determine a type in any other way</td></tr>
634 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>MIME-type</var></code></td></tr>
635 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType text/plain</code></td></tr>
636 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
637 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
638 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
639 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
641 <p>There will be times when the server is asked to provide a
642 document whose type cannot be determined by its <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME types</a> mappings.</p>
644 <p>The server must inform the client of the content-type of the
645 document, so in the event of an unknown type it uses the
646 <code>DefaultType</code>. For example:</p>
648 <div class="example"><p><code>
649 DefaultType image/gif
652 <p>would be appropriate for a directory which contained many GIF
653 images with filenames missing the <code>.gif</code> extension.</p>
655 <p>Note that unlike <code class="directive"><a href="#forcetype">ForceType</a></code>, this directive only
656 provides the default mime-type. All other mime-type definitions,
657 including filename extensions, that might identify the media type
658 will override this default.</p>
661 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
662 <div class="directive-section"><h2><a name="Directory" id="Directory"><Directory></a> <a name="directory" id="directory">Directive</a></h2>
663 <table class="directive">
664 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
665 named file-system directory and sub-directories</td></tr>
666 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Directory <var>directory-path</var>>
667 ... </Directory></code></td></tr>
668 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
669 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
670 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
672 <p><code class="directive"><Directory></code> and
673 <code></Directory></code> are used to enclose a group of
674 directives that will apply only to the named directory and
675 sub-directories of that directory. Any directive that is allowed
676 in a directory context may be used. <var>Directory-path</var> is
677 either the full path to a directory, or a wild-card string using
678 Unix shell-style matching. In a wild-card string, <code>?</code> matches
679 any single character, and <code>*</code> matches any sequences of
680 characters. You may also use <code>[]</code> character ranges. None
681 of the wildcards match a `/' character, so <code><Directory
682 /*/public_html></code> will not match
683 <code>/home/user/public_html</code>, but <code><Directory
684 /home/*/public_html></code> will match. Example:</p>
686 <div class="example"><p><code>
687 <Directory /usr/local/httpd/htdocs><br />
688 <span class="indent">
689 Options Indexes FollowSymLinks<br />
695 <p>Be careful with the <var>directory-path</var> arguments:
696 They have to literally match the filesystem path which Apache uses
697 to access the files. Directives applied to a particular
698 <code><Directory></code> will not apply to files accessed from
699 that same directory via a different path, such as via different symbolic
703 <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular
704 expressions</a> can also be used, with the addition of the
705 <code>~</code> character. For example:</p>
707 <div class="example"><p><code>
708 <Directory ~ "^/www/.*/[0-9]{3}">
711 <p>would match directories in <code>/www/</code> that consisted of
714 <p>If multiple (non-regular expression) <code class="directive"><Directory></code> sections
715 match the directory (or one of its parents) containing a document,
716 then the directives are applied in the order of shortest match
717 first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
720 <div class="example"><p><code>
721 <Directory /><br />
722 <span class="indent">
723 AllowOverride None<br />
725 </Directory><br />
727 <Directory /home/><br />
728 <span class="indent">
729 AllowOverride FileInfo<br />
734 <p>for access to the document <code>/home/web/dir/doc.html</code>
738 <li>Apply directive <code>AllowOverride None</code>
739 (disabling <code>.htaccess</code> files).</li>
741 <li>Apply directive <code>AllowOverride FileInfo</code> (for
742 directory <code>/home</code>).</li>
744 <li>Apply any <code>FileInfo</code> directives in
745 <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
746 <code>/home/web/dir/.htaccess</code> in that order.</li>
749 <p>Regular expressions are not considered until after all of the
750 normal sections have been applied. Then all of the regular
751 expressions are tested in the order they appeared in the
752 configuration file. For example, with</p>
754 <div class="example"><p><code>
755 <Directory ~ abc$><br />
756 <span class="indent">
757 # ... directives here ...<br />
762 <p>the regular expression section won't be considered until after
763 all normal <code class="directive"><Directory></code>s and
764 <code>.htaccess</code> files have been applied. Then the regular
765 expression will match on <code>/home/abc/public_html/abc</code> and
766 the corresponding <code class="directive"><Directory></code> will
769 <p><strong>Note that the default Apache access for
770 <code><Directory /></code> is <code>Allow from All</code>.
771 This means that Apache will serve any file mapped from an URL. It is
772 recommended that you change this with a block such
775 <div class="example"><p><code>
776 <Directory /><br />
777 <span class="indent">
778 Order Deny,Allow<br />
784 <p><strong>and then override this for directories you
785 <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
786 details.</strong></p>
788 <p>The directory sections occur in the <code>httpd.conf</code> file.
789 <code class="directive"><Directory></code> directives
790 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>
794 <li><a href="../sections.html">How <Directory>,
795 <Location> and <Files> sections work</a> for an
796 explanation of how these different sections are combined when a
797 request is received</li>
800 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
801 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch"><DirectoryMatch></a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
802 <table class="directive">
803 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
804 file-system directories matching a regular expression and their
805 subdirectories</td></tr>
806 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><DirectoryMatch <var>regex</var>>
807 ... </DirectoryMatch></code></td></tr>
808 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
809 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
810 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
812 <p><code class="directive"><DirectoryMatch></code> and
813 <code></DirectoryMatch></code> are used to enclose a group
814 of directives which will apply only to the named directory and
815 sub-directories of that directory, the same as <code class="directive"><a href="#directory"><Directory></a></code>. However, it
816 takes as an argument a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular
817 expression</a>. For example:</p>
819 <div class="example"><p><code>
820 <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
823 <p>would match directories in <code>/www/</code> that consisted of three
828 <li><code class="directive"><a href="#directory"><Directory></a></code> for
829 a description of how regular expressions are mixed in with normal
830 <code class="directive"><Directory></code>s</li>
831 <li><a href="../sections.html">How <Directory>, <Location> and
832 <Files> sections work</a> for an explanation of how these different
833 sections are combined when a request is received</li>
836 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
837 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
838 <table class="directive">
839 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
840 from the web</td></tr>
841 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
842 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
843 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
844 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
845 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
847 <p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
848 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
849 path from the requested URL to the document root to make the
850 path to the document. Example:</p>
852 <div class="example"><p><code>
853 DocumentRoot /usr/web
857 <code>http://www.my.host.com/index.html</code> refers to
858 <code>/usr/web/index.html</code>. If the <var>directory-path</var> is
859 not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
861 <p>The <code class="directive">DocumentRoot</code> should be specified without
862 a trailing slash.</p>
866 <li><a href="../urlmapping.html">Mapping URLs to Filesystem
870 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
871 <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
872 <table class="directive">
873 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
874 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
875 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
876 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
877 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
878 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
879 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
881 <p>This directive controls whether the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use
882 memory-mapping if it needs to read the contents of a file during
883 delivery. By default, when the handling of a request requires
884 access to the data within a file -- for example, when delivering a
885 server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache
886 memory-maps the file if the OS supports it.</p>
888 <p>This memory-mapping sometimes yields a performance improvement.
889 But in some environments, it is better to disable the memory-mapping
890 to prevent operational problems:</p>
893 <li>On some multiprocessor systems, memory-mapping can reduce the
894 performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
895 <li>With an NFS-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code>,
896 the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may crash due to a segmentation fault if a file
897 is deleted or truncated while the <code class="program"><a href="../programs/httpd.html">httpd</a></code> has it
901 <p>For server configurations that are vulnerable to these problems,
902 you should disable memory-mapping of delivered files by specifying:</p>
904 <div class="example"><p><code>
908 <p>For NFS mounted files, this feature may be disabled explicitly for
909 the offending files by specifying:</p>
911 <div class="example"><p><code>
912 <Directory "/path-to-nfs-files">
913 <span class="indent">
920 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
921 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
922 <table class="directive">
923 <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>
924 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
925 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile On</code></td></tr>
926 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
927 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
928 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
929 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
930 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later</td></tr>
932 <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
933 sendfile support from the kernel to transmit file contents to the client.
934 By default, when the handling of a request requires no access
935 to the data within a file -- for example, when delivering a
936 static file -- Apache uses sendfile to deliver the file contents
937 without ever reading the file if the OS supports it.</p>
939 <p>This sendfile mechanism avoids separate read and send operations,
940 and buffer allocations. But on some platforms or within some
941 filesystems, it is better to disable this feature to avoid
942 operational problems:</p>
945 <li>Some platforms may have broken sendfile support that the build
946 system did not detect, especially if the binaries were built on
947 another box and moved to such a machine with broken sendfile
949 <li>On Linux the use of sendfile triggers TCP-checksum
950 offloading bugs on certain networking cards when using IPv6.</li>
951 <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS or SMB),
952 the kernel may be unable to serve the network file through
956 <p>For server configurations that are vulnerable to these problems,
957 you should disable this feature by specifying:</p>
959 <div class="example"><p><code>
963 <p>For NFS or SMB mounted files, this feature may be disabled explicitly
964 for the offending files by specifying:</p>
966 <div class="example"><p><code>
967 <Directory "/path-to-nfs-files">
968 <span class="indent">
975 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
976 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
977 <table class="directive">
978 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
979 in case of an error</td></tr>
980 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
981 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
982 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
983 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
984 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
985 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Quoting syntax for text messages is different in Apache
988 <p>In the event of a problem or error, Apache can be configured
989 to do one of four things,</p>
992 <li>output a simple hardcoded error message</li>
994 <li>output a customized message</li>
996 <li>redirect to a local <var>URL-path</var> to handle the
999 <li>redirect to an external <var>URL</var> to handle the
1003 <p>The first option is the default, while options 2-4 are
1004 configured using the <code class="directive">ErrorDocument</code>
1005 directive, which is followed by the HTTP response code and a URL
1006 or a message. Apache will sometimes offer additional information
1007 regarding the problem/error.</p>
1009 <p>URLs can begin with a slash (/) for local web-paths (relative
1010 to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
1011 full URL which the client can resolve. Alternatively, a message
1012 can be provided to be displayed by the browser. Examples:</p>
1014 <div class="example"><p><code>
1015 ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
1016 ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
1017 ErrorDocument 401 /subscription_info.html<br />
1018 ErrorDocument 403 "Sorry can't allow you access today"
1021 <p>Additionally, the special value <code>default</code> can be used
1022 to specify Apache's simple hardcoded message. While not required
1023 under normal circumstances, <code>default</code> will restore
1024 Apache's simple hardcoded message for configurations that would
1025 otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
1027 <div class="example"><p><code>
1028 ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
1029 <Directory /web/docs><br />
1030 <span class="indent">
1031 ErrorDocument 404 default<br />
1036 <p>Note that when you specify an <code class="directive">ErrorDocument</code>
1037 that points to a remote URL (ie. anything with a method such as
1038 <code>http</code> in front of it), Apache will send a redirect to the
1039 client to tell it where to find the document, even if the
1040 document ends up being on the same server. This has several
1041 implications, the most important being that the client will not
1042 receive the original error status code, but instead will
1043 receive a redirect status code. This in turn can confuse web
1044 robots and other clients which try to determine if a URL is
1045 valid using the status code. In addition, if you use a remote
1046 URL in an <code>ErrorDocument 401</code>, the client will not
1047 know to prompt the user for a password since it will not
1048 receive the 401 status code. Therefore, <strong>if you use an
1049 <code>ErrorDocument 401</code> directive then it must refer to a local
1050 document.</strong></p>
1052 <p>Microsoft Internet Explorer (MSIE) will by default ignore
1053 server-generated error messages when they are "too small" and substitute
1054 its own "friendly" error messages. The size threshold varies depending on
1055 the type of error, but in general, if you make your error document
1056 greater than 512 bytes, then MSIE will show the server-generated
1057 error rather than masking it. More information is available in
1058 Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
1060 <p>Although most error messages can be overriden, there are certain
1061 circumstances where the internal messages are used regardless of the
1062 setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>. In
1063 particular, if a malformed request is detected, normal request processing
1064 will be immediately halted and the internal error message returned.
1065 This is necessary to guard against security problems caused by
1068 <p>Prior to version 2.0, messages were indicated by prefixing
1069 them with a single unmatched double quote character.</p>
1073 <li><a href="../custom-error.html">documentation of
1074 customizable responses</a></li>
1077 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1078 <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
1079 <table class="directive">
1080 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
1081 <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>
1082 <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>
1083 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1084 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1085 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1087 <p>The <code class="directive">ErrorLog</code> directive sets the name of
1088 the file to which the server will log any errors it encounters. If
1089 the <var>file-path</var> is not absolute then it is assumed to be
1090 relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
1092 <div class="example"><h3>Example</h3><p><code>
1093 ErrorLog /var/log/httpd/error_log
1096 <p>If the <var>file-path</var>
1097 begins with a pipe (|) then it is assumed to be a command to spawn
1098 to handle the error log.</p>
1100 <div class="example"><h3>Example</h3><p><code>
1101 ErrorLog "|/usr/local/bin/httpd_errors"
1104 <p>Using <code>syslog</code> instead of a filename enables logging
1105 via syslogd(8) if the system supports it. The default is to use
1106 syslog facility <code>local7</code>, but you can override this by
1107 using the <code>syslog:<var>facility</var></code> syntax where
1108 <var>facility</var> can be one of the names usually documented in
1111 <div class="example"><h3>Example</h3><p><code>
1112 ErrorLog syslog:user
1115 <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
1116 document for details on why your security could be compromised
1117 if the directory where log files are stored is writable by
1118 anyone other than the user that starts the server.</p>
1119 <div class="warning"><h3>Note</h3>
1120 <p>When entering a file path on non-Unix platforms, care should be taken
1121 to make sure that only forward slashed are used even though the platform
1122 may allow the use of back slashes. In general it is a good idea to always
1123 use forward slashes throughout the configuration files.</p>
1128 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
1129 <li><a href="../logs.html">Apache Log Files</a></li>
1132 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1133 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
1134 <table class="directive">
1135 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
1136 HTTP response header</td></tr>
1137 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
1138 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
1139 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1140 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1141 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1142 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1145 The <code class="directive">FileETag</code> directive configures the file
1146 attributes that are used to create the <code>ETag</code> (entity
1147 tag) response header field when the document is based on a file.
1148 (The <code>ETag</code> value is used in cache management to save
1149 network bandwidth.) In Apache 1.3.22 and earlier, the
1150 <code>ETag</code> value was <em>always</em> formed
1151 from the file's inode, size, and last-modified time (mtime). The
1152 <code class="directive">FileETag</code> directive allows you to choose
1153 which of these -- if any -- should be used. The recognized keywords are:
1157 <dt><strong>INode</strong></dt>
1158 <dd>The file's i-node number will be included in the calculation</dd>
1159 <dt><strong>MTime</strong></dt>
1160 <dd>The date and time the file was last modified will be included</dd>
1161 <dt><strong>Size</strong></dt>
1162 <dd>The number of bytes in the file will be included</dd>
1163 <dt><strong>All</strong></dt>
1164 <dd>All available fields will be used. This is equivalent to:
1165 <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1166 <dt><strong>None</strong></dt>
1167 <dd>If a document is file-based, no <code>ETag</code> field will be
1168 included in the response</dd>
1171 <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1172 keywords may be prefixed with either <code>+</code> or <code>-</code>,
1173 which allow changes to be made to the default setting inherited
1174 from a broader scope. Any keyword appearing without such a prefix
1175 immediately and completely cancels the inherited setting.</p>
1177 <p>If a directory's configuration includes
1178 <code>FileETag INode MTime Size</code>, and a
1179 subdirectory's includes <code>FileETag -INode</code>,
1180 the setting for that subdirectory (which will be inherited by
1181 any sub-subdirectories that don't override it) will be equivalent to
1182 <code>FileETag MTime Size</code>.</p>
1185 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1186 <div class="directive-section"><h2><a name="Files" id="Files"><Files></a> <a name="files" id="files">Directive</a></h2>
1187 <table class="directive">
1188 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
1190 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Files <var>filename</var>> ... </Files></code></td></tr>
1191 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1192 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1193 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1194 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1196 <p>The <code class="directive"><Files></code> directive
1197 limits the scope of the enclosed directives by filename. It is comparable
1198 to the <code class="directive"><a href="#directory"><Directory></a></code>
1199 and <code class="directive"><a href="#location"><Location></a></code>
1200 directives. It should be matched with a <code></Files></code>
1201 directive. The directives given within this section will be applied to
1202 any object with a basename (last component of filename) matching the
1203 specified filename. <code class="directive"><Files></code>
1204 sections are processed in the order they appear in the
1205 configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1206 <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location"><Location></a></code> sections. Note
1207 that <code class="directive"><Files></code> can be nested
1208 inside <code class="directive"><a href="#directory"><Directory></a></code> sections to restrict the
1209 portion of the filesystem they apply to.</p>
1211 <p>The <var>filename</var> argument should include a filename, or
1212 a wild-card string, where <code>?</code> matches any single character,
1213 and <code>*</code> matches any sequences of characters.
1214 <a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a>
1215 can also be used, with the addition of the
1216 <code>~</code> character. For example:</p>
1218 <div class="example"><p><code>
1219 <Files ~ "\.(gif|jpe?g|png)$">
1222 <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
1225 <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
1226 <code>.htaccess</code> files. This allows users to control access to
1227 their own files, at a file-by-file level.</p>
1232 <li><a href="../sections.html">How <Directory>, <Location>
1233 and <Files> sections work</a> for an explanation of how these
1234 different sections are combined when a request is received</li>
1237 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1238 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch"><FilesMatch></a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
1239 <table class="directive">
1240 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
1242 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><FilesMatch <var>regex</var>> ... </FilesMatch></code></td></tr>
1243 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1244 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1245 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1246 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1248 <p>The <code class="directive"><FilesMatch></code> directive
1249 limits the scope of the enclosed directives by filename, just as the
1250 <code class="directive"><a href="#files"><Files></a></code> directive
1251 does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular
1252 expression</a>. For example:</p>
1254 <div class="example"><p><code>
1255 <FilesMatch "\.(gif|jpe?g|png)$">
1258 <p>would match most common Internet graphics formats.</p>
1262 <li><a href="../sections.html">How <Directory>, <Location>
1263 and <Files> sections work</a> for an explanation of how these
1264 different sections are combined when a request is received</li>
1267 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1268 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
1269 <table class="directive">
1270 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
1271 MIME content-type</td></tr>
1272 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>MIME-type</var>|None</code></td></tr>
1273 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1274 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1275 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1276 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1277 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache 2.0</td></tr>
1279 <p>When placed into an <code>.htaccess</code> file or a
1280 <code class="directive"><a href="#directory"><Directory></a></code>, or
1281 <code class="directive"><a href="#location"><Location></a></code> or
1282 <code class="directive"><a href="#files"><Files></a></code>
1283 section, this directive forces all matching files to be served
1284 with the content type identification given by
1285 <var>MIME-type</var>. For example, if you had a directory full of
1286 GIF files, but did not want to label them all with <code>.gif</code>,
1287 you might want to use:</p>
1289 <div class="example"><p><code>
1293 <p>Note that unlike <code class="directive"><a href="#defaulttype">DefaultType</a></code>,
1294 this directive overrides all mime-type associations, including
1295 filename extensions, that might identify the media type.</p>
1297 <p>You can override any <code class="directive">ForceType</code> setting
1298 by using the value of <code>None</code>:</p>
1300 <div class="example"><p><code>
1301 # force all files to be image/gif:<br />
1302 <Location /images><br />
1303 <span class="indent">
1304 ForceType image/gif<br />
1306 </Location><br />
1308 # but normal mime-type associations here:<br />
1309 <Location /images/mixed><br />
1310 <span class="indent">
1311 ForceType None<br />
1317 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1318 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
1319 <table class="directive">
1320 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1321 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1322 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
1323 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1324 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1325 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1327 <p>This directive enables DNS lookups so that host names can be
1328 logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1329 The value <code>Double</code> refers to doing double-reverse
1330 DNS lookup. That is, after a reverse lookup is performed, a forward
1331 lookup is then performed on that result. At least one of the IP
1332 addresses in the forward lookup must match the original
1333 address. (In "tcpwrappers" terminology this is called
1334 <code>PARANOID</code>.)</p>
1336 <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1337 used for controlling access by hostname, a double reverse lookup
1338 will be performed. This is necessary for security. Note that the
1339 result of this double-reverse isn't generally available unless you
1340 set <code>HostnameLookups Double</code>. For example, if only
1341 <code>HostnameLookups On</code> and a request is made to an object
1342 that is protected by hostname restrictions, regardless of whether
1343 the double-reverse fails or not, CGIs will still be passed the
1344 single-reverse result in <code>REMOTE_HOST</code>.</p>
1346 <p>The default is <code>Off</code> in order to save the network
1347 traffic for those sites that don't truly need the reverse
1348 lookups done. It is also better for the end users because they
1349 don't have to suffer the extra latency that a lookup entails.
1350 Heavily loaded sites should leave this directive
1351 <code>Off</code>, since DNS lookups can take considerable
1352 amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
1353 default to the <code>bin</code> subdirectory of your installation
1354 directory, can be used to look up host names from logged IP addresses
1358 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1359 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine"><IfDefine></a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
1360 <table class="directive">
1361 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
1362 if a test is true at startup</td></tr>
1363 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfDefine [!]<var>parameter-name</var>> ...
1364 </IfDefine></code></td></tr>
1365 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1366 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1367 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1368 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1370 <p>The <code><IfDefine <var>test</var>>...</IfDefine>
1371 </code> section is used to mark directives that are conditional. The
1372 directives within an <code class="directive"><IfDefine></code>
1373 section are only processed if the <var>test</var> is true. If <var>
1374 test</var> is false, everything between the start and end markers is
1377 <p>The <var>test</var> in the <code class="directive"><IfDefine></code> section directive can be one of two forms:</p>
1380 <li><var>parameter-name</var></li>
1382 <li><code>!</code><var>parameter-name</var></li>
1385 <p>In the former case, the directives between the start and end
1386 markers are only processed if the parameter named
1387 <var>parameter-name</var> is defined. The second format reverses
1388 the test, and only processes the directives if
1389 <var>parameter-name</var> is <strong>not</strong> defined.</p>
1391 <p>The <var>parameter-name</var> argument is a define as given on
1392 the <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter-</var>
1393 </code>, at the time the server was started.</p>
1395 <p><code class="directive"><IfDefine></code> sections are
1396 nest-able, which can be used to implement simple
1397 multiple-parameter tests. Example:</p>
1399 <div class="example"><p><code>
1400 httpd -DReverseProxy ...<br />
1403 <IfDefine ReverseProxy><br />
1404 <span class="indent">
1405 LoadModule rewrite_module modules/mod_rewrite.so<br />
1406 LoadModule proxy_module modules/libproxy.so<br />
1412 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1413 <div class="directive-section"><h2><a name="IfModule" id="IfModule"><IfModule></a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
1414 <table class="directive">
1415 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
1416 presence or absence of a specific module</td></tr>
1417 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfModule [!]<var>module-file</var>|<var>module-identifier</var>> ...
1418 </IfModule></code></td></tr>
1419 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1420 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1421 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1422 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1423 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Module identifiers are available in version 2.1 and
1426 <p>The <code><IfModule <var>test</var>>...</IfModule></code>
1427 section is used to mark directives that are conditional on the presence of
1428 a specific module. The directives within an <code class="directive"><IfModule></code> section are only processed if the <var>test</var>
1429 is true. If <var>test</var> is false, everything between the start and
1430 end markers is ignored.</p>
1432 <p>The <var>test</var> in the <code class="directive"><IfModule></code> section directive can be one of two forms:</p>
1435 <li><var>module</var></li>
1437 <li>!<var>module</var></li>
1440 <p>In the former case, the directives between the start and end
1441 markers are only processed if the module named <var>module</var>
1442 is included in Apache -- either compiled in or
1443 dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1444 and only processes the directives if <var>module</var> is
1445 <strong>not</strong> included.</p>
1447 <p>The <var>module</var> argument can be either the module identifier or
1448 the file name of the module, at the time it was compiled. For example,
1449 <code>rewrite_module</code> is the identifier and
1450 <code>mod_rewrite.c</code> is the file name. If a module consists of
1451 several source files, use the name of the file containing the string
1452 <code>STANDARD20_MODULE_STUFF</code>.</p>
1454 <p><code class="directive"><IfModule></code> sections are
1455 nest-able, which can be used to implement simple multiple-module
1458 <div class="note">This section should only be used if you need to have one
1459 configuration file that works whether or not a specific module
1460 is available. In normal operation, directives need not be
1461 placed in <code class="directive"><IfModule></code>
1465 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1466 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
1467 <table class="directive">
1468 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
1469 the server configuration files</td></tr>
1470 <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>
1471 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1472 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1473 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1474 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later</td></tr>
1476 <p>This directive allows inclusion of other configuration files
1477 from within the server configuration files.</p>
1479 <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used to
1480 include several files at once, in alphabetical order. In
1481 addition, if <code class="directive">Include</code> points to a directory,
1482 rather than a file, Apache will read all files in that directory
1483 and any subdirectory. But including entire directories is not
1484 recommended, because it is easy to accidentally leave temporary
1485 files in a directory that can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
1488 <p>The file path specified may be an absolute path, or may be relative
1489 to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1493 <div class="example"><p><code>
1494 Include /usr/local/apache2/conf/ssl.conf<br />
1495 Include /usr/local/apache2/conf/vhosts/*.conf
1498 <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1500 <div class="example"><p><code>
1501 Include conf/ssl.conf<br />
1502 Include conf/vhosts/*.conf
1505 <p>Running <code>apachectl configtest</code> will give you a list
1506 of the files that are being processed during the configuration
1509 <div class="example"><p><code>
1510 root@host# apachectl configtest<br />
1511 Processing config file: /usr/local/apache2/conf/ssl.conf<br />
1512 Processing config file: /usr/local/apache2/conf/vhosts/vhost1.conf<br />
1513 Processing config file: /usr/local/apache2/conf/vhosts/vhost2.conf<br />
1519 <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
1522 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1523 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
1524 <table class="directive">
1525 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
1526 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1527 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
1528 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1529 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1530 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1532 <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1533 connection feature of HTTP/1.1 provide long-lived HTTP sessions
1534 which allow multiple requests to be sent over the same TCP
1535 connection. In some cases this has been shown to result in an
1536 almost 50% speedup in latency times for HTML documents with
1537 many images. To enable Keep-Alive connections, set
1538 <code>KeepAlive On</code>.</p>
1540 <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1541 used if they are specifically requested by a client. In
1542 addition, a Keep-Alive connection with an HTTP/1.0 client can
1543 only be used when the length of the content is known in
1544 advance. This implies that dynamic content such as CGI output,
1545 SSI pages, and server-generated directory listings will
1546 generally not use Keep-Alive connections to HTTP/1.0 clients.
1547 For HTTP/1.1 clients, persistent connections are the default
1548 unless otherwise specified. If the client requests it, chunked
1549 encoding will be used in order to send content of unknown
1550 length over persistent connections.</p>
1554 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
1557 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1558 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
1559 <table class="directive">
1560 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
1561 requests on a persistent connection</td></tr>
1562 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>seconds</var></code></td></tr>
1563 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 5</code></td></tr>
1564 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1565 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1566 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1568 <p>The number of seconds Apache will wait for a subsequent
1569 request before closing the connection. Once a request has been
1570 received, the timeout value specified by the
1571 <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
1573 <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
1574 may cause performance problems in heavily loaded servers. The
1575 higher the timeout, the more server processes will be kept
1576 occupied waiting on connections with idle clients.</p>
1579 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1580 <div class="directive-section"><h2><a name="Limit" id="Limit"><Limit></a> <a name="limit" id="limit">Directive</a></h2>
1581 <table class="directive">
1582 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
1584 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Limit <var>method</var> [<var>method</var>] ... > ...
1585 </Limit></code></td></tr>
1586 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1587 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1588 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1589 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1591 <p>Access controls are normally effective for
1592 <strong>all</strong> access methods, and this is the usual
1593 desired behavior. <strong>In the general case, access control
1594 directives should not be placed within a
1595 <code class="directive"><Limit></code> section.</strong></p>
1597 <p>The purpose of the <code class="directive"><Limit></code>
1598 directive is to restrict the effect of the access controls to the
1599 nominated HTTP methods. For all other methods, the access
1600 restrictions that are enclosed in the <code class="directive"><Limit></code> bracket <strong>will have no
1601 effect</strong>. The following example applies the access control
1602 only to the methods <code>POST</code>, <code>PUT</code>, and
1603 <code>DELETE</code>, leaving all other methods unprotected:</p>
1605 <div class="example"><p><code>
1606 <Limit POST PUT DELETE><br />
1607 <span class="indent">
1608 Require valid-user<br />
1613 <p>The method names listed can be one or more of: <code>GET</code>,
1614 <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1615 <code>CONNECT</code>, <code>OPTIONS</code>,
1616 <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1617 <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1618 <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1619 case-sensitive.</strong> If <code>GET</code> is used it will also
1620 restrict <code>HEAD</code> requests. The <code>TRACE</code> method
1621 cannot be limited.</p>
1623 <div class="warning">A <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section should always be
1624 used in preference to a <code class="directive"><a href="#limit"><Limit></a></code> section when restricting access,
1625 since a <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section provides protection
1626 against arbitrary methods.</div>
1630 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1631 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept"><LimitExcept></a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
1632 <table class="directive">
1633 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
1634 except the named ones</td></tr>
1635 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LimitExcept <var>method</var> [<var>method</var>] ... > ...
1636 </LimitExcept></code></td></tr>
1637 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1638 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1639 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1640 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1642 <p><code class="directive"><LimitExcept></code> and
1643 <code></LimitExcept></code> are used to enclose
1644 a group of access control directives which will then apply to any
1645 HTTP access method <strong>not</strong> listed in the arguments;
1646 i.e., it is the opposite of a <code class="directive"><a href="#limit"><Limit></a></code> section and can be used to control
1647 both standard and nonstandard/unrecognized methods. See the
1648 documentation for <code class="directive"><a href="#limit"><Limit></a></code> for more details.</p>
1652 <div class="example"><p><code>
1653 <LimitExcept POST GET><br />
1654 <span class="indent">
1655 Require valid-user<br />
1657 </LimitExcept>
1662 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1663 <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directive</a></h2>
1664 <table class="directive">
1665 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine maximum number of internal redirects and nested
1666 subrequests</td></tr>
1667 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
1668 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
1669 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1670 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1671 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1672 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.47 and later</td></tr>
1674 <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
1675 redirects the original request to a CGI script. A subrequest is Apache's
1676 mechanism to find out what would happen for some URI if it were requested.
1677 For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
1678 files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
1681 <p><code class="directive">LimitInternalRecursion</code> prevents the server
1682 from crashing when entering an infinite loop of internal redirects or
1683 subrequests. Such loops are usually caused by misconfigurations.</p>
1685 <p>The directive stores two different limits, which are evaluated on
1686 per-request basis. The first <var>number</var> is the maximum number of
1687 internal redirects, that may follow each other. The second <var>number</var>
1688 determines, how deep subrequests may be nested. If you specify only one
1689 <var>number</var>, it will be assigned to both limits.</p>
1691 <div class="example"><h3>Example</h3><p><code>
1692 LimitInternalRecursion 5
1696 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1697 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
1698 <table class="directive">
1699 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
1700 from the client</td></tr>
1701 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
1702 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
1703 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1704 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1705 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1706 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1708 <p>This directive specifies the number of <var>bytes</var> from 0
1709 (meaning unlimited) to 2147483647 (2GB) that are allowed in a
1712 <p>The <code class="directive">LimitRequestBody</code> directive allows
1713 the user to set a limit on the allowed size of an HTTP request
1714 message body within the context in which the directive is given
1715 (server, per-directory, per-file or per-location). If the client
1716 request exceeds that limit, the server will return an error
1717 response instead of servicing the request. The size of a normal
1718 request message body will vary greatly depending on the nature of
1719 the resource and the methods allowed on that resource. CGI scripts
1720 typically use the message body for retrieving form information.
1721 Implementations of the <code>PUT</code> method will require
1722 a value at least as large as any representation that the server
1723 wishes to accept for that resource.</p>
1725 <p>This directive gives the server administrator greater
1726 control over abnormal client request behavior, which may be
1727 useful for avoiding some forms of denial-of-service
1730 <p>If, for example, you are permitting file upload to a particular
1731 location, and wish to limit the size of the uploaded file to 100K,
1732 you might use the following directive:</p>
1734 <div class="example"><p><code>
1735 LimitRequestBody 102400
1740 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1741 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
1742 <table class="directive">
1743 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
1744 will be accepted from the client</td></tr>
1745 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
1746 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
1747 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1748 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1749 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1751 <p><var>Number</var> is an integer from 0 (meaning unlimited) to
1752 32767. The default value is defined by the compile-time
1753 constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
1756 <p>The <code class="directive">LimitRequestFields</code> directive allows
1757 the server administrator to modify the limit on the number of
1758 request header fields allowed in an HTTP request. A server needs
1759 this value to be larger than the number of fields that a normal
1760 client request might include. The number of request header fields
1761 used by a client rarely exceeds 20, but this may vary among
1762 different client implementations, often depending upon the extent
1763 to which a user has configured their browser to support detailed
1764 content negotiation. Optional HTTP extensions are often expressed
1765 using request header fields.</p>
1767 <p>This directive gives the server administrator greater
1768 control over abnormal client request behavior, which may be
1769 useful for avoiding some forms of denial-of-service attacks.
1770 The value should be increased if normal clients see an error
1771 response from the server that indicates too many fields were
1772 sent in the request.</p>
1776 <div class="example"><p><code>
1777 LimitRequestFields 50
1782 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1783 <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
1784 <table class="directive">
1785 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
1787 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldsize <var>bytes</var></code></td></tr>
1788 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldsize 8190</code></td></tr>
1789 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1790 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1791 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1793 <p>This directive specifies the number of <var>bytes</var>
1794 that will be allowed in an HTTP request header.</p>
1796 <p>The <code class="directive">LimitRequestFieldSize</code> directive
1797 allows the server administrator to reduce or increase the limit
1798 on the allowed size of an HTTP request header field. A server
1799 needs this value to be large enough to hold any one header field
1800 from a normal client request. The size of a normal request header
1801 field will vary greatly among different client implementations,
1802 often depending upon the extent to which a user has configured
1803 their browser to support detailed content negotiation. SPNEGO
1804 authentication headers can be up to 12392 bytes.</p>
1806 <p>This directive gives the server administrator greater
1807 control over abnormal client request behavior, which may be
1808 useful for avoiding some forms of denial-of-service attacks.</p>
1812 <div class="example"><p><code>
1813 LimitRequestFieldSize 4094
1816 <div class="note">Under normal conditions, the value should not be changed from
1821 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1822 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
1823 <table class="directive">
1824 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
1825 from the client</td></tr>
1826 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
1827 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
1828 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1829 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1830 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1832 <p>This directive sets the number of <var>bytes</var> that will be
1833 allowed on the HTTP request-line.</p>
1835 <p>The <code class="directive">LimitRequestLine</code> directive allows
1836 the server administrator to reduce or increase the limit on the allowed size
1837 of a client's HTTP request-line. Since the request-line consists of the
1838 HTTP method, URI, and protocol version, the
1839 <code class="directive">LimitRequestLine</code> directive places a
1840 restriction on the length of a request-URI allowed for a request
1841 on the server. A server needs this value to be large enough to
1842 hold any of its resource names, including any information that
1843 might be passed in the query part of a <code>GET</code> request.</p>
1845 <p>This directive gives the server administrator greater
1846 control over abnormal client request behavior, which may be
1847 useful for avoiding some forms of denial-of-service attacks.</p>
1851 <div class="example"><p><code>
1852 LimitRequestLine 4094
1855 <div class="note">Under normal conditions, the value should not be changed from
1859 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1860 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
1861 <table class="directive">
1862 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
1863 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
1864 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
1865 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1866 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1867 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1868 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1870 <p>Limit (in bytes) on maximum size of an XML-based request
1871 body. A value of <code>0</code> will disable any checking.</p>
1875 <div class="example"><p><code>
1876 LimitXMLRequestBody 0
1881 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1882 <div class="directive-section"><h2><a name="Location" id="Location"><Location></a> <a name="location" id="location">Directive</a></h2>
1883 <table class="directive">
1884 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
1886 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Location
1887 <var>URL-path</var>|<var>URL</var>> ... </Location></code></td></tr>
1888 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1889 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1890 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1892 <p>The <code class="directive"><Location></code> directive
1893 limits the scope of the enclosed directives by URL. It is similar to the
1894 <code class="directive"><a href="#directory"><Directory></a></code>
1895 directive, and starts a subsection which is terminated with a
1896 <code></Location></code> directive. <code class="directive"><Location></code> sections are processed in the
1897 order they appear in the configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1898 <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files"><Files></a></code> sections.</p>
1900 <p><code class="directive"><Location></code> sections operate
1901 completely outside the filesystem. This has several consequences.
1902 Most importantly, <code class="directive"><Location></code>
1903 directives should not be used to control access to filesystem
1904 locations. Since several different URLs may map to the same
1905 filesystem location, such access controls may by circumvented.</p>
1907 <div class="note"><h3>When to use <code class="directive"><Location></code></h3>
1909 <p>Use <code class="directive"><Location></code> to apply
1910 directives to content that lives outside the filesystem. For
1911 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
1912 <code><Location /></code>, which is an easy way to
1913 apply a configuration to the entire server.</p>
1916 <p>For all origin (non-proxy) requests, the URL to be matched is a
1917 URL-path of the form <code>/path/</code>. No scheme, hostname,
1918 port, or query string may be included. For proxy requests, the
1919 URL to be matched is of the form
1920 <code>scheme://servername/path</code>, and you must include the
1923 <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
1924 any single character, and <code>*</code> matches any sequences of
1927 <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a>
1928 can also be used, with the addition of the
1929 <code>~</code> character. For example:</p>
1931 <div class="example"><p><code>
1932 <Location ~ "/(extra|special)/data">
1935 <p>would match URLs that contained the substring <code>/extra/data</code>
1936 or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch"><LocationMatch></a></code> behaves
1937 identical to the regex version of <code class="directive"><Location></code>.</p>
1939 <p>The <code class="directive"><Location></code>
1940 functionality is especially useful when combined with the
1941 <code class="directive"><a href="#sethandler">SetHandler</a></code>
1942 directive. For example, to enable status requests, but allow them
1943 only from browsers at <code>foo.com</code>, you might use:</p>
1945 <div class="example"><p><code>
1946 <Location /status><br />
1947 <span class="indent">
1948 SetHandler server-status<br />
1949 Order Deny,Allow<br />
1951 Allow from .foo.com<br />
1956 <div class="note"><h3>Note about / (slash)</h3>
1957 <p>The slash character has special meaning depending on where in a
1958 URL it appears. People may be used to its behavior in the filesystem
1959 where multiple adjacent slashes are frequently collapsed to a single
1960 slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
1961 <code>/home/foo</code>). In URL-space this is not necessarily true.
1962 The <code class="directive"><a href="#locationmatch"><LocationMatch></a></code>
1963 directive and the regex version of <code class="directive"><Location></code> require you to explicitly specify multiple
1964 slashes if that is your intention.</p>
1966 <p>For example, <code><LocationMatch ^/abc></code> would match
1967 the request URL <code>/abc</code> but not the request URL <code>
1968 //abc</code>. The (non-regex) <code class="directive"><Location></code> directive behaves similarly when used for
1969 proxy requests. But when (non-regex) <code class="directive"><Location></code> is used for non-proxy requests it will
1970 implicitly match multiple slashes with a single slash. For example,
1971 if you specify <code><Location /abc/def></code> and the
1972 request is to <code>/abc//def</code> then it will match.</p>
1977 <li><a href="../sections.html">How <Directory>, <Location>
1978 and <Files> sections work</a> for an explanation of how these
1979 different sections are combined when a request is received</li>
1982 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1983 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch"><LocationMatch></a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
1984 <table class="directive">
1985 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
1986 matching URLs</td></tr>
1987 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LocationMatch
1988 <var>regex</var>> ... </LocationMatch></code></td></tr>
1989 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1990 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1991 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1993 <p>The <code class="directive"><LocationMatch></code> directive
1994 limits the scope of the enclosed directives by URL, in an identical manner
1995 to <code class="directive"><a href="#location"><Location></a></code>. However,
1996 it takes a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
1997 as an argument instead of a simple string. For example:</p>
1999 <div class="example"><p><code>
2000 <LocationMatch "/(extra|special)/data">
2003 <p>would match URLs that contained the substring <code>/extra/data</code>
2004 or <code>/special/data</code>.</p>
2008 <li><a href="../sections.html">How <Directory>, <Location>
2009 and <Files> sections work</a> for an explanation of how these
2010 different sections are combined when a request is received</li>
2013 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2014 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
2015 <table class="directive">
2016 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
2017 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel <var>level</var></code></td></tr>
2018 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
2019 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2020 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2021 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2023 <p><code class="directive">LogLevel</code> adjusts the verbosity of the
2024 messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
2025 <var>level</var>s are available, in order of decreasing
2028 <table class="bordered">
2031 <th><strong>Level</strong> </th>
2033 <th><strong>Description</strong> </th>
2035 <th><strong>Example</strong> </th>
2039 <td><code>emerg</code> </td>
2041 <td>Emergencies - system is unusable.</td>
2043 <td>"Child cannot open lock file. Exiting"</td>
2047 <td><code>alert</code> </td>
2049 <td>Action must be taken immediately.</td>
2051 <td>"getpwuid: couldn't determine user name from uid"</td>
2055 <td><code>crit</code> </td>
2057 <td>Critical Conditions.</td>
2059 <td>"socket: Failed to get a socket, exiting child"</td>
2063 <td><code>error</code> </td>
2065 <td>Error conditions.</td>
2067 <td>"Premature end of script headers"</td>
2071 <td><code>warn</code> </td>
2073 <td>Warning conditions.</td>
2075 <td>"child process 1234 did not exit, sending another
2080 <td><code>notice</code> </td>
2082 <td>Normal but significant condition.</td>
2084 <td>"httpd: caught SIGBUS, attempting to dump core in
2089 <td><code>info</code> </td>
2091 <td>Informational.</td>
2093 <td>"Server seems busy, (you may need to increase
2094 StartServers, or Min/MaxSpareServers)..."</td>
2098 <td><code>debug</code> </td>
2100 <td>Debug-level messages</td>
2102 <td>"Opening config file ..."</td>
2106 <p>When a particular level is specified, messages from all
2107 other levels of higher significance will be reported as well.
2108 <em>E.g.</em>, when <code>LogLevel info</code> is specified,
2109 then messages with log levels of <code>notice</code> and
2110 <code>warn</code> will also be posted.</p>
2112 <p>Using a level of at least <code>crit</code> is
2117 <div class="example"><p><code>
2121 <div class="note"><h3>Note</h3>
2122 <p>When logging to a regular file messages of the level
2123 <code>notice</code> cannot be suppressed and thus are always
2124 logged. However, this doesn't apply when logging is done
2125 using <code>syslog</code>.</p>
2129 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2130 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
2131 <table class="directive">
2132 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
2133 connection</td></tr>
2134 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
2135 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
2136 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2137 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2138 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2140 <p>The <code class="directive">MaxKeepAliveRequests</code> directive
2141 limits the number of requests allowed per connection when
2142 <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
2143 set to <code>0</code>, unlimited requests will be allowed. We
2144 recommend that this setting be kept to a high value for maximum
2145 server performance.</p>
2149 <div class="example"><p><code>
2150 MaxKeepAliveRequests 500
2154 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2155 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
2156 <table class="directive">
2157 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
2159 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
2160 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2161 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2162 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2164 <p>The <code class="directive">NameVirtualHost</code> directive is a
2165 required directive if you want to configure <a href="../vhosts/">name-based virtual hosts</a>.</p>
2167 <p>Although <var>addr</var> can be hostname it is recommended
2168 that you always use an IP address, e.g.</p>
2170 <div class="example"><p><code>
2171 NameVirtualHost 111.22.33.44
2174 <p>With the <code class="directive">NameVirtualHost</code> directive you
2175 specify the IP address on which the server will receive requests
2176 for the name-based virtual hosts. This will usually be the address
2177 to which your name-based virtual host names resolve. In cases
2178 where a firewall or other proxy receives the requests and forwards
2179 them on a different IP address to the server, you must specify the
2180 IP address of the physical interface on the machine which will be
2181 servicing the requests. If you have multiple name-based hosts on
2182 multiple addresses, repeat the directive for each address.</p>
2184 <div class="note"><h3>Note</h3>
2185 <p>Note, that the "main server" and any <code>_default_</code> servers
2186 will <strong>never</strong> be served for a request to a
2187 <code class="directive">NameVirtualHost</code> IP address (unless for some
2188 reason you specify <code class="directive">NameVirtualHost</code> but then
2189 don't define any <code class="directive">VirtualHost</code>s for that
2193 <p>Optionally you can specify a port number on which the
2194 name-based virtual hosts should be used, e.g.</p>
2196 <div class="example"><p><code>
2197 NameVirtualHost 111.22.33.44:8080
2200 <p>IPv6 addresses must be enclosed in square brackets, as shown
2201 in the following example:</p>
2203 <div class="example"><p><code>
2204 NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
2207 <p>To receive requests on all interfaces, you can use an argument of
2210 <div class="example"><p><code>
2214 <div class="note"><h3>Argument to <code class="directive"><VirtualHost></code>
2216 <p>Note that the argument to the <code class="directive"><VirtualHost></code> directive must
2217 exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
2219 <div class="example"><p><code>
2220 NameVirtualHost 1.2.3.4<br />
2221 <VirtualHost 1.2.3.4><br />
2223 </VirtualHost><br />
2229 <li><a href="../vhosts/">Virtual Hosts
2230 documentation</a></li>
2233 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2234 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
2235 <table class="directive">
2236 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
2238 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
2239 [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
2240 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
2241 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2242 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
2243 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2244 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2246 <p>The <code class="directive">Options</code> directive controls which
2247 server features are available in a particular directory.</p>
2249 <p><var>option</var> can be set to <code>None</code>, in which
2250 case none of the extra features are enabled, or one or more of
2254 <dt><code>All</code></dt>
2256 <dd>All options except for <code>MultiViews</code>. This is the default
2259 <dt><code>ExecCGI</code></dt>
2262 Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
2265 <dt><code>FollowSymLinks</code></dt>
2269 The server will follow symbolic links in this directory.
2271 <p>Even though the server follows the symlink it does <em>not</em>
2272 change the pathname used to match against <code class="directive"><a href="#directory"><Directory></a></code> sections.</p>
2273 <p>Note also, that this option <strong>gets ignored</strong> if set
2274 inside a <code class="directive"><a href="#location"><Location></a></code>
2278 <dt><code>Includes</code></dt>
2281 Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
2284 <dt><code>IncludesNOEXEC</code></dt>
2288 Server-side includes are permitted, but the <code>#exec
2289 cmd</code> and <code>#exec cgi</code> are disabled. It is still
2290 possible to <code>#include virtual</code> CGI scripts from
2291 <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
2294 <dt><code>Indexes</code></dt>
2297 If a URL which maps to a directory is requested, and there
2298 is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
2299 (<em>e.g.</em>, <code>index.html</code>) in that directory, then
2300 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
2301 of the directory.</dd>
2303 <dt><code>MultiViews</code></dt>
2306 <a href="../content-negotiation.html">Content negotiated</a>
2307 "MultiViews" are allowed using
2308 <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.</dd>
2310 <dt><code>SymLinksIfOwnerMatch</code></dt>
2312 <dd>The server will only follow symbolic links for which the
2313 target file or directory is owned by the same user id as the
2316 <div class="note"><h3>Note</h3> This option gets ignored if
2317 set inside a <code class="directive"><a href="#location"><Location></a></code> section.</div>
2321 <p>Normally, if multiple <code class="directive">Options</code> could
2322 apply to a directory, then the most specific one is used and
2323 others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
2324 However if <em>all</em> the options on the
2325 <code class="directive">Options</code> directive are preceded by a
2326 <code>+</code> or <code>-</code> symbol, the options are
2327 merged. Any options preceded by a <code>+</code> are added to the
2328 options currently in force, and any options preceded by a
2329 <code>-</code> are removed from the options currently in
2332 <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
2334 <div class="example"><p><code>
2335 <Directory /web/docs><br />
2336 <span class="indent">
2337 Options Indexes FollowSymLinks<br />
2339 </Directory><br />
2341 <Directory /web/docs/spec><br />
2342 <span class="indent">
2343 Options Includes<br />
2348 <p>then only <code>Includes</code> will be set for the
2349 <code>/web/docs/spec</code> directory. However if the second
2350 <code class="directive">Options</code> directive uses the <code>+</code> and
2351 <code>-</code> symbols:</p>
2353 <div class="example"><p><code>
2354 <Directory /web/docs><br />
2355 <span class="indent">
2356 Options Indexes FollowSymLinks<br />
2358 </Directory><br />
2360 <Directory /web/docs/spec><br />
2361 <span class="indent">
2362 Options +Includes -Indexes<br />
2367 <p>then the options <code>FollowSymLinks</code> and
2368 <code>Includes</code> are set for the <code>/web/docs/spec</code>
2371 <div class="note"><h3>Note</h3>
2372 <p>Using <code>-IncludesNOEXEC</code> or
2373 <code>-Includes</code> disables server-side includes completely
2374 regardless of the previous setting.</p>
2377 <p>The default in the absence of any other settings is
2378 <code>All</code>.</p>
2381 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2382 <div class="directive-section"><h2><a name="Require" id="Require">Require</a> <a name="require" id="require">Directive</a></h2>
2383 <table class="directive">
2384 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Selects which authenticated users can access
2385 a resource</td></tr>
2386 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Require <var>entity-name</var> [<var>entity-name</var>] ...</code></td></tr>
2387 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2388 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2389 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2390 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2392 <p>This directive selects which authenticated users can access
2393 a resource. The allowed syntaxes are:</p>
2396 <dt><code>Require user <var>userid</var> [<var>userid</var>]
2398 <dd>Only the named users can access the resource.</dd>
2400 <dt><code>Require group <var>group-name</var> [<var>group-name</var>]
2402 <dd>Only users in the named groups can access the resource.</dd>
2404 <dt><code>Require valid-user</code></dt>
2405 <dd>All valid users can access the resource.</dd>
2408 <p><code class="directive">Require</code> must be accompanied by
2409 <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#authtype">AuthType</a></code> directives, and directives such
2410 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>
2411 and <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> (to
2412 define users and groups) in order to work correctly. Example:</p>
2414 <div class="example"><p><code>
2415 AuthType Basic<br />
2416 AuthName "Restricted Resource"<br />
2417 AuthUserFile /web/users<br />
2418 AuthGroupFile /web/groups<br />
2422 <p>Access controls which are applied in this way are effective for
2423 <strong>all</strong> methods. <strong>This is what is normally
2424 desired.</strong> If you wish to apply access controls only to
2425 specific methods, while leaving other methods unprotected, then
2426 place the <code class="directive">Require</code> statement into a
2427 <code class="directive"><a href="#limit"><Limit></a></code>
2432 <li><code class="directive"><a href="#satisfy">Satisfy</a></code></li>
2433 <li><code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code></li>
2436 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2437 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
2438 <table class="directive">
2439 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
2440 by Apache children</td></tr>
2441 <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>
2442 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2443 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2444 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2445 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2446 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2448 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2449 resource limit for all processes and the second parameter sets
2450 the maximum resource limit. Either parameter can be a number,
2451 or <code>max</code> to indicate to the server that the limit should
2452 be set to the maximum allowed by the operating system
2453 configuration. Raising the maximum resource limit requires that
2454 the server is running as <code>root</code>, or in the initial startup
2457 <p>This applies to processes forked off from Apache children
2458 servicing requests, not the Apache children themselves. This
2459 includes CGI scripts and SSI exec commands, but not any
2460 processes forked off from the Apache parent such as piped
2463 <p>CPU resource limits are expressed in seconds per
2468 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2469 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2472 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2473 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
2474 <table class="directive">
2475 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
2476 by Apache children</td></tr>
2477 <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>
2478 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2479 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2480 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2481 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2482 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2484 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2485 resource limit for all processes and the second parameter sets
2486 the maximum resource limit. Either parameter can be a number,
2487 or <code>max</code> to indicate to the server that the limit should
2488 be set to the maximum allowed by the operating system
2489 configuration. Raising the maximum resource limit requires that
2490 the server is running as <code>root</code>, or in the initial startup
2493 <p>This applies to processes forked off from Apache children
2494 servicing requests, not the Apache children themselves. This
2495 includes CGI scripts and SSI exec commands, but not any
2496 processes forked off from the Apache parent such as piped
2499 <p>Memory resource limits are expressed in bytes per
2504 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2505 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2508 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2509 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
2510 <table class="directive">
2511 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
2512 processes launched by Apache children</td></tr>
2513 <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>
2514 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2515 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2516 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2517 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2518 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2520 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2521 resource limit for all processes and the second parameter sets
2522 the maximum resource limit. Either parameter can be a number,
2523 or <code>max</code> to indicate to the server that the limit
2524 should be set to the maximum allowed by the operating system
2525 configuration. Raising the maximum resource limit requires that
2526 the server is running as <code>root</code>, or in the initial startup
2529 <p>This applies to processes forked off from Apache children
2530 servicing requests, not the Apache children themselves. This
2531 includes CGI scripts and SSI exec commands, but not any
2532 processes forked off from the Apache parent such as piped
2535 <p>Process limits control the number of processes per user.</p>
2537 <div class="note"><h3>Note</h3>
2538 <p>If CGI processes are <strong>not</strong> running
2539 under user ids other than the web server user id, this directive
2540 will limit the number of processes that the server itself can
2541 create. Evidence of this situation will be indicated by
2542 <strong><code>cannot fork</code></strong> messages in the
2543 <code>error_log</code>.</p>
2548 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2549 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2552 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2553 <div class="directive-section"><h2><a name="Satisfy" id="Satisfy">Satisfy</a> <a name="satisfy" id="satisfy">Directive</a></h2>
2554 <table class="directive">
2555 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Interaction between host-level access control and
2556 user authentication</td></tr>
2557 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Satisfy Any|All</code></td></tr>
2558 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Satisfy All</code></td></tr>
2559 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2560 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2561 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2562 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2563 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Influenced by <code class="directive"><a href="#limit"><Limit></a></code> and <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> in version 2.0.51 and
2566 <p>Access policy if both <code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code> and <code class="directive"><a href="#require">Require</a></code> used. The parameter can be
2567 either <code>All</code> or <code>Any</code>. This directive is only
2568 useful if access to a particular area is being restricted by both
2569 username/password <em>and</em> client host address. In this case
2570 the default behavior (<code>All</code>) is to require that the client
2571 passes the address access restriction <em>and</em> enters a valid
2572 username and password. With the <code>Any</code> option the client will be
2573 granted access if they either pass the host restriction or enter a
2574 valid username and password. This can be used to password restrict
2575 an area, but to let clients from particular addresses in without
2576 prompting for a password.</p>
2578 <p>For example, if you wanted to let people on your network have
2579 unrestricted access to a portion of your website, but require that
2580 people outside of your network provide a password, you could use a
2581 configuration similar to the following:</p>
2583 <div class="example"><p><code>
2584 Require valid-user<br />
2585 Allow from 192.168.1<br />
2589 <p>Since version 2.0.51 <code class="directive">Satisfy</code> directives can
2590 be restricted to particular methods by <code class="directive"><a href="#limit"><Limit></a></code> and <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> sections.</p>
2594 <li><code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code></li>
2595 <li><code class="directive"><a href="#require">Require</a></code></li>
2598 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2599 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
2600 <table class="directive">
2601 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
2603 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
2604 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
2605 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2606 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2607 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2608 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2609 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only;
2610 option <code>Registry-Strict</code> is available in Apache 2.0 and
2613 <p>This directive is used to control how Apache finds the
2614 interpreter used to run CGI scripts. The default setting is
2615 <code>Script</code>. This causes Apache to use the interpreter pointed to
2616 by the shebang line (first line, starting with <code>#!</code>) in the
2617 script. On Win32 systems this line usually looks like:</p>
2619 <div class="example"><p><code>
2620 #!C:/Perl/bin/perl.exe
2623 <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
2625 <div class="example"><p><code>
2629 <p>Setting <code>ScriptInterpreterSource Registry</code> will
2630 cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
2631 searched using the script file extension (e.g., <code>.pl</code>) as a
2632 search key. The command defined by the registry subkey
2633 <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
2634 <code>Shell\Open\Command</code> is used to open the script file. If the
2635 registry keys cannot be found, Apache falls back to the behavior of the
2636 <code>Script</code> option.</p>
2638 <div class="warning"><h3>Security</h3>
2639 <p>Be careful when using <code>ScriptInterpreterSource
2640 Registry</code> with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
2641 Apache will try to execute <strong>every</strong> file within this
2642 directory. The <code>Registry</code> setting may cause undesired
2643 program calls on files which are typically not executed. For
2644 example, the default open command on <code>.htm</code> files on
2645 most Windows systems will execute Microsoft Internet Explorer, so
2646 any HTTP request for an <code>.htm</code> file existing within the
2647 script directory would start the browser in the background on the
2648 server. This is a good way to crash your system within a minute or
2652 <p>The option <code>Registry-Strict</code> which is new in Apache
2653 2.0 does the same thing as <code>Registry</code> but uses only the
2654 subkey <code>Shell\ExecCGI\Command</code>. The
2655 <code>ExecCGI</code> key is not a common one. It must be
2656 configured manually in the windows registry and hence prevents
2657 accidental program calls on your system.</p>
2660 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2661 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
2662 <table class="directive">
2663 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
2664 messages sent to the client</td></tr>
2665 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
2666 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2667 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2668 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2670 <p>The <code class="directive">ServerAdmin</code> sets the contact address
2671 that the server includes in any error messages it returns to the
2672 client. If the <code>httpd</code> doesn't recognize the supplied argument
2674 assumes, that it's an <var>email-address</var> and prepends it with
2675 <code>mailto:</code> in hyperlink targets. However, it's recommended to
2676 actually use an email address, since there are a lot of CGI scripts that
2677 make that assumption. If you want to use an URL, it should point to another
2678 server under your control. Otherwise users may not be able to contact you in
2681 <p>It may be worth setting up a dedicated address for this, e.g.</p>
2683 <div class="example"><p><code>
2684 ServerAdmin www-admin@foo.example.com
2686 <p>as users do not always mention that they are talking about the
2690 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2691 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
2692 <table class="directive">
2693 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
2694 to name-virtual hosts</td></tr>
2695 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
2696 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2697 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2698 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2700 <p>The <code class="directive">ServerAlias</code> directive sets the
2701 alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
2703 <div class="example"><p><code>
2704 <VirtualHost *><br />
2705 ServerName server.domain.com<br />
2706 ServerAlias server server2.domain.com server2<br />
2708 </VirtualHost>
2713 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2716 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2717 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
2718 <table class="directive">
2719 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
2721 <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>
2722 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2723 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2724 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2725 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>In version 2.0, this
2726 directive supersedes the functionality of the <code class="directive">Port</code>
2727 directive from version 1.3.</td></tr>
2729 <p>The <code class="directive">ServerName</code> directive sets the hostname and
2730 port that the server uses to identify itself. This is used when
2731 creating redirection URLs. For example, if the name of the
2732 machine hosting the web server is <code>simple.example.com</code>,
2733 but the machine also has the DNS alias <code>www.example.com</code>
2734 and you wish the web server to be so identified, the following
2735 directive should be used:</p>
2737 <div class="example"><p><code>
2738 ServerName www.example.com:80
2741 <p>If no <code class="directive">ServerName</code> is specified, then the
2742 server attempts to deduce the hostname by performing a reverse
2743 lookup on the IP address. If no port is specified in the
2744 <code class="directive">ServerName</code>, then the server will use the port
2746 request. For optimal reliability and predictability, you should
2747 specify an explicit hostname and port using the
2748 <code class="directive">ServerName</code> directive.</p>
2750 <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
2751 the <code class="directive">ServerName</code> inside a
2752 <code class="directive"><a href="#virtualhost"><VirtualHost></a></code>
2753 section specifies what hostname must appear in the request's
2754 <code>Host:</code> header to match this virtual host.</p>
2756 <p>See the description of the
2757 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive for
2758 settings which determine whether self-referential URL's (e.g., by the
2759 <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
2760 specified port, or to the port number given in the client's request.
2765 <li><a href="../dns-caveats.html">Issues Regarding DNS and
2767 <li><a href="../vhosts/">Apache virtual host
2768 documentation</a></li>
2769 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
2770 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
2771 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
2774 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2775 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
2776 <table class="directive">
2777 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
2778 is accessed by an incompatible browser</td></tr>
2779 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
2780 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2781 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2782 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2784 <p>The <code class="directive">ServerPath</code> directive sets the legacy
2785 URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
2789 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2792 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2793 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
2794 <table class="directive">
2795 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
2796 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
2797 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
2798 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2799 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2800 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2802 <p>The <code class="directive">ServerRoot</code> directive sets the
2803 directory in which the server lives. Typically it will contain the
2804 subdirectories <code>conf/</code> and <code>logs/</code>. Relative
2805 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
2806 relative to this directory.</p>
2808 <div class="example"><h3>Example</h3><p><code>
2809 ServerRoot /home/httpd
2815 <li><a href="../invoking.html">the <code>-d</code>
2816 option to <code>httpd</code></a></li>
2817 <li><a href="../misc/security_tips.html#serverroot">the
2818 security tips</a> for information on how to properly set
2819 permissions on the <code class="directive">ServerRoot</code></li>
2822 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2823 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
2824 <table class="directive">
2825 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
2826 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
2827 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
2828 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2829 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2830 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2831 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2833 <p>The <code class="directive">ServerSignature</code> directive allows the
2834 configuration of a trailing footer line under server-generated
2835 documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
2836 listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
2837 would want to enable such a footer line is that in a chain of proxies,
2838 the user often has no possibility to tell which of the chained servers
2839 actually produced a returned error message.</p>
2841 <p>The <code>Off</code>
2842 setting, which is the default, suppresses the footer line (and is
2843 therefore compatible with the behavior of Apache-1.2 and
2844 below). The <code>On</code> setting simply adds a line with the
2845 server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
2846 and the <code>EMail</code> setting additionally creates a
2847 "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
2850 <p>After version 2.0.44, the details of the server version number
2851 presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
2855 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
2858 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2859 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
2860 <table class="directive">
2861 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the <code>Server</code> HTTP response
2863 <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>
2864 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
2865 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2866 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2867 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2869 <p>This directive controls whether <code>Server</code> response
2870 header field which is sent back to clients includes a
2871 description of the generic OS-type of the server as well as
2872 information about compiled-in modules.</p>
2875 <dt><code>ServerTokens Prod[uctOnly]</code></dt>
2877 <dd>Server sends (<em>e.g.</em>): <code>Server:
2880 <dt><code>ServerTokens Major</code></dt>
2882 <dd>Server sends (<em>e.g.</em>): <code>Server:
2883 Apache/2</code></dd>
2885 <dt><code>ServerTokens Minor</code></dt>
2887 <dd>Server sends (<em>e.g.</em>): <code>Server:
2888 Apache/2.0</code></dd>
2890 <dt><code>ServerTokens Min[imal]</code></dt>
2892 <dd>Server sends (<em>e.g.</em>): <code>Server:
2893 Apache/2.0.41</code></dd>
2895 <dt><code>ServerTokens OS</code></dt>
2897 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2900 <dt><code>ServerTokens Full</code> (or not specified)</dt>
2902 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2903 (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
2906 <p>This setting applies to the entire server, and cannot be
2907 enabled or disabled on a virtualhost-by-virtualhost basis.</p>
2909 <p>After version 2.0.44, this directive also controls the
2910 information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
2914 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
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="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
2919 <table class="directive">
2920 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
2922 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
2923 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2924 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</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>Moved into the core in Apache 2.0</td></tr>
2929 <p>When placed into an <code>.htaccess</code> file or a
2930 <code class="directive"><a href="#directory"><Directory></a></code> or
2931 <code class="directive"><a href="#location"><Location></a></code>
2932 section, this directive forces all matching files to be parsed
2933 through the <a href="../handler.html">handler</a> given by
2934 <var>handler-name</var>. For example, if you had a directory you
2935 wanted to be parsed entirely as imagemap rule files, regardless
2936 of extension, you might put the following into an
2937 <code>.htaccess</code> file in that directory:</p>
2939 <div class="example"><p><code>
2940 SetHandler imap-file
2943 <p>Another example: if you wanted to have the server display a
2944 status report whenever a URL of
2945 <code>http://servername/status</code> was called, you might put
2946 the following into <code>httpd.conf</code>:</p>
2948 <div class="example"><p><code>
2949 <Location /status><br />
2950 <span class="indent">
2951 SetHandler server-status<br />
2956 <p>You can override an earlier defined <code class="directive">SetHandler</code>
2957 directive by using the value <code>None</code>.</p>
2958 <p><strong>Note:</strong> because SetHandler overrides default handlers,
2959 normal behaviour such as handling of URLs ending in a slash (/) as
2960 directories or index files is suppressed.</p>
2964 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
2967 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2968 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
2969 <table class="directive">
2970 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
2972 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2973 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2974 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2975 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2976 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2978 <p>The <code class="directive">SetInputFilter</code> directive sets the
2979 filter or filters which will process client requests and POST
2980 input when they are received by the server. This is in addition to
2981 any filters defined elsewhere, including the
2982 <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
2985 <p>If more than one filter is specified, they must be separated
2986 by semicolons in the order in which they should process the
2991 <li><a href="../filter.html">Filters</a> documentation</li>
2994 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2995 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
2996 <table class="directive">
2997 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
2999 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
3000 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
3001 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
3002 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3003 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3005 <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
3006 which will process responses from the server before they are
3007 sent to the client. This is in addition to any filters defined
3008 elsewhere, including the
3009 <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
3012 <p>For example, the following configuration will process all files
3013 in the <code>/www/data/</code> directory for server-side
3016 <div class="example"><p><code>
3017 <Directory /www/data/><br />
3018 <span class="indent">
3019 SetOutputFilter INCLUDES<br />
3024 <p>If more than one filter is specified, they must be separated
3025 by semicolons in the order in which they should process the
3030 <li><a href="../filter.html">Filters</a> documentation</li>
3033 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3034 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
3035 <table class="directive">
3036 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
3037 certain events before failing a request</td></tr>
3038 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
3039 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
3040 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3041 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3042 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3044 <p>The <code class="directive">TimeOut</code> directive currently defines
3045 the amount of time Apache will wait for three things:</p>
3048 <li>The total amount of time it takes to receive a GET
3051 <li>The amount of time between receipt of TCP packets on a
3052 POST or PUT request.</li>
3054 <li>The amount of time between ACKs on transmissions of TCP
3055 packets in responses.</li>
3058 <p>We plan on making these separately configurable at some point
3059 down the road. The timer used to default to 1200 before 1.2,
3060 but has been lowered to 300 which is still far more than
3061 necessary in most situations. It is not set any lower by
3062 default because there may still be odd places in the code where
3063 the timer is not reset when a packet is sent. </p>
3066 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3067 <div class="directive-section"><h2><a name="TraceEnable" id="TraceEnable">TraceEnable</a> <a name="traceenable" id="traceenable">Directive</a></h2>
3068 <table class="directive">
3069 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines the behaviour on <code>TRACE</code>
3071 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TraceEnable <var>[on|off|extended]</var></code></td></tr>
3072 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TraceEnable on</code></td></tr>
3073 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3074 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3075 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3076 <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>
3078 <p>This directive overrides the behavior of <code>TRACE</code> for both
3079 the core server and <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>. The default
3080 <code>TraceEnable on</code> permits <code>TRACE</code> requests per
3081 RFC 2616, which disallows any request body to accompany the request.
3082 <code>TraceEnable off</code> causes the core server and
3083 <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> to return a <code>405</code> (Method not
3084 allowed) error to the client.</p>
3086 <p>Finally, for testing and diagnostic purposes only, request
3087 bodies may be allowed using the non-compliant <code>TraceEnable
3088 extended</code> directive. The core (as an origin server) will
3089 restrict the request body to 64k (plus 8k for chunk headers if
3090 <code>Transfer-Encoding: chunked</code> is used). The core will
3091 reflect the full headers and all chunk headers with the response
3092 body. As a proxy server, the request body is not restricted to 64k.</p>
3095 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3096 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
3097 <table class="directive">
3098 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
3100 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
3101 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName Off</code></td></tr>
3102 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
3103 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3104 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3106 <p>In many situations Apache must construct a <em>self-referential</em>
3107 URL -- that is, a URL that refers back to the same server. With
3108 <code>UseCanonicalName On</code> Apache will use the hostname and port
3109 specified in the <code class="directive"><a href="#servername">ServerName</a></code>
3110 directive to construct the canonical name for the server. This name
3111 is used in all self-referential URLs, and for the values of
3112 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
3114 <p>With <code>UseCanonicalName Off</code> Apache will form
3115 self-referential URLs using the hostname and port supplied by
3116 the client if any are supplied (otherwise it will use the
3117 canonical name, as defined above). These values are the same
3118 that are used to implement <a href="../vhosts/name-based.html">name based virtual hosts</a>,
3119 and are available with the same clients. The CGI variables
3120 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
3121 constructed from the client supplied values as well.</p>
3123 <p>An example where this may be useful is on an intranet server
3124 where you have users connecting to the machine using short
3125 names such as <code>www</code>. You'll notice that if the users
3126 type a shortname, and a URL which is a directory, such as
3127 <code>http://www/splat</code>, <em>without the trailing
3128 slash</em> then Apache will redirect them to
3129 <code>http://www.domain.com/splat/</code>. If you have
3130 authentication enabled, this will cause the user to have to
3131 authenticate twice (once for <code>www</code> and once again
3132 for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
3133 FAQ on this subject for more information</a>). But if
3134 <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
3135 Apache will redirect to <code>http://www/splat/</code>.</p>
3137 <p>There is a third option, <code>UseCanonicalName DNS</code>,
3138 which is intended for use with mass IP-based virtual hosting to
3139 support ancient clients that do not provide a
3140 <code>Host:</code> header. With this option Apache does a
3141 reverse DNS lookup on the server IP address that the client
3142 connected to in order to work out self-referential URLs.</p>
3144 <div class="warning"><h3>Warning</h3>
3145 <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
3146 they may be broken by this option. The client is essentially free
3147 to give whatever value they want as a hostname. But if the CGI is
3148 only using <code>SERVER_NAME</code> to construct self-referential URLs
3149 then it should be just fine.</p>
3154 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
3155 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
3158 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
3159 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost"><VirtualHost></a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
3160 <table class="directive">
3161 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
3162 hostname or IP address</td></tr>
3163 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><VirtualHost
3164 <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
3165 ...> ... </VirtualHost></code></td></tr>
3166 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
3167 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
3168 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3170 <p><code class="directive"><VirtualHost></code> and
3171 <code></VirtualHost></code> are used to enclose a group of
3172 directives that will apply only to a particular virtual host. Any
3173 directive that is allowed in a virtual host context may be
3174 used. When the server receives a request for a document on a
3175 particular virtual host, it uses the configuration directives
3176 enclosed in the <code class="directive"><VirtualHost></code>
3177 section. <var>Addr</var> can be:</p>
3180 <li>The IP address of the virtual host;</li>
3182 <li>A fully qualified domain name for the IP address of the
3185 <li>The character <code>*</code>, which is used only in combination with
3186 <code>NameVirtualHost *</code> to match all IP addresses; or</li>
3188 <li>The string <code>_default_</code>, which is used only
3189 with IP virtual hosting to catch unmatched IP addresses.</li>
3192 <div class="example"><h3>Example</h3><p><code>
3193 <VirtualHost 10.1.2.3><br />
3194 <span class="indent">
3195 ServerAdmin webmaster@host.foo.com<br />
3196 DocumentRoot /www/docs/host.foo.com<br />
3197 ServerName host.foo.com<br />
3198 ErrorLog logs/host.foo.com-error_log<br />
3199 TransferLog logs/host.foo.com-access_log<br />
3201 </VirtualHost>
3205 <p>IPv6 addresses must be specified in square brackets because
3206 the optional port number could not be determined otherwise. An
3207 IPv6 example is shown below:</p>
3209 <div class="example"><p><code>
3210 <VirtualHost [2001:db8::a00:20ff:fea7:ccea]><br />
3211 <span class="indent">
3212 ServerAdmin webmaster@host.example.com<br />
3213 DocumentRoot /www/docs/host.example.com<br />
3214 ServerName host.example.com<br />
3215 ErrorLog logs/host.example.com-error_log<br />
3216 TransferLog logs/host.example.com-access_log<br />
3218 </VirtualHost>
3221 <p>Each Virtual Host must correspond to a different IP address,
3222 different port number or a different host name for the server,
3223 in the former case the server machine must be configured to
3224 accept IP packets for multiple addresses. (If the machine does
3225 not have multiple network interfaces, then this can be
3226 accomplished with the <code>ifconfig alias</code> command -- if
3227 your OS supports it).</p>
3229 <div class="note"><h3>Note</h3>
3230 <p>The use of <code class="directive"><VirtualHost></code> does
3231 <strong>not</strong> affect what addresses Apache listens on. You
3232 may need to ensure that Apache is listening on the correct addresses
3233 using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
3236 <p>When using IP-based virtual hosting, the special name
3237 <code>_default_</code> can be specified in
3238 which case this virtual host will match any IP address that is
3239 not explicitly listed in another virtual host. In the absence
3240 of any <code>_default_</code> virtual host the "main" server config,
3241 consisting of all those definitions outside any VirtualHost
3242 section, is used when no IP-match occurs. (But note that any IP
3243 address that matches a <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> directive will use neither
3244 the "main" server config nor the <code>_default_</code> virtual host.
3245 See the <a href="../vhosts/name-based.html">name-based virtual hosting</a>
3246 documentation for further details.)</p>
3248 <p>You can specify a <code>:port</code> to change the port that is
3249 matched. If unspecified then it defaults to the same port as the
3250 most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
3251 statement of the main server. You may also specify <code>:*</code>
3252 to match all ports on that address. (This is recommended when used
3253 with <code>_default_</code>.)</p>
3255 <div class="warning"><h3>Security</h3>
3256 <p>See the <a href="../misc/security_tips.html">security tips</a>
3257 document for details on why your security could be compromised if the
3258 directory where log files are stored is writable by anyone other
3259 than the user that starts the server.</p>
3264 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
3265 <li><a href="../dns-caveats.html">Issues Regarding DNS and
3267 <li><a href="../bind.html">Setting
3268 which addresses and ports Apache uses</a></li>
3269 <li><a href="../sections.html">How <Directory>, <Location>
3270 and <Files> sections work</a> for an explanation of how these
3271 different sections are combined when a request is received</li>
3275 <div class="bottomlang">
3276 <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
3277 <a href="../en/mod/core.html" title="English"> en </a> |
3278 <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
3279 </div><div id="footer">
3280 <p class="apache">Copyright 1995-2005 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>
3281 <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>