This realm is given to the client so that the user knows which username and
It must be accompanied by <
A HREF="#authtype">AuthType</
A> and
<
A HREF="#require">require</
A> directives, and directives such as
<
A HREF="mod_auth.html#authgroupfile">AuthGroupFile</
A> to work.<
p><
hr>
<
A name="authtype"><
h2>AuthType directive</
h2></
A>
<!--%plaintext <?INDEX {\tt AuthType} directive> --> <
strong>Syntax:</
strong> AuthType <
em>type</
em><
br>
<
strong>Context:</
strong> directory, .htaccess<
br>
<
strong>Override:</
strong> AuthConfig<
br>
<
strong>Status:</
strong> core<
p>
This directive selects the type of user authentication for a directory.
Only <
code>Basic</
code> is currently implemented.
<!--%plaintext <?INDEX {\tt Basic} authentication scheme> --> It must be accompanied by <
A HREF="#authname">AuthName</
A> and
<
A HREF="#require">require</
A> directives, and directives such as
<
A HREF="mod_auth.html#authgroupfile">AuthGroupFile</
A> to work.<
p><
hr>
<
A name="clearmodulelist"><
h2>ClearModuleList directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ClearModuleList} directive> --> <
strong>Syntax:</
strong> ClearModuleList<
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> ClearModuleList is only available in Apache 1.2 and later<
p>
The server comes with a built-in list of active modules. This
directive clears the list. It is assumed that the list will then be
re-populated using the <
A HREF="#addmodule">AddModule</
A> directive.<
p><
hr>
<
A name="bindaddress"><
h2>BindAddress directive</
h2></
A>
<!--%plaintext <?INDEX {\tt BindAddress} directive> --> <
strong>Syntax:</
strong> BindAddress <
em>saddr</
em><
br>
<
strong>Default:</
strong> <
code>BindAddress *</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
A Unix® http server can either listen for connections to every
IP address of the server machine, or just one IP address of the server
machine. <
em>Saddr</
em> can be
<
li>A fully-qualified internet domain name
If the value is *, then the server will listen for connections on
every IP address, otherwise it will only listen on the IP address
This option can be used as an alternative method for supporting
<
A HREF="#virtualhost"><VirtualHost></
A> sections.
<
p><
strong>See Also:</
strong>
<
strong>See Also:</
strong>
<
a href="/bind.html">Setting which addresses and ports Apache uses</
a></
p>
<
A name="defaulttype"><
h2>DefaultType directive</
h2></
A>
<!--%plaintext <?INDEX {\tt DefaultType} directive> --> <
strong>Syntax:</
strong> DefaultType <
em>mime-type</
em><
br>
<
strong>Default:</
strong> <
code>DefaultType
text/
html</
code><
br>
<
strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
<
strong>Override:</
strong> FileInfo<
br>
<
strong>Status:</
strong> core<
p>
There will be times when the server is asked to provide a document
whose type cannot be determined by its MIME types mappings.<
p>
The server must inform the client of the content-type of the document, so in
the event of an unknown type it uses the <
CODE>DefaultType</
CODE>. For
<
blockquote><
code>DefaultType
image/
gif</
code></
blockquote>
would be appropriate for a directory which contained many gif images
with filenames missing the .gif extension.<
p><
hr>
<
A name="directory"><
h2><Directory> directive</
h2></
A>
<!--%plaintext <?INDEX {\tt Directory} section directive> --> <
strong>Syntax:</
strong> <Directory <
em>directory</
em>> ... </Directory> <
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> Core. <
p>
<Directory> and </Directory> are used to enclose a group of
directives which will apply only to the named directory and sub-directories
of that directory. Any directive which is allowed in a directory
context may be used. <
em>Directory</
em> is either the full path to a directory,
or a wild-card string. In a wild-card string, `?' matches any single character,
and `*' matches any sequences of characters. Example:
Options Indexes FollowSymLinks
<
p><
strong>Apache 1.2 and above:</
strong>
Extended regular expressions can also be used, with the addition of the
<
code>~</
code> character. For example:</
p>
<Directory ~ "^/www/.*/[0-9]{3}">
would match directories in /www/ that consisted of three numbers.<
p>
<
p>If multiple directory sections match the directory (or its parents) containing
a document, then the directives are applied in the order of shortest match
first, interspersed with the directives from the
<
A HREF="#accessfilename">.htaccess</
A> files. For example, with
</Directory><
br><
br>
<Directory /home/*><
br>
AllowOverride FileInfo<
br>
</Directory></
code></
blockquote>
<
li>Apply directive <
code>AllowOverride None</
code> (disabling
<
code>.htaccess</
code> files).
<
li>Apply directive <
code>AllowOverride FileInfo</
code> (for directory
Note that the default Apache access for <Directory /> is
<
SAMP>Allow from All</
SAMP>. This means that Apache will serve any file
mapped from an URL. It is recommended that you change this with a block
and then override this for directories you <
EM>want</
EM> accessible.
The directory sections typically occur in the
access.conf file, but they
may appear in any configuration file. <Directory> directives cannot
nest, and cannot appear in a <
A HREF="#limit"><Limit></
A> section.
<
A NAME="documentroot"><
h2>DocumentRoot directive</
h2></
A>
<!--%plaintext <?INDEX {\tt DocumentRoot} directive> --> <
strong>Syntax:</
strong> DocumentRoot <
em>directory-filename</
em><
br>
<
strong>Default:</
strong> <
code>DocumentRoot
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
This directive sets the directory from which httpd will serve files.
Unless matched by a directive like Alias, the server appends the path
from the requested URL to the document root to make the path to the
<
blockquote><
code>DocumentRoot /
usr/
web</
code></
blockquote>
<
P>There appears to be a bug in mod_dir which causes problems when the
DocumentRoot has a trailing slash (
i.e. "DocumentRoot /
usr/
web/") so
<
A name="errordocument"><
h2>ErrorDocument directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ErrorDocument} directive> --> <
strong>Syntax:</
strong> ErrorDocument <
em>error-code document</
em><
br>
<
strong>Context</
strong> server config, virtual host, directory, .htaccess<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Override:</
strong> FileInfo<
br>
<
strong>Compatibility:</
strong> The directory and .htaccess contexts
are only available in Apache 1.1 and later.<
p>
In the event of a problem or error, Apache can be configured to do
<
LI>output a simple hardcoded error message
<
LI>output a customized message
<
P>The first option is the default, while options 2-4 are configured
using the <
CODE>ErrorDocument</
CODE> directive, which is followed by
the HTTP response code and a message or URL.
<
P><
em>Messages</
em> in this context begin with a single quote
(<
code>"</
code>), which does not form part of the message itself.
Apache will sometimes offer additional information regarding the
<
P>URLs can begin with a slash (/) for local URLs, or be a full
URL which the client can resolve. Examples:
ErrorDocument 403 "Sorry can't allow you access today
<
P>Note that when you specify an <
CODE>ErrorDocument</
CODE> that
points to a remote URL (ie. anything with a method such as "http" in
front of it) Apache will send a redirect to the client to tell it
where to find the document, even if the document ends up being
on the same server.. This has several implications, the
most important being that <
STRONG>if you use an "ErrorDocument 401"
directive then it must refer to a local document.</
STRONG> This results
from the nature of the HTTP basic authentication scheme.
<
A name="errorlog"><
h2>ErrorLog directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ErrorLog} directive> --> <
strong>Syntax:</
strong> ErrorLog <
em>filename</
em><
br>
<
strong>Default:</
strong> <
code>ErrorLog
logs/
error_log</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The error log directive sets the name of the file to which the server will log
any errors it encounters. If the filename does not begin with a slash (/)
then it is assumed to be relative to the <
A HREF="#serverroot">ServerRoot</
A>.
<
blockquote><
code>ErrorLog /
dev/
null</
code></
blockquote>
This effectively turns off error logging.<
p>
document for details on why your security could be compromised if
the directory where logfiles are stored is writable by anyone other
than the user that starts the server.
<
A name="files"><
h2><Files></
h2></
A>
<
strong>Syntax:</
strong> <Files <
em>filename</
em>>
<
strong>Context:</
strong> server config, virtual host, htaccess<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> only available in Apache
<
p>The <Files> directive provides for access control by
filename. It is comparable to the <
ahref="#directory"><Directory></
a> directive and
<
a href="#location"><Location></
a> directives. It
should be matched with a </Files> directive. Directives that
apply to the filename given should be listed
within. <
code><Files></
code> sections are processed in the
order they appear in the configuration file, after the
<Directory> sections and <
code>.htaccess</
code> files are
read, but before <Location> sections.</
p>
<
p>The <
em>filename</
em> argument should include a filename, or a
wild-card string, where `?' matches any single character, and `*' matches any
sequences of characters. Extended regular expressions can also be used, with the addition of
the <
code>~</
code> character. For example:</
p>
<Files ~ "\.(gif|jpe?g|png)$">
would match most common Internet graphics formats.
href="#directory"><
code><Directory></
code></
a> and <
a href="#location"><
code><Location></
code></
a> sections,
<
code><Files></
code> sections can be used inside .htaccess
files. This allows users to control access to their own files, at a
file-by-file level. When used in an .htaccess file, if the
<
em>filename</
em> does not begin with a <
code>/</
code> character,
the directory being applied will be prefixed automatically.
<
A name="group"><
h2>Group directive</
h2></
A>
<!--%plaintext <?INDEX {\tt Group} directive> --> <
strong>Syntax:</
strong> Group <
em>unix-group</
em><
br>
<
strong>Default:</
strong> <
code>Group #-1</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The Group directive sets the group under which the server will answer requests.
In order to use this directive, the stand-alone server must be run initially
as root. <
em>Unix-group</
em> is one of:
<
dd>Refers to the given group by name.
<
dt># followed by a group number.
<
dd>Refers to a group by its number.
It is recommended that you set up a new group specifically for running the
server. Some admins use user <
code>nobody</
code>, but this is not always
possible or desirable.<
p>
Note: if you start the server as a non-root user, it will fail to change
to the specified group, and will instead continue to run as the group of the
Special note: Use of this directive in <VirtualHost> requires a
properly configured <
A HREF="/suexec.html">SUEXEC wrapper</
A>.<
p>
SECURITY: See <
A HREF="#user">User</
A> for a discussion of the security
<
A name="hostnamelookups"><
h2>HostNameLookups directive</
h2></
A>
<!--%plaintext <?INDEX {\tt HostNameLookups} directive> --> <
strong>Syntax:</
strong> HostNameLookups <
em>boolean</
em><
br>
<
strong>Default:</
strong> <
code>HostNameLookups on</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
This directive enables DNS lookups so that host names can be logged.
Having this directive set <
code>on</
code> also enables the use of names
in <Limit> blocks for access control.<
p>
Heavily loaded sites should set this directive <
code>off</
code>, since DNS
lookups can take considerable amounts of time. The utility <
i>logresolve</
i>,
provided in the <
i>/support</
i> directory, can be used to look up host names
from logged IP addresses offline.<
p><
hr>
<
A name="identitycheck"><
h2>IdentityCheck directive</
h2></
A>
<!--%plaintext <?INDEX {\tt IdentityCheck} directive> --> <
strong>Syntax:</
strong> IdentityCheck <
em>boolean</
em><
br>
<
strong>Default:</
strong> <
code>IdentityCheck off</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
This directive enables RFC1413-compliant logging of the remote user name
for each connection, where the client machine runs identd or something similar.
This information is logged in the access log. <
em>Boolean</
em> is either
<
code>on</
code> or <
code>off</
code>.<
p>
The information should not be trusted in any way except for rudimentary usage
Note that this can cause serious latency problems accessing your server
since every request requires one of these lookups to be performed. When
firewalls are involved each lookup might possibly fail and add 30 seconds
of latency to each hit. So in general this is not very useful on public
servers accessible from the internet.
<
A NAME="ifmodule"><
H2><IfModule></
H2></
A>
<
b>Syntax:</
b> <IfModule [!]<
i>module-name</
i>> <
i>...</
i>
<
strong>Compatibility:</
strong> ScriptLog is only available in 1.2 and
The <IfModule <
i>test</
i>>...</IfModule>
section is used to mark directives that are conditional. The
directives within an IfModule section are only
processed if the <
i>test</
i> is true. If <
i>test</
i>
is false, everything between the start and end markers
The <
i>test</
i> in the <IfModule> section directive
<
p>In the former case, the directives between the start and end markers
are only processed if the module named <
i>module name</
i> is compiled
in to Apache. The second format reverses the test, and only processes
the directives if <
i>module name</
i> is <
b>not</
b> compiled in.
<
p>The <
i>module name</
i> argument is a module name as given as the file
name of the module, at the time it was compiled. For example,
<
p><IfModule> sections are nest-able, which can be used to implement
simple multiple-module tests.
<
h2><
a name="keepalive">KeepAlive</
a></
h2>
<
strong>Syntax: (Apache 1.1)</
strong> KeepAlive <
em>max-requests</
em><
br>
<
strong>Default: (Apache 1.1)</
strong> <
code>KeepAlive 5</
code><
br>
<
strong>Syntax: (Apache 1.2)</
strong> KeepAlive <
em>
on/
off</
em><
br>
<
strong>Default: (Apache 1.2)</
strong> <
code>KeepAlive On</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> Core<
br>
<
strong>Compatibility:</
strong> KeepAlive is only available in Apache
<
p><
strong>Apache 1.1</
strong>: Set <
em>max-requests</
em>
to the maximum number of requests you want Apache to entertain per
request. A limit is imposed to prevent a client from hogging your
server resources. Set this to <
code>0</
code> to disable support.
<
p><
strong>Apache 1.2 and later</
strong>: Set to "On" to enable
persistent connections, "Off" to disable. See also the <
ahref="#maxkeepaliverequests">MaxKeepAliveRequests</
a> directive.</
p>
<
h2><
a name="keepalivetimeout">KeepAliveTimeout</
a></
h2>
<
strong>Syntax:</
strong> KeepAliveTimeout <
em>seconds</
em><
br>
<
strong>Default:</
strong> <
code>KeepAliveTimeout 15</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> Core<
br>
<
strong>Compatibility:</
strong> KeepAliveTimeout is only available in Apache
The number of seconds Apache will wait for a subsequent request before
closing the connection. Once a request has been received, the timeout
value specified by the <
ahref="#timeout"><
code>Timeout</
code></
a> directive
<
A name="listen"><
h2>Listen</
h2></
A>
Listen [<
em>IP address</
em>:]<
em>port number</
em><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> Listen is only available in Apache
<
p>The Listen directive instructs Apache to listen to more than one IP
address or port; by default it responds to requests on all IP
interfaces, but only on the port given by the <
a href="#port">Port</
a>
<
p><
strong>See Also:</
strong>
<
strong>See Also:</
strong>
<
a href="/bind.html">Setting which addresses and ports Apache uses</
a></
p>
<
A name="limit"><
h2><Limit> directive</
h2></
A>
<!--%plaintext <?INDEX {\tt Limit} section directive> --> <Limit <
em>method method</
em> ... > ... </Limit><
br>
<
strong>Context:</
strong> any<
br>
<
strong>Status:</
strong> core<
p>
<Limit> and </Limit> are used to enclose a group of
access control directives which will then apply only to the specified
access methods, where <
em>method</
em> is any valid HTTP method.
Any directive except another <Limit> or
<
A HREF="#directory"><Directory></
A> may be used; the majority will be
unaffected by the <Limit>. Example:
<Limit GET POST><
br>
</Limit></
code></
blockquote>
If an access control directive appears outside a <Limit> directive,
then it applies to all access methods.<
p><
hr>
<
h2><
a name="location"><Location></
a></
h2>
<
strong>Syntax:</
strong> <Location <
em>URL</
em>>
... </Location><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> Location is only available in Apache
<
p>The <Location> directive provides for access control by
URL. It is comparable to the <
ahref="#directory"><Directory></
a> directive, and
should be matched with a </Location> directive. Directives that
apply to the URL given should be listed
within. <
code><Location></
code> sections are processed in the
order they appear in the configuration file, after the
<Directory> sections and <
code>.htaccess</
code> files are
<
p>Note that, due to the way HTTP functions, <
em>URL prefix</
em>
should, save for proxy requests, be of the form <
code>/path/</
code>,
necessarily have to protect a directory (it can be an individual
file, or a number of files), and can include wild-cards. In a wild-card
string, `?' matches any single character, and `*' matches any
<
p><
strong>Apache 1.2 and above:</
strong>
Extended regular expressions can also be used, with the addition of
<
code>~</
code> character. For example:</
p>
<Location ~ "/(extra|special)/data">
would match URLs that contained the substring "/
extra/
data" or
<
p>The <
code>Location</
code> functionality is especially useful when
combined with the <
code><
ahref="mod_mime.html#sethandler">SetHandler</
a></
code> directive. For example, to enable status requests, but allow them only
from browsers at
foo.com, you might use:
<
A name="maxclients"><
h2>MaxClients directive</
h2></
A>
<!--%plaintext <?INDEX {\tt MaxClients} directive> --> <
strong>Syntax:</
strong> MaxClients <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>MaxClients 256</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The MaxClients directive sets the limit on the number of simultaneous
requests that can be supported; not more than this number of child server
processes will be created.<
p><
hr>
<
A name="maxkeepaliverequests"><
h2>MaxKeepAliveRequests</
h2></
A>
<
strong>Syntax:</
strong> MaxKeepAliveRequests <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>MaxKeepAliveRequests 100</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> Only available in Apache
<
p>The MaxKeepAliveRequests directive limits the number of requests
allowed per connection when <
a href="#keepalive">KeepAlive</
a> is
on. If it is set to "<
code>0</
code>", unlimited requests will be
allowed. We recommend that this setting be kept to a high value for
maximum server peformance.
<
A name="maxrequestsperchild"><
h2>MaxRequestsPerChild directive</
h2></
A>
<!--%plaintext <?INDEX {\tt MaxRequestsPerChild} directive> --> <
strong>Syntax:</
strong> MaxRequestsPerChild <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>MaxRequestsPerChild 0</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The MaxRequestsPerChild directive sets the limit on the number of requests
that an individual child server process will handle. After MaxRequestsPerChild
requests, the child process will die. If MaxRequestsPerChild is 0, then
the process will never expire.<
p>
Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
<
li>it limits the amount of memory that process can consume by (accidental)
<
li> by giving processes a finite lifetime, it helps reduce the
number of processes when the server load reduces.
<
A name="maxspareservers"><
h2>MaxSpareServers directive</
h2></
A>
<!--%plaintext <?INDEX {\tt MaxSpareServers} directive> --> <
strong>Syntax:</
strong> MaxSpareServers <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>MaxSpareServers 10</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The MaxSpareServers directive sets the desired maximum number of <
em>idle</
em>
child server processes. An idle process is one which is not handling
a request. If there are more than MaxSpareServers idle, then the parent
process will kill off the excess processes.<
p>
Tuning of this parameter should only be necessary on very busy sites.
Setting this parameter to a large number is almost always a bad idea.<
p>
See also <
A HREF="#minspareservers">MinSpareServers</
A> and
<
A HREF="#startservers">StartServers</
A>.<
p><
hr>
<
A name="minspareservers"><
h2>MinSpareServers directive</
h2></
A>
<!--%plaintext <?INDEX {\tt MinSpareServers} directive> --> <
strong>Syntax:</
strong> MinSpareServers <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>MinSpareServers 5</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The MinSpareServers directive sets the desired minimum number of <
em>idle</
em>
child server processes. An idle process is one which is not handling
a request. If there are fewer than MinSpareServers idle, then the parent
process creates new children at a maximum rate of 1 per second.<
p>
Tuning of this parameter should only be necessary on very busy sites.
Setting this parameter to a large number is almost always a bad idea.<
p>
See also <
A HREF="#maxspareservers">MaxSpareServers</
A> and
<
A HREF="#startservers">StartServers</
A>.<
p><
hr>
<
A name="options"><
h2>Options directive</
h2></
A>
<!--%plaintext <?INDEX {\tt Options} directive> --> <
strong>Syntax:</
strong> Options <
em>[+|-]option [+|-]option ...</
em><
br>
<
strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
<
strong>Override:</
strong> Options<
br>
<
strong>Status:</
strong> core<
p>
The Options directive controls which server features are available in
<
em>option</
em> can be set to <
code>None</
code>, in which case none of
the extra features are enabled, or one or more of the following:
<
dd>All options except for MultiViews.
<!--%plaintext <?INDEX {\tt ExecCGI} option> --> Execution of CGI scripts is permitted.
<!--%plaintext <?INDEX {\tt FollowSymLinks} option> --> The server will follow symbolic links in this directory.
<!--%plaintext <?INDEX {\tt Includes} option> --> Server-side includes are permitted.
<!--%plaintext <?INDEX {\tt IncludesNOEXEC} option> --> Server-side includes are permitted, but the #exec command and
#include of CGI scripts are disabled.
<!--%plaintext <?INDEX {\tt Indexes} option> --> If a URL which maps to a directory is requested, and the there is no
DirectoryIndex (
e.g. index.html) in that directory, then the server will
return a formatted listing of the directory.
<!--%plaintext <?INDEX {\tt MultiViews} option> --> <!--%plaintext <?INDEX {\tt SymLinksIfOwnerMatch} option> --> The server will only follow symbolic links for which the target
file or directory is owned by the same user id as the link.
Normally, if multiple <
code>Options</
code> could apply to a directory,
then the most specific one is taken complete; the options are not
merged. However if <
i>all</
i> the options on the <
code>Options</
code>
directive are preceded by a + or - symbol, the options are
merged. Any options preceded by a + are added to the options
currently in force, and any options preceded by a - are removed from
the options currently in force. <
P>
For example, without any + and - symbols:
Options Indexes FollowSymLinks<
br>
then only <
code>Includes</
code> will be set for the /
web/
docs/
specdirectory. However if the second <
code>Options</
code> directive uses the +
Options Indexes FollowSymLinks<
br>
Options +Includes -Indexes<
br>
then the options <
code>FollowSymLinks</
code> and <
code>Includes</
code>
<
A name="pidfile"><
h2>PidFile directive</
h2></
A>
<!--%plaintext <?INDEX {\tt PidFile} directive> --> <
strong>Syntax:</
strong> PidFile <
em>filename</
em><
br>
<
strong>Default:</
strong> <
code>PidFile
logs/
httpd.pid</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The PidFile directive sets the file to which the server records the
process id of the daemon. If the filename does not begin with a slash (/)
then it is assumed to be relative to the <
A HREF="#serverroot">ServerRoot</
A>.
The PidFile is only used in <
A HREF="#servertype">standalone</
A> mode.<
p>
It is often useful to be able to send the server a signal, so that it closes
and then reopens its <
A HREF="#errorlog">ErrorLog</
A> and TransferLog, and
re-reads its configuration files. This is done by sending a SIGHUP (kill -1)
signal to the process id listed in the PidFile.<
p>
The PidFile is subject to the same warnings about log file placement and
<
A name="port"><
h2>Port directive</
h2></
A>
<!--%plaintext <?INDEX {\tt Port} directive> --> <
strong>Syntax:</
strong> Port <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>Port 80</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The Port directive sets the network port on which the server listens.
<
em>Num</
em> is a number from 0 to 65535; some port numbers (especially below
1024) are reserved for particular protocols. See <
code>/
etc/
services</
code>
for a list of some defined ports; the standard port for the http protocol
Port 80 is one of Unix's special ports. All ports numbered
below 1024 are reserved for system use,
i.e. regular (non-root) users cannot
make use of them; instead they can only use higher port numbers.<
p>
To use port 80, you must start the server from the root account.
After binding to the port and before accepting requests, Apache will change
to a low privileged user as set by the <
A HREF="#user">User directive</
A>.<
p>
If you cannot use port 80, choose any other unused port. Non-root users
will have to choose a port number higher than 1023, such as 8000.<
p>
SECURITY: if you do start the server as root, be sure
not to set <
A HREF="#user">User</
A> to root. If you run the server as
root whilst handling connections, your site may be open to a major security
<
A name="require"><
h2>require directive</
h2></
A>
<!--%plaintext <?INDEX {\tt require} directive> --> <
strong>Syntax:</
strong> require <
em>entity-name entity entity...</
em><
br>
<
strong>Context:</
strong> directory, .htaccess<
br>
<
strong>Override:</
strong> AuthConfig<
br>
<
strong>Status:</
strong> core<
p>
This directive selects which authenticated users can access a directory.
The allowed syntaxes are:
<
li>require user <
em>userid userid ...</
em><
p>
Only the named users can access the directory.<
p>
<
li>require group <
em>group-name group-name ...</
em><
p>
Only users in the named groups can access the directory.<
p>
<
li>require valid-user<
p>
All valid users can access the directory.
If <
code>require</
code> appears in a <
A HREF="#limit"><Limit></
A>
section, then it restricts access to the named methods, otherwise
it restricts access for all methods. Example:
<Limit GET POST><
br>
Require must be accompanied by <
A HREF="#authname">AuthName</
A> and
<
A HREF="#authtype">AuthType</
A> directives, and directives such as
<
A HREF="mod_auth.html#authgroupfile">AuthGroupFile</
A> (to define users and
groups) in order to work correctly.<
p><
hr>
<
A name="resourceconfig"><
h2>ResourceConfig directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ResourceConfig} directive> --> <
strong>Syntax:</
strong> ResourceConfig <
em>filename</
em><
br>
<
strong>Default:</
strong> <
code>ResourceConfig
conf/
srm.conf</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The server will read this file for more directives after reading the
httpd.conf file. <
em>Filename</
em> is relative to the
<
A HREF="#serverroot">ServerRoot</
A>.
This feature can be disabled using:
<
blockquote><
code>ResourceConfig /
dev/
null</
code></
blockquote>
Historically, this file contained most directives except for server
configuration directives and <
A HREF="#directory"><Directory></
A>
sections; in fact it can now contain any server directive allowed in the
<
em>server config</
em> context.<
p>
See also <
A HREF="#accessconfig">AccessConfig</
A>.<
p><
hr>
<
A name="rlimitcpu"><
h2>RLimitCPU directive</
h2></
A>
<!--%plaintext <?INDEX {\tt RLimitCPU} directive> --> <
strong>Syntax:</
strong> RLimitCPU <
em># or 'max'</
em> <
em>[# or 'max']</
em><
br>
<
strong>Default:</
strong> <
code>Unset uses operating system defaults</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> RLimitCPU is only available in Apache 1.2 and later<
p>
Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all
processes and the second parameter sets the maximum resource limit. Either parameter
can be a number, or <
em>max</
em> to indicate to the server that the limit should
be set to the maximum allowed by the operating system configuration. Raising the
maximum resource limit requires that the server is running as root, or in the initial
CPU resource limits are expressed in seconds per process.<
p>
See also <
A HREF="#rlimitmem">RLimitMEM</
A> or <
A HREF="#rlimitnproc">RLimitNPROC</
A>.<
p><
hr>
<
A name="rlimitmem"><
h2>RLimitMEM directive</
h2></
A>
<!--%plaintext <?INDEX {\tt RLimitMEM} directive> --> <
strong>Syntax:</
strong> RLimitMEM <
em># or 'max'</
em> <
em>[# or 'max']</
em><
br>
<
strong>Default:</
strong> <
code>Unset uses operating system defaults</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> RLimitMEM is only available in Apache 1.2 and later<
p>
Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all
processes and the second parameter sets the maximum resource limit. Either parameter
can be a number, or <
em>max</
em> to indicate to the server that the limit should
be set to the maximum allowed by the operating system configuration. Raising the
maximum resource limit requires that the server is running as root, or in the initial
Memory resource limits are expressed in bytes per process.<
p>
See also <
A HREF="#rlimitcpu">RLimitCPU</
A> or <
A HREF="#rlimitnproc">RLimitNPROC</
A>.<
p><
hr>
<
A name="rlimitnproc"><
h2>RLimitNPROC directive</
h2></
A>
<!--%plaintext <?INDEX {\tt RLimitNPROC} directive> --> <
strong>Syntax:</
strong> RLimitNPROC <
em># or 'max'</
em> <
em>[# or 'max']</
em><
br>
<
strong>Default:</
strong> <
code>Unset uses operating system defaults</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> RLimitNPROC is only available in Apache 1.2 and later<
p>
Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all
processes and the second parameter sets the maximum resource limit. Either parameter
can be a number, or <
em>max</
em> to indicate to the server that the limit should
be set to the maximum allowed by the operating system configuration. Raising the
maximum resource limit requires that the server is running as root, or in the initial
Process limits control the number of processes per user.<
p>
Note: If CGI processes are <
b>not</
b> running under userids other than the
web server userid, this directive will limit the number of processes that the
server itself can create. Evidence of this situation will be indicated by
<
b><
em>cannot fork</
em></
b> messages in the error_log.<
p>
See also <
A HREF="#rlimitmem">RLimitMEM</
A> or <
A HREF="#rlimitcpu">RLimitCPU</
A>.
<
A name="satisfy"><
h2>Satisfy</
h2></
A>
<!--%plaintext <?INDEX {\tt Satisfy} directive> --> <
strong>Syntax:</
strong> Satisfy <
em>'any' or 'all'</
em><
br>
<
strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> Satisfy is only available in Apache 1.2 and later<
p>
Access policy if both allow and require used. The parameter can be either
<
em>'all'</
em> or <
em>'any'</
em>.
<
A name="scoreboardfile"><
h2>ScoreBoardFile directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ScoreBoardFile} directive> --> <
strong>Syntax:</
strong> ScoreBoardFile <
em>filename</
em><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The ScoreBoardFile directive is required on some architectures to place
a file that the server will use to communicate between its children and
the parent. The easiest way to find out if your architecture requires
a scoreboard file is to run Apache and see if it creates the file named
by the directive. If your architecture requires it then you must ensure
that this file is not used at the same time by more than one invocation
If you have to use a ScoreBoardFile then you may see improved speed by
placing it on a RAM disk. But be careful that you heed the same warnings
about log file placement and
<
A name="sendbuffersize"><
h2>SendBufferSize directive</
h2></
A>
<!--%plaintext <?INDEX {\tt SendBufferSize} directive> --> <
strong>Syntax:</
strong> SendBufferSize <
em>bytes</
em><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The server will set the TCP buffer size to the number of bytes
specified. Very useful to increase past standard OS defaults on high
speed high latency (
i.e. 100ms or so, such as transcontinental
<
A name="serveradmin"><
h2>ServerAdmin directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerAdmin} directive> --> <
strong>Syntax:</
strong> ServerAdmin <
em>email-address</
em><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The ServerAdmin sets the e-mail address that the server includes in any
error messages it returns to the client.<
p>
It may be worth setting up a dedicated address for this,
e.g.<
blockquote><
code>ServerAdmin www-admin@foo.bar.com</
code></
blockquote>
as users do not always mention that they are talking about the server!<
p><
hr>
<
A name="serveralias"><
h2>ServerAlias directive</
h2></
A>
<
strong>Syntax:</
strong> ServerAlias <
em>host1 host2 ...</
em><
br>
<
strong>Context:</
strong> virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> ServerAlias is only available in Apache
The ServerAlias directive sets the alternate names for a host, for use
<
a href="/host.html">Host-header based virtual hosts</
a>.
<
p><
strong>See Also</
strong>:
<
A name="servername"><
h2>ServerName directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerName} directive> --> <
strong>Syntax:</
strong> ServerName <
em>fully-qualified domain name</
em><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The ServerName directive sets the hostname of the server; this is only
used when creating redirection URLs. If it is not specified, then the
server attempts to deduce it from its own IP address; however this may
not work reliably, or may not return the preferred hostname. For example:
would be used if the canonical (main) name of the actual machine
<
p><
strong>See Also</
strong>:
<
A name="serverpath"><
h2>ServerPath directive</
h2></
A>
<
strong>Syntax:</
strong> ServerPath <
em>pathname</
em><
br>
<
strong>Context:</
strong> virtual host<
br>
<
strong>Status:</
strong> core<
br>
<
strong>Compatibility:</
strong> ServerPath is only available in Apache
The ServerPath directive sets the legacy URL pathname for a host, for
use with <
a href="/host.html">Host-header based virtual hosts</
a>.
<
p><
strong>See Also</
strong>:
<
A name="serverroot"><
h2>ServerRoot directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerRoot} directive> --> <
strong>Syntax:</
strong> ServerRoot <
em>directory-filename</
em><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The ServerRoot directive sets the directory in which the server lives.
Typically it will contain the subdirectories <
code>conf/</
code> and
<
code>logs/</
code>. Relative paths for other configuration files are taken
as relative to this directory.<
br>
See also <
a href="/invoking.html">the <
code>-d</
code> option to httpd</
a>.<
p><
hr>
<
A name="servertype"><
h2>ServerType directive</
h2></
A>
<!--%plaintext <?INDEX {\tt ServerType} directive> --> <
strong>Syntax:</
strong> ServerType <
em>type</
em><
br>
<
strong>Default:</
strong> <
code>ServerType standalone</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The ServerType directive sets how the server is executed by the system.
<
dd>The server will be run from the system process inetd; the command to start
<
dd>The server will run as a daemon process; the command to start the server
is added to the system startup scripts. (<
code>/
etc/
rc.local</
code> or
Inetd is the lesser used of the two options. For each http
connection received, a new copy of the server is started from scratch;
after the connection is complete, this program exits. There is a high price to
pay per connection, but for security reasons, some admins prefer this option.
Standalone is the most common setting for ServerType since
it is far more efficient. The server is started once, and services all
subsequent connections. If you intend running Apache to serve a busy site,
standalone will probably be your only option.<
p>
SECURITY: if you are paranoid about security, run in inetd mode. Security
cannot be guaranteed in either, but whilst most people are happy to use
standalone, inetd is probably least prone to attack.<
p><
hr>
<
A name="startservers"><
h2>StartServers directive</
h2></
A>
<!--%plaintext <?INDEX {\tt StartServers} directive> --> <
strong>Syntax:</
strong> StartServers <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>StartServers 5</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The StartServers directive sets the number of child server processes created
on startup. As the number of processes is dynamically controlled depending
on the load, there is usually little reason to adjust this parameter.<
p>
See also <
A HREF="#minspareservers">MinSpareServers</
A> and
<
A HREF="#maxspareservers">MaxSpareServers</
A>.<
p><
hr>
<
A name="timeout"><
h2>TimeOut directive</
h2></
A>
<!--%plaintext <?INDEX {\tt TimeOut} directive> --> <
strong>Syntax:</
strong> TimeOut <
em>number</
em><
br>
<
strong>Default:</
strong> <
code>TimeOut 300</
code><
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> core<
p>
The TimeOut directive currently defines the amount of time Apache will
<
LI>The total amount of time it takes to receive a GET request.
<
LI>The amount of time between receipt of TCP packets on a POST or
<
LI>The amount of time between ACKs on transmissions of TCP packets
We plan on making these separately configurable at some point down the
road. The timer used to default to 1200 before 1.2, but has been
lowered to 300 which is still far more than necessary in most
situations. It is not set any lower by default because there may
still be odd places in the code where the timer is not reset when
<
A name="user"><
h2>User directive</
h2></
A>
<!--%plaintext <?INDEX {\tt User} directive> --> <
strong>Syntax:</
strong> User <
em>unix-userid</
em><
br>
<
strong>Default:</
strong> <
code>User #-1</
code><
br>
<
strong>Context:</
strong> server config, virtual host<
br>
<
strong>Status:</
strong> core<
p>
The User directive sets the userid as which the server will answer requests.
In order to use this directive, the standalone server must be run initially
as root. <
em>Unix-userid</
em> is one of:
<
dd>Refers to the given user by name.
<
dt># followed by a user number.
<
dd>Refers to a user by their number.
The user should have no privileges which result in it being able to access
files which are not intended to be visible to the outside world, and
similarly, the user should not be able to execute code which is not
meant for httpd requests. It is recommended that you set up a new user and
group specifically for running the server. Some admins use user
<
code>nobody</
code>, but this is not always possible or desirable.<
p>
Notes: If you start the server as a non-root user, it will fail to change
to the lesser privileged user, and will instead continue to run as
that original user. If you do start the server as root, then it is normal
for the parent process to remain running as root.<
p>
Special note: Use of this directive in <VirtualHost> requires a
properly configured <
A HREF="/suexec.html">SUEXEC wrapper</
A>.<
p>
SECURITY: Don't set User (or <
A HREF="#group">Group</
A>) to
<
code>root</
code> unless you know exactly what you are doing, and what the
<
A name="virtualhost"><
h2><VirtualHost> directive</
h2></
A>
<!--%plaintext <?INDEX {\tt VirtualHost} section directive> --> <
strong>Syntax:</
strong> <VirtualHost <
em>addr</
em>[:<
em>port</
em>] ...> ...
</VirtualHost> <
br>
<
strong>Context:</
strong> server config<
br>
<
strong>Status:</
strong> Core.<
br>
<
strong>Compatibility:</
strong> Non-IP address-based Virtual Hosting only
available in Apache 1.1 and later.<
br>
<
strong>Compatibility:</
strong> Multiple address support only available in
<VirtualHost> and </VirtualHost> are used to enclose a group of
directives which will apply only to a particular virtual host.
Any directive which is allowed in a virtual host context may be used.
When the server receives a request for a document on a particular virtual
host, it uses the configuration directives enclosed in the <VirtualHost>
section. <
em>Addr</
em> can be
<
li>The IP address of the virtual host
<
li>A fully qualified domain name for the IP address of the virtual host.
ServerAdmin webmaster@host.foo.com <
br>
Each VirtualHost must correspond to a different IP address or a
different host name for the server, in the latter case the server
machine must be configured to accept IP packets for multiple
addresses. (If the machine does not have multiple network interfaces,
then this can be accomplished with the <
code>ifconfig alias</
code>
command (if your OS supports it), or with kernel patches like <
AThe special name <
code>_default_</
code> can be specified in which case
this virtual host will match any ip address that is not explicitly listed
in another virtual host. In the absence of any _default_ virtual host
the "main" server config, consisting of all those definitions outside
any VirtualHost section, is used when no match occurs.<
p>
<
strong>SECURITY</
strong>: See the
document for details on why your security could be compromised if
the directory where logfiles are stored is writable by anyone other
than the user that starts the server.
<
p><
strong>See also:</
strong>
<
strong>See also:</
strong>
<
strong>See also:</
strong>
<
a href="/host.html">Non-IP address-based Virtual Hosts</
a><
br>
<
strong>See also:</
strong>