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" title="Deutsch"> de </a> | <a href="../en/mod/core.html" hreflang="en" title="English"> en </a></p>
26 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Core Apache HTTP Server features that are always
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Core</td></tr></table>
30 <div id="quickview"><h3 class="directives">Directives</h3>
32 <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
33 <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
34 <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
35 <li><img alt="" src="../images/down.gif" /> <a href="#addoutputfilterbytype">AddOutputFilterByType</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#authname">AuthName</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#authtype">AuthType</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#directory"><Directory></a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch"><DirectoryMatch></a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#files"><Files></a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch"><FilesMatch></a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine"><IfDefine></a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule"><IfModule></a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#limit"><Limit></a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept"><LimitExcept></a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#location"><Location></a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch"><LocationMatch></a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#require">Require</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#satisfy">Satisfy</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost"><VirtualHost></a></li>
95 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
96 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
97 <table class="directive">
98 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
99 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
100 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
101 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
102 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
103 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
104 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
105 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.30 and later</td></tr>
108 <p>This directive controls whether requests that contain trailing
109 pathname information that follows an actual filename (or
110 non-existent file in an existing directory) will be accepted or
111 rejected. The trailing pathname information can be made
112 available to scripts in the <code>PATH_INFO</code> environment
115 <p>For example, assume the location <code>/test/</code> points to
116 a directory that contains only the single file
117 <code>here.html</code>. Then requests for
118 <code>/test/here.html/more</code> and
119 <code>/test/nothere.html/more</code> both collect
120 <code>/more</code> as <code>PATH_INFO</code>.</p>
122 <p>The three possible arguments for the
123 <code class="directive">AcceptPathInfo</code> directive are:</p>
125 <dt><code>Off</code></dt><dd>A request will only be accepted if it
126 maps to a literal path that exists. Therefore a request with
127 trailing pathname information after the true filename such as
128 <code>/test/here.html/more</code> in the above example will return
129 a 404 NOT FOUND error.</dd>
131 <dt><code>On</code></dt><dd>A request will be accepted if a
132 leading path component maps to a file that exists. The above
133 example <code>/test/here.html/more</code> will be accepted if
134 <code>/test/here.html</code> maps to a valid file.</dd>
136 <dt><code>Default</code></dt><dd>The treatment of requests with
137 trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
138 The core handler for normal files defaults to rejecting
139 <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
140 <code>PATH_INFO</code> by default.</dd>
143 <p>The primary purpose of the <code>AcceptPathInfo</code>
144 directive is to allow you to override the handler's choice of
145 accepting or rejecting <code>PATH_INFO</code>. This override is required,
146 for example, when you use a <a href="../filter.html">filter</a>, such
147 as <a href="mod_include.html">INCLUDES</a>, to generate content
148 based on <code>PATH_INFO</code>. The core handler would usually reject
149 the request, so you can use the following configuration to enable
152 <div class="example"><p><code>
153 <Files "mypaths.shtml"><br />
154 <span class="indent">
155 Options +Includes<br />
156 SetOutputFilter INCLUDES<br />
157 AcceptPathInfo On<br />
164 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
165 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
166 <table class="directive">
167 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
168 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
169 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
170 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
171 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
172 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
174 <p>While processing a request the server looks for
175 the first existing configuration file from this list of names in
176 every directory of the path to the document, if distributed
177 configuration files are <a href="#allowoverride">enabled for that
178 directory</a>. For example:</p>
180 <div class="example"><p><code>
184 <p>before returning the document
185 <code>/usr/local/web/index.html</code>, the server will read
186 <code>/.acl</code>, <code>/usr/.acl</code>,
187 <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
188 for directives, unless they have been disabled with</p>
190 <div class="example"><p><code>
191 <Directory /><br />
192 <span class="indent">
193 AllowOverride None<br />
200 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
201 <li><a href="../configuring.html">Configuration Files</a></li>
202 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
205 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
206 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
207 <table class="directive">
208 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default character set to be added for a
209 response without an explicit character set</td></tr>
210 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
211 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
212 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
213 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
214 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
215 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
217 <p>This directive specifies the name of the character set that
218 will be added to any response that does not have any parameter on
219 the content type in the HTTP headers. This will override any
220 character set specified in the body of the document via a
221 <code>META</code> tag. A setting of <code>AddDefaultCharset
222 Off</code> disables this
223 functionality. <code>AddDefaultCharset On</code> enables
224 Apache's internal default charset of <code>iso-8859-1</code> as
225 required by the directive. You can also specify an alternate
226 <var>charset</var> to be used. For example:</p>
228 <div class="example"><p><code>
229 AddDefaultCharset utf-8
233 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
234 <div class="directive-section"><h2><a name="AddOutputFilterByType" id="AddOutputFilterByType">AddOutputFilterByType</a> <a name="addoutputfilterbytype" id="addoutputfilterbytype">Directive</a></h2>
235 <table class="directive">
236 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>assigns an output filter to a particular MIME-type</td></tr>
237 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
238 <var>MIME-type</var> [<var>MIME-type</var>] ...</code></td></tr>
239 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
240 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
241 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
242 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
243 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later</td></tr>
245 <p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the
246 response MIME-type.</p>
248 <p>The following example uses the <code>DEFLATE</code> filter, which
249 is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all
250 output (either static or dynamic) which is labeled as
251 <code>text/html</code> or <code>text/plain</code> before it is sent
254 <div class="example"><p><code>
255 AddOutputFilterByType DEFLATE text/html text/plain
258 <p>If you want the content to be processed by more than one filter, their
259 names have to be separated by semicolons. It's also possible to use one
260 <code class="directive">AddOutputFilterByType</code> directive for each of
263 <p>The configuration below causes all script output labeled as
264 <code>text/html</code> to be processed at first by the
265 <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
268 <div class="example"><p><code>
269 <Location /cgi-bin/><br />
270 <span class="indent">
271 Options Includes<br />
272 AddOutputFilterByType INCLUDES;DEFLATE text/html<br />
277 <div class="warning"><h3>Note</h3>
278 <p>Enabling filters with <code class="directive">AddOutputFilterByType</code>
279 may fail partially or completely in some cases. For expample, no
280 filters are applied if the MIME-type could not be determined and falls
281 back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting,
282 even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the
285 <p>However, if you want to make sure, that the filters will be
286 applied, assign the content type to a resource explicitely, for
287 example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or
288 <code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the
289 content type within a (non-nph) CGI script is also safe.</p>
291 <p>The by-type output filters are never applied on proxy requests.</p>
296 <li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li>
297 <li><code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code></li>
298 <li><a href="../filter.html">filters</a></li>
301 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
302 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
303 <table class="directive">
304 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
305 .htaccess files</td></tr>
306 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
307 [<var>directive-type</var>] ...</code></td></tr>
308 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr>
309 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
310 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
311 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
313 <p>When the server finds an <code>.htaccess</code> file (as
314 specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
315 it needs to know which directives declared in that file can override
316 earlier configuration directives.</p>
318 <div class="note"><h3>Only available in <Directory> sections</h3>
319 <code class="directive">AllowOverride</code> is valid only in
320 <code class="directive"><a href="#directory"><Directory></a></code>
321 sections, not in <code class="directive"><a href="#location"><Location></a></code> or <code class="directive"><a href="#files"><Files></a></code> sections.
324 <p>When this directive is set to <code>None</code>, then
325 <a href="#accessfilename">.htaccess</a> files are completely ignored.
326 In this case, the server will not even attempt to read
327 <code>.htaccess</code> files in the filesystem.</p>
329 <p>When this directive is set to <code>All</code>, then any
330 directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
331 <code>.htaccess</code> files.</p>
333 <p>The <var>directive-type</var> can be one of the following
334 groupings of directives.</p>
341 Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
342 <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
343 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
344 <code class="directive"><a href="#authname">AuthName</a></code>,
345 <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>
350 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>,
351 <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
352 <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove*
353 directives, <em>etc.</em>).</dd>
358 Allow use of the directives controlling directory indexing
359 (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
360 <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>,
361 <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
362 <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>,
368 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>
373 Allow use of the directives controlling specific directory
374 features (<code class="directive"><a href="#options">Options</a></code> and
375 <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).</dd>
380 <div class="example"><p><code>
381 AllowOverride AuthConfig Indexes
386 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
387 <li><a href="../configuring.html">Configuration Files</a></li>
388 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
391 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
392 <div class="directive-section"><h2><a name="AuthName" id="AuthName">AuthName</a> <a name="authname" id="authname">Directive</a></h2>
393 <table class="directive">
394 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Authorization realm for use in HTTP
395 authentication</td></tr>
396 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthName <var>auth-domain</var></code></td></tr>
397 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
398 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
399 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
400 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
402 <p>This directive sets the name of the authorization realm for a
403 directory. This realm is given to the client so that the user
404 knows which username and password to send.
405 <code class="directive">AuthName</code> takes a single argument; if the
406 realm name contains spaces, it must be enclosed in quotation
407 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
408 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
409 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
414 <div class="example"><p><code>
415 AuthName "Top Secret"
418 <p>The string provided for the <code>AuthName</code> is what will
419 appear in the password dialog provided by most browsers.</p>
423 <li><a href="../howto/auth.html">Authentication, Authorization, and
424 Access Control</a></li>
427 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
428 <div class="directive-section"><h2><a name="AuthType" id="AuthType">AuthType</a> <a name="authtype" id="authtype">Directive</a></h2>
429 <table class="directive">
430 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Type of user authentication</td></tr>
431 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthType Basic|Digest</code></td></tr>
432 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
433 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
434 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
435 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
437 <p>This directive selects the type of user authentication for a
438 directory. Only <code>Basic</code> and <code>Digest</code> are
439 currently implemented.
441 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
442 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
443 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
448 <li><a href="../howto/auth.html">Authentication, Authorization,
449 and Access Control</a></li>
452 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
453 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
454 <table class="directive">
455 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
457 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
458 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
459 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
460 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
461 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
462 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
464 <p>This directive is used to control how Apache finds the
465 interpreter used to run CGI scripts. For example, setting
466 <code>CGIMapExtension sys:\foo.nlm .foo</code> will
467 cause all CGI script files with a <code>.foo</code> extension to
468 be passed to the FOO interpreter.</p>
471 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
472 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
473 <table class="directive">
474 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of Content-MD5 HTTP Response
476 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
477 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
478 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
479 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
480 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
481 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
483 <p>This directive enables the generation of
484 <code>Content-MD5</code> headers as defined in RFC1864
485 respectively RFC2068.</p>
487 <p>MD5 is an algorithm for computing a "message digest"
488 (sometimes called "fingerprint") of arbitrary-length data, with
489 a high degree of confidence that any alterations in the data
490 will be reflected in alterations in the message digest.</p>
492 <p>The <code>Content-MD5</code> header provides an end-to-end
493 message integrity check (MIC) of the entity-body. A proxy or
494 client may check this header for detecting accidental
495 modification of the entity-body in transit. Example header:</p>
497 <div class="example"><p><code>
498 Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
501 <p>Note that this can cause performance problems on your server
502 since the message digest is computed on every request (the
503 values are not cached).</p>
505 <p><code>Content-MD5</code> is only sent for documents served
506 by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
507 SSI documents, output from CGI scripts, and byte range responses
508 do not have this header.</p>
511 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
512 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
513 <table class="directive">
514 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>MIME content-type that will be sent if the
515 server cannot determine a type in any other way</td></tr>
516 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>MIME-type</var></code></td></tr>
517 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType text/plain</code></td></tr>
518 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
519 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
520 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
521 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
523 <p>There will be times when the server is asked to provide a
524 document whose type cannot be determined by its MIME types
527 <p>The server must inform the client of the content-type of the
528 document, so in the event of an unknown type it uses the
529 <code>DefaultType</code>. For example:</p>
531 <div class="example"><p><code>
532 DefaultType image/gif
535 <p>would be appropriate for a directory which contained many GIF
536 images with filenames missing the <code>.gif</code> extension.</p>
538 <p>Note that unlike <code class="directive"><a href="#forcetype">ForceType</a></code>, this directive only
539 provides the default mime-type. All other mime-type definitions,
540 including filename extensions, that might identify the media type
541 will override this default.</p>
544 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
545 <div class="directive-section"><h2><a name="Directory" id="Directory"><Directory></a> <a name="directory" id="directory">Directive</a></h2>
546 <table class="directive">
547 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
548 named file-system directory and sub-directories</td></tr>
549 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Directory <var>directory-path</var>>
550 ... </Directory></code></td></tr>
551 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</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><code class="directive"><Directory></code> and
556 <code></Directory></code> are used to enclose a group of
557 directives that will apply only to the named directory and
558 sub-directories of that directory. Any directive that is allowed
559 in a directory context may be used. <var>Directory-path</var> is
560 either the full path to a directory, or a wild-card string using
561 Unix shell-style matching. In a wild-card string, <code>?</code> matches
562 any single character, and <code>*</code> matches any sequences of
563 characters. You may also use <code>[]</code> character ranges. None
564 of the wildcards match a `/' character, so <code><Directory
565 /*/public_html></code> will not match
566 <code>/home/user/public_html</code>, but <code><Directory
567 /home/*/public_html></code> will match. Example:</p>
569 <div class="example"><p><code>
570 <Directory /usr/local/httpd/htdocs><br />
571 <span class="indent">
572 Options Indexes FollowSymLinks<br />
578 <p>Be careful with the <var>directory-path</var> arguments:
579 They have to literally match the filesystem path which Apache uses
580 to access the files. Directives applied to a particular
581 <code><Directory></code> will not apply to files accessed from
582 that same directory via a different path, such as via different symbolic
587 expressions can also be used, with the addition of the
588 <code>~</code> character. For example:</p>
590 <div class="example"><p><code>
591 <Directory ~ "^/www/.*/[0-9]{3}">
594 <p>would match directories in <code>/www/</code> that consisted of
597 <p>If multiple (non-regular expression) <code class="directive"><Directory></code> sections
598 match the directory (or one of its parents) containing a document,
599 then the directives are applied in the order of shortest match
600 first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
603 <div class="example"><p><code>
604 <Directory /><br />
605 <span class="indent">
606 AllowOverride None<br />
608 </Directory><br />
610 <Directory /home/><br />
611 <span class="indent">
612 AllowOverride FileInfo<br />
617 <p>for access to the document <code>/home/web/dir/doc.html</code>
621 <li>Apply directive <code>AllowOverride None</code>
622 (disabling <code>.htaccess</code> files).</li>
624 <li>Apply directive <code>AllowOverride FileInfo</code> (for
625 directory <code>/home</code>).</li>
627 <li>Apply any <code>FileInfo</code> directives in
628 <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
629 <code>/home/web/dir/.htaccess</code> in that order.</li>
632 <p>Regular expressions are not considered until after all of the
633 normal sections have been applied. Then all of the regular
634 expressions are tested in the order they appeared in the
635 configuration file. For example, with</p>
637 <div class="example"><p><code>
638 <Directory ~ abc$><br />
639 <span class="indent">
640 # ... directives here ...<br />
645 <p>the regular expression section won't be considered until after
646 all normal <code class="directive"><Directory></code>s and
647 <code>.htaccess</code> files have been applied. Then the regular
648 expression will match on <code>/home/abc/public_html/abc</code> and
649 the corresponding <code class="directive"><Directory></code> will
652 <p><strong>Note that the default Apache access for
653 <code><Directory /></code> is <code>Allow from All</code>.
654 This means that Apache will serve any file mapped from an URL. It is
655 recommended that you change this with a block such
658 <div class="example"><p><code>
659 <Directory /><br />
660 <span class="indent">
661 Order Deny,Allow<br />
667 <p><strong>and then override this for directories you
668 <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
669 details.</strong></p>
671 <p>The directory sections occur in the <code>httpd.conf</code> file.
672 <code class="directive"><Directory></code> directives
673 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>
677 <li><a href="../sections.html">How <Directory>,
678 <Location> and <Files> sections work</a> for an
679 explanation of how these different sections are combined when a
680 request is received</li>
683 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
684 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch"><DirectoryMatch></a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
685 <table class="directive">
686 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
687 file-system directories matching a regular expression and their
688 subdirectories</td></tr>
689 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><DirectoryMatch <var>regex</var>>
690 ... </DirectoryMatch></code></td></tr>
691 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
692 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
693 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
695 <p><code class="directive"><DirectoryMatch></code> and
696 <code></DirectoryMatch></code> are used to enclose a group
697 of directives which will apply only to the named directory and
698 sub-directories of that directory, the same as <code class="directive"><a href="#directory"><Directory></a></code>. However, it
699 takes as an argument a regular expression. For example:</p>
701 <div class="example"><p><code>
702 <DirectoryMatch "^/www/.*/[0-9]{3}">
705 <p>would match directories in <code>/www/</code> that consisted of three
710 <li><code class="directive"><a href="#directory"><Directory></a></code> for
711 a description of how regular expressions are mixed in with normal
712 <code class="directive"><Directory></code>s</li>
713 <li><a href="../sections.html">How <Directory>, <Location> and
714 <Files> sections work</a> for an explanation of how these different
715 sections are combined when a request is received</li>
718 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
719 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
720 <table class="directive">
721 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
722 from the web</td></tr>
723 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
724 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
725 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
726 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
727 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
729 <p>This directive sets the directory from which <code>httpd</code>
730 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
731 path from the requested URL to the document root to make the
732 path to the document. Example:</p>
734 <div class="example"><p><code>
735 DocumentRoot /usr/web
739 <code>http://www.my.host.com/index.html</code> refers to
740 <code>/usr/web/index.html</code>.</p>
742 <p>The <code class="directive">DocumentRoot</code> should be specified without
743 a trailing slash.</p>
747 <li><a href="../urlmapping.html">Mapping URLs to Filesystem
751 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
752 <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
753 <table class="directive">
754 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
755 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
756 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
757 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
758 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
759 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
760 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
762 <p>This directive controls whether the <code>httpd</code> may use
763 memory-mapping if it needs to read the contents of a file during
764 delivery. By default, when the handling of a request requires
765 access to the data within a file -- for example, when delivering a
766 server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache
767 memory-maps the file if the OS supports it.</p>
769 <p>This memory-mapping sometimes yields a performance improvement.
770 But in some environments, it is better to disable the memory-mapping
771 to prevent operational problems:</p>
774 <li>On some multiprocessor systems, memory-mapping can reduce the
775 performance of the <code>httpd</code>.</li>
776 <li>With an NFS-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code>,
777 the <code>httpd</code> may crash due to a segmentation fault if a file
778 is deleted or truncated while the <code>httpd</code> has it
782 <p>For server configurations that are vulnerable to these problems,
783 you should disable memory-mapping of delivered files by specifying:</p>
785 <div class="example"><p><code>
789 <p>For NFS mounted files, this feature may be disabled explicitly for
790 the offending files by specifying:</p>
792 <div class="example"><p><code>
793 <Directory "/path-to-nfs-files">
794 <span class="indent">
801 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
802 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
803 <table class="directive">
804 <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>
805 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
806 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile On</code></td></tr>
807 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
808 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</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>
811 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later</td></tr>
813 <p>This directive controls whether <code>httpd</code> may use the sendfile
814 support from the kernel to transmit file contents to the client.
815 By default, when the handling of a request requires no access
816 to the data within a file -- for example, when delivering a
817 static file -- Apache uses sendfile to deliver the file contents
818 without ever reading the file if the OS supports it.</p>
820 <p>This sendfile mechanism avoids seperate read and send operations,
821 and buffer allocations. But on some platforms or within some
822 filesystems, it is better to disable this feature to avoid
823 operational problems:</p>
826 <li>Some platforms may have broken sendfile support that the build
827 system did not detect, especially if the binaries were built on
828 another box and moved to such a machine with broken sendfile
830 <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS or SMB),
831 the kernel may be unable to serve the network file through
835 <p>For server configurations that are vulnerable to these problems,
836 you should disable this feature by specifying:</p>
838 <div class="example"><p><code>
842 <p>For NFS or SMB mounted files, this feature may be disabled explicitly
843 for the offending files by specifying:</p>
845 <div class="example"><p><code>
846 <Directory "/path-to-nfs-files">
847 <span class="indent">
854 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
855 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
856 <table class="directive">
857 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
858 in case of an error</td></tr>
859 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
860 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
861 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
862 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
863 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
864 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Quoting syntax for text messages is different in Apache
867 <p>In the event of a problem or error, Apache can be configured
868 to do one of four things,</p>
871 <li>output a simple hardcoded error message</li>
873 <li>output a customized message</li>
875 <li>redirect to a local <var>URL-path</var> to handle the
878 <li>redirect to an external <var>URL</var> to handle the
882 <p>The first option is the default, while options 2-4 are
883 configured using the <code class="directive">ErrorDocument</code>
884 directive, which is followed by the HTTP response code and a URL
885 or a message. Apache will sometimes offer additional information
886 regarding the problem/error.</p>
888 <p>URLs can begin with a slash (/) for local URLs, or be a full
889 URL which the client can resolve. Alternatively, a message can
890 be provided to be displayed by the browser. Examples:</p>
892 <div class="example"><p><code>
893 ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
894 ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
895 ErrorDocument 401 /subscription_info.html<br />
896 ErrorDocument 403 "Sorry can't allow you access today"
899 <p>Note that when you specify an <code class="directive">ErrorDocument</code>
900 that points to a remote URL (ie. anything with a method such as
901 <code>http</code> in front of it), Apache will send a redirect to the
902 client to tell it where to find the document, even if the
903 document ends up being on the same server. This has several
904 implications, the most important being that the client will not
905 receive the original error status code, but instead will
906 receive a redirect status code. This in turn can confuse web
907 robots and other clients which try to determine if a URL is
908 valid using the status code. In addition, if you use a remote
909 URL in an <code>ErrorDocument 401</code>, the client will not
910 know to prompt the user for a password since it will not
911 receive the 401 status code. Therefore, <strong>if you use an
912 <code>ErrorDocument 401</code> directive then it must refer to a local
913 document.</strong></p>
915 <p>Microsoft Internet Explorer (MSIE) will by default ignore
916 server-generated error messages when they are "too small" and substitute
917 its own "friendly" error messages. The size threshold varies depending on
918 the type of error, but in general, if you make your error document
919 greater than 512 bytes, then MSIE will show the server-generated
920 error rather than masking it. More information is available in
921 Microsoft Knowledgebase article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
923 <p>Prior to version 2.0, messages were indicated by prefixing
924 them with a single unmatched double quote character.</p>
928 <li><a href="../custom-error.html">documentation of
929 customizable responses</a></li>
932 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
933 <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
934 <table class="directive">
935 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
936 <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>
937 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ErrorLog logs/error_log (Unix)<br />
938 ErrorLog logs/error.log (Windows and OS/2)</code></td></tr>
939 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
940 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
941 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
943 <p>The <code class="directive">ErrorLog</code> directive sets the name of
944 the file to which the server will log any errors it encounters. If
945 the <var>file-path</var> is not absolute (in general: does not begin
946 with a slash (/)) then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
948 <div class="example"><h3>Example</h3><p><code>
949 ErrorLog /var/log/httpd/error_log
952 <p>If the <var>file-path</var>
953 begins with a pipe (|) then it is assumed to be a command to spawn
954 to handle the error log.</p>
956 <div class="example"><h3>Example</h3><p><code>
957 ErrorLog "|/usr/local/bin/httpd_errors"
960 <p>Using <code>syslog</code> instead of a filename enables logging
961 via syslogd(8) if the system supports it. The default is to use
962 syslog facility <code>local7</code>, but you can override this by
963 using the <code>syslog:<var>facility</var></code> syntax where
964 <var>facility</var> can be one of the names usually documented in
967 <div class="example"><h3>Example</h3><p><code>
971 <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
972 document for details on why your security could be compromised
973 if the directory where logfiles are stored is writable by
974 anyone other than the user that starts the server.</p>
975 <div class="warning"><h3>Note</h3>
976 <p>When entering a file path on non-Unix platforms, care should be taken
977 to make sure that only forward slashed are used even though the platform
978 may allow the use of back slashes. In general it is a good idea to always
979 use forward slashes throughout the configuration files.</p>
984 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
985 <li><a href="../logs.html">Apache Log Files</a></li>
988 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
989 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
990 <table class="directive">
991 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
992 HTTP response header</td></tr>
993 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
994 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
995 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
996 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
997 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
998 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1001 The <code class="directive">FileETag</code> directive configures the file
1002 attributes that are used to create the <code>ETag</code> (entity
1003 tag) response header field when the document is based on a file.
1004 (The <code>ETag</code> value is used in cache management to save
1005 network bandwidth.) In Apache 1.3.22 and earlier, the
1006 <code>ETag</code> value was <em>always</em> formed
1007 from the file's inode, size, and last-modified time (mtime). The
1008 <code class="directive">FileETag</code> directive allows you to choose
1009 which of these -- if any -- should be used. The recognized keywords are:
1013 <dt><strong>INode</strong></dt>
1014 <dd>The file's i-node number will be included in the calculation</dd>
1015 <dt><strong>MTime</strong></dt>
1016 <dd>The date and time the file was last modified will be included</dd>
1017 <dt><strong>Size</strong></dt>
1018 <dd>The number of bytes in the file will be included</dd>
1019 <dt><strong>All</strong></dt>
1020 <dd>All available fields will be used. This is equivalent to:
1021 <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1022 <dt><strong>None</strong></dt>
1023 <dd>If a document is file-based, no <code>ETag</code> field will be
1024 included in the response</dd>
1027 <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1028 keywords may be prefixed with either <code>+</code> or <code>-</code>,
1029 which allow changes to be made to the default setting inherited
1030 from a broader scope. Any keyword appearing without such a prefix
1031 immediately and completely cancels the inherited setting.</p>
1033 <p>If a directory's configuration includes
1034 <code>FileETag INode MTime Size</code>, and a
1035 subdirectory's includes <code>FileETag -INode</code>,
1036 the setting for that subdirectory (which will be inherited by
1037 any sub-subdirectories that don't override it) will be equivalent to
1038 <code>FileETag MTime Size</code>.</p>
1041 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1042 <div class="directive-section"><h2><a name="Files" id="Files"><Files></a> <a name="files" id="files">Directive</a></h2>
1043 <table class="directive">
1044 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
1046 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Files <var>filename</var>> ... </Files></code></td></tr>
1047 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1048 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1049 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1050 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1052 <p>The <code class="directive"><Files></code> directive
1053 limits the scope of the enclosed directives by filename. It is comparable
1054 to the <code class="directive"><a href="#directory"><Directory></a></code>
1055 and <code class="directive"><a href="#location"><Location></a></code>
1056 directives. It should be matched with a <code></Files></code>
1057 directive. The directives given within this section will be applied to
1058 any object with a basename (last component of filename) matching the
1059 specified filename. <code class="directive"><Files></code>
1060 sections are processed in the order they appear in the
1061 configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1062 <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location"><Location></a></code> sections. Note
1063 that <code class="directive"><Files></code> can be nested
1064 inside <code class="directive"><a href="#directory"><Directory></a></code> sections to restrict the
1065 portion of the filesystem they apply to.</p>
1067 <p>The <var>filename</var> argument should include a filename, or
1068 a wild-card string, where <code>?</code> matches any single character,
1069 and <code>*</code> matches any sequences of characters. Extended regular
1070 expressions can also be used, with the addition of the
1071 <code>~</code> character. For example:</p>
1073 <div class="example"><p><code>
1074 <Files ~ "\.(gif|jpe?g|png)$">
1077 <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
1080 <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
1081 <code>.htaccess</code> files. This allows users to control access to
1082 their own files, at a file-by-file level.</p>
1087 <li><a href="../sections.html">How <Directory>, <Location>
1088 and <Files> sections work</a> for an explanation of how these
1089 different sections are combined when a request is received</li>
1092 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1093 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch"><FilesMatch></a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
1094 <table class="directive">
1095 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
1097 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><FilesMatch <var>regex</var>> ... </FilesMatch></code></td></tr>
1098 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1099 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1100 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1101 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1103 <p>The <code class="directive"><FilesMatch></code> directive
1104 limits the scope of the enclosed directives by filename, just as the
1105 <code class="directive"><a href="#files"><Files></a></code> directive
1106 does. However, it accepts a regular expression. For example:</p>
1108 <div class="example"><p><code>
1109 <FilesMatch "\.(gif|jpe?g|png)$">
1112 <p>would match most common Internet graphics formats.</p>
1116 <li><a href="../sections.html">How <Directory>, <Location>
1117 and <Files> sections work</a> for an explanation of how these
1118 different sections are combined when a request is received</li>
1121 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1122 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
1123 <table class="directive">
1124 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
1125 MIME content-type</td></tr>
1126 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>MIME-type</var>|None</code></td></tr>
1127 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1128 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1129 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1130 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1131 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache 2.0</td></tr>
1133 <p>When placed into an <code>.htaccess</code> file or a
1134 <code class="directive"><a href="#directory"><Directory></a></code>, or
1135 <code class="directive"><a href="#location"><Location></a></code> or
1136 <code class="directive"><a href="#files"><Files></a></code>
1137 section, this directive forces all matching files to be served
1138 with the content type identification given by
1139 <var>MIME-type</var>. For example, if you had a directory full of
1140 GIF files, but did not want to label them all with <code>.gif</code>,
1141 you might want to use:</p>
1143 <div class="example"><p><code>
1147 <p>Note that unlike <code class="directive"><a href="#defaulttype">DefaultType</a></code>,
1148 this directive overrides all mime-type associations, including
1149 filename extensions, that might identify the media type.</p>
1151 <p>You can override any <code class="directive">ForceType</code> setting
1152 by using the value of <code>None</code>:</p>
1154 <div class="example"><p><code>
1155 # force all files to be image/gif:<br />
1156 <Location /images><br />
1157 <span class="indent">
1158 ForceType image/gif<br />
1160 </Location><br />
1162 # but normal mime-type associations here:<br />
1163 <Location /images/mixed><br />
1164 <span class="indent">
1165 ForceType None<br />
1171 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1172 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
1173 <table class="directive">
1174 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1175 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1176 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
1177 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1178 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1179 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1181 <p>This directive enables DNS lookups so that host names can be
1182 logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1183 The value <code>Double</code> refers to doing double-reverse
1184 DNS lookup. That is, after a reverse lookup is performed, a forward
1185 lookup is then performed on that result. At least one of the ip
1186 addresses in the forward lookup must match the original
1187 address. (In "tcpwrappers" terminology this is called
1188 <code>PARANOID</code>.)</p>
1190 <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1191 used for controlling access by hostname, a double reverse lookup
1192 will be performed. This is necessary for security. Note that the
1193 result of this double-reverse isn't generally available unless you
1194 set <code>HostnameLookups Double</code>. For example, if only
1195 <code>HostnameLookups On</code> and a request is made to an object
1196 that is protected by hostname restrictions, regardless of whether
1197 the double-reverse fails or not, CGIs will still be passed the
1198 single-reverse result in <code>REMOTE_HOST</code>.</p>
1200 <p>The default is <code>Off</code> in order to save the network
1201 traffic for those sites that don't truly need the reverse
1202 lookups done. It is also better for the end users because they
1203 don't have to suffer the extra latency that a lookup entails.
1204 Heavily loaded sites should leave this directive
1205 <code>Off</code>, since DNS lookups can take considerable
1206 amounts of time. The utility <a href="../programs/logresolve.html">logresolve</a>, compiled by default
1207 to the <code>bin</code> subdirectory of your installation directory, can
1208 be used to look up host names from logged IP addresses offline.</p>
1211 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1212 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine"><IfDefine></a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
1213 <table class="directive">
1214 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
1215 if a test is true at startup</td></tr>
1216 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfDefine [!]<var>parameter-name</var>> ...
1217 </IfDefine></code></td></tr>
1218 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1219 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1220 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1221 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1223 <p>The <code><IfDefine <var>test</var>>...</IfDefine>
1224 </code> section is used to mark directives that are conditional. The
1225 directives within an <code class="directive"><IfDefine></code>
1226 section are only processed if the <var>test</var> is true. If <var>
1227 test</var> is false, everything between the start and end markers is
1230 <p>The <var>test</var> in the <code class="directive"><IfDefine></code> section directive can be one of two forms:</p>
1233 <li><var>parameter-name</var></li>
1235 <li><code>!</code><var>parameter-name</var></li>
1238 <p>In the former case, the directives between the start and end
1239 markers are only processed if the parameter named
1240 <var>parameter-name</var> is defined. The second format reverses
1241 the test, and only processes the directives if
1242 <var>parameter-name</var> is <strong>not</strong> defined.</p>
1244 <p>The <var>parameter-name</var> argument is a define as given on
1245 the <code>httpd</code> command line via <code>-D<var>parameter-</var>
1246 </code>, at the time the server was started.</p>
1248 <p><code class="directive"><IfDefine></code> sections are
1249 nest-able, which can be used to implement simple
1250 multiple-parameter tests. Example:</p>
1252 <div class="example"><p><code>
1253 httpd -DReverseProxy ...<br />
1256 <IfDefine ReverseProxy><br />
1257 <span class="indent">
1258 LoadModule rewrite_module modules/mod_rewrite.so<br />
1259 LoadModule proxy_module modules/libproxy.so<br />
1265 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1266 <div class="directive-section"><h2><a name="IfModule" id="IfModule"><IfModule></a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
1267 <table class="directive">
1268 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
1269 presence or absence of a specific module</td></tr>
1270 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfModule [!]<var>module-name</var>> ...
1271 </IfModule></code></td></tr>
1272 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1273 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1274 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1275 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1277 <p>The <code><IfModule <var>test</var>>...</IfModule></code>
1278 section is used to mark directives that are conditional on the presence of
1279 a specific module. The directives within an <code class="directive"><IfModule></code> section are only processed if the <var>test</var>
1280 is true. If <var>test</var> is false, everything between the start and
1281 end markers is ignored.</p>
1283 <p>The <var>test</var> in the <code class="directive"><IfModule></code> section directive can be one of two forms:</p>
1286 <li><var>module name</var></li>
1288 <li>!<var>module name</var></li>
1291 <p>In the former case, the directives between the start and end
1292 markers are only processed if the module named <var>module
1293 name</var> is included in Apache -- either compiled in or
1294 dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1295 and only processes the directives if <var>module name</var> is
1296 <strong>not</strong> included.</p>
1298 <p>The <var>module name</var> argument is the file name of the
1299 module, at the time it was compiled. For example,
1300 <code>mod_rewrite.c</code>. If a module consists of several
1301 source files, use the name of the file containing the string
1302 <code>STANDARD20_MODULE_STUFF</code>.</p>
1304 <p><code class="directive"><IfModule></code> sections are
1305 nest-able, which can be used to implement simple multiple-module
1308 <div class="note">This section should only be used if you need to have one
1309 configuration file that works whether or not a specific module
1310 is available. In normal operation, directives need not be
1311 placed in <code class="directive"><IfModule></code>
1315 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1316 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
1317 <table class="directive">
1318 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
1319 the server configuration files</td></tr>
1320 <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>
1321 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1322 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1323 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1324 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later</td></tr>
1326 <p>This directive allows inclusion of other configuration files
1327 from within the server configuration files.</p>
1329 <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used to
1330 include several files at once, in alphabetical order. In
1331 addition, if <code class="directive">Include</code> points to a directory,
1332 rather than a file, Apache will read all files in that directory
1333 and any subdirectory. But including entire directories is not
1334 recommended, because it is easy to accidentally leave temporary
1335 files in a directory that can cause <code>httpd</code> to
1338 <p>The file path specified may be an absolute path (i.e.
1339 starting with a slash), or may be relative to the
1340 <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1344 <div class="example"><p><code>
1345 Include /usr/local/apache2/conf/ssl.conf<br />
1346 Include /usr/local/apache2/conf/vhosts/*.conf
1349 <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1351 <div class="example"><p><code>
1352 Include conf/ssl.conf<br />
1353 Include conf/vhosts/*.conf
1356 <p>Running <code>apachectl configtest</code> will give you a list
1357 of the files that are being processed during the configuration
1360 <div class="example"><p><code>
1361 root@host# apachectl configtest<br />
1362 Processing config file: /usr/local/apache2/conf/ssl.conf<br />
1363 Processing config file: /usr/local/apache2/conf/vhosts/vhost1.conf<br />
1364 Processing config file: /usr/local/apache2/conf/vhosts/vhost2.conf<br />
1370 <li><a href="../programs/apachectl.html">apachectl</a></li>
1373 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1374 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
1375 <table class="directive">
1376 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
1377 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1378 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
1379 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1380 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1381 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1383 <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1384 connection feature of HTTP/1.1 provide long-lived HTTP sessions
1385 which allow multiple requests to be sent over the same TCP
1386 connection. In some cases this has been shown to result in an
1387 almost 50% speedup in latency times for HTML documents with
1388 many images. To enable Keep-Alive connections, set
1389 <code>KeepAlive On</code>.</p>
1391 <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1392 used if they are specifically requested by a client. In
1393 addition, a Keep-Alive connection with an HTTP/1.0 client can
1394 only be used when the length of the content is known in
1395 advance. This implies that dynamic content such as CGI output,
1396 SSI pages, and server-generated directory listings will
1397 generally not use Keep-Alive connections to HTTP/1.0 clients.
1398 For HTTP/1.1 clients, persistent connections are the default
1399 unless otherwise specified. If the client requests it, chunked
1400 encoding will be used in order to send content of unknown
1401 length over persistent connections.</p>
1405 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
1408 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1409 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
1410 <table class="directive">
1411 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
1412 requests on a persistent connection</td></tr>
1413 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>seconds</var></code></td></tr>
1414 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 15</code></td></tr>
1415 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1416 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1417 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1419 <p>The number of seconds Apache will wait for a subsequent
1420 request before closing the connection. Once a request has been
1421 received, the timeout value specified by the
1422 <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
1424 <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
1425 may cause performance problems in heavily loaded servers. The
1426 higher the timeout, the more server processes will be kept
1427 occupied waiting on connections with idle clients.</p>
1430 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1431 <div class="directive-section"><h2><a name="Limit" id="Limit"><Limit></a> <a name="limit" id="limit">Directive</a></h2>
1432 <table class="directive">
1433 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
1435 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Limit <var>method</var> [<var>method</var>] ... > ...
1436 </Limit></code></td></tr>
1437 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1438 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1439 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1440 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1442 <p>Access controls are normally effective for
1443 <strong>all</strong> access methods, and this is the usual
1444 desired behavior. <strong>In the general case, access control
1445 directives should not be placed within a
1446 <code class="directive"><Limit></code> section.</strong></p>
1448 <p>The purpose of the <code class="directive"><Limit></code>
1449 directive is to restrict the effect of the access controls to the
1450 nominated HTTP methods. For all other methods, the access
1451 restrictions that are enclosed in the <code class="directive"><Limit></code> bracket <strong>will have no
1452 effect</strong>. The following example applies the access control
1453 only to the methods <code>POST</code>, <code>PUT</code>, and
1454 <code>DELETE</code>, leaving all other methods unprotected:</p>
1456 <div class="example"><p><code>
1457 <Limit POST PUT DELETE><br />
1458 <span class="indent">
1459 Require valid-user<br />
1464 <p>The method names listed can be one or more of: <code>GET</code>,
1465 <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1466 <code>CONNECT</code>, <code>OPTIONS</code>,
1467 <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1468 <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1469 <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1470 case-sensitive.</strong> If <code>GET</code> is used it will also
1471 restrict <code>HEAD</code> requests. The <code>TRACE</code> method
1472 cannot be limited.</p>
1475 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1476 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept"><LimitExcept></a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
1477 <table class="directive">
1478 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
1479 except the named ones</td></tr>
1480 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LimitExcept <var>method</var> [<var>method</var>] ... > ...
1481 </LimitExcept></code></td></tr>
1482 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1483 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1484 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1485 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1487 <p><code class="directive"><LimitExcept></code> and
1488 <code></LimitExcept></code> are used to enclose
1489 a group of access control directives which will then apply to any
1490 HTTP access method <strong>not</strong> listed in the arguments;
1491 i.e., it is the opposite of a <code class="directive"><a href="#limit"><Limit></a></code> section and can be used to control
1492 both standard and nonstandard/unrecognized methods. See the
1493 documentation for <code class="directive"><a href="#limit"><Limit></a></code> for more details.</p>
1497 <div class="example"><p><code>
1498 <LimitExcept POST GET><br />
1499 <span class="indent">
1500 Require valid-user<br />
1507 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1508 <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directive</a></h2>
1509 <table class="directive">
1510 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine maximum number of internal redirects and nested
1511 subrequests</td></tr>
1512 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
1513 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
1514 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1515 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1516 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1517 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.1 and later</td></tr>
1519 <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
1520 redirects the original request to a CGI script. A subrequest is Apache's
1521 mechanism to find out what would happen for some URI if it were requested.
1522 For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
1523 files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
1526 <p><code class="directive">LimitInternalRecursion</code> prevents the server
1527 from crashing when entering an infinite loop of internal redirects or
1528 subrequests. Such loops are usually caused by misconfigurations.</p>
1530 <p>The directive stores two different limits, which are evaluated on
1531 per-request basis. The first <var>number</var> is the maximum number of
1532 internal redirects, that may follow each other. The second <var>number</var>
1533 determines, how deep subrequests may be nested. If you specify only one
1534 <var>number</var>, it will be assigned to both limits.</p>
1536 <div class="example"><h3>Example</h3><p><code>
1537 LimitInternalRecursion 5
1541 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1542 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
1543 <table class="directive">
1544 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
1545 from the client</td></tr>
1546 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
1547 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
1548 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1549 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1550 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1551 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1553 <p>This directive specifies the number of <var>bytes</var> from 0
1554 (meaning unlimited) to 2147483647 (2GB) that are allowed in a
1555 request body. The default value is defined by the compile-time
1556 constant <code>DEFAULT_LIMIT_REQUEST_BODY</code> (0 as
1559 <p>The <code class="directive">LimitRequestBody</code> directive allows
1560 the user to set a limit on the allowed size of an HTTP request
1561 message body within the context in which the directive is given
1562 (server, per-directory, per-file or per-location). If the client
1563 request exceeds that limit, the server will return an error
1564 response instead of servicing the request. The size of a normal
1565 request message body will vary greatly depending on the nature of
1566 the resource and the methods allowed on that resource. CGI scripts
1567 typically use the message body for retrieving form information.
1568 Implementations of the <code>PUT</code> method will require
1569 a value at least as large as any representation that the server
1570 wishes to accept for that resource.</p>
1572 <p>This directive gives the server administrator greater
1573 control over abnormal client request behavior, which may be
1574 useful for avoiding some forms of denial-of-service
1577 <p>If, for example, you are permitting file upload to a particular
1578 location, and wish to limit the size of the uploaded file to 100K,
1579 you might use the following directive:</p>
1581 <div class="example"><p><code>
1582 LimitRequestBody 102400
1587 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1588 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
1589 <table class="directive">
1590 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
1591 will be accepted from the client</td></tr>
1592 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
1593 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
1594 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1595 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1596 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1598 <p><var>Number</var> is an integer from 0 (meaning unlimited) to
1599 32767. The default value is defined by the compile-time
1600 constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
1603 <p>The <code class="directive">LimitRequestFields</code> directive allows
1604 the server administrator to modify the limit on the number of
1605 request header fields allowed in an HTTP request. A server needs
1606 this value to be larger than the number of fields that a normal
1607 client request might include. The number of request header fields
1608 used by a client rarely exceeds 20, but this may vary among
1609 different client implementations, often depending upon the extent
1610 to which a user has configured their browser to support detailed
1611 content negotiation. Optional HTTP extensions are often expressed
1612 using request header fields.</p>
1614 <p>This directive gives the server administrator greater
1615 control over abnormal client request behavior, which may be
1616 useful for avoiding some forms of denial-of-service attacks.
1617 The value should be increased if normal clients see an error
1618 response from the server that indicates too many fields were
1619 sent in the request.</p>
1623 <div class="example"><p><code>
1624 LimitRequestFields 50
1629 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1630 <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
1631 <table class="directive">
1632 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
1634 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldsize <var>bytes</var></code></td></tr>
1635 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldsize 8190</code></td></tr>
1636 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1637 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1638 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1640 <p>This directive specifies the number of <var>bytes</var> from 0
1641 to the value of the compile-time constant
1642 <code>DEFAULT_LIMIT_REQUEST_FIELDSIZE</code> (8190 as
1643 distributed) that will be allowed in an HTTP request
1646 <p>The <code class="directive">LimitRequestFieldSize</code> directive
1647 allows the server administrator to reduce the limit on the allowed
1648 size of an HTTP request header field below the normal input buffer
1649 size compiled with the server. A server needs this value to be
1650 large enough to hold any one header field from a normal client
1651 request. The size of a normal request header field will vary
1652 greatly among different client implementations, often depending
1653 upon the extent to which a user has configured their browser to
1654 support detailed content negotiation.</p>
1656 <p>This directive gives the server administrator greater
1657 control over abnormal client request behavior, which may be
1658 useful for avoiding some forms of denial-of-service attacks.</p>
1662 <div class="example"><p><code>
1663 LimitRequestFieldSize 4094
1666 <div class="note">Under normal conditions, the value should not be changed from
1671 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1672 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
1673 <table class="directive">
1674 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
1675 from the client</td></tr>
1676 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
1677 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
1678 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1679 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1680 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1682 <p>This directive sets the number of <var>bytes</var> from 0 to
1683 the value of the compile-time constant
1684 <code>DEFAULT_LIMIT_REQUEST_LINE</code> (8190 as distributed)
1685 that will be allowed on the HTTP request-line.</p>
1687 <p>The <code class="directive">LimitRequestLine</code> directive allows
1688 the server administrator to reduce the limit on the allowed size
1689 of a client's HTTP request-line below the normal input buffer size
1690 compiled with the server. Since the request-line consists of the
1691 HTTP method, URI, and protocol version, the
1692 <code class="directive">LimitRequestLine</code> directive places a
1693 restriction on the length of a request-URI allowed for a request
1694 on the server. A server needs this value to be large enough to
1695 hold any of its resource names, including any information that
1696 might be passed in the query part of a <code>GET</code> request.</p>
1698 <p>This directive gives the server administrator greater
1699 control over abnormal client request behavior, which may be
1700 useful for avoiding some forms of denial-of-service attacks.</p>
1704 <div class="example"><p><code>
1705 LimitRequestLine 4094
1708 <div class="note">Under normal conditions, the value should not be changed from
1712 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1713 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
1714 <table class="directive">
1715 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
1716 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
1717 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
1718 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1719 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1720 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1721 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1723 <p>Limit (in bytes) on maximum size of an XML-based request
1724 body. A value of <code>0</code> will disable any checking.</p>
1728 <div class="example"><p><code>
1729 LimitXMLRequestBody 0
1734 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1735 <div class="directive-section"><h2><a name="Location" id="Location"><Location></a> <a name="location" id="location">Directive</a></h2>
1736 <table class="directive">
1737 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
1739 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Location
1740 <var>URL-path</var>|<var>URL</var>> ... </Location></code></td></tr>
1741 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1742 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1743 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1745 <p>The <code class="directive"><Location></code> directive
1746 limits the scope of the enclosed directives by URL. It is similar to the
1747 <code class="directive"><a href="#directory"><Directory></a></code>
1748 directive, and starts a subsection which is terminated with a
1749 <code></Location></code> directive. <code class="directive"><Location></code> sections are processed in the
1750 order they appear in the configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1751 <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files"><Files></a></code> sections.</p>
1753 <p><code class="directive"><Location></code> sections operate
1754 completely outside the filesystem. This has several consequences.
1755 Most importantly, <code class="directive"><Location></code>
1756 directives should not be used to control access to filesystem
1757 locations. Since several different URLs may map to the same
1758 filesystem location, such access controls may by circumvented.</p>
1760 <div class="note"><h3>When to use <code class="directive"><Location></code></h3>
1762 <p>Use <code class="directive"><Location></code> to apply
1763 directives to content that lives outside the filesystem. For
1764 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
1765 <code><Location /></code>, which is an easy way to
1766 apply a configuration to the entire server.</p>
1769 <p>For all origin (non-proxy) requests, the URL to be matched is a
1770 URL-path of the form <code>/path/</code>. No scheme, hostname,
1771 port, or query string may be included. For proxy requests, the
1772 URL to be matched is of the form
1773 <code>scheme://servername/path</code>, and you must include the
1776 <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
1777 any single character, and <code>*</code> matches any sequences of
1781 expressions can also be used, with the addition of the
1782 <code>~</code> character. For example:</p>
1784 <div class="example"><p><code>
1785 <Location ~ "/(extra|special)/data">
1788 <p>would match URLs that contained the substring <code>/extra/data</code>
1789 or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch"><LocationMatch></a></code> behaves
1790 identical to the regex version of <code class="directive"><Location></code>.</p>
1792 <p>The <code class="directive"><Location></code>
1793 functionality is especially useful when combined with the
1794 <code class="directive"><a href="#sethandler">SetHandler</a></code>
1795 directive. For example, to enable status requests, but allow them
1796 only from browsers at <code>foo.com</code>, you might use:</p>
1798 <div class="example"><p><code>
1799 <Location /status><br />
1800 <span class="indent">
1801 SetHandler server-status<br />
1802 Order Deny,Allow<br />
1804 Allow from .foo.com<br />
1809 <div class="note"><h3>Note about / (slash)</h3>
1810 <p>The slash character has special meaning depending on where in a
1811 URL it appears. People may be used to its behavior in the filesystem
1812 where multiple adjacent slashes are frequently collapsed to a single
1813 slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
1814 <code>/home/foo</code>). In URL-space this is not necessarily true.
1815 The <code class="directive"><a href="#locationmatch"><LocationMatch></a></code>
1816 directive and the regex version of <code class="directive"><Location></code> require you to explicitly specify multiple
1817 slashes if that is your intention.</p>
1819 <p>For example, <code><LocationMatch ^/abc></code> would match
1820 the request URL <code>/abc</code> but not the request URL <code>
1821 //abc</code>. The (non-regex) <code class="directive"><Location></code> directive behaves similarly when used for
1822 proxy requests. But when (non-regex) <code class="directive"><Location></code> is used for non-proxy requests it will
1823 implicitly match multiple slashes with a single slash. For example,
1824 if you specify <code><Location /abc/def></code> and the
1825 request is to <code>/abc//def</code> then it will match.</p>
1830 <li><a href="../sections.html">How <Directory>, <Location>
1831 and <Files> sections work</a> for an explanation of how these
1832 different sections are combined when a request is received</li>
1835 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1836 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch"><LocationMatch></a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
1837 <table class="directive">
1838 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
1839 matching URLs</td></tr>
1840 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LocationMatch
1841 <var>regex</var>> ... </LocationMatch></code></td></tr>
1842 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1843 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1844 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1846 <p>The <code class="directive"><LocationMatch></code> directive
1847 limits the scope of the enclosed directives by URL, in an identical manner
1848 to <code class="directive"><a href="#location"><Location></a></code>. However,
1849 it takes a regular expression as an argument instead of a simple
1850 string. For example:</p>
1852 <div class="example"><p><code>
1853 <LocationMatch "/(extra|special)/data">
1856 <p>would match URLs that contained the substring <code>/extra/data</code>
1857 or <code>/special/data</code>.</p>
1861 <li><a href="../sections.html">How <Directory>, <Location>
1862 and <Files> sections work</a> for an explanation of how these
1863 different sections are combined when a request is received</li>
1866 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1867 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
1868 <table class="directive">
1869 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
1870 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel <var>level</var></code></td></tr>
1871 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
1872 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1873 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1874 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1876 <p><code class="directive">LogLevel</code> adjusts the verbosity of the
1877 messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
1878 <var>level</var>s are available, in order of decreasing
1881 <table class="bordered">
1883 <th><strong>Level</strong> </th>
1885 <th><strong>Description</strong> </th>
1887 <th><strong>Example</strong> </th>
1891 <td><code>emerg</code> </td>
1893 <td>Emergencies - system is unusable.</td>
1895 <td>"Child cannot open lock file. Exiting"</td>
1899 <td><code>alert</code> </td>
1901 <td>Action must be taken immediately.</td>
1903 <td>"getpwuid: couldn't determine user name from uid"</td>
1907 <td><code>crit</code> </td>
1909 <td>Critical Conditions.</td>
1911 <td>"socket: Failed to get a socket, exiting child"</td>
1915 <td><code>error</code> </td>
1917 <td>Error conditions.</td>
1919 <td>"Premature end of script headers"</td>
1923 <td><code>warn</code> </td>
1925 <td>Warning conditions.</td>
1927 <td>"child process 1234 did not exit, sending another
1932 <td><code>notice</code> </td>
1934 <td>Normal but significant condition.</td>
1936 <td>"httpd: caught SIGBUS, attempting to dump core in
1941 <td><code>info</code> </td>
1943 <td>Informational.</td>
1945 <td>"Server seems busy, (you may need to increase
1946 StartServers, or Min/MaxSpareServers)..."</td>
1950 <td><code>debug</code> </td>
1952 <td>Debug-level messages</td>
1954 <td>"Opening config file ..."</td>
1958 <p>When a particular level is specified, messages from all
1959 other levels of higher significance will be reported as well.
1960 <em>E.g.</em>, when <code>LogLevel info</code> is specified,
1961 then messages with log levels of <code>notice</code> and
1962 <code>warn</code> will also be posted.</p>
1964 <p>Using a level of at least <code>crit</code> is
1969 <div class="example"><p><code>
1974 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1975 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
1976 <table class="directive">
1977 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
1978 connection</td></tr>
1979 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
1980 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
1981 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1982 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1983 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1985 <p>The <code class="directive">MaxKeepAliveRequests</code> directive
1986 limits the number of requests allowed per connection when
1987 <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
1988 set to <code>0</code>, unlimited requests will be allowed. We
1989 recommend that this setting be kept to a high value for maximum
1990 server performance.</p>
1994 <div class="example"><p><code>
1995 MaxKeepAliveRequests 500
1999 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2000 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
2001 <table class="directive">
2002 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
2004 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
2005 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2006 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2007 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2009 <p>The <code class="directive">NameVirtualHost</code> directive is a
2010 required directive if you want to configure <a href="../vhosts/">name-based virtual hosts</a>.</p>
2012 <p>Although <var>addr</var> can be hostname it is recommended
2013 that you always use an IP address, e.g.</p>
2015 <div class="example"><p><code>
2016 NameVirtualHost 111.22.33.44
2019 <p>With the <code class="directive">NameVirtualHost</code> directive you
2020 specify the IP address on which the server will receive requests
2021 for the name-based virtual hosts. This will usually be the address
2022 to which your name-based virtual host names resolve. In cases
2023 where a firewall or other proxy receives the requests and forwards
2024 them on a different IP address to the server, you must specify the
2025 IP address of the physical interface on the machine which will be
2026 servicing the requests. If you have multiple name-based hosts on
2027 multiple addresses, repeat the directive for each address.</p>
2029 <div class="note"><h3>Note</h3>
2030 <p>Note, that the "main server" and any <code>_default_</code> servers
2031 will <strong>never</strong> be served for a request to a
2032 <code class="directive">NameVirtualHost</code> IP Address (unless for some
2033 reason you specify <code class="directive">NameVirtualHost</code> but then
2034 don't define any <code class="directive">VirtualHost</code>s for that
2038 <p>Optionally you can specify a port number on which the
2039 name-based virtual hosts should be used, e.g.</p>
2041 <div class="example"><p><code>
2042 NameVirtualHost 111.22.33.44:8080
2045 <p>IPv6 addresses must be enclosed in square brackets, as shown
2046 in the following example:</p>
2048 <div class="example"><p><code>
2049 NameVirtualHost [fe80::a00:20ff:fea7:ccea]:8080
2052 <p>To receive requests on all interfaces, you can use an argument of
2055 <div class="example"><p><code>
2059 <div class="note"><h3>Argument to <code class="directive"><VirtualHost></code>
2061 <p>Note that the argument to the <code class="directive"><VirtualHost></code> directive must
2062 exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
2064 <div class="example"><p><code>
2065 NameVirtualHost 1.2.3.4<br />
2066 <VirtualHost 1.2.3.4><br />
2068 </VirtualHost><br />
2074 <li><a href="../vhosts/">Virtual Hosts
2075 documentation</a></li>
2078 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2079 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
2080 <table class="directive">
2081 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
2083 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
2084 [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
2085 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
2086 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2087 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
2088 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2089 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2091 <p>The <code class="directive">Options</code> directive controls which
2092 server features are available in a particular directory.</p>
2094 <p><var>option</var> can be set to <code>None</code>, in which
2095 case none of the extra features are enabled, or one or more of
2099 <dt><code>All</code></dt>
2101 <dd>All options except for <code>MultiViews</code>. This is the default
2104 <dt><code>ExecCGI</code></dt>
2107 Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
2110 <dt><code>FollowSymLinks</code></dt>
2114 The server will follow symbolic links in this directory.
2116 <p>Even though the server follows the symlink it does <em>not</em>
2117 change the pathname used to match against <code class="directive"><a href="#directory"><Directory></a></code> sections.</p>
2118 <p>Note also, that this option <strong>gets ignored</strong> if set
2119 inside a <code class="directive"><a href="#location"><Location></a></code>
2123 <dt><code>Includes</code></dt>
2126 Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
2129 <dt><code>IncludesNOEXEC</code></dt>
2133 Server-side includes are permitted, but the <code>#exec
2134 cmd</code> and <code>#exec cgi</code> are disabled. It is still
2135 possible to <code>#include virtual</code> CGI scripts from
2136 <code class="directive"><a href="../mod/mod_cgi.html#scriptalias">ScriptAlias</a></code>ed
2139 <dt><code>Indexes</code></dt>
2142 If a URL which maps to a directory is requested, and the there
2143 is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
2144 (<em>e.g.</em>, <code>index.html</code>) in that directory, then
2145 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
2146 of the directory.</dd>
2148 <dt><code>MultiViews</code></dt>
2151 <a href="../content-negotiation.html">Content negotiated</a>
2152 "MultiViews" are allowed using
2153 <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.</dd>
2155 <dt><code>SymLinksIfOwnerMatch</code></dt>
2157 <dd>The server will only follow symbolic links for which the
2158 target file or directory is owned by the same user id as the
2161 <div class="note"><h3>Note</h3> This option gets ignored if
2162 set inside a <code class="directive"><a href="#location"><Location></a></code> section.</div>
2166 <p>Normally, if multiple <code class="directive">Options</code> could
2167 apply to a directory, then the most specific one is used and
2168 others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
2169 However if <em>all</em> the options on the
2170 <code class="directive">Options</code> directive are preceded by a
2171 <code>+</code> or <code>-</code> symbol, the options are
2172 merged. Any options preceded by a <code>+</code> are added to the
2173 options currently in force, and any options preceded by a
2174 <code>-</code> are removed from the options currently in
2177 <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
2179 <div class="example"><p><code>
2180 <Directory /web/docs><br />
2181 <span class="indent">
2182 Options Indexes FollowSymLinks<br />
2184 </Directory><br />
2186 <Directory /web/docs/spec><br />
2187 <span class="indent">
2188 Options Includes<br />
2193 <p>then only <code>Includes</code> will be set for the
2194 <code>/web/docs/spec</code> directory. However if the second
2195 <code class="directive">Options</code> directive uses the <code>+</code> and
2196 <code>-</code> symbols:</p>
2198 <div class="example"><p><code>
2199 <Directory /web/docs><br />
2200 <span class="indent">
2201 Options Indexes FollowSymLinks<br />
2203 </Directory><br />
2205 <Directory /web/docs/spec><br />
2206 <span class="indent">
2207 Options +Includes -Indexes<br />
2212 <p>then the options <code>FollowSymLinks</code> and
2213 <code>Includes</code> are set for the <code>/web/docs/spec</code>
2216 <div class="note"><h3>Note</h3>
2217 <p>Using <code>-IncludesNOEXEC</code> or
2218 <code>-Includes</code> disables server-side includes completely
2219 regardless of the previous setting.</p>
2222 <p>The default in the absence of any other settings is
2223 <code>All</code>.</p>
2226 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2227 <div class="directive-section"><h2><a name="Require" id="Require">Require</a> <a name="require" id="require">Directive</a></h2>
2228 <table class="directive">
2229 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Selects which authenticated users can access
2230 a resource</td></tr>
2231 <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>
2232 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2233 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2234 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2235 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2237 <p>This directive selects which authenticated users can access
2238 a directory. The allowed syntaxes are:</p>
2241 <dt><code>Require user <var>userid</var> [<var>userid</var>]
2243 <dd>Only the named users can access the resource.</dd>
2245 <dt><code>Require group <var>group-name</var> [<var>group-name</var>]
2247 <dd>Only users in the named groups can access the resource.</dd>
2249 <dt><code>Require valid-user</code></dt>
2250 <dd>All valid users can access the resource.</dd>
2253 <p><code class="directive">Require</code> must be accompanied by
2254 <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#authtype">AuthType</a></code> directives, and directives such
2255 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>
2256 and <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> (to
2257 define users and groups) in order to work correctly. Example:</p>
2259 <div class="example"><p><code>
2260 AuthType Basic<br />
2261 AuthName "Restricted Directory"<br />
2262 AuthUserFile /web/users<br />
2263 AuthGroupFile /web/groups<br />
2267 <p>Access controls which are applied in this way are effective for
2268 <strong>all</strong> methods. <strong>This is what is normally
2269 desired.</strong> If you wish to apply access controls only to
2270 specific methods, while leaving other methods unprotected, then
2271 place the <code class="directive">Require</code> statement into a
2272 <code class="directive"><a href="#limit"><Limit></a></code>
2277 <li><code class="directive"><a href="#satisfy">Satisfy</a></code></li>
2278 <li><code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code></li>
2281 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2282 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
2283 <table class="directive">
2284 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
2285 by Apache children</td></tr>
2286 <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>
2287 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2288 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2289 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2290 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2291 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2293 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2294 resource limit for all processes and the second parameter sets
2295 the maximum resource limit. Either parameter can be a number,
2296 or <code>max</code> to indicate to the server that the limit should
2297 be set to the maximum allowed by the operating system
2298 configuration. Raising the maximum resource limit requires that
2299 the server is running as <code>root</code>, or in the initial startup
2302 <p>This applies to processes forked off from Apache children
2303 servicing requests, not the Apache children themselves. This
2304 includes CGI scripts and SSI exec commands, but not any
2305 processes forked off from the Apache parent such as piped
2308 <p>CPU resource limits are expressed in seconds per
2313 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2314 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2317 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2318 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
2319 <table class="directive">
2320 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
2321 by Apache children</td></tr>
2322 <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>
2323 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2324 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2325 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2326 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2327 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2329 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2330 resource limit for all processes and the second parameter sets
2331 the maximum resource limit. Either parameter can be a number,
2332 or <code>max</code> to indicate to the server that the limit should
2333 be set to the maximum allowed by the operating system
2334 configuration. Raising the maximum resource limit requires that
2335 the server is running as <code>root</code>, or in the initial startup
2338 <p>This applies to processes forked off from Apache children
2339 servicing requests, not the Apache children themselves. This
2340 includes CGI scripts and SSI exec commands, but not any
2341 processes forked off from the Apache parent such as piped
2344 <p>Memory resource limits are expressed in bytes per
2349 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2350 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2353 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2354 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
2355 <table class="directive">
2356 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
2357 processes launched by Apache children</td></tr>
2358 <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>
2359 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2360 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2361 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2362 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2363 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2365 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2366 resource limit for all processes and the second parameter sets
2367 the maximum resource limit. Either parameter can be a number,
2368 or <code>max</code> to indicate to the server that the limit
2369 should be set to the maximum allowed by the operating system
2370 configuration. Raising the maximum resource limit requires that
2371 the server is running as <code>root</code>, or in the initial startup
2374 <p>This applies to processes forked off from Apache children
2375 servicing requests, not the Apache children themselves. This
2376 includes CGI scripts and SSI exec commands, but not any
2377 processes forked off from the Apache parent such as piped
2380 <p>Process limits control the number of processes per user.</p>
2382 <div class="note"><h3>Note</h3>
2383 <p>If CGI processes are <strong>not</strong> running
2384 under userids other than the web server userid, this directive
2385 will limit the number of processes that the server itself can
2386 create. Evidence of this situation will be indicated by
2387 <strong><code>cannot fork</code></strong> messages in the
2388 <code>error_log</code>.</p>
2393 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2394 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2397 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2398 <div class="directive-section"><h2><a name="Satisfy" id="Satisfy">Satisfy</a> <a name="satisfy" id="satisfy">Directive</a></h2>
2399 <table class="directive">
2400 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Interaction between host-level access control and
2401 user authentication</td></tr>
2402 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Satisfy Any|All</code></td></tr>
2403 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Satisfy All</code></td></tr>
2404 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2405 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2406 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2407 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2409 <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
2410 either <code>All</code> or <code>Any</code>. This directive is only
2411 useful if access to a particular area is being restricted by both
2412 username/password <em>and</em> client host address. In this case
2413 the default behavior (<code>All</code>) is to require that the client
2414 passes the address access restriction <em>and</em> enters a valid
2415 username and password. With the <code>Any</code> option the client will be
2416 granted access if they either pass the host restriction or enter a
2417 valid username and password. This can be used to password restrict
2418 an area, but to let clients from particular addresses in without
2419 prompting for a password.</p>
2421 <p>For example, if you wanted to let people on your network have
2422 unrestricted access to a portion of your website, but require that
2423 people outside of your network provide a password, you could use a
2424 configuration similar to the following:</p>
2426 <div class="example"><p><code>
2427 Require valid-user<br />
2428 Allow from 192.168.1<br />
2435 <li><code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code></li>
2436 <li><code class="directive"><a href="#require">Require</a></code></li>
2439 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2440 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
2441 <table class="directive">
2442 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
2444 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
2445 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
2446 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2447 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2448 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2449 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2450 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only<br />
2451 option <code>Registry-Strict</code> is available in Apache 2.0 and
2454 <p>This directive is used to control how Apache finds the
2455 interpreter used to run CGI scripts. The default technique is to
2456 use the interpreter pointed to by the <code>#!</code> line in the
2459 <p>Setting <code>ScriptInterpreterSource Registry</code> will
2460 cause the Windows Registry to be searched using the script file
2461 extension (e.g., <code>.pl</code>) as a search key.</p>
2463 <p>The option <code>Registry-Strict</code> which is new in Apache 2.0
2464 does the same as <code>Registry</code> but uses a more strict registry
2468 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2469 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
2470 <table class="directive">
2471 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
2472 messages sent to the client</td></tr>
2473 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var></code></td></tr>
2474 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2475 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2476 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2478 <p>The <code class="directive">ServerAdmin</code> sets the e-mail address
2479 that the server includes in any error messages it returns to the
2482 <p>It may be worth setting up a dedicated address for this, e.g.</p>
2484 <div class="example"><p><code>
2485 ServerAdmin www-admin@foo.example.com
2487 <p>as users do not always mention that they are talking about the
2491 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2492 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
2493 <table class="directive">
2494 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
2495 to name-virtual hosts</td></tr>
2496 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
2497 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2498 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2499 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2501 <p>The <code class="directive">ServerAlias</code> directive sets the
2502 alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
2504 <div class="example"><p><code>
2505 <VirtualHost *><br />
2506 ServerName server.domain.com<br />
2507 ServerAlias server server2.domain.com server2<br />
2509 </VirtualHost>
2514 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2517 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2518 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
2519 <table class="directive">
2520 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
2522 <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>
2523 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2524 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2525 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2526 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>In version 2.0, this
2527 directive supersedes the functionality of the <code class="directive">Port</code>
2528 directive from version 1.3.</td></tr>
2530 <p>The <code class="directive">ServerName</code> directive sets the hostname and
2531 port that the server uses to identify itself. This is used when
2532 creating redirection URLs. For example, if the name of the
2533 machine hosting the webserver is <code>simple.example.com</code>,
2534 but the machine also has the DNS alias <code>www.example.com</code>
2535 and you wish the webserver to be so identified, the following
2536 directive should be used:</p>
2538 <div class="example"><p><code>
2539 ServerName www.example.com:80
2542 <p>If no <code class="directive">ServerName</code> is specified, then the
2543 server attempts to deduce the hostname by performing a reverse
2544 lookup on the IP address. If no port is specified in the
2545 servername, then the server will use the port from the incoming
2546 request. For optimal reliability and predictability, you should
2547 specify an explicit hostname and port using the
2548 <code class="directive">ServerName</code> directive.</p>
2550 <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
2551 the <code class="directive">ServerName</code> inside a
2552 <code class="directive"><a href="#virtualhost"><VirtualHost></a></code>
2553 section specifies what hostname must appear in the request's
2554 <code>Host:</code> header to match this virtual host.</p>
2556 <p>See the description of the
2557 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive for
2558 settings which determine whether self-referential URL's (e.g., by the
2559 <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
2560 specified port, or to the port number given in the client's request.
2565 <li><a href="../dns-caveats.html">Issues Regarding DNS and
2567 <li><a href="../vhosts/">Apache virtual host
2568 documentation</a></li>
2569 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
2570 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
2571 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
2574 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2575 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
2576 <table class="directive">
2577 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
2578 is accessed by an incompatible browser</td></tr>
2579 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
2580 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2581 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2582 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2584 <p>The <code class="directive">ServerPath</code> directive sets the legacy
2585 URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
2589 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2592 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2593 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
2594 <table class="directive">
2595 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
2596 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
2597 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
2598 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2599 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2600 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2602 <p>The <code class="directive">ServerRoot</code> directive sets the
2603 directory in which the server lives. Typically it will contain the
2604 subdirectories <code>conf/</code> and <code>logs/</code>. Relative
2605 paths for other configuration files are taken as relative to this
2608 <div class="example"><h3>Example</h3><p><code>
2609 ServerRoot /home/httpd
2615 <li><a href="../invoking.html">the <code>-d</code>
2616 option to <code>httpd</code></a></li>
2617 <li><a href="../misc/security_tips.html#serverroot">the
2618 security tips</a> for information on how to properly set
2619 permissions on the <code class="directive">ServerRoot</code></li>
2622 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2623 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
2624 <table class="directive">
2625 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
2626 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
2627 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
2628 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2629 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2630 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2631 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2633 <p>The <code class="directive">ServerSignature</code> directive allows the
2634 configuration of a trailing footer line under server-generated
2635 documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
2636 listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
2637 would want to enable such a footer line is that in a chain of proxies,
2638 the user often has no possibility to tell which of the chained servers
2639 actually produced a returned error message.</p>
2641 <p>The <code>Off</code>
2642 setting, which is the default, suppresses the footer line (and is
2643 therefore compatible with the behavior of Apache-1.2 and
2644 below). The <code>On</code> setting simply adds a line with the
2645 server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
2646 and the <code>EMail</code> setting additionally creates a
2647 "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
2650 <p>After version 2.0.44, the details of the server version number
2651 presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
2655 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
2658 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2659 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
2660 <table class="directive">
2661 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the Server HTTP response
2663 <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>
2664 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
2665 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2666 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2667 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2669 <p>This directive controls whether <code>Server</code> response
2670 header field which is sent back to clients includes a
2671 description of the generic OS-type of the server as well as
2672 information about compiled-in modules.</p>
2675 <dt><code>ServerTokens Prod[uctOnly]</code></dt>
2677 <dd>Server sends (<em>e.g.</em>): <code>Server:
2680 <dt><code>ServerTokens Major</code></dt>
2682 <dd>Server sends (<em>e.g.</em>): <code>Server:
2683 Apache/2</code></dd>
2685 <dt><code>ServerTokens Minor</code></dt>
2687 <dd>Server sends (<em>e.g.</em>): <code>Server:
2688 Apache/2.0</code></dd>
2690 <dt><code>ServerTokens Min[imal]</code></dt>
2692 <dd>Server sends (<em>e.g.</em>): <code>Server:
2693 Apache/2.0.41</code></dd>
2695 <dt><code>ServerTokens OS</code></dt>
2697 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2700 <dt><code>ServerTokens Full</code> (or not specified)</dt>
2702 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2703 (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
2706 <p>This setting applies to the entire server, and cannot be
2707 enabled or disabled on a virtualhost-by-virtualhost basis.</p>
2709 <p>After version 2.0.44, this directive also controls the
2710 information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
2714 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
2717 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2718 <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
2719 <table class="directive">
2720 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
2722 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
2723 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2724 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2725 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2726 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2727 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved into the core in Apache 2.0</td></tr>
2729 <p>When placed into an <code>.htaccess</code> file or a
2730 <code class="directive"><a href="#directory"><Directory></a></code> or
2731 <code class="directive"><a href="#location"><Location></a></code>
2732 section, this directive forces all matching files to be parsed
2733 through the <a href="../handler.html">handler</a> given by
2734 <var>handler-name</var>. For example, if you had a directory you
2735 wanted to be parsed entirely as imagemap rule files, regardless
2736 of extension, you might put the following into an
2737 <code>.htaccess</code> file in that directory:</p>
2739 <div class="example"><p><code>
2740 SetHandler imap-file
2743 <p>Another example: if you wanted to have the server display a
2744 status report whenever a URL of
2745 <code>http://servername/status</code> was called, you might put
2746 the following into <code>httpd.conf</code>:</p>
2748 <div class="example"><p><code>
2749 <Location /status><br />
2750 <span class="indent">
2751 SetHandler server-status<br />
2756 <p>You can override an earlier defined <code class="directive">SetHandler</code>
2757 directive by using the value <code>None</code>.</p>
2761 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
2764 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2765 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
2766 <table class="directive">
2767 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
2769 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2770 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2771 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2772 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2773 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2775 <p>The <code class="directive">SetInputFilter</code> directive sets the
2776 filter or filters which will process client requests and POST
2777 input when they are received by the server. This is in addition to
2778 any filters defined elsewhere, including the
2779 <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
2782 <p>If more than one filter is specified, they must be separated
2783 by semicolons in the order in which they should process the
2788 <li><a href="../filter.html">Filters</a> documentation</li>
2791 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2792 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
2793 <table class="directive">
2794 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
2796 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2797 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2798 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</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">SetOutputFilter</code> directive sets the filters
2803 which will process responses from the server before they are
2804 sent to the client. This is in addition to any filters defined
2805 elsewhere, including the
2806 <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
2809 <p>For example, the following configuration will process all files
2810 in the <code>/www/data/</code> directory for server-side
2813 <div class="example"><p><code>
2814 <Directory /www/data/><br />
2815 <span class="indent">
2816 SetOutputFilter INCLUDES<br />
2821 <p>If more than one filter is specified, they must be separated
2822 by semicolons in the order in which they should process the
2827 <li><a href="../filter.html">Filters</a> documentation</li>
2830 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2831 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
2832 <table class="directive">
2833 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
2834 certain events before failing a request</td></tr>
2835 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
2836 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
2837 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2838 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2839 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2841 <p>The <code class="directive">TimeOut</code> directive currently defines
2842 the amount of time Apache will wait for three things:</p>
2845 <li>The total amount of time it takes to receive a GET
2848 <li>The amount of time between receipt of TCP packets on a
2849 POST or PUT request.</li>
2851 <li>The amount of time between ACKs on transmissions of TCP
2852 packets in responses.</li>
2855 <p>We plan on making these separately configurable at some point
2856 down the road. The timer used to default to 1200 before 1.2,
2857 but has been lowered to 300 which is still far more than
2858 necessary in most situations. It is not set any lower by
2859 default because there may still be odd places in the code where
2860 the timer is not reset when a packet is sent. </p>
2863 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2864 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
2865 <table class="directive">
2866 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
2868 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
2869 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName On</code></td></tr>
2870 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
2871 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2872 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2874 <p>In many situations Apache must construct a <em>self-referential</em>
2875 URL -- that is, a URL that refers back to the same server. With
2876 <code>UseCanonicalName On</code> Apache will use the hostname and port
2877 specified in the <code class="directive"><a href="#servername">ServerName</a></code>
2878 directive to construct the canonical name for the server. This name
2879 is used in all self-referential URLs, and for the values of
2880 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
2882 <p>With <code>UseCanonicalName Off</code> Apache will form
2883 self-referential URLs using the hostname and port supplied by
2884 the client if any are supplied (otherwise it will use the
2885 canonical name, as defined above). These values are the same
2886 that are used to implement <a href="../vhosts/name-based.html">name based virtual hosts</a>,
2887 and are available with the same clients. The CGI variables
2888 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
2889 constructed from the client supplied values as well.</p>
2891 <p>An example where this may be useful is on an intranet server
2892 where you have users connecting to the machine using short
2893 names such as <code>www</code>. You'll notice that if the users
2894 type a shortname, and a URL which is a directory, such as
2895 <code>http://www/splat</code>, <em>without the trailing
2896 slash</em> then Apache will redirect them to
2897 <code>http://www.domain.com/splat/</code>. If you have
2898 authentication enabled, this will cause the user to have to
2899 authenticate twice (once for <code>www</code> and once again
2900 for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
2901 FAQ on this subject for more information</a>). But if
2902 <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
2903 Apache will redirect to <code>http://www/splat/</code>.</p>
2905 <p>There is a third option, <code>UseCanonicalName DNS</code>,
2906 which is intended for use with mass IP-based virtual hosting to
2907 support ancient clients that do not provide a
2908 <code>Host:</code> header. With this option Apache does a
2909 reverse DNS lookup on the server IP address that the client
2910 connected to in order to work out self-referential URLs.</p>
2912 <div class="warning"><h3>Warning</h3>
2913 <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
2914 they may be broken by this option. The client is essentially free
2915 to give whatever value they want as a hostname. But if the CGI is
2916 only using <code>SERVER_NAME</code> to construct self-referential URLs
2917 then it should be just fine.</p>
2922 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
2923 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
2926 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2927 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost"><VirtualHost></a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
2928 <table class="directive">
2929 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
2930 hostname or IP address</td></tr>
2931 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><VirtualHost
2932 <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
2933 ...> ... </VirtualHost></code></td></tr>
2934 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2935 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2936 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2938 <p><code class="directive"><VirtualHost></code> and
2939 <code></VirtualHost></code> are used to enclose a group of
2940 directives that will apply only to a particular virtual host. Any
2941 directive that is allowed in a virtual host context may be
2942 used. When the server receives a request for a document on a
2943 particular virtual host, it uses the configuration directives
2944 enclosed in the <code class="directive"><VirtualHost></code>
2945 section. <var>Addr</var> can be:</p>
2948 <li>The IP address of the virtual host;</li>
2950 <li>A fully qualified domain name for the IP address of the
2953 <li>The character <code>*</code>, which is used only in combination with
2954 <code>NameVirtualHost *</code> to match all IP addresses; or</li>
2956 <li>The string <code>_default_</code>, which is used only
2957 with IP virtual hosting to catch unmatched IP addresses.</li>
2960 <div class="example"><h3>Example</h3><p><code>
2961 <VirtualHost 10.1.2.3><br />
2962 <span class="indent">
2963 ServerAdmin webmaster@host.foo.com<br />
2964 DocumentRoot /www/docs/host.foo.com<br />
2965 ServerName host.foo.com<br />
2966 ErrorLog logs/host.foo.com-error_log<br />
2967 TransferLog logs/host.foo.com-access_log<br />
2969 </VirtualHost>
2973 <p>IPv6 addresses must be specified in square brackets because
2974 the optional port number could not be determined otherwise. An
2975 IPv6 example is shown below:</p>
2977 <div class="example"><p><code>
2978 <VirtualHost [fe80::a00:20ff:fea7:ccea]><br />
2979 <span class="indent">
2980 ServerAdmin webmaster@host.example.com<br />
2981 DocumentRoot /www/docs/host.example.com<br />
2982 ServerName host.example.com<br />
2983 ErrorLog logs/host.example.com-error_log<br />
2984 TransferLog logs/host.example.com-access_log<br />
2986 </VirtualHost>
2989 <p>Each Virtual Host must correspond to a different IP address,
2990 different port number or a different host name for the server,
2991 in the former case the server machine must be configured to
2992 accept IP packets for multiple addresses. (If the machine does
2993 not have multiple network interfaces, then this can be
2994 accomplished with the <code>ifconfig alias</code> command -- if
2995 your OS supports it).</p>
2997 <div class="note"><h3>Note</h3>
2998 <p>The use of <code class="directive"><VirtualHost></code> does
2999 <strong>not</strong> affect what addresses Apache listens on. You
3000 may need to ensure that Apache is listening on the correct addresses
3001 using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
3004 <p>When using IP-based virtual hosting, the special name
3005 <code>_default_</code> can be specified in
3006 which case this virtual host will match any IP address that is
3007 not explicitly listed in another virtual host. In the absence
3008 of any <code>_default_</code> virtual host the "main" server config,
3009 consisting of all those definitions outside any VirtualHost
3010 section, is used when no IP-match occurs. (But note that any IP
3011 address that matches a <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> directive will use neither
3012 the "main" server config nor the <code>_default_</code> virtual host.
3013 See the <a href="../vhosts/name-based.html">name-based virtual hosting</a>
3014 documentation for further details.)</p>
3016 <p>You can specify a <code>:port</code> to change the port that is
3017 matched. If unspecified then it defaults to the same port as the
3018 most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
3019 statement of the main server. You may also specify <code>:*</code>
3020 to match all ports on that address. (This is recommended when used
3021 with <code>_default_</code>.)</p>
3023 <div class="warning"><h3>Security</h3>
3024 <p>See the <a href="../misc/security_tips.html">security tips</a>
3025 document for details on why your security could be compromised if the
3026 directory where logfiles are stored is writable by anyone other
3027 than the user that starts the server.</p>
3032 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
3033 <li><a href="../dns-caveats.html">Issues Regarding DNS and
3035 <li><a href="../bind.html">Setting
3036 which addresses and ports Apache uses</a></li>
3037 <li><a href="../sections.html">How <Directory>, <Location>
3038 and <Files> sections work</a> for an explanation of how these
3039 different sections are combined when a request is received</li>
3043 <div class="bottomlang">
3044 <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" title="Deutsch"> de </a> | <a href="../en/mod/core.html" hreflang="en" title="English"> en </a></p>
3045 </div><div id="footer">
3046 <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
3047 <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>