0N/A<!
DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
0N/A<
TITLE>Apache Core Features</
TITLE>
0N/A<
H1>Apache Core Features</
h1>
0N/AThese configuration parameters control the core Apache features, and are
0N/A<
li><
A HREF="#accessconfig">AccessConfig</
A>
0N/A<
li><
A HREF="#accessfilename">AccessFileName</
A>
0N/A<
li><
A HREF="#allowoverride">AllowOverride</
A>
0N/A<
li><
A HREF="#authname">AuthName</
A>
0N/A<
li><
A HREF="#authtype">AuthType</
A>
0N/A<
li><
A HREF="#bindaddress">BindAdress</
A>
5085N/A<
li><
A HREF="#defaulttype">DefaultType</
A>
6238N/A<
li><
A HREF="#directory"><Directory></
A>
0N/A<
li><
A HREF="#documentroot">DocumentRoot</
A>
0N/A<
li><
A HREF="#errordocument">ErrorDocument</
A>
0N/A<
li><
A HREF="#errorlog">ErrorLog</
A>
0N/A<
li><
A HREF="#files"><Files></
A>
0N/A<
li><
A HREF="#group">Group</
A>
0N/A<
li><
A HREF="#identitycheck">IdentityCheck</
A>
0N/A<
li><
A HREF="#ifmodule"><IfModule></
A>
0N/A<
li><
A HREF="#keepalive">KeepAlive</
A>
0N/A<
li><
A HREF="#keepalivetimeout">KeepAliveTimeout</
A>
0N/A<
li><
A HREF="#limit"><Limit></
A>
0N/A<
li><
A HREF="#listen">Listen</
A>
0N/A<
li><
A HREF="#location"><Location></
A>
0N/A<
li><
A HREF="#maxclients">MaxClients</
A>
0N/A<
li><
A HREF="#maxrequestsperchild">MaxRequestsPerChild</
A>
0N/A<
li><
A HREF="#maxspareservers">MaxSpareServers</
A>
0N/A<
li><
A HREF="#minspareservers">MinSpareServers</
A>
0N/A<
li><
A HREF="#options">Options</
A>
0N/A<
li><
A HREF="#pidfile">PidFile</
A>
0N/A<
li><
A HREF="#port">Port</
A>
0N/A<
li><
A HREF="#require">require</
A>
0N/A<
li><
A HREF="#resourceconfig">ResourceConfig</
A>
0N/A<
li><
A HREF="#sendbuffersize>SendBufferSize</A> 0N/A<li><A HREF="#
serveradmin">ServerAdmin</A> 0N/A<li><A HREF="#
serveralias">ServerAlias</A> 0N/A<li><A HREF="#
servername">ServerName</A> 0N/A<li><A HREF="#
serverpath">ServerPath</A> 0N/A<li><A HREF="#
serverroot">ServerRoot</A> 0N/A<li><A HREF="#
servertype">ServerType</A> 0N/A<li><A HREF="#
startservers">StartServers</A> 0N/A<li><A HREF="#
timeout">TimeOut</A> 0N/A<li><A HREF="#
user">User</A> 0N/A<li><A HREF="#
virtualhost"><VirtualHost></A> 0N/A<A name="accessconfig"><h2>AccessConfig directive</h2></A> 0N/A<!--%plaintext <?INDEX {\tt AccessConfig} directive> --> 0N/A<strong>Syntax:</strong> AccessConfig <em>filename</em><br> 0N/A<strong>Context:</strong> server config, virtual host<br> 0N/A<strong>Status:</strong> core<p> 0N/AThe server will read this file for more directives after reading the 0N/A<A HREF="#
resourceconfig">ResourceConfig</A> file. <em>Filename</em> is 0N/Arelative to the <A HREF="#
serverroot">ServerRoot</A>. 0N/AThis feature can be disabled using: 0N/A<blockquote><code>AccessConfig /dev/null</code></blockquote> 0N/AHistorically, this file only contained 0N/A<A HREF="#
directory"><Directory></A> sections; in fact it can now 0N/Acontain any server directive allowed in the <em>server config</em> context. 0N/A<A name="accessfilename"><h2>AccessFileName directive</h2></A> 0N/A<!--%plaintext <?INDEX {\tt AccessFileName} directive> --> 0N/A<strong>Syntax:</strong> AccessFileName <em>filename</em><br> 0N/A<strong>Default:</strong> <code>AccessFileName .htaccess</code><br> 0N/A<strong>Context:</strong> server config, virtual host<br> 0N/A<strong>Status:</strong> core<p> 0N/AWhen returning a document to the client the server looks for an 1060N/Aaccess control file with this name in every directory of the path to 1060N/Athe document, if access control files are enabled for that directory. 2568N/A<blockquote><code>AccessFileName .acl</code></blockquote> 2568N/Afor directives, unless they have been disabled with 2568N/A</Directory></code></blockquote><p><hr> 2568N/A<A name="allowoverride"><h2>AllowOverride directive</h2></A> 2568N/A<!--%plaintext <?INDEX {\tt AllowOverride} directive> --> 2568N/A<strong>Syntax:</strong> AllowOverride <em>override override ...</em><br> 2568N/A<strong>Default:</strong> <code>AllowOverride All</code><br> 2568N/A<strong>Context:</strong> directory<br> 2568N/A<strong>Status:</strong> core<p> 2568N/AWhen the server finds an .htaccess file (as specified by 2568N/A<A HREF="#
accessfilename">AccessFileName</A>) it needs to know which 1060N/Adirectives declared in that file can override earlier access information.<p> 1060N/A<em>Override</em> can be set to <code>None</code>, in which case the server 1060N/Awill not read the file, <code>All</code> in which case the server will 1060N/Aallow all the directives, or one or more of the following: 1060N/A<!--%plaintext <?INDEX {\tt AuthConfig} override> --> 1060N/AAllow use of the authorization directives 4486N/A<A HREF="#
authname">AuthName</A>, <A HREF="#
authtype">AuthType</A>, 4486N/A<A HREF="#
require">require</A>). 4486N/A<!--%plaintext <?INDEX {\tt FileInfo} override> --> 4486N/AAllow use of the directives controlling document types 1060N/A<A HREF="#
defaulttype">DefaultType</A> and 1060N/A<!--%plaintext <?INDEX {\tt Indexes} override> --> 1060N/AAllow use of the directives controlling directory indexing 1060N/A<!--%plaintext <?INDEX {\tt Limit} override> --> 1060N/AAllow use of the directives controlling host access (allow, deny and order). 1060N/A<!--%plaintext <?INDEX {\tt Options} override> --> 1060N/AAllow use of the directives controlling specific directory features 1060N/A(<A HREF="#
options">Options</A> and 1060N/A<A name="authname"><h2>AuthName directive</h2></A> 1060N/A<!--%plaintext <?INDEX {\tt AuthName} directive> --> 1060N/A<strong>Syntax:</strong> AuthName <em>auth-domain</em><br> 1060N/A<strong>Context:</strong> directory, .htaccess<br> 1060N/A<strong>Override:</strong> AuthConfig<br> 1060N/A<strong>Status:</strong> core<p> 1060N/AThis directive sets the name of the authorization realm for a directory. 1060N/AThis realm is given to the client so that the user knows which username and 1060N/AIt must be accompanied by <A HREF="#
authtype">AuthType</A> and 1060N/A<A HREF="#
require">require</A> directives, and directives such as 1060N/A<A name="authtype"><h2>AuthType directive</h2></A> 1060N/A<!--%plaintext <?INDEX {\tt AuthType} directive> --> 1060N/A<strong>Syntax:</strong> AuthType <em>type</em><br> 1060N/A<strong>Context:</strong> directory, .htaccess<br> 1060N/A<strong>Override:</strong> AuthConfig<br> 1060N/A<strong>Status:</strong> core<p> 1060N/AThis directive selects the type of user authentication for a directory. 1060N/AOnly <code>Basic</code> is currently implemented. 1060N/A<!--%plaintext <?INDEX {\tt Basic} authentication scheme> --> 1060N/AIt must be accompanied by <A HREF="#
authname">AuthName</A> and 1060N/A<A HREF="#
require">require</A> directives, and directives such as 1060N/A<A name="bindaddress"><h2>BindAddress directive</h2></A> 1060N/A<!--%plaintext <?INDEX {\tt BindAddress} directive> --> 1060N/A<strong>Syntax:</strong> BindAddress <em>saddr</em><br> 1060N/A<strong>Default:</strong> <code>BindAddress *</code><br> 1060N/A<strong>Context:</strong> server config<br> 1060N/A<strong>Status:</strong> core<p> 1060N/AA Unix® http server can either listen on for connections to every 1060N/AIP address of the server machine, or just one IP address of the server 1060N/Amachine. <em>Saddr</em> can be 1060N/A<li>A fully-qualified internet domain name 1060N/AIf the value is *, then the server will listen for connections on 1060N/Aevery IP address, otherwise it will only listen on the IP address 1060N/AThis option can be used as an alternative method for supporting 1060N/A<A HREF="#
virtualhost"><VirtualHost></A> sections.<p><hr> 1060N/A<p><strong>See Also:</strong> 1060N/A<a href="bind.html">Setting which addresses and ports Apache uses</a></p> 1060N/A<A name="defaulttype"><h2>DefaultType directive</h2></A> 1060N/A<!--%plaintext <?INDEX {\tt DefaultType} directive> --> 1060N/A<strong>Syntax:</strong> DefaultType <em>mime-type</em><br> 1060N/A<strong>Context:</strong> server config, virtual host, directory, .htaccess<br> 1060N/A<strong>Override:</strong> FileInfo<br> 1060N/A<strong>Status:</strong> core<p> 1060N/AThere will be times when the server is asked to provide a document 1060N/Awhose type cannot be determined by its MIME types mappings.<p> 1060N/AThe server must inform the client of the content-type of the document, so in 1060N/Athe event of an unknown type it uses the <CODE>DefaultType</CODE>. For 1060N/Awould be appropriate for a directory which contained many gif images 1060N/Awith filenames missing the .gif extension.<p><hr> 1060N/A<A name="directory"><h2><Directory> directive</h2></A> 1060N/A<!--%plaintext <?INDEX {\tt Directory} section directive> --> 1060N/A<strong>Syntax:</strong> <Directory <em>directory</em>> ... </Directory> <br> 1060N/A<strong>Context:</strong> server config, virtual host<br> 1060N/A<strong>Status:</strong> Core. <p> 1060N/A<Directory> and </Directory> are used to enclose a group of 1060N/Adirectives which will apply only to the named directory and sub-directories 1060N/Aof that directory. Any directive which is allowed in a directory 1060N/Acontext may be used. <em>Directory</em> is either the full path to a directory, 1060N/Aor a wildcard string. In a wildcard string, `?' matches any single character, 1060N/Aand `*' matches any sequences of characters. Example: 1060N/A Options Indexes FollowSymLinks 1060N/A<p><strong>Apache 1.2 and above:</strong> 1060N/AExtended regular expressions can also be used, with the addition of the 1060N/A<code>~</code> character. For example:</p> 1060N/A <Directory ~ "^/www/.*/[0-9]{3}"> 1060N/Awould match directories in /www/ that consisted of three numbers.<p> 1060N/A<p>If multiple directory sections match the directory (or its parents) containing 1060N/Aa document, then the directives are applied in the order of shortest match 1060N/Afirst, interspersed with the directives from the 1060N/A<A HREF="#
accessfilename">.htaccess</A> files. For example, with 1060N/A<Directory /home/*><br> 1060N/A</Directory></code></blockquote> 1060N/A<li>Apply directive <code>AllowOverride None</code> (disabling 1060N/A<code>.htaccess</code> files). 1060N/A<li>Apply directive <code>AllowOverride FileInfo</code> (for directory 1060N/Amay appear in any configuration file. <Directory> directives cannot 1060N/Anest, and cannot appear in a <A HREF="#
limit"><Limit></A> section. 2290N/A<A NAME="documentroot"><h2>DocumentRoot directive</h2></A> 2290N/A<!--%plaintext <?INDEX {\tt DocumentRoot} directive> --> 2290N/A<strong>Syntax:</strong> DocumentRoot <em>directory-filename</em><br> 2290N/A<strong>Default:</strong> <code>DocumentRoot 1060N/A<strong>Context:</strong> server config, virtual host<br> 1060N/A<strong>Status:</strong> core<p> 1060N/AThis directive sets the directory from which httpd will serve files. 1060N/AUnless matched by a directive like Alias, the server appends the path 1060N/Afrom the requested URL to the document root to make the path to the 1060N/A<blockquote><code>DocumentRoot /usr/web</code></blockquote> 1060N/A<P>There appears to be a bug in mod_dir which causes problems when the 1060N/A<A name="errordocument"><h2>ErrorDocument directive</h2></A> 1060N/A<!--%plaintext <?INDEX {\tt ErrorDocument} directive> --> 1060N/A<strong>Syntax:</strong> ErrorDocument <em>error-code document</em><br> 1060N/A<strong>Context</strong> server config, virtual host, directory, .htaccess<br> 1060N/A<strong>Status:</strong> core<br> 1060N/A<strong>Compatibility:</strong> The directory and .htaccess contexts 2572N/Aare only available in Apache 1.1 and later.<p> 2290N/AIn the event of a problem or error, Apache can be configured to do 2290N/A<LI>behave like NCSA httpd 1.3 2290N/A<LI>output a customized message 5360N/A<P>2-4 are configured using <CODE>ErrorDocument</CODE>, which 5360N/Ais followed by the HTTP response code and a message or URL. 5360N/A<P><em>Messages</em> in this context, begin with a single quote 5360N/A(<code>"</code>), which does not form part of the message itself. Apache will
5360N/A<
P>URLs will begin with a slash (/) for local URLs, or will be a full
5360N/AURL which the client can resolve. Examples:
2290N/AErrorDocument 403 "Sorry can't allow you access today
2290N/A<
A name="errorlog"><
h2>ErrorLog directive</
h2></
A>
1060N/A<!--%plaintext <?INDEX {\tt ErrorLog} directive> --> 1060N/A<
strong>Syntax:</
strong> ErrorLog <
em>filename</
em><
br>
1060N/A<
strong>Context:</
strong> server config, virtual host<
br>
1060N/A<
strong>Status:</
strong> core<
p>
1060N/AThe error log directive sets the name of the file to which the server will log
1060N/Aany errors it encounters. If the filename does not begin with a slash (/)
1060N/Athen it is assumed to be relative to the <
A HREF="#serverroot">ServerRoot</
A>.
1060N/AThis effectively turns off error logging.<
p><
hr>
1060N/A<
A name="files"><
h2><Files></
h2></
A>
1060N/A<
strong>Syntax:</
strong> <Files <
em>filename</
em>>
1060N/A<
strong>Context:</
strong> server config, virtual host, htaccess<
br>
1060N/A<
strong>Status:</
strong> core<
br>
1060N/A<
strong>Compatibility:</
strong> only available in Apache
1060N/A<
p>The <Files> directive provides for access control by
1060N/Afilename. It is comparable to the <
a 1060N/Ahref="#directory"><Directory></
a> directive and
1060N/A<
a href="#location"><Location></
a> directives. It
1060N/Ashould be matched with a </Files> directive. Directives that
1060N/Aapply to the filename given should be listed
1060N/Awithin. <
code><Files></
code> sections are processed in the
1060N/Aorder they appear in the configuration file, after the
1060N/A<Directory> sections and <
code>.htaccess</
code> files are
2549N/Aread, but before <Location> sections.</
p>
2549N/A<
p>The <
em>filename</
em> argument should include a filename, or a
2549N/Awildcard string, where `?' matches any single character, and `*' matches any
2549N/Asequences of characters. Extended regular expressions can also be used, with the addition of
1060N/Athe <
code>~</
code> character. For example:</
p>
1060N/A <Files ~ "\.(gif|jpe?g|png)$">
1060N/Awould match most common Internet graphics formats.
1060N/Ahref="#directory"><
code><Directory></
code></
a> and <
a 1060N/Ahref="#location"><
code><Location></
code></
a> sections,
1060N/A<
code><Files></
code> sections can be used inside .htaccess
1060N/Afiles. This allows users to control access to their own files, at a
1060N/Afile-by-file level. When used in an .htaccess file, if the
1060N/A<
em>filename</
em> does not begin with a <
code>/</
code> character,
1060N/Athe directory being applied will be prefixed automatically.
1060N/A<
A name="group"><
h2>Group directive</
h2></
A>
1241N/A<!--%plaintext <?INDEX {\tt Group} directive> --> 1241N/A<
strong>Syntax:</
strong> Group <
em>unix-group</
em><
br>
1241N/A<
strong>Default:</
strong> <
code>Group #-1</
code><
br>
1241N/A<
strong>Context:</
strong> server config<
br>
1241N/A<
strong>Status:</
strong> core<
p>
1241N/AThe Group directive sets the group under which the server will answer requests.
1241N/AIn order to use this directive, the standalone server must be run initially
1241N/Aas root. <
em>Unix-group</
em> is one of:
5919N/A<
dd>Refers to the given group by name.
1241N/A<
dt># followed by a group number.
1241N/A<
dd>Refers to a group by its number.
1241N/AIt is recommended that you set up a new group specifically for running the
1241N/Aserver. Some admins use user <
code>nobody</
code>, but this is not always
1241N/ANote: if you start the server as a non-root user, it will fail to change
1340N/Ato the specified, and will instead continue to run as the group of the
1340N/ASECURITY: See <
A HREF="#user">User</
A> for a discussion of the security
1340N/A<
A name="identitycheck"><
h2>IdentityCheck directive</
h2></
A>
1340N/A<!--%plaintext <?INDEX {\tt IdentityCheck} directive> --> 1340N/A<
strong>Syntax:</
strong> IdentityCheck <
em>boolean</
em><
br>
1340N/A<
strong>Default:</
strong> <
code>IdentityCheck off</
code><
br>
1340N/A<
strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
1340N/A<
strong>Status:</
strong> core<
p>
1340N/AThis directive enables RFC931-compliant logging of the remote user name
5085N/Afor each connection, where the client machine runs identd or something similar.
5085N/AThis information is logged in the access log. <
em>Boolean</
em> is either
5085N/A<
code>on</
code> or <
code>off</
code>.<
p>
5085N/AThe information should not trusted in any way except for rudimentary usage
1340N/A<
A NAME="ifmodule"><
H2><IfModule></
H2></
A>
1340N/A<
b>Syntax:</
b> <IfModule [!]<
i>module-name</
i>> <
i>...</
i>
1340N/A<
strong>Compatibility:</
strong> ScriptLog is only available in 1.2 and
1402N/AThe <IfModule <
i>test</
i>>...</IfModule>
1402N/Asection is used to mark directives that are conditional. The
1402N/Adirectives within an IfModule section are only
1402N/Aprocessed if the <
i>test</
i> is true. If <
i>test</
i>
1402N/Ais false, everything between the start and end markers
1402N/AThe <
i>test</
i> in the <IfModule> section directive
1402N/A<
p>In the former case, the directives between the start and end markers
1645N/Aare only processed if the module named <
i>module name</
i> is compiled
1402N/Ain to Apache. The second format reverses the test, and only processes
1402N/Athe directives if <
i>module name</
i> is <
b>not</
b> compiled in.
1402N/A<
p>The <
i>module name</
i> argument is a module name as given as the file
1645N/Aname of the module, at the time it was compiled. For example,
1645N/A<
p><IfModule> sections are nestable, which can be used to implement
1402N/Asimple multiple-module tests.
1645N/A<
h2><
a name="keepalive">KeepAlive</
a></
h2>
1645N/A<
strong>Syntax:</
strong> KeepAlive <
em>max-requests</
em><
br>
1645N/A<
strong>Default:</
strong> <
code>KeepAlive 5</
code><
br>
1645N/A<
strong>Context:</
strong> server config<
br>
1402N/A<
strong>Status:</
strong> Core<
br>
1402N/A<
strong>Compatibility:</
strong> KeepAlive is only available in Apache
1645N/Asupport. Set <
em>max-requests</
em>
1645N/Ato the maximum number of requests you want Apache to entertain per
1648N/Arequest. A limit is imposed to prevent a client from hogging your
1648N/Aserver resources. Set this to <
code>0</
code> to disable support.
1648N/A<
h2><
a name="keepalivetimeout">KeepAliveTimeout</
a></
h2>
1648N/A<
strong>Syntax:</
strong> KeepAliveTimeout <
em>seconds</
em><
br>
1648N/A<
strong>Default:</
strong> <
code>KeepAliveTimeout 15</
code><
br>
1648N/A<
strong>Context:</
strong> server config<
br>
1648N/A<
strong>Status:</
strong> Core<
br>
1648N/A<
strong>Compatibility:</
strong> KeepAliveTimeout is only available in Apache
1899N/AThe number of seconds Apache will wait for a subsequent request before
1899N/Aclosing the connection. Once a request has been received, the timeout
1899N/A<
A name="listen"><
h2>Listen</
h2></
A>
1899N/AListen [<
em>IP address</
em>:]<
em>port number</
em><
br>
1899N/A<
strong>Context:</
strong> server config<
br>
1989N/A<
strong>Status:</
strong> core<
br>
1989N/A<
strong>Compatibility:</
strong> Listen is only available in Apache
1989N/A<
p>The Listen directive instructs Apache to listen to more than one IP
1989N/Aaddress or port; by default it responds to requests on all IP
1989N/Ainterfaces, but only on the port given by the <
a href="#port">Port</
a>
1989N/A<
p><
strong>See Also</
strong>:
1989N/A<
a href="bind.html">Setting which addresses and ports Apache uses</
a></
p>
1899N/A<
A name="limit"><
h2><Limit> directive</
h2></
A>
1899N/A<!--%plaintext <?INDEX {\tt Limit} section directive> --> 1899N/A <Limit <
em>method method</
em> ... > ... </Limit><
br>
1899N/A<
strong>Context:</
strong> any<
br>
1899N/A<
strong>Status:</
strong> core<
p>
2103N/A<Limit> and </Limit> are used to enclose a group of
2103N/Aaccess control directives which will then apply only to the specified
2103N/Aaccess methods, where <
em>method</
em> is any valid HTTP method.
2103N/AAny directive except another <Limit> or
2103N/A<
A HREF="#directory"><Directory></
A> may be used; the majority will be
2103N/Aunaffected by the <Limit>. Example:
2210N/A</Limit></
code></
blockquote>
2210N/AIf an access control directive appears outside a <Limit> directive,
2212N/Athen it applies to all access methods.<
p><
hr>
2210N/A<
h2><
a name="location"><Location></
a></
h2>
2210N/A<
strong>Syntax:</
strong> <Location <
em>URL</
em>>
2210N/A<
strong>Context:</
strong> server config, virtual host<
br>
2210N/A<
strong>Status:</
strong> core<
br>
2281N/A<
strong>Compatibility:</
strong> Location is only available in Apache
2281N/A<
p>The <Location> directive provides for access control by
2281N/AURL. It is comprable to the <
a 2281N/Ahref="#directory"><Directory></
a> directive, and
2281N/Ashould be matched with a </Location> directive. Directives that
5919N/Aapply to the URL given should be listen
2281N/Awithin. <
code><Location></
code> sections are processed in the
2281N/Aorder they appear in the configuration file, after the
2281N/A<Directory> sections and <
code>.htaccess</
code> files are
2625N/A<
p>Note that, due to the way HTTP functions, <
em>URL prefix</
em>
2625N/Ashould, save for proxy requests, be of the form <
code>/path/</
code>,
2625N/Aneccessarily have to protect a directory (it can be an individual
2625N/Afile, or a number of files), and can include wildcards. In a wildcard
2625N/Astring, `?' matches any single character, and `*' matches any
2625N/A<
p><
strong>Apache 1.2 and above:</
strong>
2290N/AExtended regular expressions can also be used, with the addition of
2290N/A<
code>~</
code> character. For example:</
p>
2290N/A <Location ~ "/(extra|special)/data">
2520N/A<
p>The <
code>Location</
code> functionality is especially useful when
2520N/Ahref="mod_mime.html#sethandler">SetHandler</
a></
code> directive. For example, to enable status requests, but allow them only
4005N/A<
A name="maxclients"><
h2>MaxClients directive</
h2></
A>
4005N/A<!--%plaintext <?INDEX {\tt MaxClients} directive> --> 4848N/A<
strong>Syntax:</
strong> MaxClients <
em>number</
em><
br>
4848N/A<
strong>Default:</
strong> <
code>MaxClients 256</
code><
br>
4848N/A<
strong>Context:</
strong> server config<
br>
4848N/A<
strong>Status:</
strong> core<
p>
4848N/AThe MaxClients directive sets the limit on the number of simultaneous
4848N/Arequests that can be supported; not more than this number of child server
4848N/Aprocesses will be created.<
p><
hr>
4848N/A<
A name="maxrequestsperchild"><
h2>MaxRequestsPerChild directive</
h2></
A>
2568N/A<!--%plaintext <?INDEX {\tt MaxRequestsPerChild} directive> --> 2568N/A<
strong>Syntax:</
strong> MaxRequestsPerChild <
em>number</
em><
br>
2568N/A<
strong>Default:</
strong> <
code>MaxRequestsPerChild 0</
code><
br>
2568N/A<
strong>Context:</
strong> server config<
br>
2568N/A<
strong>Status:</
strong> core<
p>
2625N/AThe MaxRequestsPerChild directive sets the limit on the number of requests
2625N/Athat an individual child server process will handle. After MaxRequestsPerChild
2625N/Arequests, the child process will die. If MaxRequestsPerChild is 0, then
2625N/Athe process will never expire.<
p>
2625N/ASetting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
2625N/A<
li>it limits the amount of memory that process can consume by (accidental)
2625N/A<
li> by giving processes a finite lifetime, it helps reduce the
2625N/Anumber of processes when the server load reduces.
2625N/A<
A name="maxspareservers"><
h2>MaxSpareServers directive</
h2></
A>
2625N/A<!--%plaintext <?INDEX {\tt MaxSpareServers} directive> --> 2568N/A<
strong>Syntax:</
strong> MaxSpareServers <
em>number</
em><
br>
2568N/A<
strong>Default:</
strong> <
code>MaxSpareServers 10</
code><
br>
2568N/A<
strong>Context:</
strong> server config<
br>
2568N/A<
strong>Status:</
strong> core<
p>
2625N/AThe MaxSpareServers directive sets the desired maximum number of <
em>idle</
em>
2625N/Achild server processes. An idle process is one which is not handling
2625N/Aa request. If there are more than MaxSpareServers idle, then the parent
2625N/Aprocess will kill off the excess processes.<
p>
2625N/ATuning of this parameter should only be necessary on very busy sites.
2625N/ASetting this parameter to a large number is almost always a bad idea.<
p>
2625N/ASee also <
A HREF="#minspareservers">MinSpareServers</
A> and
2625N/A<
A HREF="#startservers">StartServers</
A>.<
p><
hr>
2625N/A<
A name="minspareservers"><
h2>MinSpareServers directive</
h2></
A>
4672N/A<!--%plaintext <?INDEX {\tt MinSpareServers} directive> --> 4672N/A<
strong>Syntax:</
strong> MinSpareServers <
em>number</
em><
br>
4672N/A<
strong>Default:</
strong> <
code>MinSpareServers 5</
code><
br>
4672N/A<
strong>Context:</
strong> server config<
br>
4672N/A<
strong>Status:</
strong> core<
p>
4672N/AThe MinSpareServers directive sets the desired minimum number of <
em>idle</
em>
4672N/Achild server processes. An idle process is one which is not handling
4672N/Aa request. If there are fewer than MinSpareServers idle, then the parent
2625N/Aprocess creates new children at a maximum rate of 1 per second.<
p>
2625N/ATuning of this parameter should only be necessary on very busy sites.
2625N/ASetting this parameter to a large number is almost always a bad idea.<
p>
2625N/ASee also <
A HREF="#maxspareservers">MaxSpareServers</
A> and
2625N/A<
A HREF="#startservers">StartServers</
A>.<
p><
hr>
2625N/A<
A name="options"><
h2>Options directive</
h2></
A>
2625N/A<!--%plaintext <?INDEX {\tt Options} directive> --> 2625N/A<
strong>Syntax:</
strong> Options <
em>[+|-]option [+|-]option ...</
em><
br>
2625N/A<
strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
2625N/A<
strong>Override:</
strong> Options<
br>
2625N/A<
strong>Status:</
strong> core<
p>
2625N/AThe Options directive controls which server features are available in
2625N/A<
em>option</
em> can be set to <
code>None</
code>, in which case none of
2625N/Athe extra features are enabled, or one or more of the following:
2625N/A<
dd>All options except for MultiViews.
2625N/A<!--%plaintext <?INDEX {\tt ExecCGI} option> --> 2625N/AExecution of CGI scripts is permitted.
2625N/A<!--%plaintext <?INDEX {\tt FollowSymLinks} option> --> 2658N/AThe server will follow symbolic links in this directory.
2658N/A<!--%plaintext <?INDEX {\tt Includes} option> --> 2658N/AServer-side includes are permitted.
2658N/A<!--%plaintext <?INDEX {\tt IncludesNOEXEC} option> --> 2658N/AServer-side includes are permitted, but the #exec command and
2658N/A#include of CGI scripts are disabled.
2658N/A<!--%plaintext <?INDEX {\tt Indexes} option> --> 2658N/AIf a URL which maps to a directory is requested, and the there is no
2658N/Areturn a formatted listing of the directory.
2658N/A<!--%plaintext <?INDEX {\tt MultiViews} option> --> 2658N/A<!--%plaintext <?INDEX {\tt SymLinksIfOwnerMatch} option> --> 2658N/AThe server will only follow symbolic links for which the target
2658N/Afile or directory is owned by the same user id as the link.
2658N/ANormally, if multiple <
code>Options</
code> could apply to a directory,
2658N/Athen the most specific one is taken complete; the options are not
2658N/Amerged. However if <
i>all</
i> the options on the <
code>Options</
code>
2658N/Adirective are preceeded by a + or - symbol, the options are
2658N/Amerged. Any options preceeded by a + are added to the options
2658N/Acurrently in force, and any options preceeded by a - are removed from
2658N/Athe options currently in force. <
P>
2658N/AFor example, without any + and - symbols:
2658N/AOptions Indexes FollowSymLinks<
br>
2658N/Adirectory. However if the second <
code>Options</
code> directive uses the +
2658N/AOptions Indexes FollowSymLinks<
br>
2810N/AOptions +Includes -Indexes<
br>
3362N/Athen the options <
code>FollowSymLinks</
code> and <
code>Includes</
code>
3362N/A<
A name="pidfile"><
h2>PidFile directive</
h2></
A>
3369N/A<!--%plaintext <?INDEX {\tt PidFile} directive> --> 3362N/A<
strong>Syntax:</
strong> PidFile <
em>filename</
em><
br>
3362N/A<
strong>Context:</
strong> server config<
br>
3362N/A<
strong>Status:</
strong> core<
p>
3369N/AThe PidFile directive sets the file to which the server records the
4547N/Aprocess id of the daemon. If the filename does not begin with a slash (/)
4547N/Athen it is assumed to be relative to the <
A HREF="#serverroot">ServerRoot</
A>.
4547N/AThe PidFile is only used in <
A HREF="#servertype">standalone</
A> mode.<
p>
4547N/AIt is often useful to be able to send the server a signal, so that it closes
4547N/Aand then reopens its <
A HREF="#errorlog">ErrorLog</
A> and TransferLog, and
4547N/Are-reads its configuration files. This is done by sending a SIGHUP (kill -1)
4547N/Asignal to the process id listed in the PidFile.<
p><
hr>
4547N/A<
A name="port"><
h2>Port directive</
h2></
A>
6238N/A<!--%plaintext <?INDEX {\tt Port} directive> --> 6238N/A<
strong>Syntax:</
strong> Port <
em>number</
em><
br>
6238N/A<
strong>Default:</
strong> <
code>Port 80</
code><
br>
6238N/A<
strong>Context:</
strong> server config<
br>
6238N/A<
strong>Status:</
strong> core<
p>
6238N/AThe Port directive sets the network port on which the server listens.
6238N/A<
em>Num</
em> is a number from 0 to 65535; some port numbers (especially below
6238N/Afor a list of some defined ports; the standard port for the http protocol
6238N/APort 80 is one of Unix's special ports. All ports numbered
6238N/Abelow 1024 are reserved for system use,
i.e. regular (non-root) users cannot
6238N/Amake use of them; instead they can only use higher port numbers.<
p>
6238N/ATo use port 80, you must start the server from the root account.
6277N/AAfter binding to the port and before accepting requests, Apache will change
6277N/Ato a low privileged user as set by the <
A HREF="#user">User directive</
A>.<
p>
6277N/AIf you cannot use port 80, choose any other unused port. Non-root users
6331N/Awill have to choose a port number higher than 1023, such as 8000.<
p>
6331N/ASECURITY: if you do start the server as root, be sure
6331N/Anot to set <
A HREF="#user">User</
A> to root. If you run the server as
6331N/Aroot whilst handling connections, your site may be open to a major security
6331N/A<
A name="require"><
h2>require directive</
h2></
A>
6331N/A<!--%plaintext <?INDEX {\tt require} directive> --> 0N/A<
strong>Syntax:</
strong> require <
em>entity-name entity entity...</
em><
br>
0N/A<
strong>Context:</
strong> directory, .htaccess<
br>
<
strong>Override:</
strong> AuthConfig<
br>
<
strong>Status:</
strong> core<
p>
This directive selects which authenticated users can access a directory.
The allowed syntaxes are:
<
li>require user <
em>userid userid ...</
em><
p>
Only the named users can access the directory.<
p>
<
li>require group <
em>group-name group-name ...</
em><
p>
Only users in the named groups can access the directory.<
p>
<
li>require valid-user<
p>
All valid users can access the directory.
If <
code>require</
code> appears in a <
A HREF="#limit"><Limit></
A>
section, then it restricts access to the named methods, otherwise
it restricts access for all methods. Example:
Limit <GET POST><
br>
Require must be accompanied by <
A HREF="#authname">AuthName</
A> and
<
A HREF="#authtype">AuthType</
A> directives, and directives such as
<
A HREF="mod_auth.html#authgroupfile">AuthGroupFile</
A> (to define users and
groups) in order to work correctly.<
p><
hr>
<
A name="resourceconfig"><
h2>ResourceConfig directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ResourceConfig} directive> --> <
strong>Syntax:</
strong> ResourceConfig <
em>filename</
em><
br>
<
strong>Default:</
strong> <
code>ResourceConfig
conf/
srm.conf</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The server will read this file for more directives after reading the
httpd.conf file. <
em>Filename</
em> is relative to the
<
A HREF="#serverroot">ServerRoot</
A>.
This feature can be disabled using:
<
blockquote><
code>ResourceConfig /
dev/
null</
code></
blockquote>
Historically, this file contained most directives except for server
configuration directives and <
A HREF="#directory"><Directory></
A>.
sections; in fact it can now contain any server directive allowed in the
<
em>server config</
em> context.<
p>
See also <
A HREF="#accessconfig">AccessConfig</
A>.<
p><
hr>
<
A name="sendbuffersize"><
h2>SendBufferSize</
h2></
A>
<!--%plaintext <?INDEX {\tt AccessConfig} directive> --> <
strong>Syntax:</
strong> SendBufferSize <
em>bytes</
em><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The server will set the TCP buffer size to the number of bytes
specified. Very useful to increase past standard OS defaults on high
speed high latency (
i.e. 100ms or so, such as transcontinental
<
A name="serveradmin"><
h2>ServerAdmin directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerAdmin} directive> --> <
strong>Syntax:</
strong> ServerAdmin <
em>email-address</
em><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The ServerAdmin sets the e-mail address that the server includes in any
error messages it returns to the client.<
p>
It may be worth setting up a dedicated address for this,
e.g.<
blockquote><
code>ServerAdmin www-admin@foo.bar.com</
code></
blockquote>
as users do not always mention that they are talking about the server!<
p><
hr>
<
A name="serveralias"><
h2>ServerAlias directive</
h2></
A>
<
strong>Syntax:</
strong> ServerAlias <
em>host1 host2 ...</
em><
br>
<
strong>Context:</
strong> virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> ServerAlias is only available in Apache
The ServerAlias directive sets the alternate names for a host, for use
<
a href="host.html">Host-header based virtual hosts</
a>.
<
A name="servername"><
h2>ServerName directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerName} directive> --> <
strong>Syntax:</
strong> ServerName <
em>fully-qualified domain name</
em><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The ServerName directive sets the hostname of the server; this is only
used when creating redirection URLs. If it is not specified, then the
server attempts to deduce it from its own IP address; however this may
not work reliably, or may not return the preferred hostname. For example:
would be used if the canonical (main) name of the actual machine
<
A name="serverpath"><
h2>ServerPath directive</
h2></
A>
<
strong>Syntax:</
strong> ServerPath <
em>pathname</
em><
br>
<
strong>Context:</
strong> virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> ServerPath is only available in Apache
The ServerAlias directive sets the legacy URL pathname for a host, for
use with <
a href="host.html">Host-header based virtual hosts</
a>.
<
A name="serverroot"><
h2>ServerRoot directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerRoot} directive> --> <
strong>Syntax:</
strong> ServerRoot <
em>directory-filename</
em><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The ServerRoot directive sets the directory in which the server lives.
Typically it will contain the subdirectories <
code>conf/</
code> and
<
code>logs/</
code>. Relative paths for other configuration files are taken
as relative to this directory.<
p><
hr>
<
A name="servertype"><
h2>ServerType directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerType} directive> --> <
strong>Syntax:</
strong> ServerType <
em>type</
em><
br>
<
strong>Default:</
strong> <
code>ServerType standalone</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The ServerType directive sets how the server is executed by the system.
<
dd>The server will be run from the system process inetd; the command to start
<
dd>The server will run as a daemon process; the command to start the server
is added to the system startup scripts. (<
code>/
etc/
rc.local</
code> or
Inetd is the lesser used of the two options. For each http
connection received, a new copy of the server is started from scratch;
after the connection is complete, this program exits. There is a high price to
pay per connection, but for security reasons, some admins prefer this option.
Standalone is the most common setting for ServerType since
it is far more efficient. The server is started once, and services all
subsequent connections. If you intend running Apache to serve a busy site,
standalone will probably be your only option.<
p>
SECURITY: if you are paranoid about security, run in inetd mode. Security
cannot be guaranteed in either, but whilst most people are happy to use
standalone, inetd is probably least prone to attack.<
p><
hr>
<
A name="startservers"><
h2>StartServers directive</
h2></
A>
<!--%plaintext <?INDEX {\tt StartServers} directive> --> <
strong>Syntax:</
strong> StartServers <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>StartServers 5</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The StartServers directive sets the number of child server processes created
on startup. As the number of processes is dynamically controlled depending
on the load, there is usually little reason to adjust this parameter.<
p>
See also <
A HREF="#minspareservers">MinSpareServers</
A> and
<
A HREF="#maxspareservers">MaxSpareServers</
A>.<
p><
hr>
<
A name="timeout"><
h2>TimeOut directive</
h2></
A>
<!--%plaintext <?INDEX {\tt TimeOut} directive> --> <
strong>Syntax:</
strong> TimeOut <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>TimeOut 1200</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The TimeOut directive sets the maximum time that the server will wait
for the receipt of a request and the completion of a request, in seconds.
So if it takes more than TimeOut seconds for a client to send a request or
receive a response, the server will break off the connection. Thus TimeOut
limits the maximum a transfer can take; for large files, and slow networks
transfer times can be large.
<
A name="user"><
h2>User directive</
h2></
A>
<!--%plaintext <?INDEX {\tt User} directive> --> <
strong>Syntax:</
strong> User <
em>unix-userid</
em><
br>
<
strong>Default:</
strong> <
code>User #-1</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The User directive sets the userid as which the server will answer requests.
In order to use this directive, the standalone server must be run initially
as root. <
em>Unix-userid</
em> is one of:
<
dd>Refers to the given user by name.
<
dt># followed by a user number.
<
dd>Refers to a user by their number.
The user should have no privileges which result in it being able to access
files which are not intended to be visible to the outside world, and
similarly, the user should not be able to execute code which is not
meant for httpd requests. It is recommended that you set up a new user and
group specifically for running the server. Some admins use user
<
code>nobody</
code>, but this is not always possible or desirable.<
p>
Notes: If you start the server as a non-root user, it will fail to change
to the lesser privileged user, and will instead continue to run as
that original user. If you do start the server as root, then it is normal
for the parent process to remain running as root.<
p>
SECURITY: Don't set User (or <
A HREF="#group">Group</
A>) to
<
code>root</
code> unless you know exactly what you are doing, and what the
<
A name="virtualhost"><
h2><VirtualHost> directive</
h2></
A>
<!--%plaintext <?INDEX {\tt VirtualHost} section directive> --> <
strong>Syntax:</
strong> <VirtualHost <
em>addr</
em>[:<
em>port</
em>]> ...
</VirtualHost> <
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> Core. <
p>
<VirtualHost> and </VirtualHost> are used to enclose a group of
directives which will apply only to a particular virtual host.
Any directive which is allowed in a virtual host context may be used.
When the server receives a request for a document on a particular virtual
host, it uses the configuration directives enclosed in the <VirtualHost>
section. <
em>Addr</
em> can be
<
li>The IP address of the virtual host
<
li>A fully qualified domain name for the IP address of the virtual host.
ServerAdmin webmaster@host.foo.com <
br>
Currently, each VirtualHost must correspond to a different IP address for
the server, so the server machine must be configured to accept IP packets for
multiple addresses. If the machine does not have multiple network interfaces,
then this can be accomplished with the <
code>ifconfig alias</
code> command
(if your OS supports it), or with kernel patches like
<
p><
strong>See also:</
strong>
<
strong>See also:</
strong>
<
a href="host.html">Non-IP address-based Virtual Hosts</
a>