1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml">
6 <meta name="generator" content="HTML Tidy, see www.w3.org" />
8 <title>Apache Core Features</title>
10 <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
12 <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
13 vlink="#000080" alink="#FF0000">
14 <!--#include virtual="header.html" -->
16 <h1 align="CENTER">Apache Core Features</h1>
18 <p>These configuration parameters control the core Apache
19 features, and are always available.</p>
24 <li><a href="#acceptpathinfo">AcceptPathInfo</a></li>
26 <li><a href="#accessfilename">AccessFileName</a></li>
28 <li><a href="#adddefaultcharset">AddDefaultCharset</a></li>
30 <li><a href="#addmodule">AddModule</a></li>
32 <li><a href="#allowoverride">AllowOverride</a></li>
34 <li><a href="#authname">AuthName</a></li>
36 <li><a href="#authtype">AuthType</a></li>
38 <li><a href="#clearmodulelist">ClearModuleList</a></li>
40 <li><a href="#contentdigest">ContentDigest</a></li>
42 <li><a href="#coredumpdirectory">CoreDumpDirectory</a></li>
44 <li><a href="#defaulttype">DefaultType</a></li>
46 <li><a href="#directory"><Directory></a></li>
48 <li><a href="#directorymatch"><DirectoryMatch></a></li>
50 <li><a href="#documentroot">DocumentRoot</a></li>
52 <li><a href="#errordocument">ErrorDocument</a></li>
54 <li><a href="#errorlog">ErrorLog</a></li>
56 <li><a href="#fileetag">FileETag</a></li>
58 <li><a href="#files"><Files></a></li>
60 <li><a href="#filesmatch"><FilesMatch></a></li>
62 <li><a href="#forcetype">ForceType</a></li>
64 <li><a href="#hostnamelookups">HostnameLookups</a></li>
66 <li><a href="#identitycheck">IdentityCheck</a></li>
68 <li><a href="#ifdefine"><IfDefine></a></li>
70 <li><a href="#ifmodule"><IfModule></a></li>
72 <li><a href="#include">Include</a></li>
74 <li><a href="#keepalive">KeepAlive</a></li>
76 <li><a href="#keepalivetimeout">KeepAliveTimeout</a></li>
78 <li><a href="#limit"><Limit></a></li>
80 <li><a href="#limitexcept"><LimitExcept></a></li>
82 <li><a href="#limitrequestbody">LimitRequestBody</a></li>
84 <li><a href="#limitrequestfields">LimitRequestFields</a></li>
87 href="#limitrequestfieldsize">LimitRequestFieldsize</a></li>
89 <li><a href="#limitrequestline">LimitRequestLine</a></li>
92 href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
94 <li><a href="#location"><Location></a></li>
96 <li><a href="#locationmatch"><LocationMatch></a></li>
98 <li><a href="#loglevel">LogLevel</a></li>
101 href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
103 <li><a href="#namevirtualhost">NameVirtualHost</a></li>
105 <li><a href="#options">Options</a></li>
107 <li><a href="#require">Require</a></li>
109 <li><a href="#rlimitcpu">RLimitCPU</a></li>
111 <li><a href="#rlimitmem">RLimitMEM</a></li>
113 <li><a href="#rlimitnproc">RLimitNPROC</a></li>
115 <li><a href="#satisfy">Satisfy</a></li>
118 href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
120 <li><a href="#serveradmin">ServerAdmin</a></li>
122 <li><a href="#serveralias">ServerAlias</a></li>
124 <li><a href="#servername">ServerName</a></li>
126 <li><a href="#serverpath">ServerPath</a></li>
128 <li><a href="#serverroot">ServerRoot</a></li>
130 <li><a href="#serversignature">ServerSignature</a></li>
132 <li><a href="#servertokens">ServerTokens</a></li>
134 <li><a href="#sethandler">SetHandler</a></li>
136 <li><a href="#setinputfilter">SetInputFilter</a></li>
138 <li><a href="#setoutputfilter">SetOutputFilter</a></li>
140 <li><a href="#timeout">TimeOut</a></li>
142 <li><a href="#usecanonicalname">UseCanonicalName</a></li>
144 <li><a href="#virtualhost"><VirtualHost></a></li>
148 <h2><a id="acceptpathinfo"
149 name="adddefaultcharset">AcceptPathInfo directive</a></h2>
150 <a href="directive-dict.html#Syntax"
151 rel="Help"><strong>Syntax:</strong></a> AcceptPathInfo On|Off|Default<br />
152 <a href="directive-dict.html#Default"
153 rel="Help"><strong>Default:</strong></a>
154 <code>AcceptPathInfo Default</code><br />
155 <a href="directive-dict.html#Context"
156 rel="Help"><strong>Context:</strong></a> server config, virtual host,
157 directory, .htaccess<br />
158 <a href="directive-dict.html#Status"
159 rel="Help"><strong>Status:</strong></a> core<br />
160 <a href="directive-dict.html#Compatibility"
161 rel="Help"><strong>Compatibility:</strong></a>
162 AcceptPathInfo is only available in Apache 2.0.30 and later
164 <p>This directive controls whether requests that contain trailing
165 pathname information that follows an actual filename (or
166 non-existent file in an existing directory) will be accepted or
167 rejected. The trailing pathname information can be made
168 available to scripts in the PATH_INFO environment variable.</p>
170 <p>For example, assume the location <code>/test/</code> points to
171 a directory that contains only the single file
172 <code>here.html</code>. Then requests for
173 <code>/test/here.html/more</code> and
174 <code>/test/nothere.html/more</code> both collect
175 <code>/more</code> as PATH_INFO.</p>
177 <p>The three possible arguments for the
178 <code>AcceptPathInfo</code> directive are:</p>
180 <dt><code>off</code></dt><dd>A request will only be accepted if it
181 maps to a literal path that exists. Therefore a request with
182 trailing pathname information after the true filename such as
183 <code>/test/here.html/more</code> in the above example will return
184 a 404 NOT FOUND error.</dd>
186 <dt><code>on</code></dt><dd>A request will be accepted if a
187 leading path component maps to a file that exists. The above
188 example <code>/test/here.html/more</code> will be accepted if
189 <code>/test/here.html</code> maps to a valid file.</dt>
191 <dt><code>default</code><dd>The treatment of requests with
192 trailing pathname information is determined by the <a
193 href="../handler.html">handler</a> responsible for the request.
194 The core handler for normal files defaults to rejecting PATH_INFO.
195 Handlers that serve scripts, such as <a
196 href="mod_cgi.html">cgi-script</a> and <a
197 href="mod_isapi.html">isapi-isa</a>, generally accept PATH_INFO by
201 <p>The primary purpose of the <code>AcceptPathInfo</code>
202 directive is to allow you to override the handler's choice of
203 accepting or rejecting PATH_INFO. This override is required, for
204 example, when you use a <a href="../filter.html">filter</a>, such
205 as <a href="mod_include.html">INCLUDES</a>, to generate content
206 based on PATH_INFO. The core handler would usually reject the
207 request, so you can use the following configuration to enable
210 <Files "mypaths.shtml">
212 SetOutputFilter INCLUDES
218 <h2><a id="accessfilename" name="accessfilename">AccessFileName
221 <a href="directive-dict.html#Syntax"
222 rel="Help"><strong>Syntax:</strong></a> AccessFileName
223 <em>filename</em> [<em>filename</em>] ...<br />
224 <a href="directive-dict.html#Default"
225 rel="Help"><strong>Default:</strong></a> <code>AccessFileName
226 .htaccess</code><br />
227 <a href="directive-dict.html#Context"
228 rel="Help"><strong>Context:</strong></a> server config, virtual
230 <a href="directive-dict.html#Status"
231 rel="Help"><strong>Status:</strong></a> core<br />
232 <a href="directive-dict.html#Compatibility"
233 rel="Help"><strong>Compatibility:</strong></a> AccessFileName
234 can accept more than one filename only in Apache 1.3 and later
236 <p>When returning a document to the client the server looks for
237 the first existing access control file from this list of names
238 in every directory of the path to the document, if access
239 control files are enabled for that directory. For example:</p>
242 <code>AccessFileName .acl</code>
244 before returning the document /usr/local/web/index.html, the
245 server will read /.acl, /usr/.acl, /usr/local/.acl and
246 /usr/local/web/.acl for directives, unless they have been
250 <code><Directory /><br />
251 AllowOverride None<br />
252 </Directory></code>
255 <p><strong>See Also:</strong> <a
256 href="#allowoverride">AllowOverride</a> and <a
257 href="../configuring.html">Configuration Files</a></p>
260 <h2><a id="adddefaultcharset"
261 name="adddefaultcharset">AddDefaultCharset directive</a></h2>
262 <a href="directive-dict.html#Syntax"
263 rel="Help"><strong>Syntax:</strong></a> AddDefaultCharset
264 On|Off|<em>charset</em><br />
265 <a href="directive-dict.html#Context"
266 rel="Help"><strong>Context:</strong></a> all<br />
267 <a href="directive-dict.html#Status"
268 rel="Help"><strong>Status:</strong></a> core<br />
269 <a href="directive-dict.html#Default"
270 rel="Help"><strong>Default:</strong></a>
271 <code>AddDefaultCharset Off</code><br />
272 <a href="directive-dict.html#Compatibility"
273 rel="Help"><strong>Compatibility:</strong></a>
274 AddDefaultCharset is only available in Apache 1.3.12 and later
276 <p>This directive specifies the name of the character set that
277 will be added to any response that does not have any parameter
278 on the content type in the HTTP headers. This will override any
279 character set specified in the body of the document via a
280 <code>META</code> tag. A setting of <code>AddDefaultCharset
281 Off</code> disables this functionality. <code>AddDefaultCharset
282 On</code> enables Apache's internal default charset of
283 <code>iso-8859-1</code> as required by the directive. You can
284 also specify an alternate <em>charset</em> to be used. For
288 <code>AddDefaultCharset utf-8</code>
293 <h2><a id="addmodule" name="addmodule">AddModule
296 <a href="directive-dict.html#Syntax"
297 rel="Help"><strong>Syntax:</strong></a> AddModule
298 <em>module</em> [<em>module</em>] ...<br />
299 <a href="directive-dict.html#Context"
300 rel="Help"><strong>Context:</strong></a> server config <br />
301 <a href="directive-dict.html#Status"
302 rel="Help"><strong>Status:</strong></a> core<br />
303 <a href="directive-dict.html#Compatibility"
304 rel="Help"><strong>Compatibility:</strong></a> AddModule is
305 only available in Apache 1.2 and later
307 <p>The server can have modules compiled in which are not
308 actively in use. This directive can be used to enable the use
309 of those modules. The server comes with a pre-loaded list of
310 active modules; this list can be cleared with the <a
311 href="#clearmodulelist">ClearModuleList</a> directive.</p>
316 <code>AddDefaultCharset utf-8</code>
321 <h2><a id="allowoverride" name="allowoverride">AllowOverride
324 <a href="directive-dict.html#Syntax"
325 rel="Help"><strong>Syntax:</strong></a> AllowOverride
326 All|None|<em>directive-type</em> [<em>directive-type</em>]
328 <a href="directive-dict.html#Default"
329 rel="Help"><strong>Default:</strong></a> <code>AllowOverride
331 <a href="directive-dict.html#Context"
332 rel="Help"><strong>Context:</strong></a> directory<br />
333 <a href="directive-dict.html#Status"
334 rel="Help"><strong>Status:</strong></a> core
336 <p>When the server finds an .htaccess file (as specified by <a
337 href="#accessfilename">AccessFileName</a>) it needs to know
338 which directives declared in that file can override earlier
339 access information.</p>
341 <p>When this directive is set to <code>None</code>, then
342 .htaccess files are completely ignored. In this case, the
343 server will not even attempt to read .htaccess files in the
346 <p>When this directive is set to <code>All</code>, then any
347 directive which has the .htaccess <a
348 href="directive-dict.html#Context">Context</a> is allowed in
351 <p>The <em>directive-type</em> can be one of the following
352 groupings of directives.</p>
359 Allow use of the authorization directives (<a
360 href="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a>,
362 href="mod_auth_dbm.html#authdbmuserfile">AuthDBMUserFile</a>,
363 <a href="mod_auth.html#authgroupfile">AuthGroupFile</a>, <a
364 href="#authname">AuthName</a>, <a
365 href="#authtype">AuthType</a>, <a
366 href="mod_auth.html#authuserfile">AuthUserFile</a>, <a
367 href="#require">Require</a>, <em>etc.</em>).</dd>
372 Allow use of the directives controlling document types (<a
373 href="#defaulttype">DefaultType</a>, <a
374 href="#errordocument">ErrorDocument</a>, <a
375 href="#forcetype">ForceType</a>, <a
376 href="mod_negotiation.html#languagepriority">LanguagePriority</a>,
377 <a href="#sethandler">SetHandler</a>, <a
378 href="#setinputfilter">SetInputFilter</a>, <a
379 href="#setoutputfilter">SetOutputFilter</a>, and <a
380 href="mod_mime.html">mod_mime Add* and Remove*
381 directives</a>, <em>etc.</em>).</dd>
386 Allow use of the directives controlling directory indexing
388 href="mod_autoindex.html#adddescription">AddDescription</a>,
389 <a href="mod_autoindex.html#addicon">AddIcon</a>, <a
390 href="mod_autoindex.html#addiconbyencoding">AddIconByEncoding</a>,
391 <a href="mod_autoindex.html#addiconbytype">AddIconByType</a>,
392 <a href="mod_autoindex.html#defaulticon">DefaultIcon</a>, <a
393 href="mod_dir.html#directoryindex">DirectoryIndex</a>, <a
394 href="mod_autoindex.html#fancyindexing">FancyIndexing</a>, <a
395 href="mod_autoindex.html#headername">HeaderName</a>, <a
396 href="mod_autoindex.html#indexignore">IndexIgnore</a>, <a
397 href="mod_autoindex.html#indexoptions">IndexOptions</a>, <a
398 href="mod_autoindex.html#readmename">ReadmeName</a>,
404 Allow use of the directives controlling host access (Allow,
405 Deny and Order).</dd>
410 Allow use of the directives controlling specific directory
411 features (<a href="#options">Options</a> and <a
412 href="mod_include.html#xbithack">XBitHack</a>).</dd>
417 <blockquote><code>AllowOverride AuthConfig Indexes</code></blockquote>
419 <p><strong>See Also:</strong> <a
420 href="#accessfilename">AccessFileName</a> and <a
421 href="configuring.html">Configuration Files</a></p>
424 <h2><a id="authname" name="authname">AuthName
427 <a href="directive-dict.html#Syntax"
428 rel="Help"><strong>Syntax:</strong></a> AuthName
429 <em>auth-domain</em><br />
430 <a href="directive-dict.html#Context"
431 rel="Help"><strong>Context:</strong></a> directory,
433 <a href="directive-dict.html#Override"
434 rel="Help"><strong>Override:</strong></a> AuthConfig<br />
435 <a href="directive-dict.html#Status"
436 rel="Help"><strong>Status:</strong></a> core
438 <p>This directive sets the name of the authorization realm for
439 a directory. This realm is given to the client so that the user
440 knows which username and password to send.
441 <samp>AuthName</samp> takes a single argument; if the realm
442 name contains spaces, it must be enclosed in quotation marks.
443 It must be accompanied by <a href="#authtype">AuthType</a> and
444 <a href="#require">Require</a> directives, and directives such
445 as <a href="mod_auth.html#authuserfile">AuthUserFile</a> and <a
446 href="mod_auth.html#authgroupfile">AuthGroupFile</a> to
451 <blockquote><code>AuthName "Top Secret"</code></blockquote>
453 <p>The string provided for the <code>AuthRealm</code> is what will
454 appear in the password dialog provided by most browsers.</p>
456 <p><strong>See also:</strong> <a
457 href="../howto/auth.html">Authentication, Authorization, and
458 Access Control</a></p>
462 <h2><a id="authtype" name="authtype">AuthType
465 <a href="directive-dict.html#Syntax"
466 rel="Help"><strong>Syntax:</strong></a> AuthType
468 <a href="directive-dict.html#Context"
469 rel="Help"><strong>Context:</strong></a> directory,
471 <a href="directive-dict.html#Override"
472 rel="Help"><strong>Override:</strong></a> AuthConfig<br />
473 <a href="directive-dict.html#Status"
474 rel="Help"><strong>Status:</strong></a> core
476 <p>This directive selects the type of user authentication for a
477 directory. Only <code>Basic</code> and <code>Digest</code> are
478 currently implemented.
480 It must be accompanied by <a href="#authname">AuthName</a> and
481 <a href="#require">Require</a> directives, and directives such
482 as <a href="mod_auth.html#authuserfile">AuthUserFile</a> and <a
483 href="mod_auth.html#authgroupfile">AuthGroupFile</a> to
486 <p><strong>See also:</strong> <a
487 href="../howto/auth.html">Authentication, Authorization, and
488 Access Control</a></p>
491 <h2><a id="clearmodulelist"
492 name="clearmodulelist">ClearModuleList directive</a></h2>
494 <a href="directive-dict.html#Syntax"
495 rel="Help"><strong>Syntax:</strong></a> ClearModuleList<br />
496 <a href="directive-dict.html#Context"
497 rel="Help"><strong>Context:</strong></a> server config<br />
498 <a href="directive-dict.html#Status"
499 rel="Help"><strong>Status:</strong></a> core<br />
500 <a href="directive-dict.html#Compatibility"
501 rel="Help"><strong>Compatibility:</strong></a> ClearModuleList
502 is only available in Apache 1.2 and later
504 <p>The server comes with a built-in list of active modules.
505 This directive clears the list. It is assumed that the list
506 will then be re-populated using the <a
507 href="#addmodule">AddModule</a> directive.</p>
510 <h2><a id="contentdigest" name="contentdigest">ContentDigest
513 <a href="directive-dict.html#Syntax"
514 rel="Help"><strong>Syntax:</strong></a> ContentDigest
516 <a href="directive-dict.html#Default"
517 rel="Help"><strong>Default:</strong></a> <code>ContentDigest
519 <a href="directive-dict.html#Context"
520 rel="Help"><strong>Context:</strong></a> server config, virtual
521 host, directory, .htaccess<br />
522 <a href="directive-dict.html#Override"
523 rel="Help"><strong>Override:</strong></a> Options<br />
524 <a href="directive-dict.html#Status"
525 rel="Help"><strong>Status:</strong></a> experimental<br />
526 <a href="directive-dict.html#Compatibility"
527 rel="Help"><strong>Compatibility:</strong></a> ContentDigest is
528 only available in Apache 1.1 and later
530 <p>This directive enables the generation of
531 <code>Content-MD5</code> headers as defined in RFC1864
532 respectively RFC2068.</p>
534 <p>MD5 is an algorithm for computing a "message digest"
535 (sometimes called "fingerprint") of arbitrary-length data, with
536 a high degree of confidence that any alterations in the data
537 will be reflected in alterations in the message digest.</p>
539 <p>The <code>Content-MD5</code> header provides an end-to-end
540 message integrity check (MIC) of the entity-body. A proxy or
541 client may check this header for detecting accidental
542 modification of the entity-body in transit. Example header:</p>
544 Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
547 <p>Note that this can cause performance problems on your server
548 since the message digest is computed on every request (the
549 values are not cached).</p>
551 <p><code>Content-MD5</code> is only sent for documents served
552 by the core, and not by any module. For example, SSI documents,
553 output from CGI scripts, and byte range responses do not have
557 <h2><a id="defaulttype" name="defaulttype">DefaultType
560 <a href="directive-dict.html#Syntax"
561 rel="Help"><strong>Syntax:</strong></a> DefaultType
562 <em>MIME-type</em><br />
563 <a href="directive-dict.html#Default"
564 rel="Help"><strong>Default:</strong></a> <code>DefaultType
565 text/html</code><br />
566 <a href="directive-dict.html#Context"
567 rel="Help"><strong>Context:</strong></a> server config, virtual
568 host, directory, .htaccess<br />
569 <a href="directive-dict.html#Override"
570 rel="Help"><strong>Override:</strong></a> FileInfo<br />
571 <a href="directive-dict.html#Status"
572 rel="Help"><strong>Status:</strong></a> core
574 <p>There will be times when the server is asked to provide a
575 document whose type cannot be determined by its MIME types
578 <p>The server must inform the client of the content-type of the
579 document, so in the event of an unknown type it uses the
580 <code>DefaultType</code>. For example:</p>
583 <code>DefaultType image/gif</code>
585 would be appropriate for a directory which contained many gif
586 images with filenames missing the .gif extension.
588 <p>Note that unlike <a href="#forcetype">ForceType</a>, this
589 directive is only provides the default mime-type. All other
590 mime-type definitions, including filename extensions, that
591 might identify the media type will override this default.</p>
594 <h2><a id="directory" name="directory"><Directory>
597 <a href="directive-dict.html#Syntax"
598 rel="Help"><strong>Syntax:</strong></a> <Directory
599 <em>directory-path</em>> ... </Directory> <br />
600 <a href="directive-dict.html#Context"
601 rel="Help"><strong>Context:</strong></a> server config, virtual
603 <a href="directive-dict.html#Status"
604 rel="Help"><strong>Status:</strong></a> Core.
606 <p><Directory> and </Directory> are used to enclose
607 a group of directives which will apply only to the named
608 directory and sub-directories of that directory. Any directive
609 which is allowed in a directory context may be used.
610 <em>Directory-path</em> is either the full path to a directory,
611 or a wild-card string. In a wild-card string, `?' matches any
612 single character, and `*' matches any sequences of characters.
613 As of Apache 1.3, you may also use `[]' character ranges like
614 in the shell. Also as of Apache 1.3 none of the wildcards match
615 a `/' character, which more closely mimics the behavior of Unix
618 <Directory /usr/local/httpd/htdocs>
619 Options Indexes FollowSymLinks
623 <p><strong>Apache 1.2 and above:</strong> Extended regular
624 expressions can also be used, with the addition of the
625 <code>~</code> character. For example:</p>
627 <Directory ~ "^/www/.*/[0-9]{3}">
629 would match directories in /www/ that consisted of three
632 <p>If multiple (non-regular expression) directory sections
633 match the directory (or its parents) containing a document,
634 then the directives are applied in the order of shortest match
635 first, interspersed with the directives from the <a
636 href="#accessfilename">.htaccess</a> files. For example,
640 <code><Directory /><br />
641 AllowOverride None<br />
642 </Directory><br />
644 <Directory /home/*><br />
645 AllowOverride FileInfo<br />
646 </Directory></code>
648 for access to the document <code>/home/web/dir/doc.html</code>
652 <li>Apply directive <code>AllowOverride None</code>
653 (disabling <code>.htaccess</code> files).</li>
655 <li>Apply directive <code>AllowOverride FileInfo</code> (for
656 directory <code>/home/web</code>).</li>
658 <li>Apply any FileInfo directives in
659 <code>/home/web/.htaccess</code></li>
662 <p>Regular expression directory sections are handled slightly
663 differently by Apache 1.2 and 1.3. In Apache 1.2 they are
664 interspersed with the normal directory sections and applied in
665 the order they appear in the configuration file. They are
666 applied only once, and apply when the shortest match possible
667 occurs. In Apache 1.3 regular expressions are not considered
668 until after all of the normal sections have been applied. Then
669 all of the regular expressions are tested in the order they
670 appeared in the configuration file. For example, with</p>
673 <code><Directory ~ abc$><br />
674 ... directives here ...<br />
675 </Directory><br />
678 Suppose that the filename being accessed is
679 <code>/home/abc/public_html/abc/index.html</code>. The server
680 considers each of <code>/</code>, <code>/home</code>,
681 <code>/home/abc</code>, <code>/home/abc/public_html</code>, and
682 <code>/home/abc/public_html/abc</code> in that order. In Apache
683 1.2, when <code>/home/abc</code> is considered, the regular
684 expression will match and be applied. In Apache 1.3 the regular
685 expression isn't considered at all at that point in the tree.
686 It won't be considered until after all normal
687 <Directory>s and <code>.htaccess</code> files have been
688 applied. Then the regular expression will match on
689 <code>/home/abc/public_html/abc</code> and be applied.
691 <p><strong>Note that the default Apache access for
692 <Directory /> is <samp>Allow from All</samp>. This means
693 that Apache will serve any file mapped from an URL. It is
694 recommended that you change this with a block such
703 <p><strong>and then override this for directories you
704 <em>want</em> accessible. See the <a
705 href="../misc/security_tips.html">Security Tips</a> page for
706 more details.</strong></p>
707 The directory sections typically occur in the access.conf file,
708 but they may appear in any configuration file.
709 <Directory> directives cannot nest, and cannot appear in
710 a <a href="#limit"><Limit></a> or <a
711 href="#limitexcept"><LimitExcept></a> section.
713 <p><strong>See also</strong>: <a href="../sections.html">How
714 Directory, Location and Files sections work</a> for an
715 explanation of how these different sections are combined when a
716 request is received</p>
719 <h2><a id="directorymatch"
720 name="directorymatch"><DirectoryMatch></a></h2>
721 <a href="directive-dict.html#Syntax"
722 rel="Help"><strong>Syntax:</strong></a> <DirectoryMatch
723 <em>regex</em>> ... </DirectoryMatch> <br />
724 <a href="directive-dict.html#Context"
725 rel="Help"><strong>Context:</strong></a> server config, virtual
727 <a href="directive-dict.html#Status"
728 rel="Help"><strong>Status:</strong></a> Core.<br />
729 <a href="directive-dict.html#Compatibility"
730 rel="Help"><strong>Compatibility:</strong></a> Available in
733 <p><DirectoryMatch> and </DirectoryMatch> are used
734 to enclose a group of directives which will apply only to the
735 named directory and sub-directories of that directory, the same
736 as <a href="#directory"><Directory></a>. However, it
737 takes as an argument a regular expression. For example:</p>
739 <DirectoryMatch "^/www/.*/[0-9]{3}">
742 <p>would match directories in /www/ that consisted of three
745 <p><strong>See Also:</strong> <a
746 href="#directory"><Directory></a> for a description of
747 how regular expressions are mixed in with normal
748 <Directory>s.<br />
749 <strong>See also</strong>: <a href="../sections.html">How
750 Directory, Location and Files sections work</a> for an
751 explanation of how these different sections are combined when a
752 request is received</p>
755 <h2><a id="documentroot" name="documentroot">DocumentRoot
758 <a href="directive-dict.html#Syntax"
759 rel="Help"><strong>Syntax:</strong></a> DocumentRoot
760 <em>directory-path</em><br />
761 <a href="directive-dict.html#Default"
762 rel="Help"><strong>Default:</strong></a> <code>DocumentRoot
763 /usr/local/apache/htdocs</code><br />
764 <a href="directive-dict.html#Context"
765 rel="Help"><strong>Context:</strong></a> server config, virtual
767 <a href="directive-dict.html#Status"
768 rel="Help"><strong>Status:</strong></a> core
770 <p>This directive sets the directory from which httpd will
771 serve files. Unless matched by a directive like Alias, the
772 server appends the path from the requested URL to the document
773 root to make the path to the document. Example:</p>
776 <code>DocumentRoot /usr/web</code>
779 <code>http://www.my.host.com/index.html</code> refers to
780 <code>/usr/web/index.html</code>.
782 <p>There appears to be a bug in mod_dir which causes problems
783 when the DocumentRoot has a trailing slash (<em>i.e.</em>,
784 "DocumentRoot /usr/web/") so please avoid that.</p>
787 <h2><a id="errordocument" name="errordocument">ErrorDocument
790 <a href="directive-dict.html#Syntax"
791 rel="Help"><strong>Syntax:</strong></a> ErrorDocument
792 <em>error-code document</em><br />
793 <a href="directive-dict.html#Context"
794 rel="Help"><strong>Context:</strong></a> server config, virtual
795 host, directory, .htaccess<br />
796 <a href="directive-dict.html#Status"
797 rel="Help"><strong>Status:</strong></a> core<br />
798 <a href="directive-dict.html#Override"
799 rel="Help"><strong>Override:</strong></a> FileInfo<br />
800 <a href="directive-dict.html#Compatibility"
801 rel="Help"><strong>Compatibility:</strong></a> The directory
802 and .htaccess contexts are only available in Apache 1.1 and
803 later. The quoting syntax prior to Apache 2.0 was different.
805 <p>In the event of a problem or error, Apache can be configured
806 to do one of four things,</p>
809 <li>output a simple hardcoded error message</li>
811 <li>output a customized message</li>
813 <li>redirect to a local <em>URL-path</em> to handle the
816 <li>redirect to an external <em>URL</em> to handle the
820 <p>The first option is the default, while options 2-4 are
821 configured using the <code>ErrorDocument</code> directive,
822 which is followed by the HTTP response code and a URL or a
823 message. Apache will sometimes offer additional information
824 regarding the problem/error.</p>
826 <p>URLs can begin with a slash (/) for local URLs, or be a full
827 URL which the client can resolve. Alternatively, a message can
828 be provided to be displayed by the browser. Examples:</p>
831 <code>ErrorDocument 500
832 http://foo.example.com/cgi-bin/tester<br />
833 ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
834 ErrorDocument 401 /subscription_info.html<br />
835 ErrorDocument 403 "Sorry can't allow you access
839 <p>Note that when you specify an <code>ErrorDocument</code>
840 that points to a remote URL (ie. anything with a method such as
841 "http" in front of it), Apache will send a redirect to the
842 client to tell it where to find the document, even if the
843 document ends up being on the same server. This has several
844 implications, the most important being that the client will not
845 receive the original error status code, but instead will
846 receive a redirect status code. This in turn can confuse web
847 robots and other clients which try to determine if a URL is
848 valid using the status code. In addition, if you use a remote
849 URL in an <code>ErrorDocument 401</code>, the client will not
850 know to prompt the user for a password since it will not
851 receive the 401 status code. Therefore, <strong>if you use an
852 "ErrorDocument 401" directive then it must refer to a local
853 document.</strong></p>
855 <p>Prior to version 2.0, messages were indicated by prefixing
856 them with a single unmatched double quote character.</p>
858 <p>See Also: <a href="../custom-error.html">documentation of
859 customizable responses.</a></p>
862 <h2><a id="errorlog" name="errorlog">ErrorLog
865 <a href="directive-dict.html#Syntax"
866 rel="Help"><strong>Syntax:</strong></a> ErrorLog
867 <em>file-path</em>|syslog[:<em>facility</em>] <br />
868 <a href="directive-dict.html#Default"
869 rel="Help"><strong>Default:</strong></a> <code>ErrorLog
870 logs/error_log</code> (Unix)<br />
871 <a href="directive-dict.html#Default"
872 rel="Help"><strong>Default:</strong></a> <code>ErrorLog
873 logs/error.log</code> (Windows and OS/2)<br />
874 <a href="directive-dict.html#Context"
875 rel="Help"><strong>Context:</strong></a> server config, virtual
877 <a href="directive-dict.html#Status"
878 rel="Help"><strong>Status:</strong></a> core
880 <p>The error log directive sets the name of the file to which
881 the server will log any errors it encounters. If the
882 <em>file-path</em> does not begin with a slash (/) then it is
883 assumed to be relative to the <a
884 href="#serverroot">ServerRoot</a>. If the <em>file-path</em>
885 begins with a pipe (|) then it is assumed to be a command to
886 spawn to handle the error log.</p>
888 <p><strong>Apache 1.3 and above:</strong> Using
889 <code>syslog</code> instead of a filename enables logging via
890 syslogd(8) if the system supports it. The default is to use
891 syslog facility <code>local7</code>, but you can override this
892 by using the <code>syslog:</code><em>facility</em> syntax where
893 <em>facility</em> can be one of the names usually documented in
896 <p>SECURITY: See the <a
897 href="../misc/security_tips.html#serverroot">security tips</a>
898 document for details on why your security could be compromised
899 if the directory where logfiles are stored is writable by
900 anyone other than the user that starts the server.</p>
902 <p><strong>See also:</strong> <a href="#loglevel">LogLevel</a>
903 and <a href="../logs.html">Apache Log Files</a></p>
906 <h2><a id="fileetag" name="fileetag">FileETag directive</a></h2>
907 <a href="directive-dict.html#Syntax"
908 rel="Help"><strong>Syntax:</strong></a> FileETag
909 <i>component</i> ...<br />
910 <a href="directive-dict.html#Context"
911 rel="Help"><strong>Context:</strong></a> server config, virtual
912 host, directory, .htaccess<br />
913 <a href="directive-dict.html#Override"
914 rel="Help"><strong>Override:</strong></a> FileInfo<br />
915 <a href="directive-dict.html#Status"
916 rel="Help"><strong>Status:</strong></a> core<br />
917 <a href="directive-dict.html#Compatibility"
918 rel="Help"><strong>Compatibility:</strong></a> only available
919 in Apache 1.3.23 versions and later.
922 The FileETag directive configures the file attributes that are
923 used to create the ETag (entity tag) response header field
924 when the document is based on a file.
925 (The ETag value is used in cache management to save network
926 bandwidth.) In Apache 1.3.22 and earlier, the ETag value was
927 <i>always</i> formed from the file's inode, size, and last-modified
928 time (mtime). The FileETag directive allows you to choose
929 which of these -- if any -- should be used. The recognised
932 <dl compact="compact">
933 <dt><b>INode</b></dt>
934 <dd>The file's i-node number will be included in the calculation</dd>
935 <dt><b>MTime</b></dt>
936 <dd>The date and time the file was last modified will be included</dd>
938 <dd>The number of bytes in the file will be included</dd>
940 <dd>All available fields will be used (equivalent to
941 '<code>FileETag INode MTime Size</code>')</dd>
943 <dd>If a document is file-based, no ETag field will be included in the
947 The INode, MTime, and Size keywords may be prefixed with either '+'
948 or '-', which allow changes to be made to the default setting
949 inherited from a broader scope. Any keyword appearing without
950 such a prefix immediately and completely cancels the inherited
954 If a directory's configuration includes
955 '<code>FileETag INode MTime Size</code>', and a
956 subdirectory's includes '<code>FileETag -INode</code>',
957 the setting for that subdirectory (which will be inherited by
958 any sub-subdirectories that don't override it) will be equivalent to
959 '<code>FileETag MTime Size</code>'.
963 <h2><a id="files" name="files"><Files> directive</a></h2>
964 <a href="directive-dict.html#Syntax"
965 rel="Help"><strong>Syntax:</strong></a> <Files
966 <em>filename</em>> ... </Files><br />
967 <a href="directive-dict.html#Context"
968 rel="Help"><strong>Context:</strong></a> server config, virtual
969 host, .htaccess<br />
970 <a href="directive-dict.html#Status"
971 rel="Help"><strong>Status:</strong></a> core<br />
972 <a href="directive-dict.html#Compatibility"
973 rel="Help"><strong>Compatibility:</strong></a> only available
974 in Apache 1.2 and above.
976 <p>The <Files> directive provides for access control by
977 filename. It is comparable to the <a
978 href="#directory"><Directory></a> directive and <a
979 href="#location"><Location></a> directives. It should be
980 matched with a </Files> directive. The directives given
981 within this section will be applied to any object with a
982 basename (last component of filename) matching the specified
983 filename. <code><Files></code> sections are processed in
984 the order they appear in the configuration file, after the
985 <Directory> sections and <code>.htaccess</code> files are
986 read, but before <Location> sections. Note that
987 <Files> can be nested inside <Directory> sections
988 to restrict the portion of the filesystem they apply to.</p>
990 <p>The <em>filename</em> argument should include a filename, or
991 a wild-card string, where `?' matches any single character, and
992 `*' matches any sequences of characters. Extended regular
993 expressions can also be used, with the addition of the
994 <code>~</code> character. For example:</p>
996 <Files ~ "\.(gif|jpe?g|png)$">
998 would match most common Internet graphics formats. In Apache
999 1.3 and later, <a href="#filesmatch"><FilesMatch></a> is
1002 <p>Note that unlike <a
1003 href="#directory"><code><Directory></code></a> and <a
1004 href="#location"><code><Location></code></a> sections,
1005 <code><Files></code> sections can be used inside
1006 .htaccess files. This allows users to control access to their
1007 own files, at a file-by-file level.</p>
1009 <p><strong>See also</strong>: <a href="../sections.html">How
1010 Directory, Location and Files sections work</a> for an
1011 explanation of how these different sections are combined when a
1012 request is received</p>
1015 <h2><a id="filesmatch"
1016 name="filesmatch"><FilesMatch></a></h2>
1017 <a href="directive-dict.html#Syntax"
1018 rel="Help"><strong>Syntax:</strong></a> <FilesMatch
1019 <em>regex</em>> ... </FilesMatch><br />
1020 <a href="directive-dict.html#Context"
1021 rel="Help"><strong>Context:</strong></a> server config, virtual
1022 host, .htaccess<br />
1023 <a href="directive-dict.html#Status"
1024 rel="Help"><strong>Status:</strong></a> core<br />
1025 <a href="directive-dict.html#Compatibility"
1026 rel="Help"><strong>Compatibility:</strong></a> only available
1027 in Apache 1.3 and above.
1029 <p>The <FilesMatch> directive provides for access control
1030 by filename, just as the <a href="#files"><Files></a>
1031 directive does. However, it accepts a regular expression. For
1034 <FilesMatch "\.(gif|jpe?g|png)$">
1037 <p>would match most common Internet graphics formats.</p>
1038 <strong>See also</strong>: <a href="../sections.html">How
1039 Directory, Location and Files sections work</a> for an
1040 explanation of how these different sections are combined when a
1044 <h2><a id="forcetype" name="forcetype">ForceType</a>
1046 <a href="directive-dict.html#Syntax"
1047 rel="Help"><strong>Syntax:</strong></a> ForceType
1048 <em>mime-type</em><br />
1049 <a href="directive-dict.html#Context"
1050 rel="Help"><strong>Context:</strong></a> directory,
1052 <a href="directive-dict.html#Status"
1053 rel="Help"><strong>Status:</strong></a> Base<br />
1054 <a href="directive-dict.html#Module"
1055 rel="Help"><strong>Module:</strong></a> core<br />
1056 <a href="directive-dict.html#Compatibility"
1057 rel="Help"><strong>Compatibility:</strong></a> ForceType was
1058 introduced in mod_mime with Apache 1.1, and moved to the core
1061 <p>When placed into an <code>.htaccess</code> file or a
1062 <code><Directory></code>, or
1063 <code><Location></code> or or <code><Files></code>
1064 section, this directive forces all matching files to be served
1065 with the content type identification given by
1066 <em>mime-type</em>. For example, if you had a directory full of
1067 GIF files, but did not want to label them all with ".gif", you
1068 might want to use:</p>
1073 <p>Note that unlike <a href="#defaulttype">DefaultType</a>,
1074 this directive overrides all mime-type associations, including
1075 filename extensions, that might identify the media type.</p>
1078 <h2><a id="hostnamelookups"
1079 name="hostnamelookups">HostnameLookups directive</a></h2>
1081 <a href="directive-dict.html#Syntax"
1082 rel="Help"><strong>Syntax:</strong></a> HostnameLookups
1084 <a href="directive-dict.html#Default"
1085 rel="Help"><strong>Default:</strong></a> <code>HostnameLookups
1087 <a href="directive-dict.html#Context"
1088 rel="Help"><strong>Context:</strong></a> server config, virtual
1089 host, directory<br />
1090 <a href="directive-dict.html#Status"
1091 rel="Help"><strong>Status:</strong></a> core<br />
1092 <a href="directive-dict.html#Compatibility"
1093 rel="Help"><strong>Compatibility:</strong></a>
1094 <code>double</code> available only in Apache 1.3 and
1096 <a href="directive-dict.html#Compatibility"
1097 rel="Help"><strong>Compatibility:</strong></a> Default was
1098 <code>on</code> prior to Apache 1.3.
1100 <p>This directive enables DNS lookups so that host names can be
1101 logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
1102 The value <code>double</code> refers to doing double-reverse
1103 DNS. That is, after a reverse lookup is performed, a forward
1104 lookup is then performed on that result. At least one of the ip
1105 addresses in the forward lookup must match the original
1106 address. (In "tcpwrappers" terminology this is called
1107 <code>PARANOID</code>.)</p>
1109 <p>Regardless of the setting, when <a
1110 href="mod_access.html">mod_access</a> is used for controlling
1111 access by hostname, a double reverse lookup will be performed.
1112 This is necessary for security. Note that the result of this
1113 double-reverse isn't generally available unless you set
1114 <code>HostnameLookups double</code>. For example, if only
1115 <code>HostnameLookups on</code> and a request is made to an
1116 object that is protected by hostname restrictions, regardless
1117 of whether the double-reverse fails or not, CGIs will still be
1118 passed the single-reverse result in
1119 <code>REMOTE_HOST</code>.</p>
1121 <p>The default for this directive was previously
1122 <code>on</code> in versions of Apache prior to 1.3. It was
1123 changed to <code>off</code> in order to save the network
1124 traffic for those sites that don't truly need the reverse
1125 lookups done. It is also better for the end users because they
1126 don't have to suffer the extra latency that a lookup entails.
1127 Heavily loaded sites should leave this directive
1128 <code>off</code>, since DNS lookups can take considerable
1129 amounts of time. The utility <a
1130 href="../programs/logresolve.html">logresolve</a>, provided in
1131 the <em>/support</em> directory, can be used to look up host
1132 names from logged IP addresses offline.</p>
1135 <h2><a id="identitycheck" name="identitycheck">IdentityCheck
1138 <a href="directive-dict.html#Syntax"
1139 rel="Help"><strong>Syntax:</strong></a> IdentityCheck
1141 <a href="directive-dict.html#Default"
1142 rel="Help"><strong>Default:</strong></a> <code>IdentityCheck
1144 <a href="directive-dict.html#Context"
1145 rel="Help"><strong>Context:</strong></a> server config, virtual
1146 host, directory<br />
1147 <a href="directive-dict.html#Status"
1148 rel="Help"><strong>Status:</strong></a> core
1150 <p>This directive enables RFC1413-compliant logging of the
1151 remote user name for each connection, where the client machine
1152 runs identd or something similar. This information is logged in
1153 the access log. <em>Boolean</em> is either <code>on</code> or
1154 <code>off</code>.</p>
1156 <p>The information should not be trusted in any way except for
1157 rudimentary usage tracking.</p>
1159 <p>Note that this can cause serious latency problems accessing
1160 your server since every request requires one of these lookups
1161 to be performed. When firewalls are involved each lookup might
1162 possibly fail and add 30 seconds of latency to each hit. So in
1163 general this is not very useful on public servers accessible
1164 from the Internet.</p>
1167 <h2><a id="ifdefine" name="ifdefine"><IfDefine>
1169 <a href="directive-dict.html#Syntax"
1170 rel="Help"><strong>Syntax:</strong></a> <IfDefine
1171 [!]<em>parameter-name</em>> <em>...</em>
1172 </IfDefine><br />
1173 <a href="directive-dict.html#Default"
1174 rel="Help"><strong>Default:</strong></a> None<br />
1175 <a href="directive-dict.html#Context"
1176 rel="Help"><strong>Context:</strong></a> all<br />
1177 <a href="directive-dict.html#Status"
1178 rel="Help"><strong>Status:</strong></a> Core<br />
1179 <a href="directive-dict.html#Compatibility"
1180 rel="Help"><strong>Compatibility:</strong></a> <IfDefine>
1181 is only available in 1.3.1 and later.
1183 <p>The <IfDefine <em>test</em>>...</IfDefine>
1184 section is used to mark directives that are conditional. The
1185 directives within an IfDefine section are only processed if the
1186 <em>test</em> is true. If <em>test</em> is false, everything
1187 between the start and end markers is ignored.</p>
1189 <p>The <em>test</em> in the <IfDefine> section directive
1190 can be one of two forms:</p>
1193 <li><em>parameter-name</em></li>
1195 <li><code>!</code><em>parameter-name</em></li>
1198 <p>In the former case, the directives between the start and end
1199 markers are only processed if the parameter named
1200 <em>parameter-name</em> is defined. The second format reverses
1201 the test, and only processes the directives if
1202 <em>parameter-name</em> is <strong>not</strong> defined.</p>
1204 <p>The <em>parameter-name</em> argument is a define as given on
1205 the <code>httpd</code> command line via
1206 <code>-D</code><em>parameter-</em>, at the time the server was
1209 <p><IfDefine> sections are nest-able, which can be used
1210 to implement simple multiple-parameter tests. Example:</p>
1212 $ httpd -DReverseProxy ...
1215 <IfDefine ReverseProxy>
1216 LoadModule rewrite_module modules/mod_rewrite.so
1217 LoadModule proxy_module modules/libproxy.so
1222 <h2><a id="ifmodule" name="ifmodule"><IfModule>
1224 <a href="directive-dict.html#Syntax"
1225 rel="Help"><strong>Syntax:</strong></a> <IfModule
1226 [!]<em>module-name</em>> <em>...</em>
1227 </IfModule><br />
1228 <a href="directive-dict.html#Default"
1229 rel="Help"><strong>Default:</strong></a> None<br />
1230 <a href="directive-dict.html#Context"
1231 rel="Help"><strong>Context:</strong></a> all<br />
1232 <a href="directive-dict.html#Status"
1233 rel="Help"><strong>Status:</strong></a> Core<br />
1234 <a href="directive-dict.html#Compatibility"
1235 rel="Help"><strong>Compatibility:</strong></a> IfModule is only
1236 available in 1.2 and later.
1238 <p>The <IfModule <em>test</em>>...</IfModule>
1239 section is used to mark directives that are conditional. The
1240 directives within an IfModule section are only processed if the
1241 <em>test</em> is true. If <em>test</em> is false, everything
1242 between the start and end markers is ignored.</p>
1244 <p>The <em>test</em> in the <IfModule> section directive
1245 can be one of two forms:</p>
1248 <li><em>module name</em></li>
1250 <li>!<em>module name</em></li>
1253 <p>In the former case, the directives between the start and end
1254 markers are only processed if the module named <em>module
1255 name</em> is included in Apache -- either compiled in or
1256 dynamically loaded using <a
1257 href="mod_so.html#loadmodule">LoadModule</a>. The second format
1258 reverses the test, and only processes the directives if <em>module
1259 name</em> is <strong>not</strong> included.</p>
1261 <p>The <em>module name</em> argument is the file name of the
1262 module, at the time it was compiled.
1263 For example, <code>mod_rewrite.c</code>.</p>
1265 <p><IfModule> sections are nest-able, which can be used
1266 to implement simple multiple-module tests.</p>
1269 <h2><a id="include" name="include">Include directive</a></h2>
1270 <strong>Syntax:</strong> Include
1271 <em>file-path</em>|<em>directory-path</em><br />
1272 <a href="directive-dict.html#Context"
1273 rel="Help"><strong>Context:</strong></a> server config<br />
1274 <a href="directive-dict.html#Status"
1275 rel="Help"><strong>Status:</strong></a> Core<br />
1276 <a href="directive-dict.html#Compatibility"
1277 rel="Help"><strong>Compatibility:</strong></a> Include is only
1278 available in Apache 1.3 and later.
1280 <p>This directive allows inclusion of other configuration files
1281 from within the server configuration files.</p>
1283 <p>If <code>Include</code> points to a directory, rather than a
1284 file, Apache will read all files in that directory, and any
1285 subdirectory, and parse those as configuration files.</p>
1287 <p>The file path specified may be a fully qualified path (i.e.
1288 starting with a slash), or may be relative to the
1289 <code>ServerRoot</code> directory.</p>
1294 <code>Include /usr/local/apache/conf/ssl.conf<br />
1295 Include /usr/local/apache/conf/vhosts/
1299 <p>Or, providing paths relative to your <code>ServerRoot</code>
1303 <code>Include conf/ssl.conf<br />
1304 Include conf/vhosts/
1308 <p>Make sure that an included directory does not contain any stray
1309 files, such as editor temporary files, for example, as Apache will
1310 attempt to read them in and use the contents as configuration
1311 directives, which may cause the server to fail on start up.
1312 Running <code>apachectl configtest</code> will give you a list of
1313 the files that are being processed during the configuration
1317 root@host# apachectl configtest
1318 Processing config directory: /usr/local/apache/conf/vhosts
1319 Processing config file: /usr/local/apache/conf/vhosts/vhost1
1320 Processing config file: /usr/local/apache/conf/vhosts/vhost2
1324 <p>This will help in verifying that you are getting only the files
1325 that you intended as part of your configuration.</p>
1327 <p><strong>See also</strong>: <a
1328 href="../programs/apachectl.html">apachectl</a></p>
1333 <h2><a id="keepalive" name="keepalive">KeepAlive
1335 <strong>Syntax:</strong> KeepAlive on/off<br />
1336 <strong>Default:</strong> <code>KeepAlive On</code><br />
1337 <a href="directive-dict.html#Context"
1338 rel="Help"><strong>Context:</strong></a> server config<br />
1339 <a href="directive-dict.html#Status"
1340 rel="Help"><strong>Status:</strong></a> Core<br />
1341 <a href="directive-dict.html#Compatibility"
1342 rel="Help"><strong>Compatibility:</strong></a> KeepAlive is
1343 only available in Apache 1.1 and later.
1345 <p>The Keep-Alive extension to HTTP/1.0 and the persistent
1346 connection feature of HTTP/1.1 provide long-lived HTTP sessions
1347 which allow multiple requests to be sent over the same TCP
1348 connection. In some cases this has been shown to result in an
1349 almost 50% speedup in latency times for HTML documents with
1350 many images. To enable Keep-Alive connections in Apache 1.2 and
1351 later, set <code>KeepAlive On</code>.</p>
1353 <p>For HTTP/1.0 clients, Keep-Alive connections will only be
1354 used if they are specifically requested by a client. In
1355 addition, a Keep-Alive connection with an HTTP/1.0 client can
1356 only be used when the length of the content is known in
1357 advance. This implies that dynamic content such as CGI output,
1358 SSI pages, and server-generated directory listings will
1359 generally not use Keep-Alive connections to HTTP/1.0 clients.
1360 For HTTP/1.1 clients, persistent connections are the default
1361 unless otherwise specified. If the client requests it, chunked
1362 encoding will be used in order to send content of unknown
1363 length over persistent connections.</p>
1366 href="#maxkeepaliverequests">MaxKeepAliveRequests</a>.</p>
1369 <h2><a id="keepalivetimeout"
1370 name="keepalivetimeout">KeepAliveTimeout directive</a></h2>
1371 <a href="directive-dict.html#Syntax"
1372 rel="Help"><strong>Syntax:</strong></a> KeepAliveTimeout
1373 <em>seconds</em><br />
1374 <a href="directive-dict.html#Default"
1375 rel="Help"><strong>Default:</strong></a> <code>KeepAliveTimeout
1377 <a href="directive-dict.html#Context"
1378 rel="Help"><strong>Context:</strong></a> server config<br />
1379 <a href="directive-dict.html#Status"
1380 rel="Help"><strong>Status:</strong></a> Core<br />
1381 <a href="directive-dict.html#Compatibility"
1382 rel="Help"><strong>Compatibility:</strong></a> KeepAliveTimeout
1383 is only available in Apache 1.1 and later.
1385 <p>The number of seconds Apache will wait for a subsequent
1386 request before closing the connection. Once a request has been
1387 received, the timeout value specified by the <a
1388 href="#timeout"><code>Timeout</code></a> directive applies.</p>
1390 <p>Setting <code>KeepAliveTimeout</code> to a high value may
1391 cause performance problems in heavily loaded servers. The
1392 higher the timeout, the more server processes will be kept
1393 occupied waiting on connections with idle clients.</p>
1396 <h2><a id="limit" name="limit"><Limit> directive</a></h2>
1398 <a href="directive-dict.html#Syntax"
1399 rel="Help"><strong>Syntax:</strong></a> <Limit
1400 <em>method</em> [<em>method</em>] ... > ...
1401 </Limit><br />
1402 <a href="directive-dict.html#Context"
1403 rel="Help"><strong>Context:</strong></a> any<br />
1404 <a href="directive-dict.html#Status"
1405 rel="Help"><strong>Status:</strong></a> core
1407 <p>Access controls are normally effective for
1408 <strong>all</strong> access methods, and this is the usual
1409 desired behavior. <strong>In the general case, access control
1410 directives should not be placed within a
1411 <code><limit></code> section.</strong></p>
1413 <p>The purpose of the <Limit> directive is to restrict
1414 the effect of the access controls to the nominated HTTP
1415 methods. For all other methods, the access restrictions that
1416 are enclosed in the <Limit> bracket <strong>will have no
1417 effect</strong>. The following example applies the access
1418 control only to the methods POST, PUT, and DELETE, leaving all
1419 other methods unprotected:</p>
1422 <code><Limit POST PUT DELETE><br />
1423 Require valid-user<br />
1424 </Limit></code>
1426 The method names listed can be one or more of: GET, POST, PUT,
1427 DELETE, CONNECT, OPTIONS, TRACE, PATCH, PROPFIND, PROPPATCH,
1428 MKCOL, COPY, MOVE, LOCK, and UNLOCK. <strong>The method name is
1429 case-sensitive.</strong> If GET is used it will also restrict
1433 <h2><a id="limitexcept" name="limitexcept"><LimitExcept>
1436 <a href="directive-dict.html#Syntax"
1437 rel="Help"><strong>Syntax:</strong></a> <LimitExcept
1438 <em>method</em> [<em>method</em>] ... > ...
1439 </LimitExcept><br />
1440 <a href="directive-dict.html#Context"
1441 rel="Help"><strong>Context:</strong></a> any<br />
1442 <a href="directive-dict.html#Status"
1443 rel="Help"><strong>Status:</strong></a> core<br />
1444 <a href="directive-dict.html#Compatibility"
1445 rel="Help"><strong>Compatibility:</strong></a> Available in
1446 Apache 1.3.5 and later
1448 <p><LimitExcept> and </LimitExcept> are used to
1449 enclose a group of access control directives which will then
1450 apply to any HTTP access method <strong>not</strong> listed in
1451 the arguments; i.e., it is the opposite of a <a
1452 href="#limit"><Limit></a> section and can be used to
1453 control both standard and nonstandard/unrecognized methods. See
1454 the documentation for <a href="#limit"><Limit></a> for
1458 <h2><a id="limitrequestbody"
1459 name="limitrequestbody">LimitRequestBody directive</a></h2>
1461 <a href="directive-dict.html#Syntax"
1462 rel="Help"><strong>Syntax:</strong></a> LimitRequestBody
1463 <em>bytes</em><br />
1464 <a href="directive-dict.html#Default"
1465 rel="Help"><strong>Default:</strong></a> <code>LimitRequestBody
1467 <a href="directive-dict.html#Context"
1468 rel="Help"><strong>Context:</strong></a> server config, virtual
1469 host, directory, .htaccess<br />
1470 <a href="directive-dict.html#Status"
1471 rel="Help"><strong>Status:</strong></a> core<br />
1472 <a href="directive-dict.html#Compatibility"
1473 rel="Help"><strong>Compatibility:</strong></a> LimitRequestBody
1474 is only available in Apache 1.3.2 and later.
1476 <p>This directive specifies the number of <em>bytes</em> from 0
1477 (meaning unlimited) to 2147483647 (2GB) that are allowed in a
1478 request body. The default value is defined by the compile-time
1479 constant <code>DEFAULT_LIMIT_REQUEST_BODY</code> (0 as
1482 <p>The LimitRequestBody directive allows the user to set a
1483 limit on the allowed size of an HTTP request message body
1484 within the context in which the directive is given (server,
1485 per-directory, per-file or per-location). If the client request
1486 exceeds that limit, the server will return an error response
1487 instead of servicing the request. The size of a normal request
1488 message body will vary greatly depending on the nature of the
1489 resource and the methods allowed on that resource. CGI scripts
1490 typically use the message body for passing form information to
1491 the server. Implementations of the PUT method will require a
1492 value at least as large as any representation that the server
1493 wishes to accept for that resource.</p>
1495 <p>This directive gives the server administrator greater
1496 control over abnormal client request behavior, which may be
1497 useful for avoiding some forms of denial-of-service
1501 <h2><a id="limitrequestfields"
1502 name="limitrequestfields">LimitRequestFields directive</a></h2>
1504 <a href="directive-dict.html#Syntax"
1505 rel="Help"><strong>Syntax:</strong></a> LimitRequestFields
1506 <em>number</em><br />
1507 <a href="directive-dict.html#Default"
1508 rel="Help"><strong>Default:</strong></a>
1509 <code>LimitRequestFields 100</code><br />
1510 <a href="directive-dict.html#Context"
1511 rel="Help"><strong>Context:</strong></a> server config<br />
1512 <a href="directive-dict.html#Status"
1513 rel="Help"><strong>Status:</strong></a> core<br />
1514 <a href="directive-dict.html#Compatibility"
1515 rel="Help"><strong>Compatibility:</strong></a>
1516 LimitRequestFields is only available in Apache 1.3.2 and later.
1519 <p><em>Number</em> is an integer from 0 (meaning unlimited) to
1520 32767. The default value is defined by the compile-time
1521 constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
1524 <p>The LimitRequestFields directive allows the server
1525 administrator to modify the limit on the number of request
1526 header fields allowed in an HTTP request. A server needs this
1527 value to be larger than the number of fields that a normal
1528 client request might include. The number of request header
1529 fields used by a client rarely exceeds 20, but this may vary
1530 among different client implementations, often depending upon
1531 the extent to which a user has configured their browser to
1532 support detailed content negotiation. Optional HTTP extensions
1533 are often expressed using request header fields.</p>
1535 <p>This directive gives the server administrator greater
1536 control over abnormal client request behavior, which may be
1537 useful for avoiding some forms of denial-of-service attacks.
1538 The value should be increased if normal clients see an error
1539 response from the server that indicates too many fields were
1540 sent in the request.</p>
1543 <h2><a id="limitrequestfieldsize"
1544 name="limitrequestfieldsize">LimitRequestFieldsize
1547 <a href="directive-dict.html#Syntax"
1548 rel="Help"><strong>Syntax:</strong></a> LimitRequestFieldsize
1549 <em>bytes</em><br />
1550 <a href="directive-dict.html#Default"
1551 rel="Help"><strong>Default:</strong></a>
1552 <code>LimitRequestFieldsize 8190</code><br />
1553 <a href="directive-dict.html#Context"
1554 rel="Help"><strong>Context:</strong></a> server config<br />
1555 <a href="directive-dict.html#Status"
1556 rel="Help"><strong>Status:</strong></a> core<br />
1557 <a href="directive-dict.html#Compatibility"
1558 rel="Help"><strong>Compatibility:</strong></a>
1559 LimitRequestFieldsize is only available in Apache 1.3.2 and
1562 <p>This directive specifies the number of <em>bytes</em> from 0
1563 to the value of the compile-time constant
1564 <code>DEFAULT_LIMIT_REQUEST_FIELDSIZE</code> (8190 as
1565 distributed) that will be allowed in an HTTP request
1568 <p>The LimitRequestFieldsize directive allows the server
1569 administrator to reduce the limit on the allowed size of an
1570 HTTP request header field below the normal input buffer size
1571 compiled with the server. A server needs this value to be large
1572 enough to hold any one header field from a normal client
1573 request. The size of a normal request header field will vary
1574 greatly among different client implementations, often depending
1575 upon the extent to which a user has configured their browser to
1576 support detailed content negotiation.</p>
1578 <p>This directive gives the server administrator greater
1579 control over abnormal client request behavior, which may be
1580 useful for avoiding some forms of denial-of-service attacks.
1581 Under normal conditions, the value should not be changed from
1585 <h2><a id="limitrequestline"
1586 name="limitrequestline">LimitRequestLine directive</a></h2>
1588 <a href="directive-dict.html#Syntax"
1589 rel="Help"><strong>Syntax:</strong></a> LimitRequestLine
1590 <em>bytes</em><br />
1591 <a href="directive-dict.html#Default"
1592 rel="Help"><strong>Default:</strong></a> <code>LimitRequestLine
1594 <a href="directive-dict.html#Context"
1595 rel="Help"><strong>Context:</strong></a> server config<br />
1596 <a href="directive-dict.html#Status"
1597 rel="Help"><strong>Status:</strong></a> core<br />
1598 <a href="directive-dict.html#Compatibility"
1599 rel="Help"><strong>Compatibility:</strong></a> LimitRequestLine
1600 is only available in Apache 1.3.2 and later.
1602 <p>This directive sets the number of <em>bytes</em> from 0 to
1603 the value of the compile-time constant
1604 <code>DEFAULT_LIMIT_REQUEST_LINE</code> (8190 as distributed)
1605 that will be allowed on the HTTP request-line.</p>
1607 <p>The LimitRequestLine directive allows the server
1608 administrator to reduce the limit on the allowed size of a
1609 client's HTTP request-line below the normal input buffer size
1610 compiled with the server. Since the request-line consists of
1611 the HTTP method, URI, and protocol version, the
1612 LimitRequestLine directive places a restriction on the length
1613 of a request-URI allowed for a request on the server. A server
1614 needs this value to be large enough to hold any of its resource
1615 names, including any information that might be passed in the
1616 query part of a GET request.</p>
1618 <p>This directive gives the server administrator greater
1619 control over abnormal client request behavior, which may be
1620 useful for avoiding some forms of denial-of-service attacks.
1621 Under normal conditions, the value should not be changed from
1625 <h2><a id="limitxmlrequestbody"
1626 name="limitxmlrequestbody">LimitXMLRequestBody
1628 <a href="directive-dict.html#Syntax"
1629 rel="Help"><strong>Syntax:</strong></a> LimitXMLRequestBody
1630 <em>number</em><br />
1631 <a href="directive-dict.html#Default"
1632 rel="Help"><strong>Default:</strong></a>
1633 <code>LimitXMLRequestBody 1000000</code><br />
1634 <a href="directive-dict.html#Context"
1635 rel="Help"><strong>Context:</strong></a> server config<br />
1636 <a href="directive-dict.html#Status"
1637 rel="Help"><strong>Status:</strong></a> core<br />
1640 <p>Limit (in bytes) on maximum size of an XML-based request
1641 body. A value of <code>0</code> will disable any checking.</p>
1644 <h2><a id="location" name="location"><Location>
1646 <a href="directive-dict.html#Syntax"
1647 rel="Help"><strong>Syntax:</strong></a> <Location
1648 <em>URL-path</em>|<em>URL</em>> ... </Location><br />
1649 <a href="directive-dict.html#Context"
1650 rel="Help"><strong>Context:</strong></a> server config, virtual
1652 <a href="directive-dict.html#Status"
1653 rel="Help"><strong>Status:</strong></a> core<br />
1654 <a href="directive-dict.html#Compatibility"
1655 rel="Help"><strong>Compatibility:</strong></a> Location is only
1656 available in Apache 1.1 and later.
1658 <p>The <Location> directive provides for access control
1659 by URL. It is similar to the <a
1660 href="#directory"><Directory></a> directive, and starts a
1661 subsection which is terminated with a </Location>
1662 directive. <code><Location></code> sections are processed
1663 in the order they appear in the configuration file, after the
1664 <Directory> sections and <code>.htaccess</code> files are
1665 read, and after the <Files> sections.</p>
1667 <p>Note that URLs do not have to line up with the filesystem at
1668 all, it should be emphasized that <Location> operates
1669 completely outside the filesystem.</p>
1671 <p>For all origin (non-proxy) requests, the URL to be matched
1672 is of the form <code>/path/</code>, and you should not include
1673 any <code>http://servername</code> prefix. For proxy requests,
1674 the URL to be matched is of the form
1675 <code>scheme://servername/path</code>, and you must include the
1678 <p>The URL may use wildcards In a wild-card string, `?' matches
1679 any single character, and `*' matches any sequences of
1682 <p><strong>Apache 1.2 and above:</strong> Extended regular
1683 expressions can also be used, with the addition of the
1684 <code>~</code> character. For example:</p>
1686 <Location ~ "/(extra|special)/data">
1689 <p>would match URLs that contained the substring "/extra/data"
1690 or "/special/data". In Apache 1.3 and above, a new directive <a
1691 href="#locationmatch"><LocationMatch></a> exists which
1692 behaves identical to the regex version of
1693 <code><Location></code>.</p>
1695 <p>The <code>Location</code> functionality is especially useful
1696 when combined with the <code><a
1697 href="mod_mime.html#sethandler">SetHandler</a></code>
1698 directive. For example, to enable status requests, but allow
1699 them only from browsers at foo.com, you might use:</p>
1701 <Location /status>
1702 SetHandler server-status
1709 <p><strong>Apache 1.3 and above note about / (slash)</strong>:
1710 The slash character has special meaning depending on where in a
1711 URL it appears. People may be used to its behavior in the
1712 filesystem where multiple adjacent slashes are frequently
1713 collapsed to a single slash (<em>i.e.</em>,
1714 <code>/home///foo</code> is the same as
1715 <code>/home/foo</code>). In URL-space this is not necessarily
1716 true. The <code><LocationMatch></code> directive and the
1717 regex version of <code><Location></code> require you to
1718 explicitly specify multiple slashes if that is your intention.
1719 For example, <code><LocationMatch ^/abc></code> would
1720 match the request URL <code>/abc</code> but not the request URL
1721 <code>//abc</code>. The (non-regex)
1722 <code><Location></code> directive behaves similarly when
1723 used for proxy requests. But when (non-regex)
1724 <code><Location></code> is used for non-proxy requests it
1725 will implicitly match multiple slashes with a single slash. For
1726 example, if you specify <code><Location /abc/def></code>
1727 and the request is to <code>/abc//def</code> then it will
1730 <p><strong>See also</strong>: <a href="../sections.html">How
1731 Directory, Location and Files sections work</a> for an
1732 explanation of how these different sections are combined when a
1733 request is received</p>
1736 <h2><a id="locationmatch"
1737 name="locationmatch"><LocationMatch></a></h2>
1738 <a href="directive-dict.html#Syntax"
1739 rel="Help"><strong>Syntax:</strong></a> <LocationMatch
1740 <em>regex</em>> ... </LocationMatch><br />
1741 <a href="directive-dict.html#Context"
1742 rel="Help"><strong>Context:</strong></a> server config, virtual
1744 <a href="directive-dict.html#Status"
1745 rel="Help"><strong>Status:</strong></a> core<br />
1746 <a href="directive-dict.html#Compatibility"
1747 rel="Help"><strong>Compatibility:</strong></a> LocationMatch is
1748 only available in Apache 1.3 and later.
1750 <p>The <LocationMatch> directive provides for access
1751 control by URL, in an identical manner to <a
1752 href="#location"><Location></a>. However, it takes a
1753 regular expression as an argument instead of a simple string.
1756 <LocationMatch "/(extra|special)/data">
1759 <p>would match URLs that contained the substring "/extra/data"
1760 or "/special/data".</p>
1761 <strong>See also</strong>: <a href="../sections.html">How
1762 Directory, Location and Files sections work</a> for an
1763 explanation of how these different sections are combined when a
1767 <h2><a id="loglevel" name="loglevel">LogLevel
1769 <a href="directive-dict.html#Syntax"
1770 rel="Help"><strong>Syntax:</strong></a> LogLevel
1771 <em>level</em><br />
1772 <a href="directive-dict.html#Default"
1773 rel="Help"><strong>Default:</strong></a> <code>LogLevel
1775 <a href="directive-dict.html#Context"
1776 rel="Help"><strong>Context:</strong></a> server config, virtual
1778 <a href="directive-dict.html#Status"
1779 rel="Help"><strong>Status:</strong></a> core<br />
1780 <a href="directive-dict.html#Compatibility"
1781 rel="Help"><strong>Compatibility:</strong></a> LogLevel is only
1782 available in 1.3 or later.
1784 <p>LogLevel adjusts the verbosity of the messages recorded in
1785 the error logs (see <a href="#errorlog">ErrorLog</a>
1786 directive). The following <em>level</em>s are available, in
1787 order of decreasing significance:</p>
1791 <th align="LEFT"><strong>Level</strong> </th>
1793 <th align="LEFT"><strong>Description</strong> </th>
1800 <th align="LEFT"><strong>Example</strong> </th>
1804 <td><code>emerg</code> </td>
1806 <td>Emergencies - system is unusable.</td>
1813 <td>"Child cannot open lock file. Exiting"</td>
1817 <td><code>alert</code> </td>
1819 <td>Action must be taken immediately.</td>
1826 <td>"getpwuid: couldn't determine user name from uid"</td>
1830 <td><code>crit</code> </td>
1832 <td>Critical Conditions.</td>
1839 <td>"socket: Failed to get a socket, exiting child"</td>
1843 <td><code>error</code> </td>
1845 <td>Error conditions.</td>
1852 <td>"Premature end of script headers"</td>
1856 <td><code>warn</code> </td>
1858 <td>Warning conditions.</td>
1865 <td>"child process 1234 did not exit, sending another
1870 <td><code>notice</code> </td>
1872 <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>
1893 <td>"Server seems busy, (you may need to increase
1894 StartServers, or Min/MaxSpareServers)..."</td>
1898 <td><code>debug</code> </td>
1900 <td>Debug-level messages</td>
1907 <td>"Opening config file ..."</td>
1911 <p>When a particular level is specified, messages from all
1912 other levels of higher significance will be reported as well.
1913 <em>E.g.</em>, when <code>LogLevel info</code> is specified,
1914 then messages with log levels of <code>notice</code> and
1915 <code>warn</code> will also be posted.</p>
1917 <p>Using a level of at least <code>crit</code> is
1921 <h2><a id="maxkeepaliverequests"
1922 name="maxkeepaliverequests">MaxKeepAliveRequests
1924 <a href="directive-dict.html#Syntax"
1925 rel="Help"><strong>Syntax:</strong></a> MaxKeepAliveRequests
1926 <em>number</em><br />
1927 <a href="directive-dict.html#Default"
1928 rel="Help"><strong>Default:</strong></a>
1929 <code>MaxKeepAliveRequests 100</code><br />
1930 <a href="directive-dict.html#Context"
1931 rel="Help"><strong>Context:</strong></a> server config<br />
1932 <a href="directive-dict.html#Status"
1933 rel="Help"><strong>Status:</strong></a> core<br />
1934 <a href="directive-dict.html#Compatibility"
1935 rel="Help"><strong>Compatibility:</strong></a> Only available
1936 in Apache 1.2 and later.
1938 <p>The MaxKeepAliveRequests directive limits the number of
1939 requests allowed per connection when <a
1940 href="#keepalive">KeepAlive</a> is on. If it is set to
1941 "<code>0</code>", unlimited requests will be allowed. We
1942 recommend that this setting be kept to a high value for maximum
1943 server performance.</p>
1946 <h2><a id="namevirtualhost"
1947 name="namevirtualhost">NameVirtualHost directive</a></h2>
1949 <a href="directive-dict.html#Syntax"
1950 rel="Help"><strong>Syntax:</strong></a> NameVirtualHost
1951 <em>addr</em>[:<em>port</em>]<br />
1952 <a href="directive-dict.html#Context"
1953 rel="Help"><strong>Context:</strong></a> server config<br />
1954 <a href="directive-dict.html#Status"
1955 rel="Help"><strong>Status:</strong></a> core<br />
1956 <a href="directive-dict.html#Compatibility"
1957 rel="Help"><strong>Compatibility:</strong></a> NameVirtualHost
1958 is only available in Apache 1.3 and later
1960 <p>The NameVirtualHost directive is a required directive if you
1961 want to configure <a href="../vhosts/">name-based virtual
1964 <p>Although <em>addr</em> can be hostname it is recommended
1965 that you always use an IP address, <em>e.g.</em></p>
1968 <code>NameVirtualHost 111.22.33.44</code>
1970 With the NameVirtualHost directive you specify the IP address
1971 on which the server will receive requests for the name-based
1972 virtual hosts. This will usually be the address to which your
1973 name-based virtual host names resolve. In cases where a
1974 firewall or other proxy receives the requests and forwards them
1975 on a different IP address to the server, you must specify the
1976 IP address of the physical interface on the machine which will
1977 be servicing the requests. If you have multiple name-based
1978 hosts on multiple addresses, repeat the directive for each
1981 <p>Note: the "main server" and any _default_ servers will
1982 <strong>never</strong> be served for a request to a
1983 NameVirtualHost IP Address (unless for some reason you specify
1984 NameVirtualHost but then don't define any VirtualHosts for that
1987 <p>Optionally you can specify a port number on which the
1988 name-based virtual hosts should be used, <em>e.g.</em></p>
1991 <code>NameVirtualHost 111.22.33.44:8080</code>
1994 <p>IPv6 addresses must be enclosed in square brackets, as shown
1995 in the following example:</p>
1998 <code>NameVirtualHost [fe80::a00:20ff:fea7:ccea]:8080</code>
2001 <strong>See also:</strong> <a href="../vhosts/">Apache Virtual
2002 Host documentation</a>
2005 <h2><a id="options" name="options">Options directive</a></h2>
2007 <a href="directive-dict.html#Syntax"
2008 rel="Help"><strong>Syntax:</strong></a> Options
2009 [+|-]<em>option</em> [[+|-]<em>option</em>] ...<br />
2010 <a href="directive-dict.html#Context"
2011 rel="Help"><strong>Context:</strong></a> server config, virtual
2012 host, directory, .htaccess<br />
2013 <a href="directive-dict.html#Override"
2014 rel="Help"><strong>Override:</strong></a> Options<br />
2015 <a href="directive-dict.html#Status"
2016 rel="Help"><strong>Status:</strong></a> core
2018 <p>The Options directive controls which server features are
2019 available in a particular directory.</p>
2021 <p><em>option</em> can be set to <code>None</code>, in which
2022 case none of the extra features are enabled, or one or more of
2028 <dd>All options except for MultiViews. This is the default
2034 Execution of CGI scripts is permitted.</dd>
2036 <dt>FollowSymLinks</dt>
2040 The server will follow symbolic links in this
2042 <strong>Note</strong>: even though the server follows the
2043 symlink it does <em>not</em> change the pathname used to
2044 match against <code><Directory></code> sections.<br />
2045 <strong>Note</strong>: this option gets ignored if set
2046 inside a <Location> section.</dd>
2051 Server-side includes are permitted.</dd>
2053 <dt>IncludesNOEXEC</dt>
2057 Server-side includes are permitted, but the #exec command and
2058 #exec CGI are disabled. It is still possible to #include
2059 virtual CGI scripts from ScriptAliase'd directories.</dd>
2064 If a URL which maps to a directory is requested, and the
2065 there is no DirectoryIndex (<em>e.g.</em>, index.html) in
2066 that directory, then the server will return a formatted
2067 listing of the directory.</dd>
2072 <a href="../content-negotiation.html">Content negotiated</a>
2073 MultiViews are allowed.</dd>
2075 <dt>SymLinksIfOwnerMatch</dt>
2079 The server will only follow symbolic links for which the
2080 target file or directory is owned by the same user id as the
2082 <strong>Note</strong>: this option gets ignored if set
2083 inside a <Location> section.</dd>
2085 Normally, if multiple <code>Options</code> could apply to a
2086 directory, then the most specific one is taken complete; the
2087 options are not merged. However if <em>all</em> the options on
2088 the <code>Options</code> directive are preceded by a + or -
2089 symbol, the options are merged. Any options preceded by a + are
2090 added to the options currently in force, and any options
2091 preceded by a - are removed from the options currently in
2094 <p>For example, without any + and - symbols:</p>
2097 <code><Directory /web/docs><br />
2098 Options Indexes FollowSymLinks<br />
2099 </Directory><br />
2100 <Directory /web/docs/spec><br />
2101 Options Includes<br />
2102 </Directory></code>
2104 then only <code>Includes</code> will be set for the
2105 /web/docs/spec directory. However if the second
2106 <code>Options</code> directive uses the + and - symbols:
2109 <code><Directory /web/docs><br />
2110 Options Indexes FollowSymLinks<br />
2111 </Directory><br />
2112 <Directory /web/docs/spec><br />
2113 Options +Includes -Indexes<br />
2114 </Directory></code>
2116 then the options <code>FollowSymLinks</code> and
2117 <code>Includes</code> are set for the /web/docs/spec directory.
2120 <p><strong>Note:</strong> Using <code>-IncludesNOEXEC</code> or
2121 <code>-Includes</code> disables server-side includes completely
2122 regardless of the previous setting.</p>
2124 <p>The default in the absence of any other settings is
2125 <code>All</code>.</p>
2128 <h2><a id="require" name="require">Require directive</a></h2>
2130 <a href="directive-dict.html#Syntax"
2131 rel="Help"><strong>Syntax:</strong></a> Require
2132 <em>entity-name</em> [<em>entity-name</em>] ...<br />
2133 <a href="directive-dict.html#Context"
2134 rel="Help"><strong>Context:</strong></a> directory,
2136 <a href="directive-dict.html#Override"
2137 rel="Help"><strong>Override:</strong></a> AuthConfig<br />
2138 <a href="directive-dict.html#Status"
2139 rel="Help"><strong>Status:</strong></a> core
2141 <p>This directive selects which authenticated users can access
2142 a directory. The allowed syntaxes are:</p>
2146 Require user <em>userid</em> [<em>userid</em>] ...
2148 <p>Only the named users can access the directory.</p>
2152 Require group <em>group-name</em> [<em>group-name</em>] ...
2155 <p>Only users in the named groups can access the
2162 <p>All valid users can access the directory.</p>
2166 <p>Require must be accompanied by <a
2167 href="#authname">AuthName</a> and <a
2168 href="#authtype">AuthType</a> directives, and directives such
2169 as <a href="mod_auth.html#authuserfile">AuthUserFile</a> and <a
2170 href="mod_auth.html#authgroupfile">AuthGroupFile</a> (to define
2171 users and groups) in order to work correctly. Example:</p>
2174 <code>AuthType Basic<br />
2175 AuthName "Restricted Directory"<br />
2176 AuthUserFile /web/users<br />
2177 AuthGroupFile /web/groups<br />
2178 Require group admin<br />
2181 Access controls which are applied in this way are effective for
2182 <strong>all</strong> methods. <strong>This is what is normally
2183 desired.</strong> If you wish to apply access controls only to
2184 specific methods, while leaving other methods unprotected, then
2185 place the <code>Require</code> statement into a <a
2186 href="#limit"><Limit></a> section
2188 <p>See also <a href="#satisfy">Satisfy</a> and <a
2189 href="mod_access.html">mod_access</a>.</p>
2192 <h2><a id="rlimit" name="rlimit">RLimitCPU</a> <a
2193 id="rlimitcpu" name="rlimitcpu">directive</a></h2>
2195 <a href="directive-dict.html#Syntax"
2196 rel="Help"><strong>Syntax:</strong></a> RLimitCPU
2197 <em>number</em>|max [<em>number</em>|max] <br />
2198 <a href="directive-dict.html#Default"
2199 rel="Help"><strong>Default:</strong></a> <em>Unset; uses
2200 operating system defaults</em> <br />
2201 <a href="directive-dict.html#Context"
2202 rel="Help"><strong>Context:</strong></a> server config, virtual
2204 <a href="directive-dict.html#Status"
2205 rel="Help"><strong>Status:</strong></a> core<br />
2206 <a href="directive-dict.html#Compatibility"
2207 rel="Help"><strong>Compatibility:</strong></a> RLimitCPU is
2208 only available in Apache 1.2 and later. Moved in version 2.0 to
2209 the <a href="../mpm.html">MPMs</a>.
2211 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2212 resource limit for all processes and the second parameter sets
2213 the maximum resource limit. Either parameter can be a number,
2214 or <em>max</em> to indicate to the server that the limit should
2215 be set to the maximum allowed by the operating system
2216 configuration. Raising the maximum resource limit requires that
2217 the server is running as root, or in the initial startup
2220 <p>This applies to processes forked off from Apache children
2221 servicing requests, not the Apache children themselves. This
2222 includes CGI scripts and SSI exec commands, but not any
2223 processes forked off from the Apache parent such as piped
2226 <p>CPU resource limits are expressed in seconds per
2229 <p>See also <a href="#rlimitmem">RLimitMEM</a> or <a
2230 href="#rlimitnproc">RLimitNPROC</a>.</p>
2233 <h2><a id="rlimitmem" name="rlimitmem">RLimitMEM
2236 <a href="directive-dict.html#Syntax"
2237 rel="Help"><strong>Syntax:</strong></a> RLimitMEM
2238 <em>number</em>|max [<em>number</em>|max]<br />
2239 <a href="directive-dict.html#Default"
2240 rel="Help"><strong>Default:</strong></a> <em>Unset; uses
2241 operating system defaults</em> <br />
2242 <a href="directive-dict.html#Context"
2243 rel="Help"><strong>Context:</strong></a> server config, virtual
2245 <a href="directive-dict.html#Status"
2246 rel="Help"><strong>Status:</strong></a> core<br />
2247 <a href="directive-dict.html#Compatibility"
2248 rel="Help"><strong>Compatibility:</strong></a> RLimitMEM is
2249 only available in Apache 1.2 and later. Moved in version 2.0 to
2250 the <a href="../mpm.html">MPMs</a>.
2252 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2253 resource limit for all processes and the second parameter sets
2254 the maximum resource limit. Either parameter can be a number,
2255 or <em>max</em> to indicate to the server that the limit should
2256 be set to the maximum allowed by the operating system
2257 configuration. Raising the maximum resource limit requires that
2258 the server is running as root, or in the initial startup
2261 <p>This applies to processes forked off from Apache children
2262 servicing requests, not the Apache children themselves. This
2263 includes CGI scripts and SSI exec commands, but not any
2264 processes forked off from the Apache parent such as piped
2267 <p>Memory resource limits are expressed in bytes per
2270 <p>See also <a href="#rlimitcpu">RLimitCPU</a> or <a
2271 href="#rlimitnproc">RLimitNPROC</a>.</p>
2274 <h2><a id="rlimitnproc" name="rlimitnproc">RLimitNPROC
2277 <a href="directive-dict.html#Syntax"
2278 rel="Help"><strong>Syntax:</strong></a> RLimitNPROC
2279 <em>number</em>|max [<em>number</em>|max]<br />
2280 <a href="directive-dict.html#Default"
2281 rel="Help"><strong>Default:</strong></a> <em>Unset; uses
2282 operating system defaults</em> <br />
2283 <a href="directive-dict.html#Context"
2284 rel="Help"><strong>Context:</strong></a> server config, virtual
2286 <a href="directive-dict.html#Status"
2287 rel="Help"><strong>Status:</strong></a> core<br />
2288 <a href="directive-dict.html#Compatibility"
2289 rel="Help"><strong>Compatibility:</strong></a> RLimitNPROC is
2290 only available in Apache 1.2 and later. Moved in version 2.0 to
2291 the <a href="../mpm.html">MPMs</a>.
2293 <p>Takes 1 or 2 parameters. The first parameter sets the soft
2294 resource limit for all processes and the second parameter sets
2295 the maximum resource limit. Either parameter can be a number,
2296 or <code>max</code> to indicate to the server that the limit
2297 should be set to the maximum allowed by the operating system
2298 configuration. Raising the maximum resource limit requires that
2299 the server is running as root, or in the initial startup
2302 <p>This applies to processes forked off from Apache children
2303 servicing requests, not the Apache children themselves. This
2304 includes CGI scripts and SSI exec commands, but not any
2305 processes forked off from the Apache parent such as piped
2308 <p>Process limits control the number of processes per user.</p>
2310 <p>Note: If CGI processes are <strong>not</strong> running
2311 under userids other than the web server userid, this directive
2312 will limit the number of processes that the server itself can
2313 create. Evidence of this situation will be indicated by
2314 <strong><em>cannot fork</em></strong> messages in the
2317 <p>See also <a href="#rlimitmem">RLimitMEM</a> or <a
2318 href="#rlimitcpu">RLimitCPU</a>.</p>
2321 <h2><a id="satisfy" name="satisfy">Satisfy directive</a></h2>
2323 <a href="directive-dict.html#Syntax"
2324 rel="Help"><strong>Syntax:</strong></a> Satisfy any|all<br />
2325 <a href="directive-dict.html#Default"
2326 rel="Help"><strong>Default:</strong></a> Satisfy all<br />
2327 <a href="directive-dict.html#Context"
2328 rel="Help"><strong>Context:</strong></a> directory,
2330 <a href="directive-dict.html#Status"
2331 rel="Help"><strong>Status:</strong></a> core<br />
2332 <a href="directive-dict.html#Compatibility"
2333 rel="Help"><strong>Compatibility:</strong></a> Satisfy is only
2334 available in Apache 1.2 and later
2336 <p>Access policy if both <code>Allow</code> and
2337 <code>Require</code> used. The parameter can be either
2338 <em>'all'</em> or <em>'any'</em>. This directive is only useful
2339 if access to a particular area is being restricted by both
2340 username/password <em>and</em> client host address. In this
2341 case the default behavior ("all") is to require that the client
2342 passes the address access restriction <em>and</em> enters a
2343 valid username and password. With the "any" option the client
2344 will be granted access if they either pass the host restriction
2345 or enter a valid username and password. This can be used to
2346 password restrict an area, but to let clients from particular
2347 addresses in without prompting for a password.</p>
2349 <p>See also <a href="#require">Require</a> and <a
2350 href="mod_access.html">mod_access</a>.</p>
2353 <h2><a id="scriptinterpretersource"
2354 name="scriptinterpretersource">ScriptInterpreterSource
2357 <a href="directive-dict.html#Syntax"
2358 rel="Help"><strong>Syntax:</strong></a> ScriptInterpreterSource
2359 registry|script<br />
2360 <a href="directive-dict.html#Default"
2361 rel="Help"><strong>Default:</strong></a>
2362 <code>ScriptInterpreterSource script</code> <br />
2363 <a href="directive-dict.html#Context"
2364 rel="Help"><strong>Context:</strong></a> directory,
2366 <a href="directive-dict.html#Status"
2367 rel="Help"><strong>Status:</strong></a> core (Windows only)
2369 <p>This directive is used to control how Apache 1.3.5 and later
2370 finds the interpreter used to run CGI scripts. The default
2371 technique is to use the interpreter pointed to by the #! line
2372 in the script. Setting ScriptInterpreterSource registry will
2373 cause the Windows Registry to be searched using the script file
2374 extension (e.g., .pl) as a search key.</p>
2377 <h2><a id="serveradmin" name="serveradmin">ServerAdmin
2380 <a href="directive-dict.html#Syntax"
2381 rel="Help"><strong>Syntax:</strong></a> ServerAdmin
2382 <em>email-address</em><br />
2383 <a href="directive-dict.html#Context"
2384 rel="Help"><strong>Context:</strong></a> server config, virtual
2386 <a href="directive-dict.html#Status"
2387 rel="Help"><strong>Status:</strong></a> core
2389 <p>The ServerAdmin sets the e-mail address that the server
2390 includes in any error messages it returns to the client.</p>
2392 <p>It may be worth setting up a dedicated address for this,
2396 <code>ServerAdmin www-admin@foo.bar.com</code>
2398 as users do not always mention that they are talking about the
2402 <h2><a id="serveralias" name="serveralias">ServerAlias
2404 <a href="directive-dict.html#Syntax"
2405 rel="Help"><strong>Syntax:</strong></a> ServerAlias
2406 <em>hostname</em> [<em>hostname</em>] ...<br />
2407 <a href="directive-dict.html#Context"
2408 rel="Help"><strong>Context:</strong></a> virtual host<br />
2409 <a href="directive-dict.html#Status"
2410 rel="Help"><strong>Status:</strong></a> core<br />
2411 <a href="directive-dict.html#Compatibility"
2412 rel="Help"><strong>Compatibility:</strong></a> ServerAlias is
2413 only available in Apache 1.1 and later.
2415 <p>The ServerAlias directive sets the alternate names for a
2416 host, for use with <a
2417 href="../vhosts/name-based.html">name-based virtual
2423 <VirtualHost *>
2424 ServerName server.domain.com
2425 ServerAlias server server2.domain.com server2
2427 </VirtualHost>
2430 <p><strong>See also:</strong> <a href="../vhosts/">Apache
2431 Virtual Host documentation</a></p>
2434 <h2><a id="servername" name="servername">ServerName
2437 <a href="directive-dict.html#Syntax"
2438 rel="Help"><strong>Syntax:</strong></a> ServerName
2439 <em>fully-qualified-domain-name[:port]</em> <br />
2440 <a href="directive-dict.html#Context"
2441 rel="Help"><strong>Context:</strong></a> server config, virtual
2443 <a href="directive-dict.html#Status"
2444 rel="Help"><strong>Status:</strong></a> core<br />
2445 <a href="directive-dict.html#Compatibility"
2446 rel="Help"><strong>Compatibility:</strong></a> In version 2.0, this
2447 directive supercedes the functionality of the <code>Port</code>
2448 directive from version 1.3.
2450 <p>The <code>ServerName</code> directive sets the hostname and
2451 port that the server uses to identify itself. This is used when
2452 creating redirection URLs. For example, if the name of the
2453 machine hosting the webserver is <code>simple.example.com</code>,
2454 but the machine also has the DNS alias <code>www.example.com</code>
2455 and you wish the webserver to be so identified, the following
2456 directive should be used:</p>
2459 <code>ServerName www.example.com:80</code>
2462 <p>If no <code>ServerName</code> is specified, then the server attempts
2463 to deduce the hostname by performing a reverse lookup on the IP
2464 address. If no port is specified in the servername, then the
2465 server will use the port from the incoming request. For optimal
2466 reliability and predictability, you should specify an explict
2467 hostname and port using the <code>ServerName</code> directive.</p>
2469 <p>If you are using <a
2470 href="../vhosts/name-based.html">name-based virtual hosts</a>,
2471 the <code>ServerName</code> inside a <a
2472 href="#virtualhost"><code><VirtualHost></code></a>
2473 section specifies what hostname must appear in the request's
2474 <code>Host:</code> header to match this virtual host.</p>
2476 <p>See the description of the
2477 <a href="#usecanonicalname">UseCanonicalName</a> directive for
2478 settings which determine whether self-referential URL's (e.g., by the
2479 <a href="mod_dir.html">mod_dir</a> module) will refer to the
2480 specified port, or to the port number given in the client's request.
2483 <p><strong>See Also</strong>:<br />
2484 <a href="../dns-caveats.html">DNS Issues</a><br />
2485 <a href="../vhosts/">Apache virtual host
2486 documentation</a><br />
2487 <a href="#usecanonicalname">UseCanonicalName</a><br />
2488 <a href="#namevirtualhost">NameVirtualHost</a><br />
2489 <a href="#serveralias">ServerAlias</a><br />
2493 <h2><a id="serverpath" name="serverpath">ServerPath
2495 <a href="directive-dict.html#Syntax"
2496 rel="Help"><strong>Syntax:</strong></a> ServerPath
2497 <em>directory-path</em><br />
2498 <a href="directive-dict.html#Context"
2499 rel="Help"><strong>Context:</strong></a> virtual host<br />
2500 <a href="directive-dict.html#Status"
2501 rel="Help"><strong>Status:</strong></a> core<br />
2502 <a href="directive-dict.html#Compatibility"
2503 rel="Help"><strong>Compatibility:</strong></a> ServerPath is
2504 only available in Apache 1.1 and later.
2506 <p>The ServerPath directive sets the legacy URL pathname for a
2507 host, for use with <a href="../vhosts/">name-based virtual
2510 <p><strong>See also:</strong> <a href="../vhosts/">Apache
2511 Virtual Host documentation</a></p>
2514 <h2><a id="serverroot" name="serverroot">ServerRoot
2517 <a href="directive-dict.html#Syntax"
2518 rel="Help"><strong>Syntax:</strong></a> ServerRoot
2519 <em>directory-path</em><br />
2520 <a href="directive-dict.html#Default"
2521 rel="Help"><strong>Default:</strong></a> <code>ServerRoot
2522 /usr/local/apache</code><br />
2523 <a href="directive-dict.html#Context"
2524 rel="Help"><strong>Context:</strong></a> server config<br />
2525 <a href="directive-dict.html#Status"
2526 rel="Help"><strong>Status:</strong></a> core
2528 <p>The ServerRoot directive sets the directory in which the
2529 server lives. Typically it will contain the subdirectories
2530 <code>conf/</code> and <code>logs/</code>. Relative paths for
2531 other configuration files are taken as relative to this
2534 <p>See also <a href="../invoking.html">the <code>-d</code>
2535 option to httpd</a>.</p>
2537 <p>See also <a href="../misc/security_tips.html#serverroot">the
2538 security tips</a> for information on how to properly set
2539 permissions on the ServerRoot.</p>
2542 <h2><a id="serversignature"
2543 name="serversignature">ServerSignature directive</a></h2>
2545 <a href="directive-dict.html#Syntax"
2546 rel="Help"><strong>Syntax:</strong></a> ServerSignature
2548 <a href="directive-dict.html#Default"
2549 rel="Help"><strong>Default:</strong></a> <code>ServerSignature
2551 <a href="directive-dict.html#Context"
2552 rel="Help"><strong>Context:</strong></a> server config, virtual
2553 host, directory, .htaccess<br />
2554 <a href="directive-dict.html#Status"
2555 rel="Help"><strong>Status:</strong></a> core<br />
2556 <a href="directive-dict.html#Compatibility"
2557 rel="Help"><strong>Compatibility:</strong></a> ServerSignature
2558 is only available in Apache 1.3 and later.
2560 <p>The ServerSignature directive allows the configuration of a
2561 trailing footer line under server-generated documents (error
2562 messages, mod_proxy ftp directory listings, mod_info output,
2563 ...). The reason why you would want to enable such a footer
2564 line is that in a chain of proxies, the user often has no
2565 possibility to tell which of the chained servers actually
2566 produced a returned error message.<br />
2567 The <samp>Off</samp> setting, which is the default, suppresses
2568 the error line (and is therefore compatible with the behavior
2569 of Apache-1.2 and below). The <samp>On</samp> setting simply
2570 adds a line with the server version number and <a
2571 href="#servername">ServerName</a> of the serving virtual host,
2572 and the <samp>EMail</samp> setting additionally creates a
2573 "mailto:" reference to the <a
2574 href="#serveradmin">ServerAdmin</a> of the referenced
2578 <h2><a id="servertokens" name="servertokens">ServerTokens
2581 <a href="directive-dict.html#Syntax"
2582 rel="Help"><strong>Syntax:</strong></a> ServerTokens
2583 Minimal|ProductOnly|OS|Full<br />
2584 <a href="directive-dict.html#Default"
2585 rel="Help"><strong>Default:</strong></a> <code>ServerTokens
2587 <a href="directive-dict.html#Context"
2588 rel="Help"><strong>Context:</strong></a> server config <br />
2589 <a href="directive-dict.html#Status"
2590 rel="Help"><strong>Status:</strong></a> core<br />
2591 <a href="directive-dict.html#Compatibility"
2592 rel="Help"><strong>Compatibility:</strong></a> ServerTokens is
2593 only available in Apache 1.3 and later; the
2594 <code>ProductOnly</code> keyword is only available in versions
2597 <p>This directive controls whether <samp>Server</samp> response
2598 header field which is sent back to clients includes a
2599 description of the generic OS-type of the server as well as
2600 information about compiled-in modules.</p>
2603 <dt><code>ServerTokens Prod[uctOnly]</code></dt>
2605 <dd>Server sends (<em>e.g.</em>): <samp>Server:
2608 <dt><code>ServerTokens Min[imal]</code></dt>
2610 <dd>Server sends (<em>e.g.</em>): <samp>Server:
2611 Apache/1.3.0</samp></dd>
2613 <dt><code>ServerTokens OS</code></dt>
2615 <dd>Server sends (<em>e.g.</em>): <samp>Server: Apache/1.3.0
2618 <dt><code>ServerTokens Full</code> (or not specified)</dt>
2620 <dd>Server sends (<em>e.g.</em>): <samp>Server: Apache/1.3.0
2621 (Unix) PHP/3.0 MyMod/1.2</samp></dd>
2624 <p>This setting applies to the entire server, and cannot be
2625 enabled or disabled on a virtualhost-by-virtualhost basis.</p>
2628 <h2><a id="sethandler" name="sethandler">SetHandler</a>
2630 <a href="directive-dict.html#Syntax"
2631 rel="Help"><strong>Syntax:</strong></a> SetHandler
2632 <em>handler-name</em><br />
2633 <a href="directive-dict.html#Context"
2634 rel="Help"><strong>Context:</strong></a> directory, files,
2635 location, .htaccess<br />
2636 <a href="directive-dict.html#Status"
2637 rel="Help"><strong>Status:</strong></a> Base<br />
2638 <a href="directive-dict.html#Module"
2639 rel="Help"><strong>Module:</strong></a> core<br />
2640 <a href="directive-dict.html#Compatibility"
2641 rel="Help"><strong>Compatibility:</strong></a> SetHandler was
2642 introduced in mod_mime with Apache 1.1, and moved into the core
2645 <p>When placed into an <code>.htaccess</code> file or a
2646 <code><Directory></code> or <code><Location></code>
2647 section, this directive forces all matching files to be parsed
2648 through the <a href="../handler.html">handler</a> given by
2649 <em>handler-name</em>. For example, if you had a directory you
2650 wanted to be parsed entirely as imagemap rule files, regardless
2651 of extension, you might put the following into an
2652 <code>.htaccess</code> file in that directory:</p>
2654 SetHandler imap-file
2657 <p>Another example: if you wanted to have the server display a
2658 status report whenever a URL of
2659 <code>http://servername/status</code> was called, you might put
2660 the following into access.conf:</p>
2662 <Location /status>
2663 SetHandler server-status
2668 <h2><a id="setinputfilter" name="setinputfilter">SetInputFilter
2671 <p><a href="directive-dict.html#Syntax"
2672 rel="Help"><strong>Syntax:</strong></a> SetInputFilter
2673 <em>filter</em>[<em>;filter</em>...]<br />
2674 <a href="directive-dict.html#Default"
2675 rel="Help"><strong>Default:</strong></a> none<br />
2676 <a href="directive-dict.html#Context"
2677 rel="Help"><strong>Context:</strong></a> directory, files,
2678 location, .htaccess<br />
2679 <a href="directive-dict.html#Status"
2680 rel="Help"><strong>Status:</strong></a> core</p>
2682 <p>The <code>SetInputFilter</code> directive sets the filter or
2683 filters which will process client requests and POST input when
2684 they are received by the server. This is in addition to any
2685 filters defined elsewhere, including the <a
2686 href="mod_mime.html#addinputfilter">AddInputFilter</a>
2689 <p>If more than one filter is specified, they must be seperated
2690 by semicolons in the order in which they should process the
2693 <p>See also the <a href="../filter.html">Filters</a>
2697 <h2><a id="setoutputfilter"
2698 name="setoutputfilter">SetOutputFilter directive</a></h2>
2700 <p><a href="directive-dict.html#Syntax"
2701 rel="Help"><strong>Syntax:</strong></a> SetOutputFilter
2702 <em>filter</em> [<em>filter</em>] ...<br />
2703 <a href="directive-dict.html#Default"
2704 rel="Help"><strong>Default:</strong></a> none<br />
2705 <a href="directive-dict.html#Context"
2706 rel="Help"><strong>Context:</strong></a> directory, files,
2707 location, .htaccess<br />
2708 <a href="directive-dict.html#Status"
2709 rel="Help"><strong>Status:</strong></a> core</p>
2711 <p>The <code>SetOutputFilter</code> directive sets the filters
2712 which will process responses from the server before they are
2713 sent to the client. This is in addition to any filters defined
2714 elsewhere, including the <a
2715 href="mod_mime.html#addoutputfilter">AddOutputFilter</a>
2717 For example, the following configuration will process all files
2718 in the <code>/www/data/</code> directory for server-side
2724 <code><Directory /www/data/><br />
2725 SetOutputFilter INCLUDES<br />
2726 </Directory></code>
2729 <p>If more than one filter is specified, they must be seperated
2730 by semicolons in the order in which they should process the
2733 <p>See also the <a href="../filter.html">Filters</a>
2737 <h2><a id="timeout" name="timeout">TimeOut directive</a></h2>
2739 <a href="directive-dict.html#Syntax"
2740 rel="Help"><strong>Syntax:</strong></a> TimeOut
2741 <em>number</em><br />
2742 <a href="directive-dict.html#Default"
2743 rel="Help"><strong>Default:</strong></a> <code>TimeOut
2745 <a href="directive-dict.html#Context"
2746 rel="Help"><strong>Context:</strong></a> server config<br />
2747 <a href="directive-dict.html#Status"
2748 rel="Help"><strong>Status:</strong></a> core
2750 <p>The TimeOut directive currently defines the amount of time
2751 Apache will wait for three things:</p>
2754 <li>The total amount of time it takes to receive a GET
2757 <li>The amount of time between receipt of TCP packets on a
2758 POST or PUT request.</li>
2760 <li>The amount of time between ACKs on transmissions of TCP
2761 packets in responses.</li>
2763 We plan on making these separately configurable at some point
2764 down the road. The timer used to default to 1200 before 1.2,
2765 but has been lowered to 300 which is still far more than
2766 necessary in most situations. It is not set any lower by
2767 default because there may still be odd places in the code where
2768 the timer is not reset when a packet is sent.
2771 <h2><a id="usecanonicalname"
2772 name="usecanonicalname">UseCanonicalName directive</a></h2>
2774 <a href="directive-dict.html#Syntax"
2775 rel="Help"><strong>Syntax:</strong></a> UseCanonicalName
2777 <a href="directive-dict.html#Default"
2778 rel="Help"><strong>Default:</strong></a> <code>UseCanonicalName
2780 <a href="directive-dict.html#Context"
2781 rel="Help"><strong>Context:</strong></a> server config, virtual
2782 host, directory<br />
2783 <a href="directive-dict.html#Override"
2784 rel="Help"><strong>Override:</strong></a> Options<br />
2785 <a href="directive-dict.html#Compatibility"
2786 rel="Help"><strong>Compatibility:</strong></a> UseCanonicalName
2787 is only available in Apache 1.3 and later
2789 <p>In many situations Apache has to construct a
2790 <em>self-referential</em> URL. That is, a URL which refers back
2791 to the same server. With <code>UseCanonicalName on</code> (and
2792 in all versions prior to 1.3) Apache will use the hostname and
2793 port specified in the <a href="#servername">ServerName</a>
2794 directive to construct a canonical name for the server. This
2795 name is used in all self-referential URLs, and for the values
2796 of <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in
2799 <p>With <code>UseCanonicalName off</code> Apache will form
2800 self-referential URLs using the hostname and port supplied by
2801 the client if any are supplied (otherwise it will use the
2802 canonical name). These values are the same that are used to
2803 implement <a href="../vhosts/name-based.html">name based
2804 virtual hosts</a>, and are available with the same clients. The
2805 CGI variables <code>SERVER_NAME</code> and
2806 <code>SERVER_PORT</code> will be constructed from the client
2807 supplied values as well.</p>
2809 <p>An example where this may be useful is on an intranet server
2810 where you have users connecting to the machine using short
2811 names such as <code>www</code>. You'll notice that if the users
2812 type a shortname, and a URL which is a directory, such as
2813 <code>http://www/splat</code>, <em>without the trailing
2814 slash</em> then Apache will redirect them to
2815 <code>http://www.domain.com/splat/</code>. If you have
2816 authentication enabled, this will cause the user to have to
2817 reauthenticate twice (once for <code>www</code> and once again
2818 for <code>www.domain.com</code>). But if
2819 <code>UseCanonicalName</code> is set off, then Apache will
2820 redirect to <code>http://www/splat/</code>.</p>
2822 <p>There is a third option, <code>UseCanonicalName DNS</code>,
2823 which is intended for use with mass IP-based virtual hosting to
2824 support ancient clients that do not provide a
2825 <code>Host:</code> header. With this option Apache does a
2826 reverse DNS lookup on the server IP address that the client
2827 connected to in order to work out self-referential URLs.</p>
2829 <p><strong>Warning:</strong> if CGIs make assumptions about the
2830 values of <code>SERVER_NAME</code> they may be broken by this
2831 option. The client is essentially free to give whatever value
2832 they want as a hostname. But if the CGI is only using
2833 <code>SERVER_NAME</code> to construct self-referential URLs
2834 then it should be just fine.</p>
2836 <p><strong>See also:</strong> <a
2837 href="#servername">ServerName</a>, <a
2838 href="mpm_common.html#listen">Listen</a></p>
2841 <h2><a id="virtualhost" name="virtualhost"><VirtualHost>
2844 <a href="directive-dict.html#Syntax"
2845 rel="Help"><strong>Syntax:</strong></a> <VirtualHost
2846 <em>addr</em>[:<em>port</em>] [<em>addr</em>[:<em>port</em>]]
2847 ...> ... </VirtualHost> <br />
2848 <a href="directive-dict.html#Context"
2849 rel="Help"><strong>Context:</strong></a> server config<br />
2850 <a href="directive-dict.html#Status"
2851 rel="Help"><strong>Status:</strong></a> Core.<br />
2852 <a href="directive-dict.html#Compatibility"
2853 rel="Help"><strong>Compatibility:</strong></a> Non-IP
2854 address-based Virtual Hosting only available in Apache 1.1 and
2856 <a href="directive-dict.html#Compatibility"
2857 rel="Help"><strong>Compatibility:</strong></a> Multiple address
2858 support only available in Apache 1.2 and later.
2860 <p><VirtualHost> and </VirtualHost> are used to
2861 enclose a group of directives which will apply only to a
2862 particular virtual host. Any directive which is allowed in a
2863 virtual host context may be used. When the server receives a
2864 request for a document on a particular virtual host, it uses
2865 the configuration directives enclosed in the
2866 <VirtualHost> section. <em>Addr</em> can be</p>
2869 <li>The IP address of the virtual host</li>
2871 <li>A fully qualified domain name for the IP address of the
2877 <code><VirtualHost 10.1.2.3><br />
2878 ServerAdmin webmaster@host.foo.com<br />
2879 DocumentRoot /www/docs/host.foo.com<br />
2880 ServerName host.foo.com<br />
2881 ErrorLog logs/host.foo.com-error_log<br />
2882 TransferLog logs/host.foo.com-access_log<br />
2883 </VirtualHost></code>
2886 <p>IPv6 addresses must be specified in square brackets because
2887 the optional port number could not be determined otherwise. An
2888 IPv6 example is shown below:</p>
2891 <code><VirtualHost [fe80::a00:20ff:fea7:ccea]><br />
2892 ServerAdmin webmaster@host.foo.com<br />
2893 DocumentRoot /www/docs/host.foo.com<br />
2894 ServerName host.foo.com<br />
2895 ErrorLog logs/host.foo.com-error_log<br />
2896 TransferLog logs/host.foo.com-access_log<br />
2897 </VirtualHost></code>
2900 <p>Each VirtualHost must correspond to a different IP address,
2901 different port number or a different host name for the server,
2902 in the former case the server machine must be configured to
2903 accept IP packets for multiple addresses. (If the machine does
2904 not have multiple network interfaces, then this can be
2905 accomplished with the <code>ifconfig alias</code> command (if
2906 your OS supports it), or with kernel patches like <a
2907 href="../misc/vif-info.html">VIF</a> (for SunOS(TM) 4.1.x)).</p>
2909 <p>The special name <code>_default_</code> can be specified in
2910 which case this virtual host will match any IP address that is
2911 not explicitly listed in another virtual host. In the absence
2912 of any _default_ virtual host the "main" server config,
2913 consisting of all those definitions outside any VirtualHost
2914 section, is used when no match occurs.</p>
2916 <p>You can specify a <code>:port</code> to change the port that
2917 is matched. If unspecified then it defaults to the same port as
2918 the most recent <code><a
2919 href="mpm_common.html#listen">Listen</a></code> statement
2920 of the main server. You may also specify <code>:*</code> to
2921 match all ports on that address. (This is recommended when used
2922 with <code>_default_</code>.)</p>
2924 <p><strong>SECURITY</strong>: See the <a
2925 href="../misc/security_tips.html">security tips</a> document
2926 for details on why your security could be compromised if the
2927 directory where logfiles are stored is writable by anyone other
2928 than the user that starts the server.</p>
2930 <p><strong>NOTE</strong>: The use of <VirtualHost> does
2931 <strong>not</strong> affect what addresses Apache listens on.
2932 You may need to ensure that Apache is listening on the correct
2934 href="mpm_common.html#listen">Listen</a>.</p>
2936 <p><strong>See also:</strong> <a href="../vhosts/">Apache
2937 Virtual Host documentation</a><br />
2938 <strong>See also:</strong> <a
2939 href="../dns-caveats.html">Warnings about DNS and
2941 <strong>See also:</strong> <a href="../bind.html">Setting
2942 which addresses and ports Apache uses</a><br />
2943 <strong>See also</strong>: <a href="../sections.html">How
2944 Directory, Location and Files sections work</a> for an
2945 explanation of how these different sections are combined when a
2946 request is received</p>
2947 <!--#include virtual="footer.html" -->