core.html revision 53abc428b73538cfcea5ee582a175ca13a7d4a70
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
fa9e4066f08beec538e775443c5be79dd423fcabahrens<HTML>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<HEAD>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<TITLE>Apache Core Features</TITLE>
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock</HEAD>
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock
fa9e4066f08beec538e775443c5be79dd423fcabahrens<BODY>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--#include virtual="header.html" -->
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<H1>Apache Core Features</h1>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensThese configuration parameters control the core Apache features, and are
fa9e4066f08beec538e775443c5be79dd423fcabahrensalways available.
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<ul>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#accessconfig">AccessConfig</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#accessfilename">AccessFileName</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#addmodule">AddModule</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#allowoverride">AllowOverride</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#authname">AuthName</A>
8d18220deb04ec7b12410cd90deb4d45e66d49bfMark J Musante<li><A HREF="#authtype">AuthType</A>
be6fd75a69ae679453d9cda5bff3326111e6d1caMatthew Ahrens<li><A HREF="#bindaddress">BindAddress</A>
9dc3941c735ef88de46e850f745aa556d3a071a5Sašo Kiselkov<li><A HREF="#clearmodulelist">ClearModuleList</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#defaulttype">DefaultType</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#directory">&lt;Directory&gt;</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#documentroot">DocumentRoot</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#errordocument">ErrorDocument</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#errorlog">ErrorLog</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#files">&lt;Files&gt;</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#group">Group</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#hostnamelookups">HostNameLookups</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#identitycheck">IdentityCheck</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li><A HREF="#ifmodule">&lt;IfModule&gt;</A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li><A HREF="#keepalive">KeepAlive</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#keepalivetimeout">KeepAliveTimeout</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#limit">&lt;Limit&gt;</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#listen">Listen</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#location">&lt;Location&gt;</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#maxclients">MaxClients</A>
840345f69c01af33ad169d6b4a6ae7ea78b4218aGeorge Wilson<li><A HREF="#maxkeepaliverequests">MaxKeepAliveRequests</a>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#maxrequestsperchild">MaxRequestsPerChild</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#maxspareservers">MaxSpareServers</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#minspareservers">MinSpareServers</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#options">Options</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#pidfile">PidFile</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#port">Port</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li><A HREF="#require">require</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li><A HREF="#resourceconfig">ResourceConfig</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li><A HREF="#rlimitcpu">RLimitCPU</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li><A HREF="#rlimitmem">RLimitMEM</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li><A HREF="#rlimitnproc">RLimitNPROC</A>
13506d1eefbbc37e2f12a0528831d9f6d4c361d7maybee<li><A HREF="#satisfy">Satisfy</A>
e05725b117836db173257fae43fb0746eb857fb5bonwick<li><A HREF="#sendbuffersize">SendBufferSize</A>
13506d1eefbbc37e2f12a0528831d9f6d4c361d7maybee<li><A HREF="#serveradmin">ServerAdmin</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#serveralias">ServerAlias</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#servername">ServerName</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#serverpath">ServerPath</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#serverroot">ServerRoot</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#servertype">ServerType</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#startservers">StartServers</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#timeout">TimeOut</A>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<li><A HREF="#user">User</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<li><A HREF="#virtualhost">&lt;VirtualHost&gt;</A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson</ul>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<hr>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<A name="accessconfig"><h2>AccessConfig directive</h2></A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<!--%plaintext &lt;?INDEX {\tt AccessConfig} directive&gt; -->
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Syntax:</strong> AccessConfig <em>filename</em><br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Default:</strong> <code>AccessConfig conf/access.conf</code><br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Context:</strong> server config, virtual host<br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Status:</strong> core<p>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George WilsonThe server will read this file for more directives after reading the
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<A HREF="#resourceconfig">ResourceConfig</A> file. <em>Filename</em> is
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonrelative to the <A HREF="#serverroot">ServerRoot</A>.
22e30981d82a0b6dc89253596ededafae8655e00George WilsonThis feature can be disabled using:
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<blockquote><code>AccessConfig /dev/null</code></blockquote>
22e30981d82a0b6dc89253596ededafae8655e00George WilsonHistorically, this file only contained
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<A HREF="#directory">&lt;Directory&gt;</A> sections; in fact it can now
22e30981d82a0b6dc89253596ededafae8655e00George Wilsoncontain any server directive allowed in the <em>server config</em> context.
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<p><hr>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<A name="accessfilename"><h2>AccessFileName directive</h2></A>
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<!--%plaintext &lt;?INDEX {\tt AccessFileName} directive&gt; -->
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Syntax:</strong> AccessFileName <em>filename</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>AccessFileName .htaccess</code><br>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Context:</strong> server config, virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonWhen returning a document to the client the server looks for an
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonaccess control file with this name in every directory of the path to
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthe document, if access control files are enabled for that directory.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
b24ab6762772a3f6a89393947930c7fa61306783Jeff BonwickFor example:
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<blockquote><code>AccessFileName .acl</code></blockquote>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonbefore returning the document /usr/local/web/index.html, the
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonserver will read /.acl, /usr/.acl, /usr/local/.acl and /usr/local/web/.acl
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonfor directives, unless they have been disabled with
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<blockquote><code>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson&lt;Directory /&gt;<br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George WilsonAllowOverride None<br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson&lt;/Directory&gt;</code></blockquote><p><hr>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<A name="addmodule"><h2>AddModule directive</h2></A>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<!--%plaintext &lt;?INDEX {\tt AddModule} directive&gt; -->
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Syntax:</strong> AddModule <em>module module ...</em><br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Context:</strong> server config <br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Status:</strong> core<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Compatibility:</strong> AddModule is only available in Apache 1.2 and later<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThe server can have modules compiled in which are not actively in use.
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThis directive can be used to enable the use of those modules. The
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonserver comes with a pre-loaded list of active modules; this list can
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonbe cleared with the <A HREF="#clearmodulelist">ClearModuleList</A>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsondirective.<p><hr>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<A name="allowoverride"><h2>AllowOverride directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt AllowOverride} directive&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Syntax:</strong> AllowOverride <em>override override ...</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>AllowOverride All</code><br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Context:</strong> directory<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonWhen the server finds an .htaccess file (as specified by
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#accessfilename">AccessFileName</A>) it needs to know which
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsondirectives declared in that file can override earlier access information.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<em>Override</em> can be set to <code>None</code>, in which case the server
9dc3941c735ef88de46e850f745aa556d3a071a5Sašo Kiselkovwill not read the file, <code>All</code> in which case the server will
9dc3941c735ef88de46e850f745aa556d3a071a5Sašo Kiselkovallow all the directives, or one or more of the following:
9dc3941c735ef88de46e850f745aa556d3a071a5Sašo Kiselkov<dl>
9dc3941c735ef88de46e850f745aa556d3a071a5Sašo Kiselkov<dt>AuthConfig
9dc3941c735ef88de46e850f745aa556d3a071a5Sašo Kiselkov<dd>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt AuthConfig} override&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAllow use of the authorization directives
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson(<A HREF="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="mod_auth_dbm.html#authdbmuserfile">AuthDBMUserFile</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#authname">AuthName</A>, <A HREF="#authtype">AuthType</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="mod_auth.html#authuserfile">AuthUserFile</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#require">require</A>, etc.).
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dt>FileInfo
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt FileInfo} override&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAllow use of the directives controlling document types
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson(<A HREF="mod_mime.html#addencoding">AddEncoding</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="mod_mime.html#addlanguage">AddLanguage</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="mod_mime.html#addtype">AddType</A>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#defaulttype">DefaultType</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="#errordocument">ErrorDocument</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_negotiation.html#languagepriority">LanguagePriority</A>, etc.).
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dt>Indexes
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dd>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt Indexes} override&gt; -->
fa9e4066f08beec538e775443c5be79dd423fcabahrensAllow use of the directives controlling directory indexing
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson(<A HREF="mod_dir.html#adddescription">AddDescription</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#addicon">AddIcon</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#addiconbyencoding">AddIconByEncoding</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#addiconbytype">AddIconByType</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#defaulticon">DefaultIcon</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#directoryindex">DirectoryIndex</A>,
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<A HREF="mod_dir.html#fancyindexing">FancyIndexing</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#headername">HeaderName</A>,
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<A HREF="mod_dir.html#indexignore">IndexIgnore</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#indexoptions">IndexOptions</A>,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="mod_dir.html#readmename">ReadmeName</A>, etc.).
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dt>Limit
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dd>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt Limit} override&gt; -->
fa9e4066f08beec538e775443c5be79dd423fcabahrensAllow use of the directives controlling host access (allow, deny and order).
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dt>Options
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<dd>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<!--%plaintext &lt;?INDEX {\tt Options} override&gt; -->
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickAllow use of the directives controlling specific directory features
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick(<A HREF="#options">Options</A> and
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<A HREF="mod_include.html#xbithack">XBitHack</A>).
fa9e4066f08beec538e775443c5be79dd423fcabahrens</dl><p><hr>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A name="authname"><h2>AuthName directive</h2></A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt AuthName} directive&gt; -->
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Syntax:</strong> AuthName <em>auth-domain</em><br>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Context:</strong> directory, .htaccess<br>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Override:</strong> AuthConfig<br>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Status:</strong> core<p>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George WilsonThis directive sets the name of the authorization realm for a directory.
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George WilsonThis realm is given to the client so that the user knows which username and
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilsonpassword to send.
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George WilsonIt must be accompanied by <A HREF="#authtype">AuthType</A> and
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<A HREF="#require">require</A> directives, and directives such as
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<A HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> to work.<p><hr>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<A name="authtype"><h2>AuthType directive</h2></A>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<!--%plaintext &lt;?INDEX {\tt AuthType} directive&gt; -->
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Syntax:</strong> AuthType <em>type</em><br>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Context:</strong> directory, .htaccess<br>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Override:</strong> AuthConfig<br>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<strong>Status:</strong> core<p>
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George WilsonThis directive selects the type of user authentication for a directory.
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George WilsonOnly <code>Basic</code> is currently implemented.
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<!--%plaintext &lt;?INDEX {\tt Basic} authentication scheme&gt; -->
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George WilsonIt must be accompanied by <A HREF="#authname">AuthName</A> and
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<A HREF="#require">require</A> directives, and directives such as
88ecc943b4eb72f7c4fbbd8435997b85ef171fc3George Wilson<A HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> to work.<p><hr>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<A name="clearmodulelist"><h2>ClearModuleList directive</h2></A>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<!--%plaintext &lt;?INDEX {\tt ClearModuleList} directive&gt; -->
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Syntax:</strong> ClearModuleList<br>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Context:</strong> server config<br>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Status:</strong> core<br>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Compatibility:</strong> ClearModuleList is only available in Apache 1.2 and later<p>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff BonwickThe server comes with a built-in list of active modules. This
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickdirective clears the list. It is assumed that the list will then be
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickre-populated using the <A HREF="#addmodule">AddModule</A> directive.<p><hr>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<A name="bindaddress"><h2>BindAddress directive</h2></A>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<!--%plaintext &lt;?INDEX {\tt BindAddress} directive&gt; -->
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Syntax:</strong> BindAddress <em>saddr</em><br>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Default:</strong> <code>BindAddress *</code><br>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Context:</strong> server config<br>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<strong>Status:</strong> core<p>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff BonwickA Unix&#174; http server can either listen for connections to every
b24ab6762772a3f6a89393947930c7fa61306783Jeff BonwickIP address of the server machine, or just one IP address of the server
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickmachine. <em>Saddr</em> can be
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<menu>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<li>*
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<li>An IP address
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick<li>A fully-qualified internet domain name
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick</menu>
b24ab6762772a3f6a89393947930c7fa61306783Jeff BonwickIf the value is *, then the server will listen for connections on
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickevery IP address, otherwise it will only listen on the IP address
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickspecified. <p>
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick
b24ab6762772a3f6a89393947930c7fa61306783Jeff BonwickThis option can be used as an alternative method for supporting
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="/virtual-host.html">virtual hosts</A> instead of using
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A HREF="#virtualhost">&lt;VirtualHost&gt;</A> sections.
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p><strong>See Also:</strong>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<a href="/bind.html">Setting which addresses and ports Apache uses</a></p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<hr>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A name="defaulttype"><h2>DefaultType directive</h2></A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt DefaultType} directive&gt; -->
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Syntax:</strong> DefaultType <em>mime-type</em><br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Default:</strong> <code>DefaultType text/html</code><br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Override:</strong> FileInfo<br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Status:</strong> core<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensThere will be times when the server is asked to provide a document
fa9e4066f08beec538e775443c5be79dd423fcabahrenswhose type cannot be determined by its MIME types mappings.<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe server must inform the client of the content-type of the document, so in
fa9e4066f08beec538e775443c5be79dd423fcabahrensthe event of an unknown type it uses the <CODE>DefaultType</CODE>. For
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonexample:
fa9e4066f08beec538e775443c5be79dd423fcabahrens<blockquote><code>DefaultType image/gif</code></blockquote>
fa9e4066f08beec538e775443c5be79dd423fcabahrenswould be appropriate for a directory which contained many gif images
fa9e4066f08beec538e775443c5be79dd423fcabahrenswith filenames missing the .gif extension.<p><hr>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A name="directory"><h2>&lt;Directory&gt; directive</h2></A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt Directory} section directive&gt; -->
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Syntax:</strong> &lt;Directory <em>directory</em>&gt; ... &lt;/Directory&gt; <br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Context:</strong> server config, virtual host<br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Status:</strong> Core. <p>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilson&lt;Directory&gt; and &lt;/Directory&gt; are used to enclose a group of
22e30981d82a0b6dc89253596ededafae8655e00George Wilsondirectives which will apply only to the named directory and sub-directories
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonof that directory. Any directive which is allowed in a directory
22e30981d82a0b6dc89253596ededafae8655e00George Wilsoncontext may be used. <em>Directory</em> is either the full path to a directory,
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonor a wild-card string. In a wild-card string, `?' matches any single character,
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonand `*' matches any sequences of characters. Example:
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<pre>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson &lt;Directory /usr/local/httpd/htdocs&gt;
22e30981d82a0b6dc89253596ededafae8655e00George Wilson Options Indexes FollowSymLinks
22e30981d82a0b6dc89253596ededafae8655e00George Wilson &lt;/Directory&gt;
22e30981d82a0b6dc89253596ededafae8655e00George Wilson</pre>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<p><strong>Apache 1.2 and above:</strong>
22e30981d82a0b6dc89253596ededafae8655e00George WilsonExtended regular expressions can also be used, with the addition of the
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<code>~</code> character. For example:</p>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<pre>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson &lt;Directory ~ &quot;^/www/.*/[0-9]{3}&quot;&gt;
22e30981d82a0b6dc89253596ededafae8655e00George Wilson</pre>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonwould match directories in /www/ that consisted of three numbers.<p>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<p>If multiple directory sections match the directory (or its parents) containing
22e30981d82a0b6dc89253596ededafae8655e00George Wilsona document, then the directives are applied in the order of shortest match
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonfirst, interspersed with the directives from the
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<A HREF="#accessfilename">.htaccess</A> files. For example, with
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<blockquote><code>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson&lt;Directory /&gt;<br>
22e30981d82a0b6dc89253596ededafae8655e00George WilsonAllowOverride None<br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson&lt;/Directory&gt;<br><br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson&lt;Directory /home/*&gt;<br>
22e30981d82a0b6dc89253596ededafae8655e00George WilsonAllowOverride FileInfo<br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson&lt;/Directory&gt;</code></blockquote>
22e30981d82a0b6dc89253596ededafae8655e00George WilsonThe for access to the document <code>/home/web/dir/doc.html</code> the
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonsteps are:
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<menu>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<li>Apply directive <code>AllowOverride None</code> (disabling
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<code>.htaccess</code> files).
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<li>Apply directive <code>AllowOverride FileInfo</code> (for directory
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<code>/home/web</code>).
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<li>Apply any FileInfo directives in <code>/home/web/.htaccess</code>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson</menu>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George WilsonThe directory sections typically occur in the access.conf file, but they
fa9e4066f08beec538e775443c5be79dd423fcabahrensmay appear in any configuration file. &lt;Directory&gt; directives cannot
fa9e4066f08beec538e775443c5be79dd423fcabahrensnest, and cannot appear in a <A HREF="#limit">&lt;Limit&gt;</A> section.
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p><hr>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A NAME="documentroot"><h2>DocumentRoot directive</h2></A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt DocumentRoot} directive&gt; -->
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Syntax:</strong> DocumentRoot <em>directory-filename</em><br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Default:</strong> <code>DocumentRoot
fa9e4066f08beec538e775443c5be79dd423fcabahrens/usr/local/etc/httpd/htdocs</code><br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Context:</strong> server config, virtual host<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Status:</strong> core<p>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrensThis directive sets the directory from which httpd will serve files.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonUnless matched by a directive like Alias, the server appends the path
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonfrom the requested URL to the document root to make the path to the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsondocument. Example:
fa9e4066f08beec538e775443c5be79dd423fcabahrens<blockquote><code>DocumentRoot /usr/web</code></blockquote>
fa9e4066f08beec538e775443c5be79dd423fcabahrensthen an access to <code>http://www.my.host.com/index.html</code> refers
fa9e4066f08beec538e775443c5be79dd423fcabahrensto <code>/usr/web/index.html</code>.
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<P>There appears to be a bug in mod_dir which causes problems when the
fa9e4066f08beec538e775443c5be79dd423fcabahrensDocumentRoot has a trailing slash (i.e. "DocumentRoot /usr/web/") so
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickplease avoid that.
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a33cae9802e94744efee12a7a77c89360645eae8Tim Haley<p><hr>
a33cae9802e94744efee12a7a77c89360645eae8Tim Haley
a33cae9802e94744efee12a7a77c89360645eae8Tim Haley<A name="errordocument"><h2>ErrorDocument directive</h2></A>
a33cae9802e94744efee12a7a77c89360645eae8Tim Haley<!--%plaintext &lt;?INDEX {\tt ErrorDocument} directive&gt; -->
a33cae9802e94744efee12a7a77c89360645eae8Tim Haley<strong>Syntax:</strong> ErrorDocument <em>error-code document</em><br>
a33cae9802e94744efee12a7a77c89360645eae8Tim Haley<strong>Context</strong> server config, virtual host, directory, .htaccess<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Status:</strong> core<br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Override:</strong> FileInfo<br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Compatibility:</strong> The directory and .htaccess contexts
fa9e4066f08beec538e775443c5be79dd423fcabahrensare only available in Apache 1.1 and later.<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensIn the event of a problem or error, Apache can be configured to do
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickone of four things,
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<OL>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<LI>behave like NCSA httpd 1.3
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<LI>output a customized message
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<LI>redirect to a local URL to handle the problem/error
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<LI>redirect to an external URL to handle the problem/error
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick</OL>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<P>2-4 are configured using <CODE>ErrorDocument</CODE>, which
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickis followed by the HTTP response code and a message or URL.
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<P><em>Messages</em> in this context, begin with a single quote
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick(<code>"</code>), which does not form part of the message itself. Apache will
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwicksometime offer additional information regarding the problem/error.
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<P>URLs will begin with a slash (/) for local URLs, or will be a full
22e30981d82a0b6dc89253596ededafae8655e00George WilsonURL which the client can resolve. Examples:
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<blockquote><code>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickErrorDocument 500 /cgi-bin/tester<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickErrorDocument 404 /cgi-bin/bad_urls.pl<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickErrorDocument 401 http://www2.foo.bar/subscription_info.html<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickErrorDocument 403 "Sorry can't allow you access today
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick</code></blockquote>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickSee Also: <A HREF="/custom-error.html">documentation of customizable
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickresponses.</A><p><hr>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<A name="errorlog"><h2>ErrorLog directive</h2></A>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<!--%plaintext &lt;?INDEX {\tt ErrorLog} directive&gt; -->
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Syntax:</strong> ErrorLog <em>filename</em><br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Default:</strong> <code>ErrorLog logs/error_log</code><br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Context:</strong> server config, virtual host<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Status:</strong> core<p>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickThe error log directive sets the name of the file to which the server will log
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickany errors it encounters. If the filename does not begin with a slash (/)
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickthen it is assumed to be relative to the <A HREF="#serverroot">ServerRoot</A>.
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickExample:
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<blockquote><code>ErrorLog /dev/null</code></blockquote>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickThis effectively turns off error logging.<p>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff BonwickSECURITY: See the <A HREF="/misc/security_tips.html">security tips</A>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickdocument for details on why your security could be compromised if
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickthe directory where logfiles are stored is writable by anyone other
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickthan the user that starts the server.
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="files"><h2>&lt;Files&gt;</h2></A>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Syntax:</strong> &lt;Files <em>filename</em>&gt;
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick... &lt;/Files&gt;<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Context:</strong> server config, virtual host, htaccess<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Status:</strong> core<br>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<strong>Compatibility:</strong> only available in Apache
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick1.2 and above.<p>
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<p>The &lt;Files&gt; directive provides for access control by
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickfilename. It is comparable to the <a
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickhref="#directory">&lt;Directory&gt;</a> directive and
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwick<a href="#location">&lt;Location&gt;</a> directives. It
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickshould be matched with a &lt;/Files&gt; directive. Directives that
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickapply to the filename given should be listed
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickwithin. <code>&lt;Files&gt;</code> sections are processed in the
a15215608b8bd90f714f6db21ee623b584607cb6Jeff Bonwickorder they appear in the configuration file, after the
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick&lt;Directory&gt; sections and <code>.htaccess</code> files are
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickread, but before &lt;Location&gt; sections.</p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p>The <em>filename</em> argument should include a filename, or a
fa9e4066f08beec538e775443c5be79dd423fcabahrenswild-card string, where `?' matches any single character, and `*' matches any
fa9e4066f08beec538e775443c5be79dd423fcabahrenssequences of characters. Extended regular expressions can also be used, with the addition of
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickthe <code>~</code> character. For example:</p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<pre>
fa9e4066f08beec538e775443c5be79dd423fcabahrens &lt;Files ~ &quot;\.(gif|jpe?g|png)$&quot;&gt;
fa9e4066f08beec538e775443c5be79dd423fcabahrens</pre>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrenswould match most common Internet graphics formats.
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p>Note that unlike <a
fa9e4066f08beec538e775443c5be79dd423fcabahrenshref="#directory"><code>&lt;Directory&gt;</code></a> and <a
fa9e4066f08beec538e775443c5be79dd423fcabahrenshref="#location"><code>&lt;Location&gt;</code></a> sections,
fa9e4066f08beec538e775443c5be79dd423fcabahrens<code>&lt;Files&gt;</code> sections can be used inside .htaccess
fa9e4066f08beec538e775443c5be79dd423fcabahrensfiles. This allows users to control access to their own files, at a
fa9e4066f08beec538e775443c5be79dd423fcabahrensfile-by-file level. When used in an .htaccess file, if the
fa9e4066f08beec538e775443c5be79dd423fcabahrens<em>filename</em> does not begin with a <code>/</code> character,
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickthe directory being applied will be prefixed automatically.
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p> <hr>
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrens
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrens<A name="group"><h2>Group directive</h2></A>
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrens<!--%plaintext &lt;?INDEX {\tt Group} directive&gt; -->
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrens<strong>Syntax:</strong> Group <em>unix-group</em><br>
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrens<strong>Default:</strong> <code>Group #-1</code><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Context:</strong> server config, virtual host<br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Status:</strong> core<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensThe Group directive sets the group under which the server will answer requests.
fa9e4066f08beec538e775443c5be79dd423fcabahrensIn order to use this directive, the stand-alone server must be run initially
fa9e4066f08beec538e775443c5be79dd423fcabahrensas root. <em>Unix-group</em> is one of:
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dl>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dt>A group name
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dd>Refers to the given group by name.
fa9e4066f08beec538e775443c5be79dd423fcabahrens<dt># followed by a group number.
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<dd>Refers to a group by its number.
22e30981d82a0b6dc89253596ededafae8655e00George Wilson</dl>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George WilsonIt is recommended that you set up a new group specifically for running the
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonserver. Some admins use user <code>nobody</code>, but this is not always
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonpossible or desirable.<p>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George WilsonNote: if you start the server as a non-root user, it will fail to change
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonto the specified group, and will instead continue to run as the group of the
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonoriginal user. <p>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George WilsonSpecial note: Use of this directive in &lt;VirtualHost&gt; requires a
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonproperly configured <A HREF="/suexec.html">SUEXEC wrapper</A>.<p>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George WilsonSECURITY: See <A HREF="#user">User</A> for a discussion of the security
22e30981d82a0b6dc89253596ededafae8655e00George Wilsonconsiderations.<p><hr>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<A name="hostnamelookups"><h2>HostNameLookups directive</h2></A>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<!--%plaintext &lt;?INDEX {\tt HostNameLookups} directive&gt; -->
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Syntax:</strong> HostNameLookups <em>boolean</em><br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Default:</strong> <code>HostNameLookups on</code><br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
22e30981d82a0b6dc89253596ededafae8655e00George Wilson<strong>Status:</strong> core<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThis directive enables DNS lookups so that host names can be logged.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonHaving this directive set <code>on</code> also enables the use of names
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonin &lt;Limit&gt; blocks for access control.<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonHeavily loaded sites should set this directive <code>off</code>, since DNS
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonlookups can take considerable amounts of time. The utility <i>logresolve</i>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprovided in the <i>/support</i> directory, can be used to look up host names
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonfrom logged IP addresses offline.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<A name="identitycheck"><h2>IdentityCheck directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt IdentityCheck} directive&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Syntax:</strong> IdentityCheck <em>boolean</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>IdentityCheck off</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThis directive enables RFC931-compliant logging of the remote user name
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonfor each connection, where the client machine runs identd or something similar.
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThis information is logged in the access log. <em>Boolean</em> is either
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<code>on</code> or <code>off</code>.<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThe information should not be trusted in any way except for rudimentary usage
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsontracking.<p><hr>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A NAME="ifmodule"><H2>&lt;IfModule&gt;</H2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<b>Syntax:</b> &lt;IfModule [!]<i>module-name</i>&gt; <i>...</i>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson&lt;/IfModule&gt;<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<b>Default:</b> None<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<b>Context:</b> all<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<b>Status:</b> Core
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Compatibility:</strong> ScriptLog is only available in 1.2 and
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwicklater.<P>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe &lt;IfModule <i>test</i>&gt;...&lt;/IfModule&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonsection is used to mark directives that are conditional. The
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickdirectives within an IfModule section are only
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprocessed if the <i>test</i> is true. If <i>test</i>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickis false, everything between the start and end markers
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonis ignored.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickThe <i>test</i> in the &lt;IfModule&gt; section directive
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsoncan be one of two forms:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<ul>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<li><i>module name</i>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li>!<i>module name</i>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</ul>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<p>In the former case, the directives between the start and end markers
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonare only processed if the module named <i>module name</i> is compiled
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonin to Apache. The second format reverses the test, and only processes
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthe directives if <i>module name</i> is <b>not</b> compiled in.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>The <i>module name</i> argument is a module name as given as the file
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonname of the module, at the time it was compiled. For example,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<code>mod_rewrite.c</code>.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>&lt;IfModule&gt; sections are nest-able, which can be used to implement
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonsimple multiple-module tests.
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<P> <hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<h2><a name="keepalive">KeepAlive</a></h2>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax: (Apache 1.1)</strong> KeepAlive <em>max-requests</em><br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Default: (Apache 1.1)</strong> <code>KeepAlive 5</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax: (Apache 1.2)</strong> KeepAlive <em>on/off</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default: (Apache 1.2)</strong> <code>KeepAlive On</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> Core<br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Compatibility:</strong> KeepAlive is only available in Apache
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick1.1 and later.<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThis directive enables
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<a href="/keepalive.html">Keep-Alive</a>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonsupport.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><strong>Apache 1.1</strong>: Set <em>max-requests</em>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonto the maximum number of requests you want Apache to entertain per
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonrequest. A limit is imposed to prevent a client from hogging your
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonserver resources. Set this to <code>0</code> to disable support.
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<p><strong>Apache 1.2 and later</strong>: Set to "On" to enable
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickpersistent connections, "Off" to disable. See also the <a
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonhref="#maxkeepaliverequests">MaxKeepAliveRequests</a> directive.</p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<h2><a name="keepalivetimeout">KeepAliveTimeout</a></h2>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> KeepAliveTimeout <em>seconds</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>KeepAliveTimeout 15</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> Core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> KeepAliveTimeout is only available in Apache
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson1.1 and later.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe number of seconds Apache will wait for a subsequent request before
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonclosing the connection. Once a request has been received, the timeout
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonvalue specified by the <a
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonhref="#timeout"><code>Timeout</code></a> directive
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonapplies.
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<hr>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="listen"><h2>Listen</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonListen [<em>IP address</em>:]<em>port number</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> Listen is only available in Apache
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson1.1 and later.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>The Listen directive instructs Apache to listen to more than one IP
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonaddress or port; by default it responds to requests on all IP
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsoninterfaces, but only on the port given by the <a href="#port">Port</a>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsondirective.</p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><strong>See Also</strong>:
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<a href="/bind.html">Setting which addresses and ports Apache uses</a></p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<hr>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<A name="limit"><h2>&lt;Limit&gt; directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt Limit} section directive&gt; -->
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Syntax:</strong>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson &lt;Limit <em>method method</em> ... &gt; ... &lt;/Limit&gt;<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> any<br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson&lt;Limit&gt; and &lt;/Limit&gt; are used to enclose a group of
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonaccess control directives which will then apply only to the specified
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonaccess methods, where <em>method</em> is any valid HTTP method.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAny directive except another &lt;Limit&gt; or
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#directory">&lt;Directory&gt;</A> may be used; the majority will be
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonunaffected by the &lt;Limit&gt;. Example:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<blockquote><code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;Limit GET POST&gt;<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonrequire valid-user<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;/Limit&gt;</code></blockquote>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonIf an access control directive appears outside a &lt;Limit&gt; directive,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthen it applies to all access methods.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<h2><a name="location">&lt;Location&gt;</a></h2>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> &lt;Location <em>URL</em>&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson... &lt;/Location&gt;<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> Location is only available in Apache
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson1.1 and later.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>The &lt;Location&gt; directive provides for access control by
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonURL. It is comparable to the <a
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonhref="#directory">&lt;Directory&gt;</a> directive, and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonshould be matched with a &lt;/Location&gt; directive. Directives that
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonapply to the URL given should be listen
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonwithin. <code>&lt;Location&gt;</code> sections are processed in the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonorder they appear in the configuration file, after the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;Directory&gt; sections and <code>.htaccess</code> files are
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonread.</p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>Note that, due to the way HTTP functions, <em>URL prefix</em>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonshould, save for proxy requests, be of the form <code>/path/</code>,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonand should not include the <code>http://servername</code>. It doesn't
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonnecessarily have to protect a directory (it can be an individual
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonfile, or a number of files), and can include wild-cards. In a wild-card
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonstring, `?' matches any single character, and `*' matches any
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonsequences of characters.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><strong>Apache 1.2 and above:</strong>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonExtended regular expressions can also be used, with the addition of
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthe
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<code>~</code> character. For example:</p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<pre>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson &lt;Location ~ &quot;/(extra|special)/data&quot;&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</pre>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonwould match URLs that contained the substring "/extra/data" or
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson"/special/data".</p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>The <code>Location</code> functionality is especially useful when
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsoncombined with the <code><a
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonhref="mod_mime.html#sethandler">SetHandler</a></code> directive. For example, to enable status requests, but allow them only
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonfrom browsers at foo.com, you might use:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<pre>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson &lt;Location /status&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson SetHandler server-status
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson <Limit GET>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson order deny,allow
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson deny from all
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson allow from .foo.com
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson </Limit>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson &lt;/Location&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</pre>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<A name="maxclients"><h2>MaxClients directive</h2></A>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<!--%plaintext &lt;?INDEX {\tt MaxClients} directive&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Syntax:</strong> MaxClients <em>number</em><br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Default:</strong> <code>MaxClients 256</code><br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Context:</strong> server config<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Status:</strong> core<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThe MaxClients directive sets the limit on the number of simultaneous
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonrequests that can be supported; not more than this number of child server
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonprocesses will be created.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="maxkeepaliverequests"><h2>MaxKeepAliveRequests</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> MaxKeepAliveRequests <em>number</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>MaxKeepAliveRequests</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> Only available in Apache
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson1.2 and later.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>The MaxKeepAliveRequests directive limits the number of requests
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonallowed per connection when <a href="#keepalive">KeepAlive</a> is
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonon. If it is set to "<code>0</code>," unlimited requests will be
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonallowed. We reccomend that this setting is kept to a high value, for
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonmaximum server peformance.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="maxrequestsperchild"><h2>MaxRequestsPerChild directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt MaxRequestsPerChild} directive&gt; -->
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Syntax:</strong> MaxRequestsPerChild <em>number</em><br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Default:</strong> <code>MaxRequestsPerChild 0</code><br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Context:</strong> server config<br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThe MaxRequestsPerChild directive sets the limit on the number of requests
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonthat an individual child server process will handle. After MaxRequestsPerChild
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonrequests, the child process will die. If MaxRequestsPerChild is 0, then
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonthe process will never expire.<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonSetting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<ul>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<li>it limits the amount of memory that process can consume by (accidental)
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonmemory leakage;
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<li> by giving processes a finite lifetime, it helps reduce the
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonnumber of processes when the server load reduces.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson</ul><p><hr>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="maxspareservers"><h2>MaxSpareServers directive</h2></A>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<!--%plaintext &lt;?INDEX {\tt MaxSpareServers} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> MaxSpareServers <em>number</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>MaxSpareServers 10</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe MaxSpareServers directive sets the desired maximum number of <em>idle</em>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonchild server processes. An idle process is one which is not handling
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsona request. If there are more than MaxSpareServers idle, then the parent
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprocess will kill off the excess processes.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonTuning of this parameter should only be necessary on very busy sites.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonSetting this parameter to a large number is almost always a bad idea.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George WilsonSee also <A HREF="#minspareservers">MinSpareServers</A> and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#startservers">StartServers</A>.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<A name="minspareservers"><h2>MinSpareServers directive</h2></A>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<!--%plaintext &lt;?INDEX {\tt MinSpareServers} directive&gt; -->
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Syntax:</strong> MinSpareServers <em>number</em><br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Default:</strong> <code>MinSpareServers 5</code><br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Context:</strong> server config<br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Status:</strong> core<p>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George WilsonThe MinSpareServers directive sets the desired minimum number of <em>idle</em>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonchild server processes. An idle process is one which is not handling
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsona request. If there are fewer than MinSpareServers idle, then the parent
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprocess creates new children at a maximum rate of 1 per second.<p>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George WilsonTuning of this parameter should only be necessary on very busy sites.
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George WilsonSetting this parameter to a large number is almost always a bad idea.<p>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George WilsonSee also <A HREF="#maxspareservers">MaxSpareServers</A> and
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<A HREF="#startservers">StartServers</A>.<p><hr>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="options"><h2>Options directive</h2></A>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<!--%plaintext &lt;?INDEX {\tt Options} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> Options <em>[+|-]option [+|-]option ...</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Override:</strong> Options<br>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<strong>Status:</strong> core<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonThe Options directive controls which server features are available in
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsona particular directory.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<em>option</em> can be set to <code>None</code>, in which case none of
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilsonthe extra features are enabled, or one or more of the following:
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<dl>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dt>All
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson<dd>All options except for MultiViews.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<dt>ExecCGI
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<dd>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<!--%plaintext &lt;?INDEX {\tt ExecCGI} option&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonExecution of CGI scripts is permitted.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<dt>FollowSymLinks
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt FollowSymLinks} option&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe server will follow symbolic links in this directory.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dt>Includes
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<!--%plaintext &lt;?INDEX {\tt Includes} option&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonServer-side includes are permitted.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<dt>IncludesNOEXEC
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<!--%plaintext &lt;?INDEX {\tt IncludesNOEXEC} option&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonServer-side includes are permitted, but the #exec command and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson#include of CGI scripts are disabled.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dt>Indexes
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<!--%plaintext &lt;?INDEX {\tt Indexes} option&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonIf a URL which maps to a directory is requested, and the there is no
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonDirectoryIndex (e.g. index.html) in that directory, then the server will
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonreturn a formatted listing of the directory.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<dt>MultiViews
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<!--%plaintext &lt;?INDEX {\tt MultiViews} option&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="/content-negotiation.html">Content negotiated</A> MultiViews are
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonallowed.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<dt>SymLinksIfOwnerMatch
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt SymLinksIfOwnerMatch} option&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe server will only follow symbolic links for which the target
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonfile or directory is owned by the same user id as the link.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</dl>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonNormally, if multiple <code>Options</code> could apply to a directory,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthen the most specific one is taken complete; the options are not
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonmerged. However if <i>all</i> the options on the <code>Options</code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsondirective are preceeded by a + or - symbol, the options are
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonmerged. Any options preceeded by a + are added to the options
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsoncurrently in force, and any options preceeded by a - are removed from
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonthe options currently in force. <P>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonFor example, without any + and - symbols:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<blockquote><code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;Directory /web/docs&gt; <br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonOptions Indexes FollowSymLinks<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson&lt;/Directory&gt;<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;Directory /web/docs/spec&gt; <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonOptions Includes<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;/Directory&gt;
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson</code></blockquote>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonthen only <code>Includes</code> will be set for the /web/docs/spec
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsondirectory. However if the second <code>Options</code> directive uses the +
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonand - symbols:<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<blockquote><code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;Directory /web/docs&gt; <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonOptions Indexes FollowSymLinks<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;/Directory&gt;<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;Directory /web/docs/spec&gt; <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonOptions +Includes -Indexes<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;/Directory&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</code></blockquote>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthen the options <code>FollowSymLinks</code> and <code>Includes</code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonare set for the /web/docs/spec directory.
8d18220deb04ec7b12410cd90deb4d45e66d49bfMark J Musante<hr>
8d18220deb04ec7b12410cd90deb4d45e66d49bfMark J Musante
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<A name="pidfile"><h2>PidFile directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt PidFile} directive&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Syntax:</strong> PidFile <em>filename</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>PidFile logs/httpd.pid</code><br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
8d18220deb04ec7b12410cd90deb4d45e66d49bfMark J Musante
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe PidFile directive sets the file to which the server records the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprocess id of the daemon. If the filename does not begin with a slash (/)
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonthen it is assumed to be relative to the <A HREF="#serverroot">ServerRoot</A>.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe PidFile is only used in <A HREF="#servertype">standalone</A> mode.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonIt is often useful to be able to send the server a signal, so that it closes
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonand then reopens its <A HREF="#errorlog">ErrorLog</A> and TransferLog, and
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonre-reads its configuration files. This is done by sending a SIGHUP (kill -1)
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonsignal to the process id listed in the PidFile.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="port"><h2>Port directive</h2></A>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<!--%plaintext &lt;?INDEX {\tt Port} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> Port <em>number</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>Port 80</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe Port directive sets the network port on which the server listens.
8d18220deb04ec7b12410cd90deb4d45e66d49bfMark J Musante<em>Num</em> is a number from 0 to 65535; some port numbers (especially below
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson1024) are reserved for particular protocols. See <code>/etc/services</code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonfor a list of some defined ports; the standard port for the http protocol
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonis 80.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonPort 80 is one of Unix's special ports. All ports numbered
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonbelow 1024 are reserved for system use, i.e. regular (non-root) users cannot
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonmake use of them; instead they can only use higher port numbers.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonTo use port 80, you must start the server from the root account.
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonAfter binding to the port and before accepting requests, Apache will change
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonto a low privileged user as set by the <A HREF="#user">User directive</A>.<p>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonIf you cannot use port 80, choose any other unused port. Non-root users
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonwill have to choose a port number higher than 1023, such as 8000.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonSECURITY: if you do start the server as root, be sure
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonnot to set <A HREF="#user">User</A> to root. If you run the server as
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonroot whilst handling connections, your site may be open to a major security
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonattack.<p><hr>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="require"><h2>require directive</h2></A>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<!--%plaintext &lt;?INDEX {\tt require} directive&gt; -->
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson<strong>Syntax:</strong> require <em>entity-name entity entity...</em><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Context:</strong> directory, .htaccess<br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Override:</strong> AuthConfig<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson
fa9e4066f08beec538e775443c5be79dd423fcabahrensThis directive selects which authenticated users can access a directory.
fa9e4066f08beec538e775443c5be79dd423fcabahrensThe allowed syntaxes are:
fa9e4066f08beec538e775443c5be79dd423fcabahrens<ul>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li>require user <em>userid userid ...</em><p>
fa9e4066f08beec538e775443c5be79dd423fcabahrensOnly the named users can access the directory.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li>require group <em>group-name group-name ...</em><p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonOnly users in the named groups can access the directory.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li>require valid-user<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAll valid users can access the directory.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</ul>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonIf <code>require</code> appears in a <A HREF="#limit">&lt;Limit&gt;</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonsection, then it restricts access to the named methods, otherwise
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonit restricts access for all methods. Example:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<blockquote><code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAuthType Basic<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAuthName somedomain<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAuthUserFile /web/users<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAuthGroupFile /web/groups<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;Limit GET POST&gt;<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonrequire group admin<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;/Limit&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</code></blockquote>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonRequire must be accompanied by <A HREF="#authname">AuthName</A> and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#authtype">AuthType</A> directives, and directives such as
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> (to define users and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsongroups) in order to work correctly.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="resourceconfig"><h2>ResourceConfig directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt ResourceConfig} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> ResourceConfig <em>filename</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>ResourceConfig conf/srm.conf</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe server will read this file for more directives after reading the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonhttpd.conf file. <em>Filename</em> is relative to the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="#serverroot">ServerRoot</A>.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThis feature can be disabled using:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<blockquote><code>ResourceConfig /dev/null</code></blockquote>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonHistorically, this file contained most directives except for server
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonconfiguration directives and <A HREF="#directory">&lt;Directory&gt;</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonsections; in fact it can now contain any server directive allowed in the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<em>server config</em> context.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonSee also <A HREF="#accessconfig">AccessConfig</A>.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="rlimit">
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="rlimitcpu"><h2>RLimitCPU directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt RLimitCPU} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> RLimitCPU <em># or 'max'</em> <em>[# or 'max']</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>Unset uses operating system defaults</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> RLimitCPU is only available in Apache 1.2 and later<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonTakes 1 or 2 parameters. The first parameter sets the soft resource limit for all
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprocesses and the second parameter sets the maximum resource limit. Either parameter
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsoncan be a number, or <em>max</em> to indicate to the server that the limit should
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonbe set to the maximum allowed by the operating system configuration. Raising the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonmaximum resource limit requires that the server is running as root, or in the initial
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickstartup phase.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
fa9e4066f08beec538e775443c5be79dd423fcabahrensCPU resource limits are expressed in seconds per process.<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonSee also <A HREF="#rlimitmem">RLimitMEM</A> or <A HREF="#rlimitnproc">RLimitNPROC</A>.<p><hr>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A name="rlimitmem"><h2>RLimitMEM directive</h2></A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt RLimitMEM} directive&gt; -->
5ad820458efd0fdb914baff9c1447c22b819fa23nd<strong>Syntax:</strong> RLimitMEM <em># or 'max'</em> <em>[# or 'max']</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>Unset uses operating system defaults</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> RLimitMEM is only available in Apache 1.2 and later<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonTakes 1 or 2 parameters. The first parameter sets the soft resource limit for all
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprocesses and the second parameter sets the maximum resource limit. Either parameter
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsoncan be a number, or <em>max</em> to indicate to the server that the limit should
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonbe set to the maximum allowed by the operating system configuration. Raising the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonmaximum resource limit requires that the server is running as root, or in the initial
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonstartup phase.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonMemory resource limits are expressed in bytes per process.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
fa9e4066f08beec538e775443c5be79dd423fcabahrensSee also <A HREF="#rlimitcpu">RLimitCPU</A> or <A HREF="#rlimitnproc">RLimitNPROC</A>.<p><hr>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="rlimitnproc"><h2>RLimitNPROC directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt RLimitNPROC} directive&gt; -->
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Syntax:</strong> RLimitNPROC <em># or 'max'</em> <em>[# or 'max']</em><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Default:</strong> <code>Unset uses operating system defaults</code><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Context:</strong> server config, virtual host<br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> RLimitNPROC is only available in Apache 1.2 and later<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrensTakes 1 or 2 parameters. The first parameter sets the soft resource limit for all
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonprocesses and the second parameter sets the maximum resource limit. Either parameter
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickcan be a number, or <em>max</em> to indicate to the server that the limit should
fa9e4066f08beec538e775443c5be79dd423fcabahrensbe set to the maximum allowed by the operating system configuration. Raising the
fa9e4066f08beec538e775443c5be79dd423fcabahrensmaximum resource limit requires that the server is running as root, or in the initial
fa9e4066f08beec538e775443c5be79dd423fcabahrensstartup phase.<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensProcess limits control the number of processes per user.<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickNote: If CGI processes are <b>not</b> running under userids other than the
fa9e4066f08beec538e775443c5be79dd423fcabahrensweb server userid, this directive will limit the number of processes that the
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickserver itself can create. Evidence of this situation will be indicated by
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<b><em>cannot fork</em></b> messages in the error_log.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonSee also <A HREF="#rlimitmem">RLimitMEM</A> or <A HREF="#rlimitcpu">RLimitCPU</A>.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="satisfy"><h2>Satisfy</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt Satisfy} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> Satisfy <em>'any' or 'all'</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Compatibility:</strong> Satisfy is only available in Apache 1.2 and later<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
468c413a79615e77179e8d98f22a7e513a8135bdTim HaleyAccess policy if both allow and require used. The parameter can be either
fa9e4066f08beec538e775443c5be79dd423fcabahrens<em>'all'</em> or <em>'any'</em>.
fa9e4066f08beec538e775443c5be79dd423fcabahrens
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<p><hr>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens<A name="sendbuffersize"><h2>SendBufferSize</h2></A>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--%plaintext &lt;?INDEX {\tt SendBufferSize} directive&gt; -->
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Syntax:</strong> SendBufferSize <em>bytes</em><br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Context:</strong> server config, virtual host<br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Status:</strong> core<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensThe server will set the TCP buffer size to the number of bytes
fa9e4066f08beec538e775443c5be79dd423fcabahrensspecified. Very useful to increase past standard OS defaults on high
fa9e4066f08beec538e775443c5be79dd423fcabahrensspeed high latency (i.e. 100ms or so, such as transcontinental
fa9e4066f08beec538e775443c5be79dd423fcabahrensfast pipes)
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="serveradmin"><h2>ServerAdmin directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt ServerAdmin} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> ServerAdmin <em>email-address</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
468c413a79615e77179e8d98f22a7e513a8135bdTim HaleyThe ServerAdmin sets the e-mail address that the server includes in any
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonerror messages it returns to the client.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
fa9e4066f08beec538e775443c5be79dd423fcabahrensIt may be worth setting up a dedicated address for this, e.g.
fa9e4066f08beec538e775443c5be79dd423fcabahrens<blockquote><code>ServerAdmin www-admin@foo.bar.com</code></blockquote>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilsonas users do not always mention that they are talking about the server!<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson<A name="serveralias"><h2>ServerAlias directive</h2></A>
468c413a79615e77179e8d98f22a7e513a8135bdTim Haley
fb09f5aad449c97fe309678f3f604982b563a96fMadhav Suresh<strong>Syntax:</strong> ServerAlias <em>host1 host2 ...</em><br>
468c413a79615e77179e8d98f22a7e513a8135bdTim Haley<strong>Context:</strong> virtual host<br>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> ServerAlias is only available in Apache
5ad820458efd0fdb914baff9c1447c22b819fa23nd1.1 and later.<p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensThe ServerAlias directive sets the alternate names for a host, for use
fa9e4066f08beec538e775443c5be79dd423fcabahrenswith
fa9e4066f08beec538e775443c5be79dd423fcabahrens<a href="/host.html">Host-header based virtual hosts</a>.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="servername"><h2>ServerName directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt ServerName} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> ServerName <em>fully-qualified domain name</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config, virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe ServerName directive sets the hostname of the server; this is only
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonused when creating redirection URLs. If it is not specified, then the
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonserver attempts to deduce it from its own IP address; however this may
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonnot work reliably, or may not return the preferred hostname. For example:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<blockquote><code>ServerName www.wibble.com</code></blockquote>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonwould be used if the canonical (main) name of the actual machine
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonwere <code>monster.wibble.com</code>.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="serverpath"><h2>ServerPath directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> ServerPath <em>pathname</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> virtual host<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> ServerPath is only available in Apache
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson1.1 and later.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe ServerPath directive sets the legacy URL pathname for a host, for
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonuse with <a href="/host.html">Host-header based virtual hosts</a>.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="serverroot"><h2>ServerRoot directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt ServerRoot} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> ServerRoot <em>directory-filename</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>ServerRoot /usr/local/etc/httpd</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe ServerRoot directive sets the directory in which the server lives.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonTypically it will contain the subdirectories <code>conf/</code> and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<code>logs/</code>. Relative paths for other configuration files are taken
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonas relative to this directory.<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonSee also <a href="/invoking.html">the <code>-d</code> option to httpd</a>.<p><hr>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A name="servertype"><h2>ServerType directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt ServerType} directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> ServerType <em>type</em><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Default:</strong> <code>ServerType standalone</code><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> core<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe ServerType directive sets how the server is executed by the system.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<em>Type</em> is one of
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dl>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dt>inetd
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>The server will be run from the system process inetd; the command to start
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthe server is added to <code>/etc/inetd.conf</code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dt>standalone
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dd>The server will run as a daemon process; the command to start the server
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonis added to the system startup scripts. (<code>/etc/rc.local</code> or
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<code>/etc/rc3.d/...</code>.)
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</dl>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonInetd is the lesser used of the two options. For each http
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickconnection received, a new copy of the server is started from scratch;
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickafter the connection is complete, this program exits. There is a high price to
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickpay per connection, but for security reasons, some admins prefer this option.
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<p>
44cd46cadd9aab751dae6a4023c1cb5bf316d274billm
44cd46cadd9aab751dae6a4023c1cb5bf316d274billmStandalone is the most common setting for ServerType since
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickit is far more efficient. The server is started once, and services all
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwicksubsequent connections. If you intend running Apache to serve a busy site,
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickstandalone will probably be your only option.<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George WilsonSECURITY: if you are paranoid about security, run in inetd mode. Security
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilsoncannot be guaranteed in either, but whilst most people are happy to use
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilsonstandalone, inetd is probably least prone to attack.<p><hr>
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilson
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilson<A name="startservers"><h2>StartServers directive</h2></A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--%plaintext &lt;?INDEX {\tt StartServers} directive&gt; -->
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilson<strong>Syntax:</strong> StartServers <em>number</em><br>
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilson<strong>Default:</strong> <code>StartServers 5</code><br>
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilson<strong>Context:</strong> server config<br>
9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5George Wilson<strong>Status:</strong> core<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickThe StartServers directive sets the number of child server processes created
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickon startup. As the number of processes is dynamically controlled depending
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonon the load, there is usually little reason to adjust this parameter.<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickSee also <A HREF="#minspareservers">MinSpareServers</A> and
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<A HREF="#maxspareservers">MaxSpareServers</A>.<p><hr>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<A name="timeout"><h2>TimeOut directive</h2></A>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<!--%plaintext &lt;?INDEX {\tt TimeOut} directive&gt; -->
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Syntax:</strong> TimeOut <em>number</em><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Default:</strong> <code>TimeOut 1200</code><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Context:</strong> server config<br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Status:</strong> core<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe TimeOut directive currently defines the amount of time Apache will
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickwait for three things:
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<OL>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson <LI>The total amount of time it takes to receive a GET request.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson <LI>The amount of time between receipt of TCP packets on a POST or
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson PUT request.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson <LI>The amount of time between ACKs on transmissions of TCP packets
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson in responses.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson</OL>
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
80eb36f241abf8c076119fb4c49a55fd61ebc710George WilsonWe plan on making these separately configurable at some point down the
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonroad. 1200 is very generous - you may consider turning it down to
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonsomething smaller if you find the server getting swamped by
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilsonhalf-completed connections from buggy browsers.
80eb36f241abf8c076119fb4c49a55fd61ebc710George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><hr>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<A name="user"><h2>User directive</h2></A>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<!--%plaintext &lt;?INDEX {\tt User} directive&gt; -->
09c9d376e8ccb8fbba74f33cc268964464092b62George Wilson<strong>Syntax:</strong> User <em>unix-userid</em><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Default:</strong> <code>User #-1</code><br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Context:</strong> server config, virtual host<br>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<strong>Status:</strong> core<p>
44cd46cadd9aab751dae6a4023c1cb5bf316d274billm
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonThe User directive sets the userid as which the server will answer requests.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonIn order to use this directive, the standalone server must be run initially
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonas root. <em>Unix-userid</em> is one of:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<dl>
468c413a79615e77179e8d98f22a7e513a8135bdTim Haley<dt>A username
468c413a79615e77179e8d98f22a7e513a8135bdTim Haley<dd>Refers to the given user by name.
468c413a79615e77179e8d98f22a7e513a8135bdTim Haley<dt># followed by a user number.
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<dd>Refers to a user by their number.
d6e555bdd793b8bc8fe57d5f12c3d69c813d0661George Wilson</dl>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
44cd46cadd9aab751dae6a4023c1cb5bf316d274billmThe user should have no privileges which result in it being able to access
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickfiles which are not intended to be visible to the outside world, and
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonsimilarly, the user should not be able to execute code which is not
44cd46cadd9aab751dae6a4023c1cb5bf316d274billmmeant for httpd requests. It is recommended that you set up a new user and
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickgroup specifically for running the server. Some admins use user
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<code>nobody</code>, but this is not always possible or desirable.<p>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickNotes: If you start the server as a non-root user, it will fail to change
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickto the lesser privileged user, and will instead continue to run as
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickthat original user. If you do start the server as root, then it is normal
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwickfor the parent process to remain running as root.<p>
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrens
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrensSpecial note: Use of this directive in &lt;VirtualHost&gt; requires a
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrensproperly configured <A HREF="/suexec.html">SUEXEC wrapper</A>.<p>
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrens
5f5f7a6f9c8e9c1587a54e690556d756ec67558cahrensSECURITY: Don't set User (or <A HREF="#group">Group</A>) to
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<code>root</code> unless you know exactly what you are doing, and what the
44cd46cadd9aab751dae6a4023c1cb5bf316d274billmdangers are.<p><hr>
44cd46cadd9aab751dae6a4023c1cb5bf316d274billm
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<A name="virtualhost"><h2>&lt;VirtualHost&gt; directive</h2></A>
ecc2d604e885a75cc75e647b5641af99d5a6f4a6bonwick<!--%plaintext &lt;?INDEX {\tt VirtualHost} section directive&gt; -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Syntax:</strong> &lt;VirtualHost <em>addr</em>[:<em>port</em>]&gt; ...
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;/VirtualHost&gt; <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Context:</strong> server config<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Status:</strong> Core.<br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>Compatibility:</strong> Non-IP address-based Virtual Hosting is
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsononly available in Apache 1.2 and later.<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;VirtualHost&gt; and &lt;/VirtualHost&gt; are used to enclose a group of
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsondirectives which will apply only to a particular virtual host.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonAny directive which is allowed in a virtual host context may be used.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonWhen the server receives a request for a document on a particular virtual
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonhost, it uses the configuration directives enclosed in the &lt;VirtualHost&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonsection. <em>Addr</em> can be
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<menu>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li>The IP address of the virtual host
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<li>A fully qualified domain name for the IP address of the virtual host.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</menu> Example:
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<blockquote>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;VirtualHost host.foo.com&gt; <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonServerAdmin webmaster@host.foo.com <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonDocumentRoot /www/docs/host.foo.com <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonServerName host.foo.com <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonErrorLog logs/host.foo.com-error_log <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonTransferLog logs/host.foo.com-access_log <br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson&lt;/VirtualHost&gt;
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</code></blockquote>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonEach VirtualHost must correspond to a different IP address or a
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsondifferent host name for the server, in the latter case the server
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonmachine must be configured to accept IP packets for multiple
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonaddresses. (If the machine does not have multiple network interfaces,
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthen this can be accomplished with the <code>ifconfig alias</code>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsoncommand (if your OS supports it), or with kernel patches like <A
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonHREF="/misc/vif-info.html">VIF</A> (for SunOS(TM) 4.1.x)).<p>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge WilsonSECURITY: See the <A HREF="/misc/security_tips.html">security tips</A>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsondocument for details on why your security could be compromised if
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthe directory where logfiles are stored is writable by anyone other
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilsonthan the user that starts the server.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<p><strong>See also:</strong>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<A HREF="/virtual-host.html">Information on Virtual Hosts.
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson(multihome)</A><br>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<strong>See also:</strong>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<a href="/host.html">Non-IP address-based Virtual Hosts</a>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</p>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson<!--#include virtual="footer.html" -->
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</BODY>
0713e232b7712cd27d99e1e935ebb8d5de61c57dGeorge Wilson</HTML>
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson
16a4a8074274d2d7cc408589cf6359f4a378c861George Wilson