core.html revision 52a4de2f02f994ab073ef65fc760bc5899012a57
7259N/A<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
7259N/A<HTML>
7259N/A<HEAD>
7259N/A<TITLE>Apache Core Features</TITLE>
7259N/A</HEAD>
7259N/A
7259N/A<BODY>
7259N/A<!--#include virtual="header.html" -->
7259N/A
7259N/A<H1>Apache Core Features</h1>
7259N/A
7259N/AThese configuration parameters control the core Apache features, and are
7259N/Aalways available.
7259N/A
7259N/A
7259N/A<ul>
7259N/A<li><A HREF="#accessconfig">AccessConfig</A>
7259N/A<li><A HREF="#accessfilename">AccessFileName</A>
7259N/A<li><A HREF="#addmodule">AddModule</A>
7259N/A<li><A HREF="#allowoverride">AllowOverride</A>
7259N/A<li><A HREF="#authname">AuthName</A>
7259N/A<li><A HREF="#authtype">AuthType</A>
7259N/A<li><A HREF="#bindaddress">BindAddress</A>
7259N/A<li><A HREF="#clearmodulelist">ClearModuleList</A>
7259N/A<li><A HREF="#defaulttype">DefaultType</A>
7259N/A<li><A HREF="#directory">&lt;Directory&gt;</A>
7259N/A<li><A HREF="#documentroot">DocumentRoot</A>
7259N/A<li><A HREF="#errordocument">ErrorDocument</A>
7259N/A<li><A HREF="#errorlog">ErrorLog</A>
7259N/A<li><A HREF="#files">&lt;Files&gt;</A>
7259N/A<li><A HREF="#group">Group</A>
7259N/A<li><A HREF="#hostnamelookups">HostNameLookups</A>
7259N/A<li><A HREF="#identitycheck">IdentityCheck</A>
7259N/A<li><A HREF="#ifmodule">&lt;IfModule&gt;</A>
7259N/A<li><A HREF="#keepalive">KeepAlive</A>
7259N/A<li><A HREF="#keepalivetimeout">KeepAliveTimeout</A>
7259N/A<li><A HREF="#limit">&lt;Limit&gt;</A>
7259N/A<li><A HREF="#listen">Listen</A>
7259N/A<li><A HREF="#location">&lt;Location&gt;</A>
7259N/A<li><A HREF="#maxclients">MaxClients</A>
7259N/A<li><A HREF="#maxkeepaliverequests">MaxKeepAliveRequests</a>
7259N/A<li><A HREF="#maxrequestsperchild">MaxRequestsPerChild</A>
7259N/A<li><A HREF="#maxspareservers">MaxSpareServers</A>
7259N/A<li><A HREF="#minspareservers">MinSpareServers</A>
7259N/A<li><A HREF="#options">Options</A>
7259N/A<li><A HREF="#pidfile">PidFile</A>
7259N/A<li><A HREF="#port">Port</A>
7259N/A<li><A HREF="#require">require</A>
7259N/A<li><A HREF="#resourceconfig">ResourceConfig</A>
7259N/A<li><A HREF="#rlimitcpu">RLimitCPU</A>
7259N/A<li><A HREF="#rlimitmem">RLimitMEM</A>
7259N/A<li><A HREF="#rlimitnproc">RLimitNPROC</A>
7259N/A<li><A HREF="#satisfy">Satisfy</A>
7259N/A<li><A HREF="#sendbuffersize">SendBufferSize</A>
7259N/A<li><A HREF="#serveradmin">ServerAdmin</A>
7259N/A<li><A HREF="#serveralias">ServerAlias</A>
7259N/A<li><A HREF="#servername">ServerName</A>
7259N/A<li><A HREF="#serverpath">ServerPath</A>
7259N/A<li><A HREF="#serverroot">ServerRoot</A>
7259N/A<li><A HREF="#servertype">ServerType</A>
7259N/A<li><A HREF="#startservers">StartServers</A>
7259N/A<li><A HREF="#timeout">TimeOut</A>
7259N/A<li><A HREF="#user">User</A>
7259N/A<li><A HREF="#virtualhost">&lt;VirtualHost&gt;</A>
7259N/A</ul>
7259N/A<hr>
7259N/A
7259N/A<A name="accessconfig"><h2>AccessConfig directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt AccessConfig} directive&gt; -->
7259N/A<strong>Syntax:</strong> AccessConfig <em>filename</em><br>
7259N/A<strong>Default:</strong> <code>AccessConfig conf/access.conf</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe server will read this file for more directives after reading the
7259N/A<A HREF="#resourceconfig">ResourceConfig</A> file. <em>Filename</em> is
7259N/Arelative to the <A HREF="#serverroot">ServerRoot</A>.
7259N/AThis feature can be disabled using:
7259N/A<blockquote><code>AccessConfig /dev/null</code></blockquote>
7259N/AHistorically, this file only contained
7259N/A<A HREF="#directory">&lt;Directory&gt;</A> sections; in fact it can now
7259N/Acontain any server directive allowed in the <em>server config</em> context.
7259N/A<p><hr>
7259N/A
7259N/A<A name="accessfilename"><h2>AccessFileName directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt AccessFileName} directive&gt; -->
7259N/A<strong>Syntax:</strong> AccessFileName <em>filename</em><br>
7259N/A<strong>Default:</strong> <code>AccessFileName .htaccess</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AWhen returning a document to the client the server looks for an
7259N/Aaccess control file with this name in every directory of the path to
7259N/Athe document, if access control files are enabled for that directory.
7259N/A
7259N/AFor example:
7259N/A<blockquote><code>AccessFileName .acl</code></blockquote>
7259N/Abefore returning the document /usr/local/web/index.html, the
7259N/Aserver will read /.acl, /usr/.acl, /usr/local/.acl and /usr/local/web/.acl
7259N/Afor directives, unless they have been disabled with
7259N/A<blockquote><code>
7259N/A&lt;Directory /&gt;<br>
7259N/AAllowOverride None<br>
7259N/A&lt;/Directory&gt;</code></blockquote><p><hr>
7259N/A
7259N/A<A name="addmodule"><h2>AddModule directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt AddModule} directive&gt; -->
7259N/A<strong>Syntax:</strong> AddModule <em>module module ...</em><br>
7259N/A<strong>Context:</strong> server config <br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> AddModule is only available in Apache 1.2 and later<p>
7259N/A
7259N/AThe server can have modules compiled in which are not actively in use.
7259N/AThis directive can be used to enable the use of those modules. The
7259N/Aserver comes with a pre-loaded list of active modules; this list can
7259N/Abe cleared with the <A HREF="#clearmodulelist">ClearModuleList</A>
7259N/Adirective.<p><hr>
7259N/A
7259N/A<A name="allowoverride"><h2>AllowOverride directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt AllowOverride} directive&gt; -->
7259N/A<strong>Syntax:</strong> AllowOverride <em>override override ...</em><br>
7259N/A<strong>Default:</strong> <code>AllowOverride All</code><br>
7259N/A<strong>Context:</strong> directory<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AWhen the server finds an .htaccess file (as specified by
7259N/A<A HREF="#accessfilename">AccessFileName</A>) it needs to know which
7259N/Adirectives declared in that file can override earlier access information.<p>
7259N/A
7259N/A<em>Override</em> can be set to <code>None</code>, in which case the server
7259N/Awill not read the file, <code>All</code> in which case the server will
7259N/Aallow all the directives, or one or more of the following:
7259N/A<dl>
7259N/A<dt>AuthConfig
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt AuthConfig} override&gt; -->
7259N/AAllow use of the authorization directives
7259N/A(<A HREF="mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile</A>,
7259N/A<A HREF="mod_auth_dbm.html#authdbmuserfile">AuthDBMUserFile</A>,
7259N/A<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A>,
7259N/A<A HREF="#authname">AuthName</A>, <A HREF="#authtype">AuthType</A>,
7259N/A<A HREF="mod_auth.html#authuserfile">AuthUserFile</A>,
7259N/A<A HREF="#require">require</A>, etc.).
7259N/A<dt>FileInfo
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt FileInfo} override&gt; -->
7259N/AAllow use of the directives controlling document types
7259N/A(<A HREF="mod_mime.html#addencoding">AddEncoding</A>,
7259N/A<A HREF="mod_mime.html#addlanguage">AddLanguage</A>,
7259N/A<A HREF="mod_mime.html#addtype">AddType</A>,
7259N/A<A HREF="#defaulttype">DefaultType</A>,
7259N/A<A HREF="#errordocument">ErrorDocument</A>,
7259N/A<A HREF="mod_negotiation.html#languagepriority">LanguagePriority</A>, etc.).
7259N/A<dt>Indexes
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt Indexes} override&gt; -->
7259N/AAllow use of the directives controlling directory indexing
7259N/A(<A HREF="mod_dir.html#adddescription">AddDescription</A>,
7259N/A<A HREF="mod_dir.html#addicon">AddIcon</A>,
7259N/A<A HREF="mod_dir.html#addiconbyencoding">AddIconByEncoding</A>,
7259N/A<A HREF="mod_dir.html#addiconbytype">AddIconByType</A>,
7259N/A<A HREF="mod_dir.html#defaulticon">DefaultIcon</A>,
7259N/A<A HREF="mod_dir.html#directoryindex">DirectoryIndex</A>,
7259N/A<A HREF="mod_dir.html#fancyindexing">FancyIndexing</A>,
7259N/A<A HREF="mod_dir.html#headername">HeaderName</A>,
7259N/A<A HREF="mod_dir.html#indexignore">IndexIgnore</A>,
7259N/A<A HREF="mod_dir.html#indexoptions">IndexOptions</A>,
7259N/A<A HREF="mod_dir.html#readmename">ReadmeName</A>, etc.).
7259N/A<dt>Limit
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt Limit} override&gt; -->
7259N/AAllow use of the directives controlling host access (allow, deny and order).
7259N/A<dt>Options
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt Options} override&gt; -->
7259N/AAllow use of the directives controlling specific directory features
7259N/A(<A HREF="#options">Options</A> and
7259N/A<A HREF="mod_include.html#xbithack">XBitHack</A>).
7259N/A</dl><p><hr>
7259N/A
7259N/A<A name="authname"><h2>AuthName directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt AuthName} directive&gt; -->
7259N/A<strong>Syntax:</strong> AuthName <em>auth-domain</em><br>
7259N/A<strong>Context:</strong> directory, .htaccess<br>
7259N/A<strong>Override:</strong> AuthConfig<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThis directive sets the name of the authorization realm for a directory.
7259N/AThis realm is given to the client so that the user knows which username and
7259N/Apassword to send.
7259N/AIt must be accompanied by <A HREF="#authtype">AuthType</A> and
7259N/A<A HREF="#require">require</A> directives, and directives such as
7259N/A<A HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
7259N/A<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> to work.<p><hr>
7259N/A
7259N/A<A name="authtype"><h2>AuthType directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt AuthType} directive&gt; -->
7259N/A<strong>Syntax:</strong> AuthType <em>type</em><br>
7259N/A<strong>Context:</strong> directory, .htaccess<br>
7259N/A<strong>Override:</strong> AuthConfig<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThis directive selects the type of user authentication for a directory.
7259N/AOnly <code>Basic</code> is currently implemented.
7259N/A<!--%plaintext &lt;?INDEX {\tt Basic} authentication scheme&gt; -->
7259N/AIt must be accompanied by <A HREF="#authname">AuthName</A> and
7259N/A<A HREF="#require">require</A> directives, and directives such as
7259N/A<A HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
7259N/A<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> to work.<p><hr>
7259N/A
7259N/A<A name="clearmodulelist"><h2>ClearModuleList directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ClearModuleList} directive&gt; -->
7259N/A<strong>Syntax:</strong> ClearModuleList<br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> ClearModuleList is only available in Apache 1.2 and later<p>
7259N/A
7259N/AThe server comes with a built-in list of active modules. This
7259N/Adirective clears the list. It is assumed that the list will then be
7259N/Are-populated using the <A HREF="#addmodule">AddModule</A> directive.<p><hr>
7259N/A
7259N/A<A name="bindaddress"><h2>BindAddress directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt BindAddress} directive&gt; -->
7259N/A<strong>Syntax:</strong> BindAddress <em>saddr</em><br>
7259N/A<strong>Default:</strong> <code>BindAddress *</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AA Unix&#174; http server can either listen for connections to every
7259N/AIP address of the server machine, or just one IP address of the server
7259N/Amachine. <em>Saddr</em> can be
7259N/A
7259N/A<menu>
7259N/A<li>*
7259N/A<li>An IP address
7259N/A<li>A fully-qualified internet domain name
7259N/A</menu>
7259N/AIf the value is *, then the server will listen for connections on
7259N/Aevery IP address, otherwise it will only listen on the IP address
7259N/Aspecified. <p>
7259N/A
7259N/AThis option can be used as an alternative method for supporting
7259N/A<A HREF="/virtual-host.html">virtual hosts</A> instead of using
7259N/A<A HREF="#virtualhost">&lt;VirtualHost&gt;</A> sections.
7259N/A
7259N/A<p><strong>See Also:</strong>
7259N/A<a href="/bind.html">Setting which addresses and ports Apache uses</a></p>
7259N/A
7259N/A<hr>
7259N/A
7259N/A<A name="defaulttype"><h2>DefaultType directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt DefaultType} directive&gt; -->
7259N/A<strong>Syntax:</strong> DefaultType <em>mime-type</em><br>
7259N/A<strong>Default:</strong> <code>DefaultType text/html</code><br>
7259N/A<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
7259N/A<strong>Override:</strong> FileInfo<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThere will be times when the server is asked to provide a document
7259N/Awhose type cannot be determined by its MIME types mappings.<p>
7259N/A
7259N/AThe server must inform the client of the content-type of the document, so in
7259N/Athe event of an unknown type it uses the <CODE>DefaultType</CODE>. For
7259N/Aexample:
7259N/A<blockquote><code>DefaultType image/gif</code></blockquote>
7259N/Awould be appropriate for a directory which contained many gif images
7259N/Awith filenames missing the .gif extension.<p><hr>
7259N/A
7259N/A<A name="directory"><h2>&lt;Directory&gt; directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt Directory} section directive&gt; -->
7259N/A<strong>Syntax:</strong> &lt;Directory <em>directory</em>&gt; ... &lt;/Directory&gt; <br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> Core. <p>
7259N/A
7259N/A&lt;Directory&gt; and &lt;/Directory&gt; are used to enclose a group of
7259N/Adirectives which will apply only to the named directory and sub-directories
7259N/Aof that directory. Any directive which is allowed in a directory
7259N/Acontext may be used. <em>Directory</em> is either the full path to a directory,
7259N/Aor a wild-card string. In a wild-card string, `?' matches any single character,
7259N/Aand `*' matches any sequences of characters. Example:
7259N/A<pre>
7259N/A &lt;Directory /usr/local/httpd/htdocs&gt;
7259N/A Options Indexes FollowSymLinks
7259N/A &lt;/Directory&gt;
7259N/A</pre>
7259N/A
7259N/A<p><strong>Apache 1.2 and above:</strong>
7259N/AExtended regular expressions can also be used, with the addition of the
7259N/A<code>~</code> character. For example:</p>
7259N/A
7259N/A<pre>
7259N/A &lt;Directory ~ &quot;^/www/.*/[0-9]{3}&quot;&gt;
7259N/A</pre>
7259N/A
7259N/Awould match directories in /www/ that consisted of three numbers.<p>
7259N/A
7259N/A<p>If multiple directory sections match the directory (or its parents) containing
7259N/Aa document, then the directives are applied in the order of shortest match
7259N/Afirst, interspersed with the directives from the
7259N/A<A HREF="#accessfilename">.htaccess</A> files. For example, with
7259N/A<blockquote><code>
7259N/A&lt;Directory /&gt;<br>
7259N/AAllowOverride None<br>
7259N/A&lt;/Directory&gt;<br><br>
7259N/A&lt;Directory /home/*&gt;<br>
7259N/AAllowOverride FileInfo<br>
7259N/A&lt;/Directory&gt;</code></blockquote>
7259N/AThe for access to the document <code>/home/web/dir/doc.html</code> the
7259N/Asteps are:
7259N/A<menu>
7259N/A<li>Apply directive <code>AllowOverride None</code> (disabling
7259N/A<code>.htaccess</code> files).
7259N/A<li>Apply directive <code>AllowOverride FileInfo</code> (for directory
7259N/A<code>/home/web</code>).
7259N/A<li>Apply any FileInfo directives in <code>/home/web/.htaccess</code>
7259N/A</menu>
7259N/A
7259N/AThe directory sections typically occur in the access.conf file, but they
7259N/Amay appear in any configuration file. &lt;Directory&gt; directives cannot
7259N/Anest, and cannot appear in a <A HREF="#limit">&lt;Limit&gt;</A> section.
7259N/A<p><hr>
7259N/A
7259N/A<A NAME="documentroot"><h2>DocumentRoot directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt DocumentRoot} directive&gt; -->
7259N/A<strong>Syntax:</strong> DocumentRoot <em>directory-filename</em><br>
7259N/A<strong>Default:</strong> <code>DocumentRoot
7259N/A/usr/local/etc/httpd/htdocs</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThis directive sets the directory from which httpd will serve files.
7259N/AUnless matched by a directive like Alias, the server appends the path
7259N/Afrom the requested URL to the document root to make the path to the
7259N/Adocument. Example:
7259N/A<blockquote><code>DocumentRoot /usr/web</code></blockquote>
7259N/Athen an access to <code>http://www.my.host.com/index.html</code> refers
7259N/Ato <code>/usr/web/index.html</code>.
7259N/A
7259N/A<P>There appears to be a bug in mod_dir which causes problems when the
7259N/ADocumentRoot has a trailing slash (i.e. "DocumentRoot /usr/web/") so
7259N/Aplease avoid that.
7259N/A
7259N/A<p><hr>
7259N/A
7259N/A<A name="errordocument"><h2>ErrorDocument directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ErrorDocument} directive&gt; -->
7259N/A<strong>Syntax:</strong> ErrorDocument <em>error-code document</em><br>
7259N/A<strong>Context</strong> server config, virtual host, directory, .htaccess<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Override:</strong> FileInfo<br>
7259N/A<strong>Compatibility:</strong> The directory and .htaccess contexts
7259N/Aare only available in Apache 1.1 and later.<p>
7259N/A
7259N/AIn the event of a problem or error, Apache can be configured to do
7259N/Aone of four things,
7259N/A
7259N/A<OL>
7259N/A<LI>behave like NCSA httpd 1.3
7259N/A<LI>output a customized message
7259N/A<LI>redirect to a local URL to handle the problem/error
7259N/A<LI>redirect to an external URL to handle the problem/error
7259N/A</OL>
7259N/A
7259N/A<P>2-4 are configured using <CODE>ErrorDocument</CODE>, which
7259N/Ais followed by the HTTP response code and a message or URL.
7259N/A
7259N/A<P><em>Messages</em> in this context, begin with a single quote
7259N/A(<code>"</code>), which does not form part of the message itself. Apache will
7259N/Asometime offer additional information regarding the problem/error.
7259N/A
7259N/A<P>URLs will begin with a slash (/) for local URLs, or will be a full
7259N/AURL which the client can resolve. Examples:
7259N/A<blockquote><code>
7259N/AErrorDocument 500 /cgi-bin/tester<br>
7259N/AErrorDocument 404 /cgi-bin/bad_urls.pl<br>
7259N/AErrorDocument 401 http://www2.foo.bar/subscription_info.html<br>
7259N/AErrorDocument 403 "Sorry can't allow you access today
7259N/A</code></blockquote>
7259N/A
7259N/ASee Also: <A HREF="/custom-error.html">documentation of customizable
7259N/Aresponses.</A><p><hr>
7259N/A
7259N/A<A name="errorlog"><h2>ErrorLog directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ErrorLog} directive&gt; -->
7259N/A<strong>Syntax:</strong> ErrorLog <em>filename</em><br>
7259N/A<strong>Default:</strong> <code>ErrorLog logs/error_log</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe error log directive sets the name of the file to which the server will log
7259N/Aany errors it encounters. If the filename does not begin with a slash (/)
7259N/Athen it is assumed to be relative to the <A HREF="#serverroot">ServerRoot</A>.
7259N/AExample:
7259N/A<blockquote><code>ErrorLog /dev/null</code></blockquote>
7259N/AThis effectively turns off error logging.<p>
7259N/A
7259N/ASECURITY: See the <A HREF="/misc/security_tips.html">security tips</A>
7259N/Adocument for details on why your security could be compromised if
7259N/Athe directory where logfiles are stored is writable by anyone other
7259N/Athan the user that starts the server.
7259N/A
7259N/A<p><hr>
7259N/A
7259N/A<A name="files"><h2>&lt;Files&gt;</h2></A>
7259N/A<strong>Syntax:</strong> &lt;Files <em>filename</em>&gt;
7259N/A... &lt;/Files&gt;<br>
7259N/A<strong>Context:</strong> server config, virtual host, htaccess<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> only available in Apache
7259N/A1.2 and above.<p>
7259N/A
7259N/A<p>The &lt;Files&gt; directive provides for access control by
7259N/Afilename. It is comparable to the <a
7259N/Ahref="#directory">&lt;Directory&gt;</a> directive and
7259N/A<a href="#location">&lt;Location&gt;</a> directives. It
7259N/Ashould be matched with a &lt;/Files&gt; directive. Directives that
7259N/Aapply to the filename given should be listed
7259N/Awithin. <code>&lt;Files&gt;</code> sections are processed in the
7259N/Aorder they appear in the configuration file, after the
7259N/A&lt;Directory&gt; sections and <code>.htaccess</code> files are
7259N/Aread, but before &lt;Location&gt; sections.</p>
7259N/A
7259N/A<p>The <em>filename</em> argument should include a filename, or a
7259N/Awild-card string, where `?' matches any single character, and `*' matches any
7259N/Asequences of characters. Extended regular expressions can also be used, with the addition of
7259N/Athe <code>~</code> character. For example:</p>
7259N/A
7259N/A<pre>
7259N/A &lt;Files ~ &quot;\.(gif|jpe?g|png)$&quot;&gt;
7259N/A</pre>
7259N/A
7259N/Awould match most common Internet graphics formats.
7259N/A
7259N/A<p>Note that unlike <a
7259N/Ahref="#directory"><code>&lt;Directory&gt;</code></a> and <a
7259N/Ahref="#location"><code>&lt;Location&gt;</code></a> sections,
7259N/A<code>&lt;Files&gt;</code> sections can be used inside .htaccess
7259N/Afiles. This allows users to control access to their own files, at a
7259N/Afile-by-file level. When used in an .htaccess file, if the
7259N/A<em>filename</em> does not begin with a <code>/</code> character,
7259N/Athe directory being applied will be prefixed automatically.
7259N/A
7259N/A<p> <hr>
7259N/A
7259N/A<A name="group"><h2>Group directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt Group} directive&gt; -->
7259N/A<strong>Syntax:</strong> Group <em>unix-group</em><br>
7259N/A<strong>Default:</strong> <code>Group #-1</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe Group directive sets the group under which the server will answer requests.
7259N/AIn order to use this directive, the stand-alone server must be run initially
7259N/Aas root. <em>Unix-group</em> is one of:
7259N/A<dl>
7259N/A<dt>A group name
7259N/A<dd>Refers to the given group by name.
7259N/A<dt># followed by a group number.
7259N/A<dd>Refers to a group by its number.
7259N/A</dl>
7259N/A
7259N/AIt is recommended that you set up a new group specifically for running the
7259N/Aserver. Some admins use user <code>nobody</code>, but this is not always
7259N/Apossible or desirable.<p>
7259N/A
7259N/ANote: if you start the server as a non-root user, it will fail to change
7259N/Ato the specified group, and will instead continue to run as the group of the
7259N/Aoriginal user. <p>
7259N/A
7259N/ASpecial note: Use of this directive in &lt;VirtualHost&gt; requires a
7259N/Aproperly configured <A HREF="/suexec.html">SUEXEC wrapper</A>.<p>
7259N/A
7259N/ASECURITY: See <A HREF="#user">User</A> for a discussion of the security
7259N/Aconsiderations.<p><hr>
7259N/A
7259N/A<A name="hostnamelookups"><h2>HostNameLookups directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt HostNameLookups} directive&gt; -->
7259N/A<strong>Syntax:</strong> HostNameLookups <em>boolean</em><br>
7259N/A<strong>Default:</strong> <code>HostNameLookups on</code><br>
7259N/A<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThis directive enables DNS lookups so that host names can be logged.
7259N/AHaving this directive set <code>on</code> also enables the use of names
7259N/Ain &lt;Limit&gt; blocks for access control.<p>
7259N/A
7259N/AHeavily loaded sites should set this directive <code>off</code>, since DNS
7259N/Alookups can take considerable amounts of time. The utility <i>logresolve</i>,
7259N/Aprovided in the <i>/support</i> directory, can be used to look up host names
7259N/Afrom logged IP addresses offline.<p><hr>
7259N/A
7259N/A<A name="identitycheck"><h2>IdentityCheck directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt IdentityCheck} directive&gt; -->
7259N/A<strong>Syntax:</strong> IdentityCheck <em>boolean</em><br>
7259N/A<strong>Default:</strong> <code>IdentityCheck off</code><br>
7259N/A<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThis directive enables RFC931-compliant logging of the remote user name
7259N/Afor each connection, where the client machine runs identd or something similar.
7259N/AThis information is logged in the access log. <em>Boolean</em> is either
7259N/A<code>on</code> or <code>off</code>.<p>
7259N/A
7259N/AThe information should not be trusted in any way except for rudimentary usage
7259N/Atracking.<p><hr>
7259N/A
7259N/A<A NAME="ifmodule"><H2>&lt;IfModule&gt;</H2></A>
7259N/A<b>Syntax:</b> &lt;IfModule [!]<i>module-name</i>&gt; <i>...</i>
7259N/A&lt;/IfModule&gt;<br>
7259N/A<b>Default:</b> None<br>
7259N/A<b>Context:</b> all<br>
7259N/A<b>Status:</b> Core
7259N/A<strong>Compatibility:</strong> ScriptLog is only available in 1.2 and
7259N/Alater.<P>
7259N/A
7259N/A<p>
7259N/A
7259N/AThe &lt;IfModule <i>test</i>&gt;...&lt;/IfModule&gt;
7259N/Asection is used to mark directives that are conditional. The
7259N/Adirectives within an IfModule section are only
7259N/Aprocessed if the <i>test</i> is true. If <i>test</i>
7259N/Ais false, everything between the start and end markers
7259N/Ais ignored.<p>
7259N/A
7259N/AThe <i>test</i> in the &lt;IfModule&gt; section directive
7259N/Acan be one of two forms:
7259N/A
7259N/A<ul>
7259N/A<li><i>module name</i>
7259N/A<li>!<i>module name</i>
7259N/A</ul>
7259N/A
7259N/A<p>In the former case, the directives between the start and end markers
7259N/Aare only processed if the module named <i>module name</i> is compiled
7259N/Ain to Apache. The second format reverses the test, and only processes
7259N/Athe directives if <i>module name</i> is <b>not</b> compiled in.
7259N/A
7259N/A<p>The <i>module name</i> argument is a module name as given as the file
7259N/Aname of the module, at the time it was compiled. For example,
7259N/A<code>mod_rewrite.c</code>.
7259N/A
7259N/A<p>&lt;IfModule&gt; sections are nest-able, which can be used to implement
7259N/Asimple multiple-module tests.
7259N/A
7259N/A<P> <hr>
7259N/A
7259N/A<h2><a name="keepalive">KeepAlive</a></h2>
7259N/A<strong>Syntax: (Apache 1.1)</strong> KeepAlive <em>max-requests</em><br>
7259N/A<strong>Default: (Apache 1.1)</strong> <code>KeepAlive 5</code><br>
7259N/A<strong>Syntax: (Apache 1.2)</strong> KeepAlive <em>on/off</em><br>
7259N/A<strong>Default: (Apache 1.2)</strong> <code>KeepAlive On</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> Core<br>
7259N/A<strong>Compatibility:</strong> KeepAlive is only available in Apache
7259N/A1.1 and later.<p>
7259N/A
7259N/AThis directive enables
7259N/A<a href="/keepalive.html">Keep-Alive</a>
7259N/Asupport.
7259N/A
7259N/A<p><strong>Apache 1.1</strong>: Set <em>max-requests</em>
7259N/Ato the maximum number of requests you want Apache to entertain per
7259N/Arequest. A limit is imposed to prevent a client from hogging your
7259N/Aserver resources. Set this to <code>0</code> to disable support.
7259N/A
7259N/A<p><strong>Apache 1.2 and later</strong>: Set to "On" to enable
7259N/Apersistent connections, "Off" to disable. See also the <a
7259N/Ahref="#maxkeepaliverequests">MaxKeepAliveRequests</a> directive.</p>
7259N/A
7259N/A<h2><a name="keepalivetimeout">KeepAliveTimeout</a></h2>
7259N/A<strong>Syntax:</strong> KeepAliveTimeout <em>seconds</em><br>
7259N/A<strong>Default:</strong> <code>KeepAliveTimeout 15</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> Core<br>
7259N/A<strong>Compatibility:</strong> KeepAliveTimeout is only available in Apache
7259N/A1.1 and later.<p>
7259N/A
7259N/AThe number of seconds Apache will wait for a subsequent request before
7259N/Aclosing the connection. Once a request has been received, the timeout
7259N/Avalue specified by the <a
7259N/Ahref="#timeout"><code>Timeout</code></a> directive
7259N/Aapplies.
7259N/A<hr>
7259N/A
7259N/A<A name="listen"><h2>Listen</h2></A>
7259N/A<strong>Syntax:</strong>
7259N/AListen [<em>IP address</em>:]<em>port number</em><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> Listen is only available in Apache
7259N/A1.1 and later.<p>
7259N/A
7259N/A<p>The Listen directive instructs Apache to listen to more than one IP
7259N/Aaddress or port; by default it responds to requests on all IP
7259N/Ainterfaces, but only on the port given by the <a href="#port">Port</a>
7259N/Adirective.</p>
7259N/A
7259N/A<p><strong>See Also</strong>:
7259N/A<a href="/bind.html">Setting which addresses and ports Apache uses</a></p>
7259N/A<hr>
7259N/A
7259N/A<A name="limit"><h2>&lt;Limit&gt; directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt Limit} section directive&gt; -->
7259N/A<strong>Syntax:</strong>
7259N/A &lt;Limit <em>method method</em> ... &gt; ... &lt;/Limit&gt;<br>
7259N/A<strong>Context:</strong> any<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/A&lt;Limit&gt; and &lt;/Limit&gt; are used to enclose a group of
7259N/Aaccess control directives which will then apply only to the specified
7259N/Aaccess methods, where <em>method</em> is any valid HTTP method.
7259N/AAny directive except another &lt;Limit&gt; or
7259N/A<A HREF="#directory">&lt;Directory&gt;</A> may be used; the majority will be
7259N/Aunaffected by the &lt;Limit&gt;. Example:
7259N/A<blockquote><code>
7259N/A&lt;Limit GET POST&gt;<br>
7259N/Arequire valid-user<br>
7259N/A&lt;/Limit&gt;</code></blockquote>
7259N/AIf an access control directive appears outside a &lt;Limit&gt; directive,
7259N/Athen it applies to all access methods.<p><hr>
7259N/A
7259N/A<h2><a name="location">&lt;Location&gt;</a></h2>
7259N/A
7259N/A<strong>Syntax:</strong> &lt;Location <em>URL</em>&gt;
7259N/A... &lt;/Location&gt;<br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> Location is only available in Apache
7259N/A1.1 and later.<p>
7259N/A
7259N/A<p>The &lt;Location&gt; directive provides for access control by
7259N/AURL. It is comparable to the <a
7259N/Ahref="#directory">&lt;Directory&gt;</a> directive, and
7259N/Ashould be matched with a &lt;/Location&gt; directive. Directives that
7259N/Aapply to the URL given should be listen
7259N/Awithin. <code>&lt;Location&gt;</code> sections are processed in the
7259N/Aorder they appear in the configuration file, after the
7259N/A&lt;Directory&gt; sections and <code>.htaccess</code> files are
7259N/Aread.</p>
7259N/A
7259N/A<p>Note that, due to the way HTTP functions, <em>URL prefix</em>
7259N/Ashould, save for proxy requests, be of the form <code>/path/</code>,
7259N/Aand should not include the <code>http://servername</code>. It doesn't
7259N/Anecessarily have to protect a directory (it can be an individual
7259N/Afile, or a number of files), and can include wild-cards. In a wild-card
7259N/Astring, `?' matches any single character, and `*' matches any
7259N/Asequences of characters.
7259N/A
7259N/A<p><strong>Apache 1.2 and above:</strong>
7259N/AExtended regular expressions can also be used, with the addition of
7259N/Athe
7259N/A<code>~</code> character. For example:</p>
7259N/A
7259N/A<pre>
7259N/A &lt;Location ~ &quot;/(extra|special)/data&quot;&gt;
7259N/A</pre>
7259N/A
7259N/Awould match URLs that contained the substring "/extra/data" or
7259N/A"/special/data".</p>
7259N/A
7259N/A<p>The <code>Location</code> functionality is especially useful when
7259N/Acombined with the <code><a
7259N/Ahref="mod_mime.html#sethandler">SetHandler</a></code> directive. For example, to enable status requests, but allow them only
7259N/Afrom browsers at foo.com, you might use:
7259N/A
7259N/A<pre>
7259N/A &lt;Location /status&gt;
7259N/A SetHandler server-status
7259N/A order deny,allow
7259N/A deny from all
7259N/A allow from .foo.com
7259N/A &lt;/Location&gt;
7259N/A</pre>
7259N/A<hr>
7259N/A
7259N/A<A name="maxclients"><h2>MaxClients directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt MaxClients} directive&gt; -->
7259N/A<strong>Syntax:</strong> MaxClients <em>number</em><br>
7259N/A<strong>Default:</strong> <code>MaxClients 256</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe MaxClients directive sets the limit on the number of simultaneous
7259N/Arequests that can be supported; not more than this number of child server
7259N/Aprocesses will be created.<p><hr>
7259N/A
7259N/A<A name="maxkeepaliverequests"><h2>MaxKeepAliveRequests</h2></A>
7259N/A<strong>Syntax:</strong> MaxKeepAliveRequests <em>number</em><br>
7259N/A<strong>Default:</strong> <code>MaxKeepAliveRequests 100</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> Only available in Apache
7259N/A1.2 and later.
7259N/A
7259N/A<p>The MaxKeepAliveRequests directive limits the number of requests
7259N/Aallowed per connection when <a href="#keepalive">KeepAlive</a> is
7259N/Aon. If it is set to "<code>0</code>," unlimited requests will be
7259N/Aallowed. We reccomend that this setting is kept to a high value, for
7259N/Amaximum server peformance.
7259N/A
7259N/A<A name="maxrequestsperchild"><h2>MaxRequestsPerChild directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt MaxRequestsPerChild} directive&gt; -->
7259N/A<strong>Syntax:</strong> MaxRequestsPerChild <em>number</em><br>
7259N/A<strong>Default:</strong> <code>MaxRequestsPerChild 0</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe MaxRequestsPerChild directive sets the limit on the number of requests
7259N/Athat an individual child server process will handle. After MaxRequestsPerChild
7259N/Arequests, the child process will die. If MaxRequestsPerChild is 0, then
7259N/Athe process will never expire.<p>
7259N/A
7259N/ASetting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
7259N/A<ul>
7259N/A<li>it limits the amount of memory that process can consume by (accidental)
7259N/Amemory leakage;
7259N/A<li> by giving processes a finite lifetime, it helps reduce the
7259N/Anumber of processes when the server load reduces.
7259N/A</ul><p><hr>
7259N/A
7259N/A<A name="maxspareservers"><h2>MaxSpareServers directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt MaxSpareServers} directive&gt; -->
7259N/A<strong>Syntax:</strong> MaxSpareServers <em>number</em><br>
7259N/A<strong>Default:</strong> <code>MaxSpareServers 10</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe MaxSpareServers directive sets the desired maximum number of <em>idle</em>
7259N/Achild server processes. An idle process is one which is not handling
7259N/Aa request. If there are more than MaxSpareServers idle, then the parent
7259N/Aprocess will kill off the excess processes.<p>
7259N/A
7259N/ATuning of this parameter should only be necessary on very busy sites.
7259N/ASetting this parameter to a large number is almost always a bad idea.<p>
7259N/A
7259N/ASee also <A HREF="#minspareservers">MinSpareServers</A> and
7259N/A<A HREF="#startservers">StartServers</A>.<p><hr>
7259N/A
7259N/A<A name="minspareservers"><h2>MinSpareServers directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt MinSpareServers} directive&gt; -->
7259N/A<strong>Syntax:</strong> MinSpareServers <em>number</em><br>
7259N/A<strong>Default:</strong> <code>MinSpareServers 5</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe MinSpareServers directive sets the desired minimum number of <em>idle</em>
7259N/Achild server processes. An idle process is one which is not handling
7259N/Aa request. If there are fewer than MinSpareServers idle, then the parent
7259N/Aprocess creates new children at a maximum rate of 1 per second.<p>
7259N/A
7259N/ATuning of this parameter should only be necessary on very busy sites.
7259N/ASetting this parameter to a large number is almost always a bad idea.<p>
7259N/A
7259N/ASee also <A HREF="#maxspareservers">MaxSpareServers</A> and
7259N/A<A HREF="#startservers">StartServers</A>.<p><hr>
7259N/A
7259N/A<A name="options"><h2>Options directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt Options} directive&gt; -->
7259N/A<strong>Syntax:</strong> Options <em>[+|-]option [+|-]option ...</em><br>
7259N/A<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
7259N/A<strong>Override:</strong> Options<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe Options directive controls which server features are available in
7259N/Aa particular directory.
7259N/A<p>
7259N/A<em>option</em> can be set to <code>None</code>, in which case none of
7259N/Athe extra features are enabled, or one or more of the following:
7259N/A<dl>
7259N/A<dt>All
7259N/A<dd>All options except for MultiViews.
7259N/A<dt>ExecCGI
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt ExecCGI} option&gt; -->
7259N/AExecution of CGI scripts is permitted.
7259N/A<dt>FollowSymLinks
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt FollowSymLinks} option&gt; -->
7259N/AThe server will follow symbolic links in this directory.
7259N/A<dt>Includes
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt Includes} option&gt; -->
7259N/AServer-side includes are permitted.
7259N/A<dt>IncludesNOEXEC
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt IncludesNOEXEC} option&gt; -->
7259N/AServer-side includes are permitted, but the #exec command and
7259N/A#include of CGI scripts are disabled.
7259N/A<dt>Indexes
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt Indexes} option&gt; -->
7259N/AIf a URL which maps to a directory is requested, and the there is no
7259N/ADirectoryIndex (e.g. index.html) in that directory, then the server will
7259N/Areturn a formatted listing of the directory.
7259N/A<dt>MultiViews
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt MultiViews} option&gt; -->
7259N/A<A HREF="/content-negotiation.html">Content negotiated</A> MultiViews are
7259N/Aallowed.
7259N/A<dt>SymLinksIfOwnerMatch
7259N/A<dd>
7259N/A<!--%plaintext &lt;?INDEX {\tt SymLinksIfOwnerMatch} option&gt; -->
7259N/AThe server will only follow symbolic links for which the target
7259N/Afile or directory is owned by the same user id as the link.
7259N/A</dl>
7259N/A
7259N/ANormally, if multiple <code>Options</code> could apply to a directory,
7259N/Athen the most specific one is taken complete; the options are not
7259N/Amerged. However if <i>all</i> the options on the <code>Options</code>
7259N/Adirective are preceeded by a + or - symbol, the options are
7259N/Amerged. Any options preceeded by a + are added to the options
7259N/Acurrently in force, and any options preceeded by a - are removed from
7259N/Athe options currently in force. <P>
7259N/A
7259N/AFor example, without any + and - symbols:
7259N/A
7259N/A<blockquote><code>
7259N/A&lt;Directory /web/docs&gt; <br>
7259N/AOptions Indexes FollowSymLinks<br>
7259N/A&lt;/Directory&gt;<br>
7259N/A&lt;Directory /web/docs/spec&gt; <br>
7259N/AOptions Includes<br>
7259N/A&lt;/Directory&gt;
7259N/A</code></blockquote>
7259N/Athen only <code>Includes</code> will be set for the /web/docs/spec
7259N/Adirectory. However if the second <code>Options</code> directive uses the +
7259N/Aand - symbols:<p>
7259N/A
7259N/A<blockquote><code>
7259N/A&lt;Directory /web/docs&gt; <br>
7259N/AOptions Indexes FollowSymLinks<br>
7259N/A&lt;/Directory&gt;<br>
7259N/A&lt;Directory /web/docs/spec&gt; <br>
7259N/AOptions +Includes -Indexes<br>
7259N/A&lt;/Directory&gt;
7259N/A</code></blockquote>
7259N/Athen the options <code>FollowSymLinks</code> and <code>Includes</code>
7259N/Aare set for the /web/docs/spec directory.
7259N/A<hr>
7259N/A
7259N/A<A name="pidfile"><h2>PidFile directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt PidFile} directive&gt; -->
7259N/A<strong>Syntax:</strong> PidFile <em>filename</em><br>
7259N/A<strong>Default:</strong> <code>PidFile logs/httpd.pid</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe PidFile directive sets the file to which the server records the
7259N/Aprocess id of the daemon. If the filename does not begin with a slash (/)
7259N/Athen it is assumed to be relative to the <A HREF="#serverroot">ServerRoot</A>.
7259N/AThe PidFile is only used in <A HREF="#servertype">standalone</A> mode.<p>
7259N/A
7259N/AIt is often useful to be able to send the server a signal, so that it closes
7259N/Aand then reopens its <A HREF="#errorlog">ErrorLog</A> and TransferLog, and
7259N/Are-reads its configuration files. This is done by sending a SIGHUP (kill -1)
7259N/Asignal to the process id listed in the PidFile.<p><hr>
7259N/A
7259N/A<A name="port"><h2>Port directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt Port} directive&gt; -->
7259N/A<strong>Syntax:</strong> Port <em>number</em><br>
7259N/A<strong>Default:</strong> <code>Port 80</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe Port directive sets the network port on which the server listens.
7259N/A<em>Num</em> is a number from 0 to 65535; some port numbers (especially below
7259N/A1024) are reserved for particular protocols. See <code>/etc/services</code>
7259N/Afor a list of some defined ports; the standard port for the http protocol
7259N/Ais 80.<p>
7259N/A
7259N/APort 80 is one of Unix's special ports. All ports numbered
7259N/Abelow 1024 are reserved for system use, i.e. regular (non-root) users cannot
7259N/Amake use of them; instead they can only use higher port numbers.<p>
7259N/A
7259N/ATo use port 80, you must start the server from the root account.
7259N/AAfter binding to the port and before accepting requests, Apache will change
7259N/Ato a low privileged user as set by the <A HREF="#user">User directive</A>.<p>
7259N/A
7259N/AIf you cannot use port 80, choose any other unused port. Non-root users
7259N/Awill have to choose a port number higher than 1023, such as 8000.<p>
7259N/A
7259N/ASECURITY: if you do start the server as root, be sure
7259N/Anot to set <A HREF="#user">User</A> to root. If you run the server as
7259N/Aroot whilst handling connections, your site may be open to a major security
7259N/Aattack.<p><hr>
7259N/A
7259N/A<A name="require"><h2>require directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt require} directive&gt; -->
7259N/A<strong>Syntax:</strong> require <em>entity-name entity entity...</em><br>
7259N/A<strong>Context:</strong> directory, .htaccess<br>
7259N/A<strong>Override:</strong> AuthConfig<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThis directive selects which authenticated users can access a directory.
7259N/AThe allowed syntaxes are:
7259N/A<ul>
7259N/A<li>require user <em>userid userid ...</em><p>
7259N/AOnly the named users can access the directory.<p>
7259N/A<li>require group <em>group-name group-name ...</em><p>
7259N/AOnly users in the named groups can access the directory.<p>
7259N/A<li>require valid-user<p>
7259N/AAll valid users can access the directory.
7259N/A</ul>
7259N/A<p>
7259N/AIf <code>require</code> appears in a <A HREF="#limit">&lt;Limit&gt;</A>
7259N/Asection, then it restricts access to the named methods, otherwise
7259N/Ait restricts access for all methods. Example:
7259N/A<blockquote><code>
7259N/AAuthType Basic<br>
7259N/AAuthName somedomain<br>
7259N/AAuthUserFile /web/users<br>
7259N/AAuthGroupFile /web/groups<br>
7259N/A&lt;Limit GET POST&gt;<br>
7259N/Arequire group admin<br>
7259N/A&lt;/Limit&gt;
7259N/A</code></blockquote>
7259N/A
7259N/ARequire must be accompanied by <A HREF="#authname">AuthName</A> and
7259N/A<A HREF="#authtype">AuthType</A> directives, and directives such as
7259N/A<A HREF="mod_auth.html#authuserfile">AuthUserFile</A> and
7259N/A<A HREF="mod_auth.html#authgroupfile">AuthGroupFile</A> (to define users and
7259N/Agroups) in order to work correctly.<p><hr>
7259N/A
7259N/A<A name="resourceconfig"><h2>ResourceConfig directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ResourceConfig} directive&gt; -->
7259N/A<strong>Syntax:</strong> ResourceConfig <em>filename</em><br>
7259N/A<strong>Default:</strong> <code>ResourceConfig conf/srm.conf</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe server will read this file for more directives after reading the
7259N/Ahttpd.conf file. <em>Filename</em> is relative to the
7259N/A<A HREF="#serverroot">ServerRoot</A>.
7259N/AThis feature can be disabled using:
7259N/A<blockquote><code>ResourceConfig /dev/null</code></blockquote>
7259N/AHistorically, this file contained most directives except for server
7259N/Aconfiguration directives and <A HREF="#directory">&lt;Directory&gt;</A>
7259N/Asections; in fact it can now contain any server directive allowed in the
7259N/A<em>server config</em> context.<p>
7259N/A
7259N/ASee also <A HREF="#accessconfig">AccessConfig</A>.<p><hr>
7259N/A
7259N/A<A name="rlimit">
7259N/A<A name="rlimitcpu"><h2>RLimitCPU directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt RLimitCPU} directive&gt; -->
7259N/A<strong>Syntax:</strong> RLimitCPU <em># or 'max'</em> <em>[# or 'max']</em><br>
7259N/A<strong>Default:</strong> <code>Unset uses operating system defaults</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> RLimitCPU is only available in Apache 1.2 and later<p>
7259N/A
7259N/ATakes 1 or 2 parameters. The first parameter sets the soft resource limit for all
7259N/Aprocesses and the second parameter sets the maximum resource limit. Either parameter
7259N/Acan be a number, or <em>max</em> to indicate to the server that the limit should
7259N/Abe set to the maximum allowed by the operating system configuration. Raising the
7259N/Amaximum resource limit requires that the server is running as root, or in the initial
7259N/Astartup phase.<p>
7259N/A
7259N/ACPU resource limits are expressed in seconds per process.<p>
7259N/A
7259N/ASee also <A HREF="#rlimitmem">RLimitMEM</A> or <A HREF="#rlimitnproc">RLimitNPROC</A>.<p><hr>
7259N/A
7259N/A<A name="rlimitmem"><h2>RLimitMEM directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt RLimitMEM} directive&gt; -->
7259N/A<strong>Syntax:</strong> RLimitMEM <em># or 'max'</em> <em>[# or 'max']</em><br>
7259N/A<strong>Default:</strong> <code>Unset uses operating system defaults</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> RLimitMEM is only available in Apache 1.2 and later<p>
7259N/A
7259N/ATakes 1 or 2 parameters. The first parameter sets the soft resource limit for all
7259N/Aprocesses and the second parameter sets the maximum resource limit. Either parameter
7259N/Acan be a number, or <em>max</em> to indicate to the server that the limit should
7259N/Abe set to the maximum allowed by the operating system configuration. Raising the
7259N/Amaximum resource limit requires that the server is running as root, or in the initial
7259N/Astartup phase.<p>
7259N/A
7259N/AMemory resource limits are expressed in bytes per process.<p>
7259N/A
7259N/ASee also <A HREF="#rlimitcpu">RLimitCPU</A> or <A HREF="#rlimitnproc">RLimitNPROC</A>.<p><hr>
7259N/A
7259N/A<A name="rlimitnproc"><h2>RLimitNPROC directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt RLimitNPROC} directive&gt; -->
7259N/A<strong>Syntax:</strong> RLimitNPROC <em># or 'max'</em> <em>[# or 'max']</em><br>
7259N/A<strong>Default:</strong> <code>Unset uses operating system defaults</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> RLimitNPROC is only available in Apache 1.2 and later<p>
7259N/A
7259N/ATakes 1 or 2 parameters. The first parameter sets the soft resource limit for all
7259N/Aprocesses and the second parameter sets the maximum resource limit. Either parameter
7259N/Acan be a number, or <em>max</em> to indicate to the server that the limit should
7259N/Abe set to the maximum allowed by the operating system configuration. Raising the
7259N/Amaximum resource limit requires that the server is running as root, or in the initial
7259N/Astartup phase.<p>
7259N/A
7259N/AProcess limits control the number of processes per user.<p>
7259N/A
7259N/ANote: If CGI processes are <b>not</b> running under userids other than the
7259N/Aweb server userid, this directive will limit the number of processes that the
7259N/Aserver itself can create. Evidence of this situation will be indicated by
7259N/A<b><em>cannot fork</em></b> messages in the error_log.<p>
7259N/A
7259N/ASee also <A HREF="#rlimitmem">RLimitMEM</A> or <A HREF="#rlimitcpu">RLimitCPU</A>.
7259N/A
7259N/A<p><hr>
7259N/A
7259N/A<A name="satisfy"><h2>Satisfy</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt Satisfy} directive&gt; -->
7259N/A<strong>Syntax:</strong> Satisfy <em>'any' or 'all'</em><br>
7259N/A<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> Satisfy is only available in Apache 1.2 and later<p>
7259N/A
7259N/AAccess policy if both allow and require used. The parameter can be either
7259N/A<em>'all'</em> or <em>'any'</em>.
7259N/A
7259N/A<p><hr>
7259N/A
7259N/A<A name="sendbuffersize"><h2>SendBufferSize directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt SendBufferSize} directive&gt; -->
7259N/A<strong>Syntax:</strong> SendBufferSize <em>bytes</em><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe server will set the TCP buffer size to the number of bytes
7259N/Aspecified. Very useful to increase past standard OS defaults on high
7259N/Aspeed high latency (i.e. 100ms or so, such as transcontinental
7259N/Afast pipes)
7259N/A<p><hr>
7259N/A
7259N/A<A name="serveradmin"><h2>ServerAdmin directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ServerAdmin} directive&gt; -->
7259N/A<strong>Syntax:</strong> ServerAdmin <em>email-address</em><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe ServerAdmin sets the e-mail address that the server includes in any
7259N/Aerror messages it returns to the client.<p>
7259N/A
7259N/AIt may be worth setting up a dedicated address for this, e.g.
7259N/A<blockquote><code>ServerAdmin www-admin@foo.bar.com</code></blockquote>
7259N/Aas users do not always mention that they are talking about the server!<p><hr>
7259N/A
7259N/A<A name="serveralias"><h2>ServerAlias directive</h2></A>
7259N/A
7259N/A<strong>Syntax:</strong> ServerAlias <em>host1 host2 ...</em><br>
7259N/A<strong>Context:</strong> virtual host<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> ServerAlias is only available in Apache
7259N/A1.1 and later.<p>
7259N/A
7259N/AThe ServerAlias directive sets the alternate names for a host, for use
7259N/Awith
7259N/A<a href="/host.html">Host-header based virtual hosts</a>.
7259N/A
7259N/A<p><hr>
7259N/A
7259N/A<A name="servername"><h2>ServerName directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ServerName} directive&gt; -->
7259N/A<strong>Syntax:</strong> ServerName <em>fully-qualified domain name</em><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe ServerName directive sets the hostname of the server; this is only
7259N/Aused when creating redirection URLs. If it is not specified, then the
7259N/Aserver attempts to deduce it from its own IP address; however this may
7259N/Anot work reliably, or may not return the preferred hostname. For example:
7259N/A<blockquote><code>ServerName www.wibble.com</code></blockquote>
7259N/Awould be used if the canonical (main) name of the actual machine
7259N/Awere <code>monster.wibble.com</code>.<p><hr>
7259N/A
7259N/A<A name="serverpath"><h2>ServerPath directive</h2></A>
7259N/A
7259N/A<strong>Syntax:</strong> ServerPath <em>pathname</em><br>
7259N/A<strong>Context:</strong> virtual host<br>
7259N/A<strong>Status:</strong> core<br>
7259N/A<strong>Compatibility:</strong> ServerPath is only available in Apache
7259N/A1.1 and later.<p>
7259N/A
7259N/AThe ServerPath directive sets the legacy URL pathname for a host, for
7259N/Ause with <a href="/host.html">Host-header based virtual hosts</a>.
7259N/A<hr>
7259N/A
7259N/A<A name="serverroot"><h2>ServerRoot directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ServerRoot} directive&gt; -->
7259N/A<strong>Syntax:</strong> ServerRoot <em>directory-filename</em><br>
7259N/A<strong>Default:</strong> <code>ServerRoot /usr/local/etc/httpd</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe ServerRoot directive sets the directory in which the server lives.
7259N/ATypically it will contain the subdirectories <code>conf/</code> and
7259N/A<code>logs/</code>. Relative paths for other configuration files are taken
7259N/Aas relative to this directory.<br>
7259N/ASee also <a href="/invoking.html">the <code>-d</code> option to httpd</a>.<p><hr>
7259N/A
7259N/A<A name="servertype"><h2>ServerType directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt ServerType} directive&gt; -->
7259N/A<strong>Syntax:</strong> ServerType <em>type</em><br>
7259N/A<strong>Default:</strong> <code>ServerType standalone</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe ServerType directive sets how the server is executed by the system.
7259N/A<em>Type</em> is one of
7259N/A<dl>
7259N/A<dt>inetd
7259N/A<dd>The server will be run from the system process inetd; the command to start
7259N/Athe server is added to <code>/etc/inetd.conf</code>
7259N/A<dt>standalone
7259N/A<dd>The server will run as a daemon process; the command to start the server
7259N/Ais added to the system startup scripts. (<code>/etc/rc.local</code> or
7259N/A<code>/etc/rc3.d/...</code>.)
7259N/A</dl>
7259N/A
7259N/AInetd is the lesser used of the two options. For each http
7259N/Aconnection received, a new copy of the server is started from scratch;
7259N/Aafter the connection is complete, this program exits. There is a high price to
7259N/Apay per connection, but for security reasons, some admins prefer this option.
7259N/A<p>
7259N/A
7259N/AStandalone is the most common setting for ServerType since
7259N/Ait is far more efficient. The server is started once, and services all
7259N/Asubsequent connections. If you intend running Apache to serve a busy site,
7259N/Astandalone will probably be your only option.<p>
7259N/A
7259N/ASECURITY: if you are paranoid about security, run in inetd mode. Security
7259N/Acannot be guaranteed in either, but whilst most people are happy to use
7259N/Astandalone, inetd is probably least prone to attack.<p><hr>
7259N/A
7259N/A<A name="startservers"><h2>StartServers directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt StartServers} directive&gt; -->
7259N/A<strong>Syntax:</strong> StartServers <em>number</em><br>
7259N/A<strong>Default:</strong> <code>StartServers 5</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe StartServers directive sets the number of child server processes created
7259N/Aon startup. As the number of processes is dynamically controlled depending
7259N/Aon the load, there is usually little reason to adjust this parameter.<p>
7259N/A
7259N/ASee also <A HREF="#minspareservers">MinSpareServers</A> and
7259N/A<A HREF="#maxspareservers">MaxSpareServers</A>.<p><hr>
7259N/A
7259N/A<A name="timeout"><h2>TimeOut directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt TimeOut} directive&gt; -->
7259N/A<strong>Syntax:</strong> TimeOut <em>number</em><br>
7259N/A<strong>Default:</strong> <code>TimeOut 1200</code><br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe TimeOut directive currently defines the amount of time Apache will
7259N/Await for three things:
7259N/A
7259N/A<OL>
7259N/A <LI>The total amount of time it takes to receive a GET request.
7259N/A <LI>The amount of time between receipt of TCP packets on a POST or
7259N/A PUT request.
7259N/A <LI>The amount of time between ACKs on transmissions of TCP packets
7259N/A in responses.
7259N/A</OL>
7259N/A
7259N/AWe plan on making these separately configurable at some point down the
7259N/Aroad. 1200 is very generous - you may consider turning it down to
7259N/Asomething smaller if you find the server getting swamped by
7259N/Ahalf-completed connections from buggy browsers.
7259N/A
7259N/A<p><hr>
7259N/A
7259N/A<A name="user"><h2>User directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt User} directive&gt; -->
7259N/A<strong>Syntax:</strong> User <em>unix-userid</em><br>
7259N/A<strong>Default:</strong> <code>User #-1</code><br>
7259N/A<strong>Context:</strong> server config, virtual host<br>
7259N/A<strong>Status:</strong> core<p>
7259N/A
7259N/AThe User directive sets the userid as which the server will answer requests.
7259N/AIn order to use this directive, the standalone server must be run initially
7259N/Aas root. <em>Unix-userid</em> is one of:
7259N/A<dl>
7259N/A<dt>A username
7259N/A<dd>Refers to the given user by name.
7259N/A<dt># followed by a user number.
7259N/A<dd>Refers to a user by their number.
7259N/A</dl>
7259N/A
7259N/AThe user should have no privileges which result in it being able to access
7259N/Afiles which are not intended to be visible to the outside world, and
7259N/Asimilarly, the user should not be able to execute code which is not
7259N/Ameant for httpd requests. It is recommended that you set up a new user and
7259N/Agroup specifically for running the server. Some admins use user
7259N/A<code>nobody</code>, but this is not always possible or desirable.<p>
7259N/A
7259N/ANotes: If you start the server as a non-root user, it will fail to change
7259N/Ato the lesser privileged user, and will instead continue to run as
7259N/Athat original user. If you do start the server as root, then it is normal
7259N/Afor the parent process to remain running as root.<p>
7259N/A
7259N/ASpecial note: Use of this directive in &lt;VirtualHost&gt; requires a
7259N/Aproperly configured <A HREF="/suexec.html">SUEXEC wrapper</A>.<p>
7259N/A
7259N/ASECURITY: Don't set User (or <A HREF="#group">Group</A>) to
7259N/A<code>root</code> unless you know exactly what you are doing, and what the
7259N/Adangers are.<p><hr>
7259N/A
7259N/A<A name="virtualhost"><h2>&lt;VirtualHost&gt; directive</h2></A>
7259N/A<!--%plaintext &lt;?INDEX {\tt VirtualHost} section directive&gt; -->
7259N/A<strong>Syntax:</strong> &lt;VirtualHost <em>addr</em>[:<em>port</em>]&gt; ...
7259N/A&lt;/VirtualHost&gt; <br>
7259N/A<strong>Context:</strong> server config<br>
7259N/A<strong>Status:</strong> Core.<br>
7259N/A<strong>Compatibility:</strong> Non-IP address-based Virtual Hosting is
7259N/Aonly available in Apache 1.2 and later.<p>
7259N/A
7259N/A&lt;VirtualHost&gt; and &lt;/VirtualHost&gt; are used to enclose a group of
7259N/Adirectives which will apply only to a particular virtual host.
7259N/AAny directive which is allowed in a virtual host context may be used.
7259N/AWhen the server receives a request for a document on a particular virtual
7259N/Ahost, it uses the configuration directives enclosed in the &lt;VirtualHost&gt;
7259N/Asection. <em>Addr</em> can be
7259N/A<menu>
7259N/A<li>The IP address of the virtual host
7259N/A<li>A fully qualified domain name for the IP address of the virtual host.
7259N/A</menu> Example:
7259N/A<blockquote>
7259N/A<code>
7259N/A&lt;VirtualHost host.foo.com&gt; <br>
7259N/AServerAdmin webmaster@host.foo.com <br>
7259N/ADocumentRoot /www/docs/host.foo.com <br>
7259N/AServerName host.foo.com <br>
7259N/AErrorLog logs/host.foo.com-error_log <br>
7259N/ATransferLog logs/host.foo.com-access_log <br>
7259N/A&lt;/VirtualHost&gt;
7259N/A</code></blockquote>
7259N/A
7259N/AEach VirtualHost must correspond to a different IP address or a
7259N/Adifferent host name for the server, in the latter case the server
7259N/Amachine must be configured to accept IP packets for multiple
7259N/Aaddresses. (If the machine does not have multiple network interfaces,
7259N/Athen this can be accomplished with the <code>ifconfig alias</code>
7259N/Acommand (if your OS supports it), or with kernel patches like <A
7259N/AHREF="/misc/vif-info.html">VIF</A> (for SunOS(TM) 4.1.x)).<p>
7259N/A
7259N/ASECURITY: See the <A HREF="/misc/security_tips.html">security tips</A>
7259N/Adocument for details on why your security could be compromised if
7259N/Athe directory where logfiles are stored is writable by anyone other
7259N/Athan the user that starts the server.
7259N/A
7259N/A<p><strong>See also:</strong>
7259N/A<A HREF="/virtual-host.html">Information on Virtual Hosts.
7259N/A(multihome)</A><br>
7259N/A<strong>See also:</strong>
7259N/A<a href="/host.html">Non-IP address-based Virtual Hosts</a>
7259N/A</p>
7259N/A
7259N/A<!--#include virtual="footer.html" -->
7259N/A</BODY>
7259N/A</HTML>
7259N/A
7259N/A