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>
23 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Core Apache HTTP Server features that are always
25 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Core</td></tr></table>
27 <div id="quickview"><h3 class="directives">Directives</h3>
29 <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
30 <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
31 <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
32 <li><img alt="" src="../images/down.gif" /> <a href="#addoutputfilterbytype">AddOutputFilterByType</a></li>
33 <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
34 <li><img alt="" src="../images/down.gif" /> <a href="#authname">AuthName</a></li>
35 <li><img alt="" src="../images/down.gif" /> <a href="#authtype">AuthType</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#directory"><Directory></a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch"><DirectoryMatch></a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#files"><Files></a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch"><FilesMatch></a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine"><IfDefine></a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule"><IfModule></a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#limit"><Limit></a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept"><LimitExcept></a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#location"><Location></a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch"><LocationMatch></a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#require">Require</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#satisfy">Satisfy</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost"><VirtualHost></a></li>
91 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
92 <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
93 <table class="directive">
94 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
95 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
96 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
97 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
98 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
99 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
100 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
101 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.30 and later</td></tr>
104 <p>This directive controls whether requests that contain trailing
105 pathname information that follows an actual filename (or
106 non-existent file in an existing directory) will be accepted or
107 rejected. The trailing pathname information can be made
108 available to scripts in the <code>PATH_INFO</code> environment
111 <p>For example, assume the location <code>/test/</code> points to
112 a directory that contains only the single file
113 <code>here.html</code>. Then requests for
114 <code>/test/here.html/more</code> and
115 <code>/test/nothere.html/more</code> both collect
116 <code>/more</code> as <code>PATH_INFO</code>.</p>
118 <p>The three possible arguments for the
119 <code class="directive">AcceptPathInfo</code> directive are:</p>
121 <dt><code>Off</code></dt><dd>A request will only be accepted if it
122 maps to a literal path that exists. Therefore a request with
123 trailing pathname information after the true filename such as
124 <code>/test/here.html/more</code> in the above example will return
125 a 404 NOT FOUND error.</dd>
127 <dt><code>On</code></dt><dd>A request will be accepted if a
128 leading path component maps to a file that exists. The above
129 example <code>/test/here.html/more</code> will be accepted if
130 <code>/test/here.html</code> maps to a valid file.</dd>
132 <dt><code>Default</code></dt><dd>The treatment of requests with
133 trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
134 The core handler for normal files defaults to rejecting
135 <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
136 <code>PATH_INFO</code> by default.</dd>
139 <p>The primary purpose of the <code>AcceptPathInfo</code>
140 directive is to allow you to override the handler's choice of
141 accepting or rejecting <code>PATH_INFO</code>. This override is required,
142 for example, when you use a <a href="../filter.html">filter</a>, such
143 as <a href="mod_include.html">INCLUDES</a>, to generate content
144 based on <code>PATH_INFO</code>. The core handler would usually reject
145 the request, so you can use the following configuration to enable
148 <div class="example"><p><code>
149 <Files "mypaths.shtml"><br />
150 <span class="indent">
151 Options +Includes<br />
152 SetOutputFilter INCLUDES<br />
153 AcceptPathInfo On<br />
160 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
161 <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
162 <table class="directive">
163 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
164 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
165 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
166 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
167 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
168 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
170 <p>While processing a request the server looks for
171 the first existing configuration file from this list of names in
172 every directory of the path to the document, if distributed
173 configuration files are <a href="#allowoverride">enabled for that
174 directory</a>. For example:</p>
176 <div class="example"><p><code>
180 <p>before returning the document
181 <code>/usr/local/web/index.html</code>, the server will read
182 <code>/.acl</code>, <code>/usr/.acl</code>,
183 <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
184 for directives, unless they have been disabled with</p>
186 <div class="example"><p><code>
187 <Directory /><br />
188 <span class="indent">
189 AllowOverride None<br />
196 <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
197 <li><a href="../configuring.html">Configuration Files</a></li>
198 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
201 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
202 <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
203 <table class="directive">
204 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default character set to be added for a
205 response without an explicit character set</td></tr>
206 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
207 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
208 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
209 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
210 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
211 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
213 <p>This directive specifies the name of the character set that
214 will be added to any response that does not have any parameter on
215 the content type in the HTTP headers. This will override any
216 character set specified in the body of the document via a
217 <code>META</code> tag. A setting of <code>AddDefaultCharset
218 Off</code> disables this
219 functionality. <code>AddDefaultCharset On</code> enables
220 Apache's internal default charset of <code>iso-8859-1</code> as
221 required by the directive. You can also specify an alternate
222 <var>charset</var> to be used. For example:</p>
224 <div class="example"><p><code>
225 AddDefaultCharset utf-8
229 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
230 <div class="directive-section"><h2><a name="AddOutputFilterByType" id="AddOutputFilterByType">AddOutputFilterByType</a> <a name="addoutputfilterbytype" id="addoutputfilterbytype">Directive</a></h2>
231 <table class="directive">
232 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>assigns an output filter to a particular MIME-type</td></tr>
233 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
234 <var>MIME-type</var> [<var>MIME-type</var>] ...</code></td></tr>
235 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
236 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
237 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
238 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
239 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later</td></tr>
241 <p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the
242 response MIME-type.</p>
244 <p>The following example uses the <code>DEFLATE</code> filter, which
245 is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all
246 output (either static or dynamic) which is labeled as
247 <code>text/html</code> or <code>text/plain</code> before it is sent
250 <div class="example"><p><code>
251 AddOutputFilterByType DEFLATE text/html text/plain
254 <p>If you want the content to be processed by more than one filter, their
255 names have to be separated by semicolons. It's also possible to use one
256 <code class="directive">AddOutputFilterByType</code> directive for each of
259 <p>The configuration below causes all script output labeled as
260 <code>text/html</code> to be processed at first by the
261 <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
264 <div class="example"><p><code>
265 <Location /cgi-bin/><br />
266 <span class="indent">
267 Options Includes<br />
268 AddOutputFilterByType INCLUDES;DEFLATE text/html<br />
273 <div class="warning"><h3>Note</h3>
274 <p>Enabling filters with <code class="directive">AddOutputFilterByType</code>
275 may fail partially or completely in some cases. For expample, no
276 filters are applied if the MIME-type could not be determined and falls
277 back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting,
278 even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the
281 <p>However, if you want to make sure, that the filters will be
282 applied, assign the content type to a resource explicitely, for
283 example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or
284 <code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the
285 content type within a (non-nph) CGI script is also safe.</p>
287 <p>The by-type output filters are never applied on proxy requests.</p>
292 <li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li>
293 <li><code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code></li>
294 <li><a href="../filter.html">filters</a></li>
297 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
298 <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
299 <table class="directive">
300 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
301 .htaccess files</td></tr>
302 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
303 [<var>directive-type</var>] ...</code></td></tr>
304 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr>
305 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
306 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
307 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
309 <p>When the server finds an <code>.htaccess</code> file (as
310 specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
311 it needs to know which directives declared in that file can override
312 earlier configuration directives.</p>
314 <div class="note"><h3>Only available in <Directory> sections</h3>
315 <code class="directive">AllowOverride</code> is valid only in
316 <code class="directive"><a href="#directory"><Directory></a></code>
317 sections, not in <code class="directive"><a href="#location"><Location></a></code> or <code class="directive"><a href="#files"><Files></a></code> sections.
320 <p>When this directive is set to <code>None</code>, then
321 <a href="#accessfilename">.htaccess</a> files are completely ignored.
322 In this case, the server will not even attempt to read
323 <code>.htaccess</code> files in the filesystem.</p>
325 <p>When this directive is set to <code>All</code>, then any
326 directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
327 <code>.htaccess</code> files.</p>
329 <p>The <var>directive-type</var> can be one of the following
330 groupings of directives.</p>
337 Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
338 <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
339 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
340 <code class="directive"><a href="#authname">AuthName</a></code>,
341 <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>
346 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>,
347 <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
348 <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove*
349 directives, <em>etc.</em>).</dd>
354 Allow use of the directives controlling directory indexing
355 (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
356 <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>,
357 <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
358 <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>,
364 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>
369 Allow use of the directives controlling specific directory
370 features (<code class="directive"><a href="#options">Options</a></code> and
371 <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).</dd>
376 <div class="example"><p><code>
377 AllowOverride AuthConfig Indexes
382 <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
383 <li><a href="../configuring.html">Configuration Files</a></li>
384 <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
387 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
388 <div class="directive-section"><h2><a name="AuthName" id="AuthName">AuthName</a> <a name="authname" id="authname">Directive</a></h2>
389 <table class="directive">
390 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Authorization realm for use in HTTP
391 authentication</td></tr>
392 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthName <var>auth-domain</var></code></td></tr>
393 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
394 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
395 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
396 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
398 <p>This directive sets the name of the authorization realm for a
399 directory. This realm is given to the client so that the user
400 knows which username and password to send.
401 <code class="directive">AuthName</code> takes a single argument; if the
402 realm name contains spaces, it must be enclosed in quotation
403 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
404 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
405 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
410 <div class="example"><p><code>
411 AuthName "Top Secret"
414 <p>The string provided for the <code>AuthName</code> is what will
415 appear in the password dialog provided by most browsers.</p>
419 <li><a href="../howto/auth.html">Authentication, Authorization, and
420 Access Control</a></li>
423 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
424 <div class="directive-section"><h2><a name="AuthType" id="AuthType">AuthType</a> <a name="authtype" id="authtype">Directive</a></h2>
425 <table class="directive">
426 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Type of user authentication</td></tr>
427 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthType Basic|Digest</code></td></tr>
428 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
429 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
430 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
431 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
433 <p>This directive selects the type of user authentication for a
434 directory. Only <code>Basic</code> and <code>Digest</code> are
435 currently implemented.
437 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
438 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
439 <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
444 <li><a href="../howto/auth.html">Authentication, Authorization,
445 and Access Control</a></li>
448 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
449 <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
450 <table class="directive">
451 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
453 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
454 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
455 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
456 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
457 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
458 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
460 <p>This directive is used to control how Apache finds the
461 interpreter used to run CGI scripts. For example, setting
462 <code>CGIMapExtension sys:\foo.nlm .foo</code> will
463 cause all CGI script files with a <code>.foo</code> extension to
464 be passed to the FOO interpreter.</p>
467 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
468 <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
469 <table class="directive">
470 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of Content-MD5 HTTP Response
472 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
473 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
474 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
475 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
476 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
477 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
479 <p>This directive enables the generation of
480 <code>Content-MD5</code> headers as defined in RFC1864
481 respectively RFC2068.</p>
483 <p>MD5 is an algorithm for computing a "message digest"
484 (sometimes called "fingerprint") of arbitrary-length data, with
485 a high degree of confidence that any alterations in the data
486 will be reflected in alterations in the message digest.</p>
488 <p>The <code>Content-MD5</code> header provides an end-to-end
489 message integrity check (MIC) of the entity-body. A proxy or
490 client may check this header for detecting accidental
491 modification of the entity-body in transit. Example header:</p>
493 <div class="example"><p><code>
494 Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
497 <p>Note that this can cause performance problems on your server
498 since the message digest is computed on every request (the
499 values are not cached).</p>
501 <p><code>Content-MD5</code> is only sent for documents served
502 by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
503 SSI documents, output from CGI scripts, and byte range responses
504 do not have this header.</p>
507 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
508 <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
509 <table class="directive">
510 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>MIME content-type that will be sent if the
511 server cannot determine a type in any other way</td></tr>
512 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>MIME-type</var></code></td></tr>
513 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType text/plain</code></td></tr>
514 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
515 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
516 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
517 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
519 <p>There will be times when the server is asked to provide a
520 document whose type cannot be determined by its MIME types
523 <p>The server must inform the client of the content-type of the
524 document, so in the event of an unknown type it uses the
525 <code>DefaultType</code>. For example:</p>
527 <div class="example"><p><code>
528 DefaultType image/gif
531 <p>would be appropriate for a directory which contained many GIF
532 images with filenames missing the <code>.gif</code> extension.</p>
534 <p>Note that unlike <code class="directive"><a href="#forcetype">ForceType</a></code>, this directive only
535 provides the default mime-type. All other mime-type definitions,
536 including filename extensions, that might identify the media type
537 will override this default.</p>
540 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
541 <div class="directive-section"><h2><a name="Directory" id="Directory"><Directory></a> <a name="directory" id="directory">Directive</a></h2>
542 <table class="directive">
543 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
544 named file-system directory and sub-directories</td></tr>
545 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Directory <var>directory-path</var>>
546 ... </Directory></code></td></tr>
547 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
548 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
549 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
551 <p><code class="directive"><Directory></code> and
552 <code></Directory></code> are used to enclose a group of
553 directives that will apply only to the named directory and
554 sub-directories of that directory. Any directive that is allowed
555 in a directory context may be used. <var>Directory-path</var> is
556 either the full path to a directory, or a wild-card string using
557 Unix shell-style matching. In a wild-card string, <code>?</code> matches
558 any single character, and <code>*</code> matches any sequences of
559 characters. You may also use <code>[]</code> character ranges. None
560 of the wildcards match a `/' character, so <code><Directory
561 /*/public_html></code> will not match
562 <code>/home/user/public_html</code>, but <code><Directory
563 /home/*/public_html></code> will match. Example:</p>
565 <div class="example"><p><code>
566 <Directory /usr/local/httpd/htdocs><br />
567 <span class="indent">
568 Options Indexes FollowSymLinks<br />
574 <p>Be careful with the <var>directory-path</var> arguments:
575 They have to literally match the filesystem path which Apache uses
576 to access the files. Directives applied to a particular
577 <code><Directory></code> will not apply to files accessed from
578 that same directory via a different path, such as via different symbolic
583 expressions can also be used, with the addition of the
584 <code>~</code> character. For example:</p>
586 <div class="example"><p><code>
587 <Directory ~ "^/www/.*/[0-9]{3}">
590 <p>would match directories in <code>/www/</code> that consisted of
593 <p>If multiple (non-regular expression) <code class="directive"><Directory></code> sections
594 match the directory (or one of its parents) containing a document,
595 then the directives are applied in the order of shortest match
596 first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
599 <div class="example"><p><code>
600 <Directory /><br />
601 <span class="indent">
602 AllowOverride None<br />
604 </Directory><br />
606 <Directory /home/><br />
607 <span class="indent">
608 AllowOverride FileInfo<br />
613 <p>for access to the document <code>/home/web/dir/doc.html</code>
617 <li>Apply directive <code>AllowOverride None</code>
618 (disabling <code>.htaccess</code> files).</li>
620 <li>Apply directive <code>AllowOverride FileInfo</code> (for
621 directory <code>/home</code>).</li>
623 <li>Apply any <code>FileInfo</code> directives in
624 <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
625 <code>/home/web/dir/.htaccess</code> in that order.</li>
628 <p>Regular expressions are not considered until after all of the
629 normal sections have been applied. Then all of the regular
630 expressions are tested in the order they appeared in the
631 configuration file. For example, with</p>
633 <div class="example"><p><code>
634 <Directory ~ abc$><br />
635 <span class="indent">
636 # ... directives here ...<br />
641 <p>the regular expression section won't be considered until after
642 all normal <code class="directive"><Directory></code>s and
643 <code>.htaccess</code> files have been applied. Then the regular
644 expression will match on <code>/home/abc/public_html/abc</code> and
645 the corresponding <code class="directive"><Directory></code> will
648 <p><strong>Note that the default Apache access for
649 <code><Directory /></code> is <code>Allow from All</code>.
650 This means that Apache will serve any file mapped from an URL. It is
651 recommended that you change this with a block such
654 <div class="example"><p><code>
655 <Directory /><br />
656 <span class="indent">
657 Order Deny,Allow<br />
663 <p><strong>and then override this for directories you
664 <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
665 details.</strong></p>
667 <p>The directory sections occur in the <code>httpd.conf</code> file.
668 <code class="directive"><Directory></code> directives
669 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>
673 <li><a href="../sections.html">How <Directory>,
674 <Location> and <Files> sections work</a> for an
675 explanation of how these different sections are combined when a
676 request is received</li>
679 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
680 <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch"><DirectoryMatch></a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
681 <table class="directive">
682 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
683 file-system directories matching a regular expression and their
684 subdirectories</td></tr>
685 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><DirectoryMatch <var>regex</var>>
686 ... </DirectoryMatch></code></td></tr>
687 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
688 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
689 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
691 <p><code class="directive"><DirectoryMatch></code> and
692 <code></DirectoryMatch></code> are used to enclose a group
693 of directives which will apply only to the named directory and
694 sub-directories of that directory, the same as <code class="directive"><a href="#directory"><Directory></a></code>. However, it
695 takes as an argument a regular expression. For example:</p>
697 <div class="example"><p><code>
698 <DirectoryMatch "^/www/.*/[0-9]{3}">
701 <p>would match directories in <code>/www/</code> that consisted of three
706 <li><code class="directive"><a href="#directory"><Directory></a></code> for
707 a description of how regular expressions are mixed in with normal
708 <code class="directive"><Directory></code>s</li>
709 <li><a href="../sections.html">How <Directory>, <Location> and
710 <Files> sections work</a> for an explanation of how these different
711 sections are combined when a request is received</li>
714 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
715 <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
716 <table class="directive">
717 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
718 from the web</td></tr>
719 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
720 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
721 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
722 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
723 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
725 <p>This directive sets the directory from which <code>httpd</code>
726 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
727 path from the requested URL to the document root to make the
728 path to the document. Example:</p>
730 <div class="example"><p><code>
731 DocumentRoot /usr/web
735 <code>http://www.my.host.com/index.html</code> refers to
736 <code>/usr/web/index.html</code>.</p>
738 <p>The <code class="directive">DocumentRoot</code> should be specified without
739 a trailing slash.</p>
743 <li><a href="../urlmapping.html">Mapping URLs to Filesystem
747 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
748 <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
749 <table class="directive">
750 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
751 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
752 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
753 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
754 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
755 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
756 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
758 <p>This directive controls whether the <code>httpd</code> may use
759 memory-mapping if it needs to read the contents of a file during
760 delivery. By default, when the handling of a request requires
761 access to the data within a file -- for example, when delivering a
762 server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache
763 memory-maps the file if the OS supports it.</p>
765 <p>This memory-mapping sometimes yields a performance improvement.
766 But in some environments, it is better to disable the memory-mapping
767 to prevent operational problems:</p>
770 <li>On some multiprocessor systems, memory-mapping can reduce the
771 performance of the <code>httpd</code>.</li>
772 <li>With an NFS-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code>,
773 the <code>httpd</code> may crash due to a segmentation fault if a file
774 is deleted or truncated while the <code>httpd</code> has it
778 <p>For server configurations that are vulnerable to these problems,
779 you should disable memory-mapping of delivered files by specifying:</p>
781 <div class="example"><p><code>
785 <p>For NFS mounted files, this feature may be disabled explicitly for
786 the offending files by specifying:</p>
788 <div class="example"><p><code>
789 <Directory "/path-to-nfs-files">
790 <span class="indent">
797 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
798 <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
799 <table class="directive">
800 <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>
801 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
802 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile On</code></td></tr>
803 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
804 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
805 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
806 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
807 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later</td></tr>
809 <p>This directive controls whether <code>httpd</code> may use the sendfile
810 support from the kernel to transmit file contents to the client.
811 By default, when the handling of a request requires no access
812 to the data within a file -- for example, when delivering a
813 static file -- Apache uses sendfile to deliver the file contents
814 without ever reading the file if the OS supports it.</p>
816 <p>This sendfile mechanism avoids seperate read and send operations,
817 and buffer allocations. But on some platforms or within some
818 filesystems, it is better to disable this feature to avoid
819 operational problems:</p>
822 <li>Some platforms may have broken sendfile support that the build
823 system did not detect, especially if the binaries were built on
824 another box and moved to such a machine with broken sendfile
826 <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS or SMB),
827 the kernel may be unable to serve the network file through
831 <p>For server configurations that are vulnerable to these problems,
832 you should disable this feature by specifying:</p>
834 <div class="example"><p><code>
838 <p>For NFS or SMB mounted files, this feature may be disabled explicitly
839 for the offending files by specifying:</p>
841 <div class="example"><p><code>
842 <Directory "/path-to-nfs-files">
843 <span class="indent">
850 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
851 <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
852 <table class="directive">
853 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
854 in case of an error</td></tr>
855 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
856 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
857 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
858 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
859 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
860 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Quoting syntax for text messages is different in Apache
863 <p>In the event of a problem or error, Apache can be configured
864 to do one of four things,</p>
867 <li>output a simple hardcoded error message</li>
869 <li>output a customized message</li>
871 <li>redirect to a local <var>URL-path</var> to handle the
874 <li>redirect to an external <var>URL</var> to handle the
878 <p>The first option is the default, while options 2-4 are
879 configured using the <code class="directive">ErrorDocument</code>
880 directive, which is followed by the HTTP response code and a URL
881 or a message. Apache will sometimes offer additional information
882 regarding the problem/error.</p>
884 <p>URLs can begin with a slash (/) for local URLs, or be a full
885 URL which the client can resolve. Alternatively, a message can
886 be provided to be displayed by the browser. Examples:</p>
888 <div class="example"><p><code>
889 ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
890 ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
891 ErrorDocument 401 /subscription_info.html<br />
892 ErrorDocument 403 "Sorry can't allow you access today"
895 <p>Note that when you specify an <code class="directive">ErrorDocument</code>
896 that points to a remote URL (ie. anything with a method such as
897 <code>http</code> in front of it), Apache will send a redirect to the
898 client to tell it where to find the document, even if the
899 document ends up being on the same server. This has several
900 implications, the most important being that the client will not
901 receive the original error status code, but instead will
902 receive a redirect status code. This in turn can confuse web
903 robots and other clients which try to determine if a URL is
904 valid using the status code. In addition, if you use a remote
905 URL in an <code>ErrorDocument 401</code>, the client will not
906 know to prompt the user for a password since it will not
907 receive the 401 status code. Therefore, <strong>if you use an
908 <code>ErrorDocument 401</code> directive then it must refer to a local
909 document.</strong></p>
911 <p>Microsoft Internet Explorer (MSIE) will by default ignore
912 server-generated error messages when they are "too small" and substitute
913 its own "friendly" error messages. The size threshold varies depending on
914 the type of error, but in general, if you make your error document
915 greater than 512 bytes, then MSIE will show the server-generated
916 error rather than masking it. More information is available in
917 Microsoft Knowledgebase article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
919 <p>Prior to version 2.0, messages were indicated by prefixing
920 them with a single unmatched double quote character.</p>
924 <li><a href="../custom-error.html">documentation of
925 customizable responses</a></li>
928 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
929 <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
930 <table class="directive">
931 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
932 <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>
933 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ErrorLog logs/error_log (Unix)<br />
934 ErrorLog logs/error.log (Windows and OS/2)</code></td></tr>
935 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
936 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
937 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
939 <p>The <code class="directive">ErrorLog</code> directive sets the name of
940 the file to which the server will log any errors it encounters. If
941 the <var>file-path</var> is not absolute (in general: does not begin
942 with a slash (/)) then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
944 <div class="example"><h3>Example</h3><p><code>
945 ErrorLog /var/log/httpd/error_log
948 <p>If the <var>file-path</var>
949 begins with a pipe (|) then it is assumed to be a command to spawn
950 to handle the error log.</p>
952 <div class="example"><h3>Example</h3><p><code>
953 ErrorLog "|/usr/local/bin/httpd_errors"
956 <p>Using <code>syslog</code> instead of a filename enables logging
957 via syslogd(8) if the system supports it. The default is to use
958 syslog facility <code>local7</code>, but you can override this by
959 using the <code>syslog:<var>facility</var></code> syntax where
960 <var>facility</var> can be one of the names usually documented in
963 <div class="example"><h3>Example</h3><p><code>
967 <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
968 document for details on why your security could be compromised
969 if the directory where logfiles are stored is writable by
970 anyone other than the user that starts the server.</p>
974 <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
975 <li><a href="../logs.html">Apache Log Files</a></li>
978 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
979 <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
980 <table class="directive">
981 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
982 HTTP response header</td></tr>
983 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
984 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
985 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
986 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
987 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
988 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
991 The <code class="directive">FileETag</code> directive configures the file
992 attributes that are used to create the <code>ETag</code> (entity
993 tag) response header field when the document is based on a file.
994 (The <code>ETag</code> value is used in cache management to save
995 network bandwidth.) In Apache 1.3.22 and earlier, the
996 <code>ETag</code> value was <em>always</em> formed
997 from the file's inode, size, and last-modified time (mtime). The
998 <code class="directive">FileETag</code> directive allows you to choose
999 which of these -- if any -- should be used. The recognized keywords are:
1003 <dt><strong>INode</strong></dt>
1004 <dd>The file's i-node number will be included in the calculation</dd>
1005 <dt><strong>MTime</strong></dt>
1006 <dd>The date and time the file was last modified will be included</dd>
1007 <dt><strong>Size</strong></dt>
1008 <dd>The number of bytes in the file will be included</dd>
1009 <dt><strong>All</strong></dt>
1010 <dd>All available fields will be used. This is equivalent to:
1011 <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
1012 <dt><strong>None</strong></dt>
1013 <dd>If a document is file-based, no <code>ETag</code> field will be
1014 included in the response</dd>
1017 <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
1018 keywords may be prefixed with either <code>+</code> or <code>-</code>,
1019 which allow changes to be made to the default setting inherited
1020 from a broader scope. Any keyword appearing without such a prefix
1021 immediately and completely cancels the inherited setting.</p>
1023 <p>If a directory's configuration includes
1024 <code>FileETag INode MTime Size</code>, and a
1025 subdirectory's includes <code>FileETag -INode</code>,
1026 the setting for that subdirectory (which will be inherited by
1027 any sub-subdirectories that don't override it) will be equivalent to
1028 <code>FileETag MTime Size</code>.</p>
1031 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1032 <div class="directive-section"><h2><a name="Files" id="Files"><Files></a> <a name="files" id="files">Directive</a></h2>
1033 <table class="directive">
1034 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
1036 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Files <var>filename</var>> ... </Files></code></td></tr>
1037 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1038 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1039 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1040 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1042 <p>The <code class="directive"><Files></code> directive
1043 limits the scope of the enclosed directives by filename. It is comparable
1044 to the <code class="directive"><a href="#directory"><Directory></a></code>
1045 and <code class="directive"><a href="#location"><Location></a></code>
1046 directives. It should be matched with a <code></Files></code>
1047 directive. The directives given within this section will be applied to
1048 any object with a basename (last component of filename) matching the
1049 specified filename. <code class="directive"><Files></code>
1050 sections are processed in the order they appear in the
1051 configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1052 <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location"><Location></a></code> sections. Note
1053 that <code class="directive"><Files></code> can be nested
1054 inside <code class="directive"><a href="#directory"><Directory></a></code> sections to restrict the
1055 portion of the filesystem they apply to.</p>
1057 <p>The <var>filename</var> argument should include a filename, or
1058 a wild-card string, where <code>?</code> matches any single character,
1059 and <code>*</code> matches any sequences of characters. Extended regular
1060 expressions can also be used, with the addition of the
1061 <code>~</code> character. For example:</p>
1063 <div class="example"><p><code>
1064 <Files ~ "\.(gif|jpe?g|png)$">
1067 <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
1070 <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
1071 <code>.htaccess</code> files. This allows users to control access to
1072 their own files, at a file-by-file level.</p>
1077 <li><a href="../sections.html">How <Directory>, <Location>
1078 and <Files> sections work</a> for an explanation of how these
1079 different sections are combined when a request is received</li>
1082 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1083 <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch"><FilesMatch></a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
1084 <table class="directive">
1085 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
1087 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><FilesMatch <var>regex</var>> ... </FilesMatch></code></td></tr>
1088 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1089 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1090 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1091 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1093 <p>The <code class="directive"><FilesMatch></code> directive
1094 limits the scope of the enclosed directives by filename, just as the
1095 <code class="directive"><a href="#files"><Files></a></code> directive
1096 does. However, it accepts a regular expression. For example:</p>
1098 <div class="example"><p><code>
1099 <FilesMatch "\.(gif|jpe?g|png)$">
1102 <p>would match most common Internet graphics formats.</p>
1106 <li><a href="../sections.html">How <Directory>, <Location>
1107 and <Files> sections work</a> for an explanation of how these
1108 different sections are combined when a request is received</li>
1111 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1112 <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
1113 <table class="directive">
1114 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
1115 MIME content-type</td></tr>
1116 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>MIME-type</var>|none</code></td></tr>
1117 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
1118 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
1119 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1120 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1121 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache 2.0</td></tr>
1123 <p>When placed into an <code>.htaccess</code> file or a
1124 <code class="directive"><a href="#directory"><Directory></a></code>, or
1125 <code class="directive"><a href="#location"><Location></a></code> or
1126 <code class="directive"><a href="#files"><Files></a></code>
1127 section, this directive forces all matching files to be served
1128 with the content type identification given by
1129 <var>MIME-type</var>. For example, if you had a directory full of
1130 GIF files, but did not want to label them all with <code>.gif</code>,
1131 you might want to use:</p>
1133 <div class="example"><p><code>
1137 <p>Note that unlike <code class="directive"><a href="#defaulttype">DefaultType</a></code>,
1138 this directive overrides all mime-type associations, including
1139 filename extensions, that might identify the media type.</p>
1141 <p>You can override any <code class="directive">ForceType</code> setting
1142 by using the value of <code>none</code>:</p>
1144 <div class="example"><p><code>
1145 # force all files to be image/gif:<br />
1146 <Location /images><br />
1147 <span class="indent">
1148 ForceType image/gif<br />
1150 </Location><br />
1152 # but normal mime-type associations here:<br />
1153 <Location /images/mixed><br />
1154 <span class="indent">
1155 ForceType none<br />
1161 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1162 <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
1163 <table class="directive">
1164 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
1165 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
1166 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
1167 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1168 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1169 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1171 <p>This directive enables DNS lookups so that host names can be
1172 logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1173 The value <code>Double</code> refers to doing double-reverse
1174 DNS lookup. That is, after a reverse lookup is performed, a forward
1175 lookup is then performed on that result. At least one of the ip
1176 addresses in the forward lookup must match the original
1177 address. (In "tcpwrappers" terminology this is called
1178 <code>PARANOID</code>.)</p>
1180 <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
1181 used for controlling access by hostname, a double reverse lookup
1182 will be performed. This is necessary for security. Note that the
1183 result of this double-reverse isn't generally available unless you
1184 set <code>HostnameLookups Double</code>. For example, if only
1185 <code>HostnameLookups On</code> and a request is made to an object
1186 that is protected by hostname restrictions, regardless of whether
1187 the double-reverse fails or not, CGIs will still be passed the
1188 single-reverse result in <code>REMOTE_HOST</code>.</p>
1190 <p>The default is <code>Off</code> in order to save the network
1191 traffic for those sites that don't truly need the reverse
1192 lookups done. It is also better for the end users because they
1193 don't have to suffer the extra latency that a lookup entails.
1194 Heavily loaded sites should leave this directive
1195 <code>Off</code>, since DNS lookups can take considerable
1196 amounts of time. The utility <a href="../programs/logresolve.html">logresolve</a>, compiled by default
1197 to the <code>bin</code> subdirectory of your installation directory, can
1198 be used to look up host names from logged IP addresses offline.</p>
1201 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1202 <div class="directive-section"><h2><a name="IfDefine" id="IfDefine"><IfDefine></a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
1203 <table class="directive">
1204 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
1205 if a test is true at startup</td></tr>
1206 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfDefine [!]<var>parameter-name</var>> ...
1207 </IfDefine></code></td></tr>
1208 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1209 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1210 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1211 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1213 <p>The <code><IfDefine <var>test</var>>...</IfDefine>
1214 </code> section is used to mark directives that are conditional. The
1215 directives within an <code class="directive"><IfDefine></code>
1216 section are only processed if the <var>test</var> is true. If <var>
1217 test</var> is false, everything between the start and end markers is
1220 <p>The <var>test</var> in the <code class="directive"><IfDefine></code> section directive can be one of two forms:</p>
1223 <li><var>parameter-name</var></li>
1225 <li><code>!</code><var>parameter-name</var></li>
1228 <p>In the former case, the directives between the start and end
1229 markers are only processed if the parameter named
1230 <var>parameter-name</var> is defined. The second format reverses
1231 the test, and only processes the directives if
1232 <var>parameter-name</var> is <strong>not</strong> defined.</p>
1234 <p>The <var>parameter-name</var> argument is a define as given on
1235 the <code>httpd</code> command line via <code>-D<var>parameter-</var>
1236 </code>, at the time the server was started.</p>
1238 <p><code class="directive"><IfDefine></code> sections are
1239 nest-able, which can be used to implement simple
1240 multiple-parameter tests. Example:</p>
1242 <div class="example"><p><code>
1243 httpd -DReverseProxy ...<br />
1246 <IfDefine ReverseProxy><br />
1247 <span class="indent">
1248 LoadModule rewrite_module modules/mod_rewrite.so<br />
1249 LoadModule proxy_module modules/libproxy.so<br />
1255 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1256 <div class="directive-section"><h2><a name="IfModule" id="IfModule"><IfModule></a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
1257 <table class="directive">
1258 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
1259 presence or absence of a specific module</td></tr>
1260 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfModule [!]<var>module-name</var>> ...
1261 </IfModule></code></td></tr>
1262 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1263 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1264 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1265 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1267 <p>The <code><IfModule <var>test</var>>...</IfModule></code>
1268 section is used to mark directives that are conditional on the presence of
1269 a specific module. The directives within an <code class="directive"><IfModule></code> section are only processed if the <var>test</var>
1270 is true. If <var>test</var> is false, everything between the start and
1271 end markers is ignored.</p>
1273 <p>The <var>test</var> in the <code class="directive"><IfModule></code> section directive can be one of two forms:</p>
1276 <li><var>module name</var></li>
1278 <li>!<var>module name</var></li>
1281 <p>In the former case, the directives between the start and end
1282 markers are only processed if the module named <var>module
1283 name</var> is included in Apache -- either compiled in or
1284 dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
1285 and only processes the directives if <var>module name</var> is
1286 <strong>not</strong> included.</p>
1288 <p>The <var>module name</var> argument is the file name of the
1289 module, at the time it was compiled. For example,
1290 <code>mod_rewrite.c</code>. If a module consists of several
1291 source files, use the name of the file containing the string
1292 <code>STANDARD20_MODULE_STUFF</code>.</p>
1294 <p><code class="directive"><IfModule></code> sections are
1295 nest-able, which can be used to implement simple multiple-module
1298 <div class="note">This section should only be used if you need to have one
1299 configuration file that works whether or not a specific module
1300 is available. In normal operation, directives need not be
1301 placed in <code class="directive"><IfModule></code>
1305 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1306 <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
1307 <table class="directive">
1308 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
1309 the server configuration files</td></tr>
1310 <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>
1311 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1312 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1313 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1314 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later</td></tr>
1316 <p>This directive allows inclusion of other configuration files
1317 from within the server configuration files.</p>
1319 <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used to
1320 include several files at once, in alphabetical order. In
1321 addition, if <code class="directive">Include</code> points to a directory,
1322 rather than a file, Apache will read all files in that directory
1323 and any subdirectory. But including entire directories is not
1324 recommended, because it is easy to accidentally leave temporary
1325 files in a directory that can cause <code>httpd</code> to
1328 <p>The file path specified may be an absolute path (i.e.
1329 starting with a slash), or may be relative to the
1330 <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
1334 <div class="example"><p><code>
1335 Include /usr/local/apache2/conf/ssl.conf<br />
1336 Include /usr/local/apache2/conf/vhosts/*.conf
1339 <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
1341 <div class="example"><p><code>
1342 Include conf/ssl.conf<br />
1343 Include conf/vhosts/*.conf
1346 <p>Running <code>apachectl configtest</code> will give you a list
1347 of the files that are being processed during the configuration
1350 <div class="example"><p><code>
1351 root@host# apachectl configtest<br />
1352 Processing config file: /usr/local/apache2/conf/ssl.conf<br />
1353 Processing config file: /usr/local/apache2/conf/vhosts/vhost1.conf<br />
1354 Processing config file: /usr/local/apache2/conf/vhosts/vhost2.conf<br />
1360 <li><a href="../programs/apachectl.html">apachectl</a></li>
1363 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1364 <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
1365 <table class="directive">
1366 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
1367 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
1368 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
1369 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1370 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1371 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1373 <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1374 connection feature of HTTP/1.1 provide long-lived HTTP sessions
1375 which allow multiple requests to be sent over the same TCP
1376 connection. In some cases this has been shown to result in an
1377 almost 50% speedup in latency times for HTML documents with
1378 many images. To enable Keep-Alive connections, set
1379 <code>KeepAlive On</code>.</p>
1381 <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1382 used if they are specifically requested by a client. In
1383 addition, a Keep-Alive connection with an HTTP/1.0 client can
1384 only be used when the length of the content is known in
1385 advance. This implies that dynamic content such as CGI output,
1386 SSI pages, and server-generated directory listings will
1387 generally not use Keep-Alive connections to HTTP/1.0 clients.
1388 For HTTP/1.1 clients, persistent connections are the default
1389 unless otherwise specified. If the client requests it, chunked
1390 encoding will be used in order to send content of unknown
1391 length over persistent connections.</p>
1395 <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
1398 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1399 <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
1400 <table class="directive">
1401 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
1402 requests on a persistent connection</td></tr>
1403 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>seconds</var></code></td></tr>
1404 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 15</code></td></tr>
1405 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1406 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1407 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1409 <p>The number of seconds Apache will wait for a subsequent
1410 request before closing the connection. Once a request has been
1411 received, the timeout value specified by the
1412 <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
1414 <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
1415 may cause performance problems in heavily loaded servers. The
1416 higher the timeout, the more server processes will be kept
1417 occupied waiting on connections with idle clients.</p>
1420 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1421 <div class="directive-section"><h2><a name="Limit" id="Limit"><Limit></a> <a name="limit" id="limit">Directive</a></h2>
1422 <table class="directive">
1423 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
1425 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Limit <var>method</var> [<var>method</var>] ... > ...
1426 </Limit></code></td></tr>
1427 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1428 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1429 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1430 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1432 <p>Access controls are normally effective for
1433 <strong>all</strong> access methods, and this is the usual
1434 desired behavior. <strong>In the general case, access control
1435 directives should not be placed within a
1436 <code class="directive"><Limit></code> section.</strong></p>
1438 <p>The purpose of the <code class="directive"><Limit></code>
1439 directive is to restrict the effect of the access controls to the
1440 nominated HTTP methods. For all other methods, the access
1441 restrictions that are enclosed in the <code class="directive"><Limit></code> bracket <strong>will have no
1442 effect</strong>. The following example applies the access control
1443 only to the methods <code>POST</code>, <code>PUT</code>, and
1444 <code>DELETE</code>, leaving all other methods unprotected:</p>
1446 <div class="example"><p><code>
1447 <Limit POST PUT DELETE><br />
1448 <span class="indent">
1449 Require valid-user<br />
1454 <p>The method names listed can be one or more of: <code>GET</code>,
1455 <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
1456 <code>CONNECT</code>, <code>OPTIONS</code>, <code>TRACE</code>,
1457 <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
1458 <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
1459 <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
1460 case-sensitive.</strong> If <code>GET</code> is used it will also
1461 restrict <code>HEAD</code> requests.</p>
1464 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1465 <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept"><LimitExcept></a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
1466 <table class="directive">
1467 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
1468 except the named ones</td></tr>
1469 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LimitExcept <var>method</var> [<var>method</var>] ... > ...
1470 </LimitExcept></code></td></tr>
1471 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1472 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1473 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1474 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1476 <p><code class="directive"><LimitExcept></code> and
1477 <code></LimitExcept></code> are used to enclose
1478 a group of access control directives which will then apply to any
1479 HTTP access method <strong>not</strong> listed in the arguments;
1480 i.e., it is the opposite of a <code class="directive"><a href="#limit"><Limit></a></code> section and can be used to control
1481 both standard and nonstandard/unrecognized methods. See the
1482 documentation for <code class="directive"><a href="#limit"><Limit></a></code> for more details.</p>
1486 <div class="example"><p><code>
1487 <LimitExcept POST GET><br />
1488 <span class="indent">
1489 Require valid-user<br />
1496 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1497 <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
1498 <table class="directive">
1499 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
1500 from the client</td></tr>
1501 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
1502 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
1503 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1504 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1505 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1506 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1508 <p>This directive specifies the number of <var>bytes</var> from 0
1509 (meaning unlimited) to 2147483647 (2GB) that are allowed in a
1510 request body. The default value is defined by the compile-time
1511 constant <code>DEFAULT_LIMIT_REQUEST_BODY</code> (0 as
1514 <p>The <code class="directive">LimitRequestBody</code> directive allows
1515 the user to set a limit on the allowed size of an HTTP request
1516 message body within the context in which the directive is given
1517 (server, per-directory, per-file or per-location). If the client
1518 request exceeds that limit, the server will return an error
1519 response instead of servicing the request. The size of a normal
1520 request message body will vary greatly depending on the nature of
1521 the resource and the methods allowed on that resource. CGI scripts
1522 typically use the message body for retrieving form information.
1523 Implementations of the <code>PUT</code> method will require
1524 a value at least as large as any representation that the server
1525 wishes to accept for that resource.</p>
1527 <p>This directive gives the server administrator greater
1528 control over abnormal client request behavior, which may be
1529 useful for avoiding some forms of denial-of-service
1532 <p>If, for example, you are permitting file upload to a particular
1533 location, and wish to limit the size of the uploaded file to 100K,
1534 you might use the following directive:</p>
1536 <div class="example"><p><code>
1537 LimitRequestBody 102400
1542 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1543 <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
1544 <table class="directive">
1545 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
1546 will be accepted from the client</td></tr>
1547 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
1548 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
1549 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</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><var>Number</var> is an integer from 0 (meaning unlimited) to
1554 32767. The default value is defined by the compile-time
1555 constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
1558 <p>The <code class="directive">LimitRequestFields</code> directive allows
1559 the server administrator to modify the limit on the number of
1560 request header fields allowed in an HTTP request. A server needs
1561 this value to be larger than the number of fields that a normal
1562 client request might include. The number of request header fields
1563 used by a client rarely exceeds 20, but this may vary among
1564 different client implementations, often depending upon the extent
1565 to which a user has configured their browser to support detailed
1566 content negotiation. Optional HTTP extensions are often expressed
1567 using request header fields.</p>
1569 <p>This directive gives the server administrator greater
1570 control over abnormal client request behavior, which may be
1571 useful for avoiding some forms of denial-of-service attacks.
1572 The value should be increased if normal clients see an error
1573 response from the server that indicates too many fields were
1574 sent in the request.</p>
1578 <div class="example"><p><code>
1579 LimitRequestFields 50
1584 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1585 <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
1586 <table class="directive">
1587 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
1589 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldsize <var>bytes</var></code></td></tr>
1590 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldsize 8190</code></td></tr>
1591 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1592 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1593 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1595 <p>This directive specifies the number of <var>bytes</var> from 0
1596 to the value of the compile-time constant
1597 <code>DEFAULT_LIMIT_REQUEST_FIELDSIZE</code> (8190 as
1598 distributed) that will be allowed in an HTTP request
1601 <p>The <code class="directive">LimitRequestFieldSize</code> directive
1602 allows the server administrator to reduce the limit on the allowed
1603 size of an HTTP request header field below the normal input buffer
1604 size compiled with the server. A server needs this value to be
1605 large enough to hold any one header field from a normal client
1606 request. The size of a normal request header field will vary
1607 greatly among different client implementations, often depending
1608 upon the extent to which a user has configured their browser to
1609 support detailed content negotiation.</p>
1611 <p>This directive gives the server administrator greater
1612 control over abnormal client request behavior, which may be
1613 useful for avoiding some forms of denial-of-service attacks.</p>
1617 <div class="example"><p><code>
1618 LimitRequestFieldSize 4094
1621 <div class="note">Under normal conditions, the value should not be changed from
1626 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1627 <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
1628 <table class="directive">
1629 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
1630 from the client</td></tr>
1631 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
1632 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
1633 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1634 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1635 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1637 <p>This directive sets the number of <var>bytes</var> from 0 to
1638 the value of the compile-time constant
1639 <code>DEFAULT_LIMIT_REQUEST_LINE</code> (8190 as distributed)
1640 that will be allowed on the HTTP request-line.</p>
1642 <p>The <code class="directive">LimitRequestLine</code> directive allows
1643 the server administrator to reduce the limit on the allowed size
1644 of a client's HTTP request-line below the normal input buffer size
1645 compiled with the server. Since the request-line consists of the
1646 HTTP method, URI, and protocol version, the
1647 <code class="directive">LimitRequestLine</code> directive places a
1648 restriction on the length of a request-URI allowed for a request
1649 on the server. A server needs this value to be large enough to
1650 hold any of its resource names, including any information that
1651 might be passed in the query part of a <code>GET</code> request.</p>
1653 <p>This directive gives the server administrator greater
1654 control over abnormal client request behavior, which may be
1655 useful for avoiding some forms of denial-of-service attacks.</p>
1659 <div class="example"><p><code>
1660 LimitRequestLine 4094
1663 <div class="note">Under normal conditions, the value should not be changed from
1667 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1668 <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
1669 <table class="directive">
1670 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
1671 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
1672 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
1673 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
1674 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
1675 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1676 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1678 <p>Limit (in bytes) on maximum size of an XML-based request
1679 body. A value of <code>0</code> will disable any checking.</p>
1683 <div class="example"><p><code>
1684 LimitXMLRequestBody 0
1689 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1690 <div class="directive-section"><h2><a name="Location" id="Location"><Location></a> <a name="location" id="location">Directive</a></h2>
1691 <table class="directive">
1692 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
1694 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Location
1695 <var>URL-path</var>|<var>URL</var>> ... </Location></code></td></tr>
1696 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1697 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1698 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1700 <p>The <code class="directive"><Location></code> directive
1701 limits the scope of the enclosed directives by URL. It is similar to the
1702 <code class="directive"><a href="#directory"><Directory></a></code>
1703 directive, and starts a subsection which is terminated with a
1704 <code></Location></code> directive. <code class="directive"><Location></code> sections are processed in the
1705 order they appear in the configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
1706 <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files"><Files></a></code> sections.</p>
1708 <p>Note that URLs do not have to line up with the filesystem at
1709 all, it should be emphasized that <code class="directive"><Location></code> operates completely
1710 outside the filesystem.</p>
1712 <p>For all origin (non-proxy) requests, the URL to be matched is a
1713 URL-path of the form <code>/path/</code>. No scheme, hostname,
1714 port, or query string may be included. For proxy requests, the
1715 URL to be matched is of the form
1716 <code>scheme://servername/path</code>, and you must include the
1719 <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
1720 any single character, and <code>*</code> matches any sequences of
1724 expressions can also be used, with the addition of the
1725 <code>~</code> character. For example:</p>
1727 <div class="example"><p><code>
1728 <Location ~ "/(extra|special)/data">
1731 <p>would match URLs that contained the substring <code>/extra/data</code>
1732 or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch"><LocationMatch></a></code> behaves
1733 identical to the regex version of <code class="directive"><Location></code>.</p>
1735 <p>The <code class="directive"><Location></code>
1736 functionality is especially useful when combined with the
1737 <code class="directive"><a href="#sethandler">SetHandler</a></code>
1738 directive. For example, to enable status requests, but allow them
1739 only from browsers at <code>foo.com</code>, you might use:</p>
1741 <div class="example"><p><code>
1742 <Location /status><br />
1743 <span class="indent">
1744 SetHandler server-status<br />
1745 Order Deny,Allow<br />
1747 Allow from .foo.com<br />
1752 <div class="note"><h3>Note about / (slash)</h3>
1753 <p>The slash character has special meaning depending on where in a
1754 URL it appears. People may be used to its behavior in the filesystem
1755 where multiple adjacent slashes are frequently collapsed to a single
1756 slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
1757 <code>/home/foo</code>). In URL-space this is not necessarily true.
1758 The <code class="directive"><a href="#locationmatch"><LocationMatch></a></code>
1759 directive and the regex version of <code class="directive"><Location></code> require you to explicitly specify multiple
1760 slashes if that is your intention.</p>
1762 <p>For example, <code><LocationMatch ^/abc></code> would match
1763 the request URL <code>/abc</code> but not the request URL <code>
1764 //abc</code>. The (non-regex) <code class="directive"><Location></code> directive behaves similarly when used for
1765 proxy requests. But when (non-regex) <code class="directive"><Location></code> is used for non-proxy requests it will
1766 implicitly match multiple slashes with a single slash. For example,
1767 if you specify <code><Location /abc/def></code> and the
1768 request is to <code>/abc//def</code> then it will match.</p>
1773 <li><a href="../sections.html">How <Directory>, <Location>
1774 and <Files> sections work</a> for an explanation of how these
1775 different sections are combined when a request is received</li>
1778 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1779 <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch"><LocationMatch></a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
1780 <table class="directive">
1781 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
1782 matching URLs</td></tr>
1783 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LocationMatch
1784 <var>regex</var>> ... </LocationMatch></code></td></tr>
1785 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1786 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1787 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1789 <p>The <code class="directive"><LocationMatch></code> directive
1790 limits the scope of the enclosed directives by URL, in an identical manner
1791 to <code class="directive"><a href="#location"><Location></a></code>. However,
1792 it takes a regular expression as an argument instead of a simple
1793 string. For example:</p>
1795 <div class="example"><p><code>
1796 <LocationMatch "/(extra|special)/data">
1799 <p>would match URLs that contained the substring <code>/extra/data</code>
1800 or <code>/special/data</code>.</p>
1804 <li><a href="../sections.html">How <Directory>, <Location>
1805 and <Files> sections work</a> for an explanation of how these
1806 different sections are combined when a request is received</li>
1809 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1810 <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
1811 <table class="directive">
1812 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
1813 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel <var>level</var></code></td></tr>
1814 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
1815 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1816 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1817 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1819 <p><code class="directive">LogLevel</code> adjusts the verbosity of the
1820 messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
1821 <var>level</var>s are available, in order of decreasing
1824 <table class="bordered">
1826 <th><strong>Level</strong> </th>
1828 <th><strong>Description</strong> </th>
1830 <th><strong>Example</strong> </th>
1834 <td><code>emerg</code> </td>
1836 <td>Emergencies - system is unusable.</td>
1838 <td>"Child cannot open lock file. Exiting"</td>
1842 <td><code>alert</code> </td>
1844 <td>Action must be taken immediately.</td>
1846 <td>"getpwuid: couldn't determine user name from uid"</td>
1850 <td><code>crit</code> </td>
1852 <td>Critical Conditions.</td>
1854 <td>"socket: Failed to get a socket, exiting child"</td>
1858 <td><code>error</code> </td>
1860 <td>Error conditions.</td>
1862 <td>"Premature end of script headers"</td>
1866 <td><code>warn</code> </td>
1868 <td>Warning conditions.</td>
1870 <td>"child process 1234 did not exit, sending another
1875 <td><code>notice</code> </td>
1877 <td>Normal but significant condition.</td>
1879 <td>"httpd: caught SIGBUS, attempting to dump core in
1884 <td><code>info</code> </td>
1886 <td>Informational.</td>
1888 <td>"Server seems busy, (you may need to increase
1889 StartServers, or Min/MaxSpareServers)..."</td>
1893 <td><code>debug</code> </td>
1895 <td>Debug-level messages</td>
1897 <td>"Opening config file ..."</td>
1901 <p>When a particular level is specified, messages from all
1902 other levels of higher significance will be reported as well.
1903 <em>E.g.</em>, when <code>LogLevel info</code> is specified,
1904 then messages with log levels of <code>notice</code> and
1905 <code>warn</code> will also be posted.</p>
1907 <p>Using a level of at least <code>crit</code> is
1912 <div class="example"><p><code>
1917 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1918 <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
1919 <table class="directive">
1920 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
1921 connection</td></tr>
1922 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
1923 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
1924 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1925 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1926 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1928 <p>The <code class="directive">MaxKeepAliveRequests</code> directive
1929 limits the number of requests allowed per connection when
1930 <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
1931 set to <code>0</code>, unlimited requests will be allowed. We
1932 recommend that this setting be kept to a high value for maximum
1933 server performance.</p>
1937 <div class="example"><p><code>
1938 MaxKeepAliveRequests 500
1942 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1943 <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
1944 <table class="directive">
1945 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
1947 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
1948 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
1949 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
1950 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
1952 <p>The <code class="directive">NameVirtualHost</code> directive is a
1953 required directive if you want to configure <a href="../vhosts/">name-based virtual hosts</a>.</p>
1955 <p>Although <var>addr</var> can be hostname it is recommended
1956 that you always use an IP address, e.g.</p>
1958 <div class="example"><p><code>
1959 NameVirtualHost 111.22.33.44
1962 <p>With the <code class="directive">NameVirtualHost</code> directive you
1963 specify the IP address on which the server will receive requests
1964 for the name-based virtual hosts. This will usually be the address
1965 to which your name-based virtual host names resolve. In cases
1966 where a firewall or other proxy receives the requests and forwards
1967 them on a different IP address to the server, you must specify the
1968 IP address of the physical interface on the machine which will be
1969 servicing the requests. If you have multiple name-based hosts on
1970 multiple addresses, repeat the directive for each address.</p>
1972 <div class="note"><h3>Note</h3>
1973 <p>Note, that the "main server" and any <code>_default_</code> servers
1974 will <strong>never</strong> be served for a request to a
1975 <code class="directive">NameVirtualHost</code> IP Address (unless for some
1976 reason you specify <code class="directive">NameVirtualHost</code> but then
1977 don't define any <code class="directive">VirtualHost</code>s for that
1981 <p>Optionally you can specify a port number on which the
1982 name-based virtual hosts should be used, e.g.</p>
1984 <div class="example"><p><code>
1985 NameVirtualHost 111.22.33.44:8080
1988 <p>IPv6 addresses must be enclosed in square brackets, as shown
1989 in the following example:</p>
1991 <div class="example"><p><code>
1992 NameVirtualHost [fe80::a00:20ff:fea7:ccea]:8080
1995 <p>To receive requests on all interfaces, you can use an argument of
1998 <div class="example"><p><code>
2002 <div class="note"><h3>Argument to <code class="directive"><VirtualHost></code>
2004 <p>Note that the argument to the <code class="directive"><VirtualHost></code> directive must
2005 exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
2007 <div class="example"><p><code>
2008 NameVirtualHost 1.2.3.4<br />
2009 <VirtualHost 1.2.3.4><br />
2011 </VirtualHost><br />
2017 <li><a href="../vhosts/">Virtual Hosts
2018 documentation</a></li>
2021 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2022 <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
2023 <table class="directive">
2024 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
2026 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
2027 [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
2028 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
2029 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2030 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
2031 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2032 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2034 <p>The <code class="directive">Options</code> directive controls which
2035 server features are available in a particular directory.</p>
2037 <p><var>option</var> can be set to <code>None</code>, in which
2038 case none of the extra features are enabled, or one or more of
2042 <dt><code>All</code></dt>
2044 <dd>All options except for <code>MultiViews</code>. This is the default
2047 <dt><code>ExecCGI</code></dt>
2050 Execution of CGI scripts is permitted.</dd>
2052 <dt><code>FollowSymLinks</code></dt>
2056 The server will follow symbolic links in this directory.
2058 <p>Even though the server follows the symlink it does <em>not</em>
2059 change the pathname used to match against <code class="directive"><a href="#directory"><Directory></a></code> sections.</p>
2060 <p>Note also, that this option <strong>gets ignored</strong> if set
2061 inside a <code class="directive"><a href="#location"><Location></a></code>
2065 <dt><code>Includes</code></dt>
2068 Server-side includes are permitted.</dd>
2070 <dt><code>IncludesNOEXEC</code></dt>
2074 Server-side includes are permitted, but the <code>#exec cmd</code>
2075 and <code>#exec cgi</code> are disabled. It is still possible to
2076 <code>#include virtual</code> CGI scripts from
2077 <code class="directive">ScriptAlias</code>e'd directories.</dd>
2079 <dt><code>Indexes</code></dt>
2082 If a URL which maps to a directory is requested, and the
2083 there is no <code class="directive">DirectoryIndex</code> (<em>e.g.</em>,
2084 <code>index.html</code>) in that directory, then the server will
2085 return a formatted listing of the directory.</dd>
2087 <dt><code>MultiViews</code></dt>
2090 <a href="../content-negotiation.html">Content negotiated</a>
2091 "MultiViews" are allowed.</dd>
2093 <dt><code>SymLinksIfOwnerMatch</code></dt>
2097 The server will only follow symbolic links for which the target
2098 file or directory is owned by the same user id as the link.<br /> <strong>Note</strong>: this option gets ignored if set inside
2099 a <code class="directive"><a href="#location"><Location></a></code>
2102 <p>Normally, if multiple <code class="directive">Options</code> could apply to a
2103 directory, then the most specific one is taken complete; the
2104 options are not merged. However if <em>all</em> the options on
2105 the <code class="directive">Options</code> directive are preceded by a
2106 <code>+</code> or <code>-</code>
2107 symbol, the options are merged. Any options preceded by a <code>+</code>
2108 are added to the options currently in force, and any options
2109 preceded by a <code>-</code> are removed from the options currently in
2112 <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
2114 <div class="example"><p><code>
2115 <Directory /web/docs><br />
2116 <span class="indent">
2117 Options Indexes FollowSymLinks<br />
2119 </Directory><br />
2121 <Directory /web/docs/spec><br />
2122 <span class="indent">
2123 Options Includes<br />
2128 <p>then only <code>Includes</code> will be set for the
2129 <code>/web/docs/spec</code> directory. However if the second
2130 <code class="directive">Options</code> directive uses the <code>+</code> and
2131 <code>-</code> symbols:</p>
2133 <div class="example"><p><code>
2134 <Directory /web/docs><br />
2135 <span class="indent">
2136 Options Indexes FollowSymLinks<br />
2138 </Directory><br />
2140 <Directory /web/docs/spec><br />
2141 <span class="indent">
2142 Options +Includes -Indexes<br />
2147 <p>then the options <code>FollowSymLinks</code> and
2148 <code>Includes</code> are set for the <code>/web/docs/spec</code>
2151 <div class="note"><h3>Note</h3>
2152 <p>Using <code>-IncludesNOEXEC</code> or
2153 <code>-Includes</code> disables server-side includes completely
2154 regardless of the previous setting.</p>
2157 <p>The default in the absence of any other settings is
2158 <code>All</code>.</p>
2161 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2162 <div class="directive-section"><h2><a name="Require" id="Require">Require</a> <a name="require" id="require">Directive</a></h2>
2163 <table class="directive">
2164 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Selects which authenticated users can access
2165 a resource</td></tr>
2166 <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>
2167 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2168 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2169 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2170 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2172 <p>This directive selects which authenticated users can access
2173 a directory. The allowed syntaxes are:</p>
2176 <dt><code>Require user <var>userid</var> [<var>userid</var>]
2178 <dd>Only the named users can access the resource.</dd>
2180 <dt><code>Require group <var>group-name</var> [<var>group-name</var>]
2182 <dd>Only users in the named groups can access the resource.</dd>
2184 <dt><code>Require valid-user</code></dt>
2185 <dd>All valid users can access the resource.</dd>
2188 <p><code class="directive">Require</code> must be accompanied by
2189 <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#authtype">AuthType</a></code> directives, and directives such
2190 as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>
2191 and <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> (to
2192 define users and groups) in order to work correctly. Example:</p>
2194 <div class="example"><p><code>
2195 AuthType Basic<br />
2196 AuthName "Restricted Directory"<br />
2197 AuthUserFile /web/users<br />
2198 AuthGroupFile /web/groups<br />
2202 <p>Access controls which are applied in this way are effective for
2203 <strong>all</strong> methods. <strong>This is what is normally
2204 desired.</strong> If you wish to apply access controls only to
2205 specific methods, while leaving other methods unprotected, then
2206 place the <code class="directive">Require</code> statement into a
2207 <code class="directive"><a href="#limit"><Limit></a></code>
2212 <li><code class="directive"><a href="#satisfy">Satisfy</a></code></li>
2213 <li><code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code></li>
2216 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2217 <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
2218 <table class="directive">
2219 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
2220 by Apache children</td></tr>
2221 <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>
2222 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2223 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2224 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2225 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2226 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2228 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2229 resource limit for all processes and the second parameter sets
2230 the maximum resource limit. Either parameter can be a number,
2231 or <code>max</code> to indicate to the server that the limit should
2232 be set to the maximum allowed by the operating system
2233 configuration. Raising the maximum resource limit requires that
2234 the server is running as <code>root</code>, or in the initial startup
2237 <p>This applies to processes forked off from Apache children
2238 servicing requests, not the Apache children themselves. This
2239 includes CGI scripts and SSI exec commands, but not any
2240 processes forked off from the Apache parent such as piped
2243 <p>CPU resource limits are expressed in seconds per
2248 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2249 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2252 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2253 <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
2254 <table class="directive">
2255 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
2256 by Apache children</td></tr>
2257 <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>
2258 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2259 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2260 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2261 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2262 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2264 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2265 resource limit for all processes and the second parameter sets
2266 the maximum resource limit. Either parameter can be a number,
2267 or <code>max</code> to indicate to the server that the limit should
2268 be set to the maximum allowed by the operating system
2269 configuration. Raising the maximum resource limit requires that
2270 the server is running as <code>root</code>, or in the initial startup
2273 <p>This applies to processes forked off from Apache children
2274 servicing requests, not the Apache children themselves. This
2275 includes CGI scripts and SSI exec commands, but not any
2276 processes forked off from the Apache parent such as piped
2279 <p>Memory resource limits are expressed in bytes per
2284 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2285 <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
2288 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2289 <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
2290 <table class="directive">
2291 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
2292 processes launched by Apache children</td></tr>
2293 <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>
2294 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
2295 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2296 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2297 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2298 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2300 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2301 resource limit for all processes and the second parameter sets
2302 the maximum resource limit. Either parameter can be a number,
2303 or <code>max</code> to indicate to the server that the limit
2304 should be set to the maximum allowed by the operating system
2305 configuration. Raising the maximum resource limit requires that
2306 the server is running as <code>root</code>, or in the initial startup
2309 <p>This applies to processes forked off from Apache children
2310 servicing requests, not the Apache children themselves. This
2311 includes CGI scripts and SSI exec commands, but not any
2312 processes forked off from the Apache parent such as piped
2315 <p>Process limits control the number of processes per user.</p>
2317 <div class="note"><h3>Note</h3>
2318 <p>If CGI processes are <strong>not</strong> running
2319 under userids other than the web server userid, this directive
2320 will limit the number of processes that the server itself can
2321 create. Evidence of this situation will be indicated by
2322 <strong><code>cannot fork</code></strong> messages in the
2323 <code>error_log</code>.</p>
2328 <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
2329 <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
2332 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2333 <div class="directive-section"><h2><a name="Satisfy" id="Satisfy">Satisfy</a> <a name="satisfy" id="satisfy">Directive</a></h2>
2334 <table class="directive">
2335 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Interaction between host-level access control and
2336 user authentication</td></tr>
2337 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Satisfy Any|All</code></td></tr>
2338 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Satisfy All</code></td></tr>
2339 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
2340 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
2341 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2342 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2344 <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
2345 either <code>All</code> or <code>Any</code>. This directive is only
2346 useful if access to a particular area is being restricted by both
2347 username/password <em>and</em> client host address. In this case
2348 the default behavior (<code>All</code>) is to require that the client
2349 passes the address access restriction <em>and</em> enters a valid
2350 username and password. With the <code>Any</code> option the client will be
2351 granted access if they either pass the host restriction or enter a
2352 valid username and password. This can be used to password restrict
2353 an area, but to let clients from particular addresses in without
2354 prompting for a password.</p>
2356 <p>For example, if you wanted to let people on your network have
2357 unrestricted access to a portion of your website, but require that
2358 people outside of your network provide a password, you could use a
2359 configuration similar to the following:</p>
2361 <div class="example"><p><code>
2362 Require valid-user<br />
2363 Allow from 192.168.1<br />
2370 <li><code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code></li>
2371 <li><code class="directive"><a href="#require">Require</a></code></li>
2374 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2375 <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
2376 <table class="directive">
2377 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
2379 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
2380 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
2381 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2382 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2383 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2384 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2385 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only<br />
2386 option <code>Registry-Strict</code> is available in Apache 2.0 and
2389 <p>This directive is used to control how Apache finds the
2390 interpreter used to run CGI scripts. The default technique is to
2391 use the interpreter pointed to by the <code>#!</code> line in the
2394 <p>Setting <code>ScriptInterpreterSource Registry</code> will
2395 cause the Windows Registry to be searched using the script file
2396 extension (e.g., <code>.pl</code>) as a search key.</p>
2398 <p>The option <code>Registry-Strict</code> which is new in Apache 2.0
2399 does the same as <code>Registry</code> but uses a more strict registry
2403 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2404 <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
2405 <table class="directive">
2406 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
2407 messages sent to the client</td></tr>
2408 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var></code></td></tr>
2409 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2410 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2411 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2413 <p>The <code class="directive">ServerAdmin</code> sets the e-mail address
2414 that the server includes in any error messages it returns to the
2417 <p>It may be worth setting up a dedicated address for this, e.g.</p>
2419 <div class="example"><p><code>
2420 ServerAdmin www-admin@foo.example.com
2422 <p>as users do not always mention that they are talking about the
2426 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2427 <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
2428 <table class="directive">
2429 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
2430 to name-virtual hosts</td></tr>
2431 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
2432 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2433 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2434 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2436 <p>The <code class="directive">ServerAlias</code> directive sets the
2437 alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>.</p>
2439 <div class="example"><p><code>
2440 <VirtualHost *><br />
2441 ServerName server.domain.com<br />
2442 ServerAlias server server2.domain.com server2<br />
2444 </VirtualHost>
2449 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2452 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2453 <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
2454 <table class="directive">
2455 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
2457 <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>
2458 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2459 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2460 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2461 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>In version 2.0, this
2462 directive supersedes the functionality of the <code class="directive">Port</code>
2463 directive from version 1.3.</td></tr>
2465 <p>The <code class="directive">ServerName</code> directive sets the hostname and
2466 port that the server uses to identify itself. This is used when
2467 creating redirection URLs. For example, if the name of the
2468 machine hosting the webserver is <code>simple.example.com</code>,
2469 but the machine also has the DNS alias <code>www.example.com</code>
2470 and you wish the webserver to be so identified, the following
2471 directive should be used:</p>
2473 <div class="example"><p><code>
2474 ServerName www.example.com:80
2477 <p>If no <code class="directive">ServerName</code> is specified, then the
2478 server attempts to deduce the hostname by performing a reverse
2479 lookup on the IP address. If no port is specified in the
2480 servername, then the server will use the port from the incoming
2481 request. For optimal reliability and predictability, you should
2482 specify an explicit hostname and port using the
2483 <code class="directive">ServerName</code> directive.</p>
2485 <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
2486 the <code class="directive">ServerName</code> inside a
2487 <code class="directive"><a href="#virtualhost"><VirtualHost></a></code>
2488 section specifies what hostname must appear in the request's
2489 <code>Host:</code> header to match this virtual host.</p>
2491 <p>See the description of the
2492 <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive for
2493 settings which determine whether self-referential URL's (e.g., by the
2494 <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
2495 specified port, or to the port number given in the client's request.
2500 <li><a href="../dns-caveats.html">Issues Regarding DNS and
2502 <li><a href="../vhosts/">Apache virtual host
2503 documentation</a></li>
2504 <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
2505 <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
2506 <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
2509 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2510 <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
2511 <table class="directive">
2512 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
2513 is accessed by an incompatible browser</td></tr>
2514 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
2515 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
2516 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2517 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2519 <p>The <code class="directive">ServerPath</code> directive sets the legacy
2520 URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
2524 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2527 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2528 <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
2529 <table class="directive">
2530 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
2531 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
2532 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
2533 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2534 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2535 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2537 <p>The <code class="directive">ServerRoot</code> directive sets the
2538 directory in which the server lives. Typically it will contain the
2539 subdirectories <code>conf/</code> and <code>logs/</code>. Relative
2540 paths for other configuration files are taken as relative to this
2543 <div class="example"><h3>Example</h3><p><code>
2544 ServerRoot /home/httpd
2550 <li><a href="../invoking.html">the <code>-d</code>
2551 option to <code>httpd</code></a></li>
2552 <li><a href="../misc/security_tips.html#serverroot">the
2553 security tips</a> for information on how to properly set
2554 permissions on the <code class="directive">ServerRoot</code></li>
2557 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2558 <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
2559 <table class="directive">
2560 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
2561 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
2562 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
2563 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2564 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
2565 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2566 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2568 <p>The <code class="directive">ServerSignature</code> directive allows the
2569 configuration of a trailing footer line under server-generated
2570 documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
2571 listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
2572 would want to enable such a footer line is that in a chain of proxies,
2573 the user often has no possibility to tell which of the chained servers
2574 actually produced a returned error message.</p>
2576 <p>The <code>Off</code>
2577 setting, which is the default, suppresses the footer line (and is
2578 therefore compatible with the behavior of Apache-1.2 and
2579 below). The <code>On</code> setting simply adds a line with the
2580 server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
2581 and the <code>EMail</code> setting additionally creates a
2582 "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
2585 <p>After version 2.0.44, the details of the server version number
2586 presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
2590 <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
2593 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2594 <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
2595 <table class="directive">
2596 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the Server HTTP response
2598 <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>
2599 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
2600 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2601 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2602 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2604 <p>This directive controls whether <code>Server</code> response
2605 header field which is sent back to clients includes a
2606 description of the generic OS-type of the server as well as
2607 information about compiled-in modules.</p>
2610 <dt><code>ServerTokens Prod[uctOnly]</code></dt>
2612 <dd>Server sends (<em>e.g.</em>): <code>Server:
2615 <dt><code>ServerTokens Major</code></dt>
2617 <dd>Server sends (<em>e.g.</em>): <code>Server:
2618 Apache/2</code></dd>
2620 <dt><code>ServerTokens Minor</code></dt>
2622 <dd>Server sends (<em>e.g.</em>): <code>Server:
2623 Apache/2.0</code></dd>
2625 <dt><code>ServerTokens Min[imal]</code></dt>
2627 <dd>Server sends (<em>e.g.</em>): <code>Server:
2628 Apache/2.0.41</code></dd>
2630 <dt><code>ServerTokens OS</code></dt>
2632 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2635 <dt><code>ServerTokens Full</code> (or not specified)</dt>
2637 <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
2638 (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
2641 <p>This setting applies to the entire server, and cannot be
2642 enabled or disabled on a virtualhost-by-virtualhost basis.</p>
2644 <p>After version 2.0.44, this directive also controls the
2645 information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
2649 <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
2652 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2653 <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
2654 <table class="directive">
2655 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
2657 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
2658 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2659 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2660 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2661 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2662 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved into the core in Apache 2.0</td></tr>
2664 <p>When placed into an <code>.htaccess</code> file or a
2665 <code class="directive"><a href="#directory"><Directory></a></code> or
2666 <code class="directive"><a href="#location"><Location></a></code>
2667 section, this directive forces all matching files to be parsed
2668 through the <a href="../handler.html">handler</a> given by
2669 <var>handler-name</var>. For example, if you had a directory you
2670 wanted to be parsed entirely as imagemap rule files, regardless
2671 of extension, you might put the following into an
2672 <code>.htaccess</code> file in that directory:</p>
2674 <div class="example"><p><code>
2675 SetHandler imap-file
2678 <p>Another example: if you wanted to have the server display a
2679 status report whenever a URL of
2680 <code>http://servername/status</code> was called, you might put
2681 the following into <code>httpd.conf</code>:</p>
2683 <div class="example"><p><code>
2684 <Location /status><br />
2685 <span class="indent">
2686 SetHandler server-status<br />
2693 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
2696 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2697 <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
2698 <table class="directive">
2699 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
2701 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2702 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2703 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2704 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2705 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2707 <p>The <code class="directive">SetInputFilter</code> directive sets the
2708 filter or filters which will process client requests and POST
2709 input when they are received by the server. This is in addition to
2710 any filters defined elsewhere, including the
2711 <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
2714 <p>If more than one filter is specified, they must be separated
2715 by semicolons in the order in which they should process the
2720 <li><a href="../filter.html">Filters</a> documentation</li>
2723 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2724 <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
2725 <table class="directive">
2726 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
2728 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
2729 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
2730 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
2731 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2732 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2734 <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
2735 which will process responses from the server before they are
2736 sent to the client. This is in addition to any filters defined
2737 elsewhere, including the
2738 <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
2741 <p>For example, the following configuration will process all files
2742 in the <code>/www/data/</code> directory for server-side
2745 <div class="example"><p><code>
2746 <Directory /www/data/><br />
2747 <span class="indent">
2748 SetOutputFilter INCLUDES<br />
2753 <p>If more than one filter is specified, they must be separated
2754 by semicolons in the order in which they should process the
2759 <li><a href="../filter.html">Filters</a> documentation</li>
2762 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2763 <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
2764 <table class="directive">
2765 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
2766 certain events before failing a request</td></tr>
2767 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
2768 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
2769 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2770 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2771 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2773 <p>The <code class="directive">TimeOut</code> directive currently defines
2774 the amount of time Apache will wait for three things:</p>
2777 <li>The total amount of time it takes to receive a GET
2780 <li>The amount of time between receipt of TCP packets on a
2781 POST or PUT request.</li>
2783 <li>The amount of time between ACKs on transmissions of TCP
2784 packets in responses.</li>
2787 <p>We plan on making these separately configurable at some point
2788 down the road. The timer used to default to 1200 before 1.2,
2789 but has been lowered to 300 which is still far more than
2790 necessary in most situations. It is not set any lower by
2791 default because there may still be odd places in the code where
2792 the timer is not reset when a packet is sent. </p>
2795 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2796 <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
2797 <table class="directive">
2798 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
2800 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
2801 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName On</code></td></tr>
2802 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
2803 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2804 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2806 <p>In many situations Apache must construct a <em>self-referential</em>
2807 URL -- that is, a URL that refers back to the same server. With
2808 <code>UseCanonicalName On</code> Apache will use the hostname and port
2809 specified in the <code class="directive"><a href="#servername">ServerName</a></code>
2810 directive to construct the canonical name for the server. This name
2811 is used in all self-referential URLs, and for the values of
2812 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
2814 <p>With <code>UseCanonicalName Off</code> Apache will form
2815 self-referential URLs using the hostname and port supplied by
2816 the client if any are supplied (otherwise it will use the
2817 canonical name, as defined above). These values are the same
2818 that are used to implement <a href="../vhosts/name-based.html">name based virtual hosts</a>,
2819 and are available with the same clients. The CGI variables
2820 <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
2821 constructed from the client supplied values as well.</p>
2823 <p>An example where this may be useful is on an intranet server
2824 where you have users connecting to the machine using short
2825 names such as <code>www</code>. You'll notice that if the users
2826 type a shortname, and a URL which is a directory, such as
2827 <code>http://www/splat</code>, <em>without the trailing
2828 slash</em> then Apache will redirect them to
2829 <code>http://www.domain.com/splat/</code>. If you have
2830 authentication enabled, this will cause the user to have to
2831 authenticate twice (once for <code>www</code> and once again
2832 for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
2833 FAQ on this subject for more information</a>). But if
2834 <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
2835 Apache will redirect to <code>http://www/splat/</code>.</p>
2837 <p>There is a third option, <code>UseCanonicalName DNS</code>,
2838 which is intended for use with mass IP-based virtual hosting to
2839 support ancient clients that do not provide a
2840 <code>Host:</code> header. With this option Apache does a
2841 reverse DNS lookup on the server IP address that the client
2842 connected to in order to work out self-referential URLs.</p>
2844 <div class="warning"><h3>Warning</h3>
2845 <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
2846 they may be broken by this option. The client is essentially free
2847 to give whatever value they want as a hostname. But if the CGI is
2848 only using <code>SERVER_NAME</code> to construct self-referential URLs
2849 then it should be just fine.</p>
2854 <li><code class="directive"><a href="#servername">ServerName</a></code></li>
2855 <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
2858 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
2859 <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost"><VirtualHost></a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
2860 <table class="directive">
2861 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
2862 hostname or IP address</td></tr>
2863 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><VirtualHost
2864 <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
2865 ...> ... </VirtualHost></code></td></tr>
2866 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
2867 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
2868 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
2870 <p><code class="directive"><VirtualHost></code> and
2871 <code></VirtualHost></code> are used to enclose a group of
2872 directives that will apply only to a particular virtual host. Any
2873 directive that is allowed in a virtual host context may be
2874 used. When the server receives a request for a document on a
2875 particular virtual host, it uses the configuration directives
2876 enclosed in the <code class="directive"><VirtualHost></code>
2877 section. <var>Addr</var> can be:</p>
2880 <li>The IP address of the virtual host;</li>
2882 <li>A fully qualified domain name for the IP address of the
2885 <li>The character <code>*</code>, which is used only in combination with
2886 <code>NameVirtualHost *</code> to match all IP addresses; or</li>
2888 <li>The string <code>_default_</code>, which is used only
2889 with IP virtual hosting to catch unmatched IP addresses.</li>
2892 <div class="example"><h3>Example</h3><p><code>
2893 <VirtualHost 10.1.2.3><br />
2894 <span class="indent">
2895 ServerAdmin webmaster@host.foo.com<br />
2896 DocumentRoot /www/docs/host.foo.com<br />
2897 ServerName host.foo.com<br />
2898 ErrorLog logs/host.foo.com-error_log<br />
2899 TransferLog logs/host.foo.com-access_log<br />
2901 </VirtualHost>
2905 <p>IPv6 addresses must be specified in square brackets because
2906 the optional port number could not be determined otherwise. An
2907 IPv6 example is shown below:</p>
2909 <div class="example"><p><code>
2910 <VirtualHost [fe80::a00:20ff:fea7:ccea]><br />
2911 <span class="indent">
2912 ServerAdmin webmaster@host.example.com<br />
2913 DocumentRoot /www/docs/host.example.com<br />
2914 ServerName host.example.com<br />
2915 ErrorLog logs/host.example.com-error_log<br />
2916 TransferLog logs/host.example.com-access_log<br />
2918 </VirtualHost>
2921 <p>Each Virtual Host must correspond to a different IP address,
2922 different port number or a different host name for the server,
2923 in the former case the server machine must be configured to
2924 accept IP packets for multiple addresses. (If the machine does
2925 not have multiple network interfaces, then this can be
2926 accomplished with the <code>ifconfig alias</code> command -- if
2927 your OS supports it).</p>
2929 <div class="note"><h3>Note</h3>
2930 <p>The use of <code class="directive"><VirtualHost></code> does
2931 <strong>not</strong> affect what addresses Apache listens on. You
2932 may need to ensure that Apache is listening on the correct addresses
2933 using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
2936 <p>When using IP-based virtual hosting, the special name
2937 <code>_default_</code> can be specified in
2938 which case this virtual host will match any IP address that is
2939 not explicitly listed in another virtual host. In the absence
2940 of any <code>_default_</code> virtual host the "main" server config,
2941 consisting of all those definitions outside any VirtualHost
2942 section, is used when no IP-match occurs. (But note that any IP
2943 address that matches a <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> directive will use neither
2944 the "main" server config nor the <code>_default_</code> virtual host.
2945 See the <a href="../vhosts/name-based.html">name-based virtual hosting</a>
2946 documentation for further details.)</p>
2948 <p>You can specify a <code>:port</code> to change the port that is
2949 matched. If unspecified then it defaults to the same port as the
2950 most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
2951 statement of the main server. You may also specify <code>:*</code>
2952 to match all ports on that address. (This is recommended when used
2953 with <code>_default_</code>.)</p>
2955 <div class="warning"><h3>Security</h3>
2956 <p>See the <a href="../misc/security_tips.html">security tips</a>
2957 document for details on why your security could be compromised if the
2958 directory where logfiles are stored is writable by anyone other
2959 than the user that starts the server.</p>
2964 <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
2965 <li><a href="../dns-caveats.html">Issues Regarding DNS and
2967 <li><a href="../bind.html">Setting
2968 which addresses and ports Apache uses</a></li>
2969 <li><a href="../sections.html">How <Directory>, <Location>
2970 and <Files> sections work</a> for an explanation of how these
2971 different sections are combined when a request is received</li>
2976 <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
2977 <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>