server-wide.html revision 1f95e5471a82210574f65c3427a258cfa511c21e
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony BGCOLOR="#FFFFFF"
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony TEXT="#000000"
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony LINK="#0000FF"
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony VLINK="#000080"
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony ALINK="#FF0000"
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<!--#include virtual="header.html" -->
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>This document explains some of the directives provided by the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html">core</A> server which are used to configure
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonythe basic operations of the server.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<li><a href="#identification">Server Identification</a></li>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<li><a href="#resource">Limiting Resource Usage</a></li>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<h2><a name="identfication">Server Identification</a></h2>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<A HREF="mod/core.html#serveradmin">ServerAdmin</A><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<A HREF="mod/core.html#serversignature">ServerSignature</A><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<A HREF="mod/core.html#servertokens">ServerTokens</A><br>
331e0914b4c54463a06069051f0245b4058a90c2nilgun<A HREF="mod/core.html#usecanonicalname">UseCanonicalName</A><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>ServerAdmin</code> and <code>ServerTokens</code>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonydirectives control what information about the server will be presented
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyin server-generated documents such as error messages.
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyThe <code>ServerTokens</code> directive sets the value of the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyServer HTTP response header field.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>ServerName</code> and <code>UseCanonicalName</code>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonydirectives are used by the server to determine how to construct
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyself-referential URLs. For example, when a client requests a
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonydirectory, but does not include the trailing slash in the directory
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyname, Apache must redirect the client to the full name including the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonytrailing slash so that the client will correctly resolve relative
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyreferences in the document.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#coredumpdirectory">CoreDumpDirectory</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#documentroot">DocumentRoot</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#scoreboardfile">ScoreBoardFile</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>These directives control the locations of the various files that
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyApache needs for proper operation. When the pathname used does not
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonybegin with a slash "/", the files are located relative to the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<code>ServerRoot</code>. Be careful about locating files in paths
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonywhich are writable by non-root users. See the <a
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyhref="misc/security_tips.html">security tips</a> documentation for
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonymore details.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#bs2000account">BS2000Account</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#maxrequestsperchild">MaxRequestsPerChild</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#maxspareservers">MaxSpareServers</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#minspareservers">MinSpareServers</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#startservers">StartServers</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#threadsperchild">ThreadsPerChild</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>When <code>ServerType</code> is set to its recommended value of
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<code>Standalone</code>, Apache 1.3 for Unix is a pre-forking web
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyserver. A single control process is responsible for launching child
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyprocesses which listen for connections and serve them when they
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyarrive. Apache always tries to maintain several <em>spare</em> or
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyidle server processes, which stand ready to serve incoming requests.
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyIn this way, clients do not need to wait for a new child processes to
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonybe forked before their requests can be served.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>StartServers</code>, <code>MinSpareServers</code>,
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<code>MaxSpareServers</code>, and <code>MaxServers</code> regulate how
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonythe parent process creates children to serve requests. In general,
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyApache is very self-regulating, so most sites do not need to adjust
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonythese directives from their default values. Sites which need to serve
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonymore than 256 simultaneous requests may need to increase
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<code>MaxClients</code>, while sites with limited memory may need to
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonydecrease <code>MaxClients</code> to keep the server from thrashing
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony(swapping memory to disk and back). More information about tuning
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyprocess creation is provided in the <a
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyhref="misc/perf-tuning.html">performance hints</a> documentation.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>While the parent process is usually started as root under Unix
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyin order to bind to port 80, the child processes are launched
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyby Apache as a less-privileged user. The <code>User</code> and
331e0914b4c54463a06069051f0245b4058a90c2nilgun<code>Group</code> directives are used to set the privileges
331e0914b4c54463a06069051f0245b4058a90c2nilgunof the Apache child processes. The child processes must
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonybe able to read all the content that will be served, but
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyshould have as few privileges beyond that as possible.
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyIn addition, unless <a href="suexec.html">suexec</a> is used,
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonythese directives also set the privileges which will be inherited
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyby CGI scripts.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p><code>MaxRequestsPerChild</code> controls how frequently the server
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyrecycles processes by killing old ones and launching new ones.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>Under Windows, Apache launches one control process and one
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonychild process. The child process creates multiple threads to
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyserve requests. The number of threads is controlled by the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#bindaddress">BindAddress</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#keepalivetimeout">KeepAliveTimeout</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#listenbacklog">ListenBackLog</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#maxKeepaliverequests">MaxKeepAliveRequests</a><br>
331e0914b4c54463a06069051f0245b4058a90c2nilgun<a href="mod/core.html#sendbuffersize">SendBufferSize</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>When Apache starts, it connects to some port and address on the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonylocal machine and waits for incoming requests. By default, it listens
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyto all addresses on the machine, and to the port as specified by the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<code>Port</code> directive in the server configuration. However, it
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonycan be told to listen to more than one port, to listen to only
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyselected addresses, or a combination. This is often combined with the
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="vhosts/">Virtual Host</a> feature which determines how Apache
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyresponds to different IP addresses, hostnames and ports.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>There are two directives used to restrict or specify which addresses
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyand ports Apache listens to. The <code>BindAddress</code> directive
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyis used to restrict the server to listening to a single IP address.
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyThe <code>Listen</code> directive can be used to specify multiple
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyIP addresses and/or Ports to which Apache will listen.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>ListenBackLog</code>, <code>SendBufferSize</code>, and
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<code>TimeOut</code> directives are used to adjust how Apache
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyinteracts with the network.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>KeepAlive</code>, <code>KeepAliveTimeout</code>,
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyand <code>MaxKeepAliveRequests</code> directives are used to
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyconfigure how Apache handles persistent connections.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<h2><a name="resource">Limiting Resource Usage</a></h2>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#limitrequestbody">LimitRequestBody</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#limitrequestfields">LimitRequestFields</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#limitrequestfieldsize">LimitRequestFieldsize</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#limitrequestline">LimitRequestLine</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#rlimitnproc">RLimitNPROC</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<a href="mod/core.html#threadstacksize">ThreadStackSize</a><br>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>LimitRequest</code>* directives are used to place limits
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyon the amount of resources Apache will use in reading requests
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyfrom clients. By limiting these values, some kinds of denial
331e0914b4c54463a06069051f0245b4058a90c2nilgunof service attacks can be mitigated.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>RLimit</code>* directives are used to limit the amount
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyof resources which can be used by processes forked off from
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonythe Apache children. In particular, this will control
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyresources used by CGI scripts and SSI exec commands.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<p>The <code>ThreadStackSize</code> directive is used only
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctonyon Netware to control the stack size.</p>
4a7be288e6fc28a6cb940e26542dbf574bc907b9pctony<!--#include virtual="footer.html" -->