core.html revision a8a5fb187935c210aa739f2fc582da191aae79f8
0N/A<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
0N/A<HTML>
0N/A<HEAD>
0N/A<TITLE>Apache Core Features</TITLE>
0N/A</HEAD>
0N/A
0N/A<BODY>
0N/A<!--#include virtual="header.html" -->
0N/A
0N/A<H1>Apache Core Features</h1>
0N/A
0N/AThese configuration parameters control the core Apache features, and are
0N/Aalways available.
0N/A
0N/A
0N/A<ul>
0N/A<li><A HREF="#accessconfig">AccessConfig</A>
0N/A<li><A HREF="#accessfilename">AccessFileName</A>
873N/A<li>AddModule
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>
0N/A<li>ClearModuleList
5085N/A<li><A HREF="#defaulttype">DefaultType</A>
6238N/A<li><A HREF="#directory">&lt;Directory&gt;</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">&lt;Files&gt;</A>
0N/A<li><A HREF="#group">Group</A>
0N/A<li><A HREF="#identitycheck">IdentityCheck</A>
0N/A<li><A HREF="#ifmodule">&lt;IfModule&gt;</A>
0N/A<li><A HREF="#keepalive">KeepAlive</A>
0N/A<li><A HREF="#keepalivetimeout">KeepAliveTimeout</A>
0N/A<li><A HREF="#limit">&lt;Limit&gt;</A>
0N/A<li><A HREF="#listen">Listen</A>
0N/A<li><A HREF="#location">&lt;Location&gt;</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>RLimitCPU
0N/A<li>RLimitMEM
0N/A<li>RLimitNPROC
0N/A<li>Satisfy
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">&lt;VirtualHost&gt;</A>
0N/A</ul>
0N/A<hr>
0N/A
0N/A<A name="accessconfig"><h2>AccessConfig directive</h2></A>
0N/A<!--%plaintext &lt;?INDEX {\tt AccessConfig} directive&gt; -->
0N/A<strong>Syntax:</strong> AccessConfig <em>filename</em><br>
0N/A<strong>Default:</strong> <code>AccessConfig conf/access.conf</code><br>
0N/A<strong>Context:</strong> server config, virtual host<br>
0N/A<strong>Status:</strong> core<p>
0N/A
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">&lt;Directory&gt;</A> sections; in fact it can now
0N/Acontain any server directive allowed in the <em>server config</em> context.
0N/A<p><hr>
0N/A
0N/A<A name="accessfilename"><h2>AccessFileName directive</h2></A>
0N/A<!--%plaintext &lt;?INDEX {\tt AccessFileName} directive&gt; -->
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/A
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.
1060N/A
5919N/AFor example:
2568N/A<blockquote><code>AccessFileName .acl</code></blockquote>
2568N/Abefore returning the document /usr/local/web/index.html, the
5403N/Aserver will read /.acl, /usr/.acl, /usr/local/.acl and /usr/local/web/.acl
2568N/Afor directives, unless they have been disabled with
2568N/A<blockquote><code>
2568N/A&lt;Directory /&gt;<br>
2568N/AAllowOverride None<br>
2568N/A&lt;/Directory&gt;</code></blockquote><p><hr>
2568N/A
2568N/A<A name="allowoverride"><h2>AllowOverride directive</h2></A>
2568N/A<!--%plaintext &lt;?INDEX {\tt AllowOverride} directive&gt; -->
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/A
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
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<dl>
1060N/A<dt>AuthConfig
1060N/A<dd>
1060N/A<!--%plaintext &lt;?INDEX {\tt AuthConfig} override&gt; -->
1060N/AAllow use of the authorization directives
4486N/A(<A HREF="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile</A>,
4486N/A<A HREF="mod_auth_dbm.html#authdbmuserfile">AuthDBMUserFile</A>,
4486N/A<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A>,
4486N/A<A HREF="#authname">AuthName</A>, <A HREF="#authtype">AuthType</A>,
4486N/A<A HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
4486N/A<A HREF="#require">require</A>).
4486N/A<dt>FileInfo
4486N/A<dd>
4486N/A<!--%plaintext &lt;?INDEX {\tt FileInfo} override&gt; -->
4486N/AAllow use of the directives controlling document types
4486N/A(<A HREF="mod_mime.html#addencoding">AddEncoding</A>,
1060N/A<A HREF="mod_mime.html#addlanguage">AddLanguage</A>,
1060N/A<A HREF="mod_mime.html#addtype">AddType</A>,
1060N/A<A HREF="#defaulttype">DefaultType</A> and
1060N/A<A HREF="mod_negotiation.html#languagepriority">LanguagePriority</A>).
1060N/A<dt>Indexes
1060N/A<dd>
1060N/A<!--%plaintext &lt;?INDEX {\tt Indexes} override&gt; -->
1060N/AAllow use of the directives controlling directory indexing
1060N/A(<A HREF="mod_dir.html#adddescription">AddDescription</A>,
1060N/A<A HREF="mod_dir.html#addicon">AddIcon</A>,
1060N/A<A HREF="mod_dir.html#addiconbyencoding">AddIconByEncoding</A>,
1060N/A<A HREF="mod_dir.html#addiconbytype">AddIconByType</A>,
1060N/A<A HREF="mod_dir.html#defaulticon">DefaultIcon</A>,
1060N/A<A HREF="mod_dir.html#directoryindex">DirectoryIndex</A>,
1060N/A<A HREF="mod_dir.html#fancyindexing">FancyIndexing</A>,
1060N/A<A HREF="mod_dir.html#headername">HeaderName</A>,
1060N/A<A HREF="mod_dir.html#indexignore">IndexIgnore</A>,
1060N/A<A HREF="mod_dir.html#indexoptions">IndexOptions</A> and
1060N/A<A HREF="mod_dir.html#readmename">ReadmeName</A>).
1060N/A<dt>Limit
1060N/A<dd>
1060N/A<!--%plaintext &lt;?INDEX {\tt Limit} override&gt; -->
1060N/AAllow use of the directives controlling host access (allow, deny and order).
1060N/A<dt>Options
1060N/A<dd>
1060N/A<!--%plaintext &lt;?INDEX {\tt Options} override&gt; -->
1060N/AAllow use of the directives controlling specific directory features
1060N/A(<A HREF="#options">Options</A> and
1060N/A<A HREF="mod_include.html#xbithack">XBitHack</A>).
1060N/A</dl><p><hr>
1060N/A
1060N/A<A name="authname"><h2>AuthName directive</h2></A>
1060N/A<!--%plaintext &lt;?INDEX {\tt AuthName} directive&gt; -->
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/A
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/Apassword to send.
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 HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
1060N/A<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> to work.<p><hr>
1060N/A
1060N/A<A name="authtype"><h2>AuthType directive</h2></A>
1060N/A<!--%plaintext &lt;?INDEX {\tt AuthType} directive&gt; -->
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/A
1060N/AThis directive selects the type of user authentication for a directory.
1060N/AOnly <code>Basic</code> is currently implemented.
1060N/A<!--%plaintext &lt;?INDEX {\tt Basic} authentication scheme&gt; -->
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 HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
1060N/A<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> to work.<p><hr>
1060N/A
1060N/A
1060N/A<A name="bindaddress"><h2>BindAddress directive</h2></A>
1060N/A<!--%plaintext &lt;?INDEX {\tt BindAddress} directive&gt; -->
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/A
1060N/AA Unix&#174; 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
1060N/A<menu>
1060N/A<li>*
1060N/A<li>An IP address
1060N/A<li>A fully-qualified internet domain name
1060N/A</menu>
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/Aspecified. <p>
1060N/A
1060N/AThis option can be used as an alternative method for supporting
1060N/A<A HREF="virtual-host.html">virtual hosts</A> instead of using
1060N/A<A HREF="#virtualhost">&lt;VirtualHost&gt;</A> sections.<p><hr>
1060N/A
1060N/A<p><strong>See Also:</strong>
1060N/A<a href="bind.html">Setting which addresses and ports Apache uses</a></p>
1060N/A
1060N/A<A name="defaulttype"><h2>DefaultType directive</h2></A>
1060N/A<!--%plaintext &lt;?INDEX {\tt DefaultType} directive&gt; -->
1060N/A<strong>Syntax:</strong> DefaultType <em>mime-type</em><br>
1060N/A<strong>Default:</strong> <code>DefaultType text/html</code><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/A
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/A
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/Aexample:
1060N/A<blockquote><code>DefaultType image/gif</code></blockquote>
1060N/Awould be appropriate for a directory which contained many gif images
1060N/Awith filenames missing the .gif extension.<p><hr>
1060N/A
1060N/A<A name="directory"><h2>&lt;Directory&gt; directive</h2></A>
1060N/A<!--%plaintext &lt;?INDEX {\tt Directory} section directive&gt; -->
1060N/A<strong>Syntax:</strong> &lt;Directory <em>directory</em>&gt; ... &lt;/Directory&gt; <br>
1060N/A<strong>Context:</strong> server config, virtual host<br>
1060N/A<strong>Status:</strong> Core. <p>
1060N/A
1060N/A&lt;Directory&gt; and &lt;/Directory&gt; 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<pre>
1060N/A &lt;Directory /usr/local/httpd/htdocs&gt;
1060N/A Options Indexes FollowSymLinks
1060N/A &lt;/Directory&gt;
1060N/A</pre>
1060N/A
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
1060N/A<pre>
1060N/A &lt;Directory ~ &quot;^/www/.*/[0-9]{3}&quot;&gt;
1060N/A</pre>
1060N/A
1060N/Awould match directories in /www/ that consisted of three numbers.<p>
1060N/A
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<blockquote><code>
1060N/A&lt;Directory /&gt;<br>
1060N/AAllowOverride None<br>
1060N/A&lt;/Directoy&gt;<br><br>
1060N/A&lt;Directory /home/*&gt;<br>
1060N/AAllowOverride FileInfo<br>
1060N/A&lt;/Directory&gt;</code></blockquote>
1060N/AThe for access to the document <code>/home/web/dir/doc.html</code> the
1060N/Asteps are:
1060N/A<menu>
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/A<code>/home/web</code>).
1060N/A<li>Apply any FileInfo directives in <code>/home/web/.htaccess</code>
1060N/A</menu>
1060N/A
1060N/AThe directory sections typically occur in the access.conf file, but they
1060N/Amay appear in any configuration file. &lt;Directory&gt; directives cannot
1060N/Anest, and cannot appear in a <A HREF="#limit">&lt;Limit&gt;</A> section.
1060N/A<p><hr>
2290N/A
2290N/A<A NAME="documentroot"><h2>DocumentRoot directive</h2></A>
2290N/A<!--%plaintext &lt;?INDEX {\tt DocumentRoot} directive&gt; -->
2290N/A<strong>Syntax:</strong> DocumentRoot <em>directory-filename</em><br>
2290N/A<strong>Default:</strong> <code>DocumentRoot
1060N/A/usr/local/etc/httpd/htdocs</code><br>
1060N/A<strong>Context:</strong> server config, virtual host<br>
1060N/A<strong>Status:</strong> core<p>
1060N/A
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/Adocument. Example:
1060N/A<blockquote><code>DocumentRoot /usr/web</code></blockquote>
1060N/Athen an access to <code>http://www.my.host.com/index.html</code> refers
1060N/Ato <code>/usr/web/index.html</code>.
1060N/A
1060N/A<P>There appears to be a bug in mod_dir which causes problems when the
1556N/ADocumentRoot has a trailing slash (i.e. "DocumentRoot /usr/web/") so
1060N/Aplease avoid that.
1060N/A
1060N/A<p><hr>
1060N/A
1060N/A<A name="errordocument"><h2>ErrorDocument directive</h2></A>
1060N/A<!--%plaintext &lt;?INDEX {\tt ErrorDocument} directive&gt; -->
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>
1060N/A
2290N/AIn the event of a problem or error, Apache can be configured to do
2290N/Aone of four things,
2290N/A
2290N/A<OL>
2290N/A<LI>behave like NCSA httpd 1.3
2290N/A<LI>output a customized message
2290N/A<LI>redirect to a local URL to handle the problem/error
2290N/A<LI>redirect to an external URL to handle the problem/error
2290N/A</OL>
2290N/A
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
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/Asometime offer additional information regarding the problem/error.
5360N/A
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:
5360N/A<blockquote><code>
2290N/AErrorDocument 500 /cgi-bin/tester<br>
2290N/AErrorDocument 404 /cgi-bin/bad_urls.pl<br>
2290N/AErrorDocument 401 http://www2.foo.bar/subscription_info.html<br>
2290N/AErrorDocument 403 "Sorry can't allow you access today
2290N/A</code></blockquote>
2290N/A
2290N/ASee Also: <A HREF="custom-error.html">documentation of customizable
2290N/Aresponses.</A><p><hr>
2290N/A
2290N/A<A name="errorlog"><h2>ErrorLog directive</h2></A>
1060N/A<!--%plaintext &lt;?INDEX {\tt ErrorLog} directive&gt; -->
1060N/A<strong>Syntax:</strong> ErrorLog <em>filename</em><br>
1060N/A<strong>Default:</strong> <code>ErrorLog logs/error_log</code><br>
1060N/A<strong>Context:</strong> server config, virtual host<br>
1060N/A<strong>Status:</strong> core<p>
1060N/A
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/AExample:
1060N/A<blockquote><code>ErrorLog /dev/null</code></blockquote>
1060N/AThis effectively turns off error logging.<p><hr>
1060N/A
1060N/A<A name="files"><h2>&lt;Files&gt;</h2></A>
1060N/A<strong>Syntax:</strong> &lt;Files <em>filename</em>&gt;
1060N/A... &lt;/Files&gt;<br>
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/A1.2 and above.<p>
1060N/A
1060N/A<p>The &lt;Files&gt; directive provides for access control by
1060N/Afilename. It is comparable to the <a
1060N/Ahref="#directory">&lt;Directory&gt;</a> directive and
1060N/A<a href="#location">&lt;Location&gt;</a> directives. It
1060N/Ashould be matched with a &lt;/Files&gt; directive. Directives that
1060N/Aapply to the filename given should be listed
1060N/Awithin. <code>&lt;Files&gt;</code> sections are processed in the
1060N/Aorder they appear in the configuration file, after the
1060N/A&lt;Directory&gt; sections and <code>.htaccess</code> files are
2549N/Aread, but before &lt;Location&gt; sections.</p>
2549N/A
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
1060N/A<pre>
1060N/A &lt;Files ~ &quot;\.(gif|jpe?g|png)$&quot;&gt;
1060N/A</pre>
1060N/A
1060N/Awould match most common Internet graphics formats.
1060N/A
1060N/A<p>Note that unlike <a
1060N/Ahref="#directory"><code>&lt;Directory&gt;</code></a> and <a
1060N/Ahref="#location"><code>&lt;Location&gt;</code></a> sections,
1060N/A<code>&lt;Files&gt;</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
1060N/A<p> <hr>
1060N/A
1060N/A<A name="group"><h2>Group directive</h2></A>
1241N/A<!--%plaintext &lt;?INDEX {\tt Group} directive&gt; -->
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/A
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:
1241N/A<dl>
1241N/A<dt>A group name
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/A</dl>
1241N/A
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/Apossible or desirable.<p>
1241N/A
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/Aoriginal user. <p>
1340N/A
1340N/ASECURITY: See <A HREF="#user">User</A> for a discussion of the security
1340N/Aconsiderations.<p><hr>
1340N/A
1340N/A<A name="identitycheck"><h2>IdentityCheck directive</h2></A>
1340N/A<!--%plaintext &lt;?INDEX {\tt IdentityCheck} directive&gt; -->
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/A
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/A
5085N/AThe information should not trusted in any way except for rudimentary usage
5085N/Atracking.<p><hr>
1340N/A
1340N/A<A NAME="ifmodule"><H2>&lt;IfModule&gt;</H2></A>
1340N/A<b>Syntax:</b> &lt;IfModule [!]<i>module-name</i>&gt; <i>...</i>
1340N/A&lt;/IfModule&gt;<br>
1340N/A<b>Default:</b> None<br>
1340N/A<b>Context:</b> all<br>
1340N/A<b>Status:</b> Core
1340N/A<strong>Compatibility:</strong> ScriptLog is only available in 1.2 and
1340N/Alater.<P>
1402N/A
1402N/A<p>
1402N/A
1402N/AThe &lt;IfModule <i>test</i>&gt;...&lt;/IfModule&gt;
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/Ais ignored.<p>
1402N/A
1402N/AThe <i>test</i> in the &lt;IfModule&gt; section directive
1645N/Acan be one of two forms:
1402N/A
1645N/A<ul>
1402N/A<li><i>module name</i>
1402N/A<li>!<i>module name</i>
1645N/A</ul>
1402N/A
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.
1645N/A
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,
1402N/A<code>mod_rewrite.c</code>.
1402N/A
1645N/A<p>&lt;IfModule&gt; sections are nestable, which can be used to implement
1402N/Asimple multiple-module tests.
1402N/A
1645N/A<P> <hr>
1645N/A
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/A1.1 and later.<p>
1645N/A
1645N/AThis directive enables
1645N/A<a href="keepalive.html">Keep-Alive</a>
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
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
1648N/A1.1 and later.<p>
1648N/A
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/Avalue specified by the <a
1899N/Ahref="/core.html#timeout"><code>Timeout</code></a> directive
1899N/Aapplies.
1899N/A<hr>
1899N/A
1899N/A<A name="listen"><h2>Listen</h2></A>
1899N/A<strong>Syntax:</strong>
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/A1.1 and later.<p>
1989N/A
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/Adirective.</p>
1989N/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<hr>
1899N/A
1899N/A<A name="limit"><h2>&lt;Limit&gt; directive</h2></A>
1899N/A<!--%plaintext &lt;?INDEX {\tt Limit} section directive&gt; -->
1899N/A<strong>Syntax:</strong>
1899N/A &lt;Limit <em>method method</em> ... &gt; ... &lt;/Limit&gt;<br>
1899N/A<strong>Context:</strong> any<br>
1899N/A<strong>Status:</strong> core<p>
1899N/A
2103N/A&lt;Limit&gt; and &lt;/Limit&gt; 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 &lt;Limit&gt; or
2103N/A<A HREF="#directory">&lt;Directory&gt;</A> may be used; the majority will be
2103N/Aunaffected by the &lt;Limit&gt;. Example:
2103N/A<blockquote><code>
2103N/A&lt;Limit GET POST&gt;<br>
2103N/Arequire valid-user<br>
2210N/A&lt;/Limit&gt;</code></blockquote>
2210N/AIf an access control directive appears outside a &lt;Limit&gt; directive,
2212N/Athen it applies to all access methods.<p><hr>
2210N/A
2210N/A<h2><a name="location">&lt;Location&gt;</a></h2>
2210N/A
2210N/A<strong>Syntax:</strong> &lt;Location <em>URL</em>&gt;
2212N/A... &lt;/Location&gt;<br>
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/A1.1 and later.<p>
5919N/A
2281N/A<p>The &lt;Location&gt; directive provides for access control by
2281N/AURL. It is comprable to the <a
2281N/Ahref="#directory">&lt;Directory&gt;</a> directive, and
2281N/Ashould be matched with a &lt;/Location&gt; directive. Directives that
5919N/Aapply to the URL given should be listen
2281N/Awithin. <code>&lt;Location&gt;</code> sections are processed in the
2281N/Aorder they appear in the configuration file, after the
2281N/A&lt;Directory&gt; sections and <code>.htaccess</code> files are
2290N/Aread.</p>
2625N/A
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/Aand should not include the <code>http://servername</code>. It doesn't
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/Asequences of characters.
2625N/A
2625N/A<p><strong>Apache 1.2 and above:</strong>
2290N/AExtended regular expressions can also be used, with the addition of
2290N/Athe
2290N/A<code>~</code> character. For example:</p>
2281N/A
2290N/A<pre>
2290N/A &lt;Location ~ &quot;/(extra|special)/data&quot;&gt;
2290N/A</pre>
2290N/A
2520N/Awould match URLs that contained the substring "/extra/data" or
2520N/A"/special/data".</p>
2520N/A
2520N/A<p>The <code>Location</code> functionality is especially useful when
2520N/Acombined with the <code><a
2520N/Ahref="mod_mime.html#sethandler">SetHandler</a></code> directive. For example, to enable status requests, but allow them only
2520N/Afrom browsers at foo.com, you might use:
2520N/A
2520N/A<pre>
2520N/A &lt;Location /status&gt;
2520N/A SetHandler server-status
2520N/A <Limit GET>
4005N/A order deny,allow
4005N/A deny from all
4005N/A allow from .foo.com
4005N/A </Limit>
4005N/A &lt;/Location&gt;
4005N/A</pre>
4005N/A<hr>
4005N/A
4005N/A<A name="maxclients"><h2>MaxClients directive</h2></A>
4005N/A<!--%plaintext &lt;?INDEX {\tt MaxClients} directive&gt; -->
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/A
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
4848N/A<A name="maxrequestsperchild"><h2>MaxRequestsPerChild directive</h2></A>
2568N/A<!--%plaintext &lt;?INDEX {\tt MaxRequestsPerChild} directive&gt; -->
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/A
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/A
2625N/ASetting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
2625N/A<ul>
2625N/A<li>it limits the amount of memory that process can consume by (accidental)
2625N/Amemory leakage;
2625N/A<li> by giving processes a finite lifetime, it helps reduce the
2625N/Anumber of processes when the server load reduces.
2625N/A</ul><p><hr>
2625N/A
2625N/A<A name="maxspareservers"><h2>MaxSpareServers directive</h2></A>
2625N/A<!--%plaintext &lt;?INDEX {\tt MaxSpareServers} directive&gt; -->
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/A
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/A
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/A
2625N/ASee also <A HREF="#minspareservers">MinSpareServers</A> and
2625N/A<A HREF="#startservers">StartServers</A>.<p><hr>
2625N/A
2625N/A<A name="minspareservers"><h2>MinSpareServers directive</h2></A>
4672N/A<!--%plaintext &lt;?INDEX {\tt MinSpareServers} directive&gt; -->
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/A
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/A
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/A
2625N/ASee also <A HREF="#maxspareservers">MaxSpareServers</A> and
2625N/A<A HREF="#startservers">StartServers</A>.<p><hr>
2625N/A
2625N/A<A name="options"><h2>Options directive</h2></A>
2625N/A<!--%plaintext &lt;?INDEX {\tt Options} directive&gt; -->
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/A
2625N/AThe Options directive controls which server features are available in
2625N/Aa particular directory.
2625N/A<p>
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<dl>
2625N/A<dt>All
2625N/A<dd>All options except for MultiViews.
2625N/A<dt>ExecCGI
2625N/A<dd>
2625N/A<!--%plaintext &lt;?INDEX {\tt ExecCGI} option&gt; -->
2625N/AExecution of CGI scripts is permitted.
2625N/A<dt>FollowSymLinks
2625N/A<dd>
2625N/A<!--%plaintext &lt;?INDEX {\tt FollowSymLinks} option&gt; -->
2658N/AThe server will follow symbolic links in this directory.
2658N/A<dt>Includes
2658N/A<dd>
2658N/A<!--%plaintext &lt;?INDEX {\tt Includes} option&gt; -->
2658N/AServer-side includes are permitted.
2658N/A<dt>IncludesNOEXEC
2658N/A<dd>
2658N/A<!--%plaintext &lt;?INDEX {\tt IncludesNOEXEC} option&gt; -->
2658N/AServer-side includes are permitted, but the #exec command and
2658N/A#include of CGI scripts are disabled.
2658N/A<dt>Indexes
2658N/A<dd>
2658N/A<!--%plaintext &lt;?INDEX {\tt Indexes} option&gt; -->
2658N/AIf a URL which maps to a directory is requested, and the there is no
2658N/ADirectoryIndex (e.g. index.html) in that directory, then the server will
2658N/Areturn a formatted listing of the directory.
2658N/A<dt>MultiViews
2658N/A<dd>
2658N/A<!--%plaintext &lt;?INDEX {\tt MultiViews} option&gt; -->
2658N/A<A HREF="content-negotiation.html">Ccontent negotiatad</A> MultiViews are
2658N/Aallowed.
2658N/A<dt>SymLinksIfOwnerMatch
2658N/A<dd>
2658N/A<!--%plaintext &lt;?INDEX {\tt SymLinksIfOwnerMatch} option&gt; -->
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/A</dl>
2658N/A
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/A
2658N/AFor example, without any + and - symbols:
2658N/A
2658N/A<blockquote><code>
2658N/A&lt;Directory /web/docs&gt; <br>
2658N/AOptions Indexes FollowSymLinks<br>
2658N/A&lt;/Directory&gt;<br>
2658N/A&lt;Directory /web/docs/spec&gt; <br>
2658N/AOptions Includes<br>
2658N/A&lt;/Directory&gt;
2658N/A</code></blockquote>
2658N/Athen only <code>Includes</code> will be set for the /web/docs/spec
2658N/Adirectory. However if the second <code>Options</code> directive uses the +
2658N/Aand - symbols:<p>
2658N/A
2658N/A<blockquote><code>
2658N/A&lt;Directory /web/docs&gt; <br>
2658N/AOptions Indexes FollowSymLinks<br>
2658N/A&lt;/Directory&gt;<br>
2658N/A&lt;Directory /web/docs/spec&gt; <br>
2810N/AOptions +Includes -Indexes<br>
2810N/A&lt;/Directory&gt;
2810N/A</code></blockquote>
3362N/Athen the options <code>FollowSymLinks</code> and <code>Includes</code>
3362N/Aare set for the /web/docs/spec directory.
3362N/A<hr>
3362N/A
3362N/A<A name="pidfile"><h2>PidFile directive</h2></A>
3369N/A<!--%plaintext &lt;?INDEX {\tt PidFile} directive&gt; -->
3362N/A<strong>Syntax:</strong> PidFile <em>filename</em><br>
3362N/A<strong>Default:</strong> <code>PidFile logs/httpd.pid</code><br>
3362N/A<strong>Context:</strong> server config<br>
3362N/A<strong>Status:</strong> core<p>
3362N/A
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/A
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
4547N/A<A name="port"><h2>Port directive</h2></A>
6238N/A<!--%plaintext &lt;?INDEX {\tt Port} directive&gt; -->
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/A
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/A1024) are reserved for particular protocols. See <code>/etc/services</code>
6238N/Afor a list of some defined ports; the standard port for the http protocol
6238N/Ais 80.<p>
6238N/A
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/A
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>
6238N/A
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/A
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/Aattack.<p><hr>
6331N/A
6331N/A<A name="require"><h2>require directive</h2></A>
6331N/A<!--%plaintext &lt;?INDEX {\tt require} directive&gt; -->
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:
<ul>
<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.
</ul>
<p>
If <code>require</code> appears in a <A HREF="#limit">&lt;Limit&gt;</A>
section, then it restricts access to the named methods, otherwise
it restricts access for all methods. Example:
<blockquote><code>
AuthType Basic<br>
AuthName somedomain<br>
AuthUserFile /web/users<br>
AuthGroupFile /web/groups<br>
Limit &lt;GET POST&gt;<br>
require group admin<br>
&lt;/Limit&gt;
</code></blockquote>
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#authuserfile">AuthUserFile</A> and
<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 &lt;?INDEX {\tt ResourceConfig} directive&gt; -->
<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">&lt;Directory&gt;</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 &lt;?INDEX {\tt AccessConfig} directive&gt; -->
<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
fast pipes)
<p><hr>
<A name="serveradmin"><h2>ServerAdmin directive</h2></A>
<!--%plaintext &lt;?INDEX {\tt ServerAdmin} directive&gt; -->
<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
1.1 and later.<p>
The ServerAlias directive sets the alternate names for a host, for use
with
<a href="host.html">Host-header based virtual hosts</a>.
<p><hr>
<A name="servername"><h2>ServerName directive</h2></A>
<!--%plaintext &lt;?INDEX {\tt ServerName} directive&gt; -->
<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:
<blockquote><code>ServerName www.wibble.com</code></blockquote>
would be used if the canonical (main) name of the actual machine
were <code>monster.wibble.com</code>.<p><hr>
<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
1.1 and later.<p>
The ServerAlias directive sets the legacy URL pathname for a host, for
use with <a href="host.html">Host-header based virtual hosts</a>.
<hr>
<A name="serverroot"><h2>ServerRoot directive</h2></A>
<!--%plaintext &lt;?INDEX {\tt ServerRoot} directive&gt; -->
<strong>Syntax:</strong> ServerRoot <em>directory-filename</em><br>
<strong>Default:</strong> <code>ServerRoot /usr/local/etc/httpd</code><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 &lt;?INDEX {\tt ServerType} directive&gt; -->
<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.
<em>Type</em> is one of
<dl>
<dt>inetd
<dd>The server will be run from the system process inetd; the command to start
the server is added to <code>/etc/inetd.conf</code>
<dt>standalone
<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
<code>/etc/rc3.d/...</code>.)
</dl>
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.
<p>
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 &lt;?INDEX {\tt StartServers} directive&gt; -->
<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 &lt;?INDEX {\tt TimeOut} directive&gt; -->
<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.
<p><hr>
<A name="user"><h2>User directive</h2></A>
<!--%plaintext &lt;?INDEX {\tt User} directive&gt; -->
<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:
<dl>
<dt>A username
<dd>Refers to the given user by name.
<dt># followed by a user number.
<dd>Refers to a user by their number.
</dl>
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
dangers are.<p><hr>
<A name="virtualhost"><h2>&lt;VirtualHost&gt; directive</h2></A>
<!--%plaintext &lt;?INDEX {\tt VirtualHost} section directive&gt; -->
<strong>Syntax:</strong> &lt;VirtualHost <em>addr</em>[:<em>port</em>]&gt; ...
&lt;/VirtualHost&gt; <br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Core. <p>
&lt;VirtualHost&gt; and &lt;/VirtualHost&gt; 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 &lt;VirtualHost&gt;
section. <em>Addr</em> can be
<menu>
<li>The IP address of the virtual host
<li>A fully qualified domain name for the IP address of the virtual host.
</menu> Example:
<blockquote>
<code>
&lt;VirtualHost host.foo.com&gt; <br>
ServerAdmin webmaster@host.foo.com <br>
DocumentRoot /www/docs/host.foo.com <br>
ServerName host.foo.com <br>
ErrorLog logs/host.foo.com-error_log <br>
TransferLog logs/host.foo.com-access_log <br>
&lt;/VirtualHost&gt;
</code></blockquote>
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
<A HREF="vif.info.txt">VIF</A> (for SunOS(TM) 4.1.x).<p>
<p><strong>See also:</strong>
<A HREF="virtual-host.html">Information on Virtual Hosts.
(multihome)</A><br>
<strong>See also:</strong>
<a href="host.html">Non-IP address-based Virtual Hosts</a>
</p>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>