7259N/A<!
DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
7259N/A<
TITLE>Apache Core Features</
TITLE>
7259N/A<
H1>Apache Core Features</
h1>
7259N/AThese configuration parameters control the core Apache features, and are
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"><Directory></
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"><Files></
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"><IfModule></
A>
7259N/A<
li><
A HREF="#keepalive">KeepAlive</
A>
7259N/A<
li><
A HREF="#keepalivetimeout">KeepAliveTimeout</
A>
7259N/A<
li><
A HREF="#limit"><Limit></
A>
7259N/A<
li><
A HREF="#listen">Listen</
A>
7259N/A<
li><
A HREF="#location"><Location></
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"><VirtualHost></
A>
7259N/A<
A name="accessconfig"><
h2>AccessConfig directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt AccessConfig} directive> --> 7259N/A<
strong>Syntax:</
strong> AccessConfig <
em>filename</
em><
br>
7259N/A<
strong>Context:</
strong> server config, virtual host<
br>
7259N/A<
strong>Status:</
strong> core<
p>
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/AHistorically, this file only contained
7259N/A<
A HREF="#directory"><Directory></
A> sections; in fact it can now
7259N/Acontain any server directive allowed in the <
em>server config</
em> context.
7259N/A<
A name="accessfilename"><
h2>AccessFileName directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt AccessFileName} directive> --> 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/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<
blockquote><
code>AccessFileName .acl</
code></
blockquote>
7259N/Afor directives, unless they have been disabled with
7259N/A</Directory></
code></
blockquote><
p><
hr>
7259N/A<
A name="addmodule"><
h2>AddModule directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt AddModule} directive> --> 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/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/A<
A name="allowoverride"><
h2>AllowOverride directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt AllowOverride} directive> --> 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/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<
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<!--%plaintext <?INDEX {\tt AuthConfig} override> --> 7259N/AAllow use of the authorization directives
7259N/A<
A HREF="#authname">AuthName</
A>, <
A HREF="#authtype">AuthType</
A>,
7259N/A<
A HREF="#require">require</
A>, etc.).
7259N/A<!--%plaintext <?INDEX {\tt FileInfo} override> --> 7259N/AAllow use of the directives controlling document types
7259N/A<
A HREF="#defaulttype">DefaultType</
A>,
7259N/A<
A HREF="#errordocument">ErrorDocument</
A>,
7259N/A<!--%plaintext <?INDEX {\tt Indexes} override> --> 7259N/AAllow use of the directives controlling directory indexing
7259N/A<!--%plaintext <?INDEX {\tt Limit} override> --> 7259N/AAllow use of the directives controlling host access (allow, deny and order).
7259N/A<!--%plaintext <?INDEX {\tt Options} override> --> 7259N/AAllow use of the directives controlling specific directory features
7259N/A(<
A HREF="#options">Options</
A> and
7259N/A<
A name="authname"><
h2>AuthName directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt AuthName} directive> --> 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/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/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 name="authtype"><
h2>AuthType directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt AuthType} directive> --> 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/AThis directive selects the type of user authentication for a directory.
7259N/AOnly <
code>Basic</
code> is currently implemented.
7259N/A<!--%plaintext <?INDEX {\tt Basic} authentication scheme> --> 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 name="clearmodulelist"><
h2>ClearModuleList directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ClearModuleList} directive> --> 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/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<
A name="bindaddress"><
h2>BindAddress directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt BindAddress} directive> --> 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/AA Unix® 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<
li>A fully-qualified internet domain name
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/AThis option can be used as an alternative method for supporting
7259N/A<
A HREF="#virtualhost"><VirtualHost></
A> sections.
7259N/A<
p><
strong>See Also:</
strong>
7259N/A<
a href="/bind.html">Setting which addresses and ports Apache uses</
a></
p>
7259N/A<
A name="defaulttype"><
h2>DefaultType directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt DefaultType} directive> --> 7259N/A<
strong>Syntax:</
strong> DefaultType <
em>mime-type</
em><
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/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/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/Awould be appropriate for a directory which contained many gif images
7259N/Awith filenames missing the .gif extension.<
p><
hr>
7259N/A<
A name="directory"><
h2><Directory> directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt Directory} section directive> --> 7259N/A<
strong>Syntax:</
strong> <Directory <
em>directory</
em>> ... </Directory> <
br>
7259N/A<
strong>Context:</
strong> server config, virtual host<
br>
7259N/A<
strong>Status:</
strong> Core. <
p>
7259N/A<Directory> and </Directory> 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 Options Indexes FollowSymLinks
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 <Directory ~ "^/www/.*/[0-9]{3}">
7259N/Awould match directories in /www/ that consisted of three numbers.<
p>
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<Directory /home/*><
br>
7259N/A</Directory></
code></
blockquote>
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/Amay appear in any configuration file. <Directory> directives cannot
7259N/Anest, and cannot appear in a <
A HREF="#limit"><Limit></
A> section.
7259N/A<
A NAME="documentroot"><
h2>DocumentRoot directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt DocumentRoot} directive> --> 7259N/A<
strong>Syntax:</
strong> DocumentRoot <
em>directory-filename</
em><
br>
7259N/A<
strong>Default:</
strong> <
code>DocumentRoot
7259N/A<
strong>Context:</
strong> server config, virtual host<
br>
7259N/A<
strong>Status:</
strong> core<
p>
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/A<
blockquote><
code>DocumentRoot /
usr/
web</
code></
blockquote>
7259N/A<
P>There appears to be a bug in mod_dir which causes problems when the
7259N/A<
A name="errordocument"><
h2>ErrorDocument directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ErrorDocument} directive> --> 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/AIn the event of a problem or error, Apache can be configured to do
7259N/A<
LI>behave like NCSA httpd 1.3
7259N/A<
LI>output a customized message
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<
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/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/AErrorDocument 403 "Sorry can't allow you access today
7259N/A<
A name="errorlog"><
h2>ErrorLog directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ErrorLog} directive> --> 7259N/A<
strong>Syntax:</
strong> ErrorLog <
em>filename</
em><
br>
7259N/A<
strong>Context:</
strong> server config, virtual host<
br>
7259N/A<
strong>Status:</
strong> core<
p>
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/AThis effectively turns off error logging.<
p>
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<
A name="files"><
h2><Files></
h2></
A>
7259N/A<
strong>Syntax:</
strong> <Files <
em>filename</
em>>
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/A<
p>The <Files> directive provides for access control by
7259N/Afilename. It is comparable to the <
a 7259N/Ahref="#directory"><Directory></
a> directive and
7259N/A<
a href="#location"><Location></
a> directives. It
7259N/Ashould be matched with a </Files> directive. Directives that
7259N/Aapply to the filename given should be listed
7259N/Awithin. <
code><Files></
code> sections are processed in the
7259N/Aorder they appear in the configuration file, after the
7259N/A<Directory> sections and <
code>.htaccess</
code> files are
7259N/Aread, but before <Location> sections.</
p>
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 <Files ~ "\.(gif|jpe?g|png)$">
7259N/Awould match most common Internet graphics formats.
7259N/Ahref="#directory"><
code><Directory></
code></
a> and <
a 7259N/Ahref="#location"><
code><Location></
code></
a> sections,
7259N/A<
code><Files></
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<
A name="group"><
h2>Group directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt Group} directive> --> 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/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<
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/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/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/ASpecial note: Use of this directive in <VirtualHost> requires a
7259N/ASECURITY: See <
A HREF="#user">User</
A> for a discussion of the security
7259N/A<
A name="hostnamelookups"><
h2>HostNameLookups directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt HostNameLookups} directive> --> 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/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 <Limit> blocks for access control.<
p>
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<
A name="identitycheck"><
h2>IdentityCheck directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt IdentityCheck} directive> --> 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/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/AThe information should not be trusted in any way except for rudimentary usage
7259N/A<
A NAME="ifmodule"><
H2><IfModule></
H2></
A>
7259N/A<
b>Syntax:</
b> <IfModule [!]<
i>module-name</
i>> <
i>...</
i>
7259N/A<
strong>Compatibility:</
strong> ScriptLog is only available in 1.2 and
7259N/AThe <IfModule <
i>test</
i>>...</IfModule>
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/AThe <
i>test</
i> in the <IfModule> section directive
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<
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<
p><IfModule> sections are nest-able, which can be used to implement
7259N/Asimple multiple-module tests.
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/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<
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<
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/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/Ahref="#timeout"><
code>Timeout</
code></
a> directive
7259N/A<
A name="listen"><
h2>Listen</
h2></
A>
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/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/A<
p><
strong>See Also</
strong>:
7259N/A<
a href="/bind.html">Setting which addresses and ports Apache uses</
a></
p>
7259N/A<
A name="limit"><
h2><Limit> directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt Limit} section directive> --> 7259N/A <Limit <
em>method method</
em> ... > ... </Limit><
br>
7259N/A<
strong>Context:</
strong> any<
br>
7259N/A<
strong>Status:</
strong> core<
p>
7259N/A<Limit> and </Limit> 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 <Limit> or
7259N/A<
A HREF="#directory"><Directory></
A> may be used; the majority will be
7259N/Aunaffected by the <Limit>. Example:
7259N/A</Limit></
code></
blockquote>
7259N/AIf an access control directive appears outside a <Limit> directive,
7259N/Athen it applies to all access methods.<
p><
hr>
7259N/A<
h2><
a name="location"><Location></
a></
h2>
7259N/A<
strong>Syntax:</
strong> <Location <
em>URL</
em>>
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/A<
p>The <Location> directive provides for access control by
7259N/AURL. It is comparable to the <
a 7259N/Ahref="#directory"><Directory></
a> directive, and
7259N/Ashould be matched with a </Location> directive. Directives that
7259N/Aapply to the URL given should be listen
7259N/Awithin. <
code><Location></
code> sections are processed in the
7259N/Aorder they appear in the configuration file, after the
7259N/A<Directory> sections and <
code>.htaccess</
code> files are
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/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/A<
p><
strong>Apache 1.2 and above:</
strong>
7259N/AExtended regular expressions can also be used, with the addition of
7259N/A<
code>~</
code> character. For example:</
p>
7259N/A <Location ~ "/(extra|special)/data">
7259N/A<
p>The <
code>Location</
code> functionality is especially useful when
7259N/Ahref="mod_mime.html#sethandler">SetHandler</
a></
code> directive. For example, to enable status requests, but allow them only
7259N/A<
A name="maxclients"><
h2>MaxClients directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt MaxClients} directive> --> 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/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<
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/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/A<
A name="maxrequestsperchild"><
h2>MaxRequestsPerChild directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt MaxRequestsPerChild} directive> --> 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/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/ASetting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
7259N/A<
li>it limits the amount of memory that process can consume by (accidental)
7259N/A<
li> by giving processes a finite lifetime, it helps reduce the
7259N/Anumber of processes when the server load reduces.
7259N/A<
A name="maxspareservers"><
h2>MaxSpareServers directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt MaxSpareServers} directive> --> 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/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/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/ASee also <
A HREF="#minspareservers">MinSpareServers</
A> and
7259N/A<
A HREF="#startservers">StartServers</
A>.<
p><
hr>
7259N/A<
A name="minspareservers"><
h2>MinSpareServers directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt MinSpareServers} directive> --> 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/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/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/ASee also <
A HREF="#maxspareservers">MaxSpareServers</
A> and
7259N/A<
A HREF="#startservers">StartServers</
A>.<
p><
hr>
7259N/A<
A name="options"><
h2>Options directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt Options} directive> --> 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/AThe Options directive controls which server features are available in
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<
dd>All options except for MultiViews.
7259N/A<!--%plaintext <?INDEX {\tt ExecCGI} option> --> 7259N/AExecution of CGI scripts is permitted.
7259N/A<!--%plaintext <?INDEX {\tt FollowSymLinks} option> --> 7259N/AThe server will follow symbolic links in this directory.
7259N/A<!--%plaintext <?INDEX {\tt Includes} option> --> 7259N/AServer-side includes are permitted.
7259N/A<!--%plaintext <?INDEX {\tt IncludesNOEXEC} option> --> 7259N/AServer-side includes are permitted, but the #exec command and
7259N/A#include of CGI scripts are disabled.
7259N/A<!--%plaintext <?INDEX {\tt Indexes} option> --> 7259N/AIf a URL which maps to a directory is requested, and the there is no
7259N/Areturn a formatted listing of the directory.
7259N/A<!--%plaintext <?INDEX {\tt MultiViews} option> --> 7259N/A<!--%plaintext <?INDEX {\tt SymLinksIfOwnerMatch} option> --> 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/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/AFor example, without any + and - symbols:
7259N/AOptions Indexes FollowSymLinks<
br>
7259N/Adirectory. However if the second <
code>Options</
code> directive uses the +
7259N/AOptions Indexes FollowSymLinks<
br>
7259N/AOptions +Includes -Indexes<
br>
7259N/Athen the options <
code>FollowSymLinks</
code> and <
code>Includes</
code>
7259N/A<
A name="pidfile"><
h2>PidFile directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt PidFile} directive> --> 7259N/A<
strong>Syntax:</
strong> PidFile <
em>filename</
em><
br>
7259N/A<
strong>Context:</
strong> server config<
br>
7259N/A<
strong>Status:</
strong> core<
p>
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/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<
A name="port"><
h2>Port directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt Port} directive> --> 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/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/Afor a list of some defined ports; the standard port for the http protocol
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/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/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/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/A<
A name="require"><
h2>require directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt require} directive> --> 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/AThis directive selects which authenticated users can access a directory.
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/AAll valid users can access the directory.
7259N/AIf <
code>require</
code> appears in a <
A HREF="#limit"><Limit></
A>
7259N/Asection, then it restricts access to the named methods, otherwise
7259N/Ait restricts access for all methods. Example:
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/Agroups) in order to work correctly.<
p><
hr>
7259N/A<
A name="resourceconfig"><
h2>ResourceConfig directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ResourceConfig} directive> --> 7259N/A<
strong>Syntax:</
strong> ResourceConfig <
em>filename</
em><
br>
7259N/A<
strong>Context:</
strong> server config, virtual host<
br>
7259N/A<
strong>Status:</
strong> core<
p>
7259N/AThe server will read this file for more directives after reading the
7259N/A<
A HREF="#serverroot">ServerRoot</
A>.
7259N/AThis feature can be disabled using:
7259N/AHistorically, this file contained most directives except for server
7259N/Aconfiguration directives and <
A HREF="#directory"><Directory></
A>
7259N/Asections; in fact it can now contain any server directive allowed in the
7259N/A<
em>server config</
em> context.<
p>
7259N/ASee also <
A HREF="#accessconfig">AccessConfig</
A>.<
p><
hr>
7259N/A<
A name="rlimitcpu"><
h2>RLimitCPU directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt RLimitCPU} directive> --> 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/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/ACPU resource limits are expressed in seconds per process.<
p>
7259N/ASee also <
A HREF="#rlimitmem">RLimitMEM</
A> or <
A HREF="#rlimitnproc">RLimitNPROC</
A>.<
p><
hr>
7259N/A<
A name="rlimitmem"><
h2>RLimitMEM directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt RLimitMEM} directive> --> 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/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/AMemory resource limits are expressed in bytes per process.<
p>
7259N/ASee also <
A HREF="#rlimitcpu">RLimitCPU</
A> or <
A HREF="#rlimitnproc">RLimitNPROC</
A>.<
p><
hr>
7259N/A<
A name="rlimitnproc"><
h2>RLimitNPROC directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt RLimitNPROC} directive> --> 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/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/AProcess limits control the number of processes per user.<
p>
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/ASee also <
A HREF="#rlimitmem">RLimitMEM</
A> or <
A HREF="#rlimitcpu">RLimitCPU</
A>.
7259N/A<
A name="satisfy"><
h2>Satisfy</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt Satisfy} directive> --> 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/AAccess policy if both allow and require used. The parameter can be either
7259N/A<
em>'all'</
em> or <
em>'any'</
em>.
7259N/A<
A name="sendbuffersize"><
h2>SendBufferSize directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt SendBufferSize} directive> --> 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/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/A<
A name="serveradmin"><
h2>ServerAdmin directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ServerAdmin} directive> --> 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/AThe ServerAdmin sets the e-mail address that the server includes in any
7259N/Aerror messages it returns to the client.<
p>
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<
A name="serveralias"><
h2>ServerAlias directive</
h2></
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/AThe ServerAlias directive sets the alternate names for a host, for use
7259N/A<
A name="servername"><
h2>ServerName directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ServerName} directive> --> 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/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/Awould be used if the canonical (main) name of the actual machine
7259N/A<
A name="serverpath"><
h2>ServerPath directive</
h2></
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/AThe ServerPath directive sets the legacy URL pathname for a host, for
7259N/A<
A name="serverroot"><
h2>ServerRoot directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ServerRoot} directive> --> 7259N/A<
strong>Syntax:</
strong> ServerRoot <
em>directory-filename</
em><
br>
7259N/A<
strong>Context:</
strong> server config<
br>
7259N/A<
strong>Status:</
strong> core<
p>
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/A<
A name="servertype"><
h2>ServerType directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt ServerType} directive> --> 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/AThe ServerType directive sets how the server is executed by the system.
7259N/A<
dd>The server will be run from the system process inetd; the command to start
7259N/A<
dd>The server will run as a daemon process; the command to start the server
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/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/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<
A name="startservers"><
h2>StartServers directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt StartServers} directive> --> 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/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/ASee also <
A HREF="#minspareservers">MinSpareServers</
A> and
7259N/A<
A HREF="#maxspareservers">MaxSpareServers</
A>.<
p><
hr>
7259N/A<
A name="timeout"><
h2>TimeOut directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt TimeOut} directive> --> 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/AThe TimeOut directive currently defines the amount of time Apache will
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 <
LI>The amount of time between ACKs on transmissions of TCP packets
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<
A name="user"><
h2>User directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt User} directive> --> 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/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<
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/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/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/ASpecial note: Use of this directive in <VirtualHost> requires 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/A<
A name="virtualhost"><
h2><VirtualHost> directive</
h2></
A>
7259N/A<!--%plaintext <?INDEX {\tt VirtualHost} section directive> --> 7259N/A<
strong>Syntax:</
strong> <VirtualHost <
em>addr</
em>[:<
em>port</
em>]> ...
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<VirtualHost> and </VirtualHost> 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 <VirtualHost>
7259N/Asection. <
em>Addr</
em> can be
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/AServerAdmin webmaster@host.foo.com <
br>
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/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<
p><
strong>See also:</
strong>