server-wide.html.en revision 3503aba0b8e0af2f99d61d81411a94447676fe6e
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<HTML>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<HEAD>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<TITLE>Server-Wide Configuration</TITLE>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki</HEAD>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<BODY
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd BGCOLOR="#FFFFFF"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd TEXT="#000000"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd LINK="#0000FF"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd VLINK="#000080"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd ALINK="#FF0000"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<!--#include virtual="header.html" -->
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz<h1 align="center">Server-Wide Configuration</h1>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p>This document explains some of the directives provided by the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<a href="mod/core.html">core</A> server which are used to configure
4b5981e276e93df97c34e4da05ca5cf8bbd937dandthe basic operations of the server.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<ul>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<li><a href="#identification">Server Identification</a></li>
7dc5a2d4a0c77f5bf5a95de92d68e43de7d8117anilgun<li><a href="#locations">File Locations</a></li>
7dc5a2d4a0c77f5bf5a95de92d68e43de7d8117anilgun<li><a href="#process">Process Creation</a></li>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<li><a href="#network">Network Configuration</a></li>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<li><a href="#resource">Limiting Resource Usage</a></li>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</ul>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<hr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<h2><a name="identification">Server Identification</a></h2>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<table border="1">
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<tr><td valign="top">
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<strong>Related Directives</strong><br><br>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<A HREF="mod/core.html#servername">ServerName</A><br>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<A HREF="mod/core.html#serveradmin">ServerAdmin</A><br>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<A HREF="mod/core.html#serversignature">ServerSignature</A><br>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<A HREF="mod/core.html#servertokens">ServerTokens</A><br>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<A HREF="mod/core.html#usecanonicalname">UseCanonicalName</A><br>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin</td></tr></table>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<p>The <code>ServerAdmin</code> and <code>ServerTokens</code>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirindirectives control what information about the server will be presented
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirinin server-generated documents such as error messages.
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirinThe <code>ServerTokens</code> directive sets the value of the
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirinServer HTTP response header field.</p>
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<p>The <code>ServerName</code> and <code>UseCanonicalName</code>
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowendirectives are used by the server to determine how to construct
f0a393c5c2d7de58f447855369ad2fbfa254e544rbowenself-referential URLs. For example, when a client requests a
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nddirectory, but does not include the trailing slash in the directory
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndname, Apache must redirect the client to the full name including the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndtrailing slash so that the client will correctly resolve relative
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndreferences in the document.</p>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<hr>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<h2><a name="locations">File Locations</a></h2>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<table border="1">
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<tr><td valign="top">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<strong>Related Directives</strong><br><br>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
f6445f3ad1c82f9398dc8edd77093cd3e20b806cnoirin<a href="mod/core.html#coredumpdirectory">CoreDumpDirectory</a><br>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<a href="mod/core.html#documentroot">DocumentRoot</a><br>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<a href="mod/core.html#errorlog">ErrorLog</a><br>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<a href="mod/core.html#lockfile">Lockfile</a><br>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<a href="mod/core.html#pidfile">PidFile</a><br>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<a href="mod/core.html#scoreboardfile">ScoreBoardFile</a><br>
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin<a href="mod/core.html#serverroot">ServerRoot</a><br>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</td></tr></table>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p>These directives control the locations of the various files that
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndApache needs for proper operation. When the pathname used does not
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndbegin with a slash "/", the files are located relative to the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<code>ServerRoot</code>. Be careful about locating files in paths
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovenerwhich are writable by non-root users. See the <a
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirinhref="misc/security_tips.html">security tips</a> documentation for
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirinmore details.</p>
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin<hr>
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin<h2><a name="process">Process Creation</a></h2>
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener<table border="1">
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener<tr><td valign="top">
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener<strong>Related Directives</strong><br><br>
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener<a href="mod/core.html#bs2000account">BS2000Account</a><br>
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin<a href="mod/core.html#group">Group</a><br>
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener<a href="mod/core.html#baxclients">MaxClients</a><br>
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin<a href="mod/core.html#maxrequestsperchild">MaxRequestsPerChild</a><br>
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin<a href="mod/core.html#maxspareservers">MaxSpareServers</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#minspareservers">MinSpareServers</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#servertype">ServerType</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#startservers">StartServers</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#threadsperchild">ThreadsPerChild</a><br>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<a href="mod/core.html#user">User</a><br>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</td></tr></table>
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener
25d988d92af8cf0d997aa1ebbc7cb11daa14d0becovener<p>When <code>ServerType</code> is set to its recommended value of
635de20c16ef862bfc5b0d5f9ceb40ebeaddfdf3noirin<code>Standalone</code>, Apache 1.3 for Unix is a pre-forking web
97a9a944b5887e91042b019776c41d5dd74557aferikabeleserver. A single control process is responsible for launching child
06ba4a61654b3763ad65f52283832ebf058fdf1csliveprocesses which listen for connections and serve them when they
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndarrive. Apache always tries to maintain several <em>spare</em> or
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndidle server processes, which stand ready to serve incoming requests.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndIn this way, clients do not need to wait for a new child processes to
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndbe forked before their requests can be served.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p>The <code>StartServers</code>, <code>MinSpareServers</code>,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<code>MaxSpareServers</code>, and <code>MaxServers</code> regulate how
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndthe parent process creates children to serve requests. In general,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndApache is very self-regulating, so most sites do not need to adjust
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndthese directives from their default values. Sites which need to serve
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndmore than 256 simultaneous requests may need to increase
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<code>MaxClients</code>, while sites with limited memory may need to
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nddecrease <code>MaxClients</code> to keep the server from thrashing
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd(swapping memory to disk and back). More information about tuning
fa0f379e3845907d7c1087d885169e302239bdbbndprocess creation is provided in the <a
fa0f379e3845907d7c1087d885169e302239bdbbndhref="misc/perf-tuning.html">performance hints</a> documentation.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<p>While the parent process is usually started as root under Unix
fa0f379e3845907d7c1087d885169e302239bdbbndin order to bind to port 80, the child processes are launched
fa0f379e3845907d7c1087d885169e302239bdbbndby Apache as a less-privileged user. The <code>User</code> and
fa0f379e3845907d7c1087d885169e302239bdbbnd<code>Group</code> directives are used to set the privileges
fa0f379e3845907d7c1087d885169e302239bdbbndof the Apache child processes. The child processes must
fa0f379e3845907d7c1087d885169e302239bdbbndbe able to read all the content that will be served, but
06ba4a61654b3763ad65f52283832ebf058fdf1csliveshould have as few privileges beyond that as possible.
06ba4a61654b3763ad65f52283832ebf058fdf1csliveIn addition, unless <a href="suexec.html">suexec</a> is used,
06ba4a61654b3763ad65f52283832ebf058fdf1cslivethese directives also set the privileges which will be inherited
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemby CGI scripts.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<p><code>MaxRequestsPerChild</code> controls how frequently the server
fa0f379e3845907d7c1087d885169e302239bdbbndrecycles processes by killing old ones and launching new ones.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<p>Under Windows, Apache launches one control process and one
06ba4a61654b3763ad65f52283832ebf058fdf1cslivechild process. The child process creates multiple threads to
06ba4a61654b3763ad65f52283832ebf058fdf1csliveserve requests. The number of threads is controlled by the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<code>ThreadsPerChild</code> directive.</p>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<hr>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<h2><a name="network">Network Configuration</a></h2>
fa0f379e3845907d7c1087d885169e302239bdbbnd
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<table border="1">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><td valign="top">
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<strong>Related Directives</strong><br><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#bindaddress">BindAddress</a><br>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<a href="mod/core.html#keepalive">KeepAlive</a><br>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<a href="mod/core.html#keepalivetimeout">KeepAliveTimeout</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#listen">Listen</a><br>
81785f72c9d133aef57ad6b02f248345d90239aapoirier<a href="mod/core.html#listenbacklog">ListenBackLog</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#maxKeepaliverequests">MaxKeepAliveRequests</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#port">Port</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#sendbuffersize">SendBufferSize</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd<a href="mod/core.html#timeOut">TimeOut</a><br>
fa0f379e3845907d7c1087d885169e302239bdbbnd</td></tr></table>
fa0f379e3845907d7c1087d885169e302239bdbbnd
c6a2d6fa44f8698851dec5051ee3782c2913605fnd<p>When Apache starts, it connects to some port and address on the
06ba4a61654b3763ad65f52283832ebf058fdf1cslivelocal machine and waits for incoming requests. By default, it listens
97a9a944b5887e91042b019776c41d5dd74557aferikabeleto all addresses on the machine, and to the port as specified by the
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<code>Port</code> directive in the server configuration. However, it
97a9a944b5887e91042b019776c41d5dd74557aferikabelecan be told to listen to more than one port, to listen to only
97a9a944b5887e91042b019776c41d5dd74557aferikabeleselected addresses, or a combination. This is often combined with the
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<a href="vhosts/">Virtual Host</a> feature which determines how Apache
5ae30adbe59946de742ab0cd6be3b7457471a698takashiresponds to different IP addresses, hostnames and ports.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele<p>There are two directives used to restrict or specify which addresses
97a9a944b5887e91042b019776c41d5dd74557aferikabeleand ports Apache listens to. The <code>BindAddress</code> directive
97a9a944b5887e91042b019776c41d5dd74557aferikabeleis used to restrict the server to listening to a single IP address.
97a9a944b5887e91042b019776c41d5dd74557aferikabeleThe <code>Listen</code> directive can be used to specify multiple
97a9a944b5887e91042b019776c41d5dd74557aferikabeleIP addresses and/or Ports to which Apache will listen.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<p>The <code>ListenBackLog</code>, <code>SendBufferSize</code>, and
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<code>TimeOut</code> directives are used to adjust how Apache
97a9a944b5887e91042b019776c41d5dd74557aferikabeleinteracts with the network.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
74a6de79356cd15d2e47065087785e36dd65aa41nd<p>The <code>KeepAlive</code>, <code>KeepAliveTimeout</code>,
97a9a944b5887e91042b019776c41d5dd74557aferikabeleand <code>MaxKeepAliveRequests</code> directives are used to
97a9a944b5887e91042b019776c41d5dd74557aferikabeleconfigure how Apache handles persistent connections.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele<hr>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<h2><a name="resource">Limiting Resource Usage</a></h2>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<table border="1">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<tr><td valign="top">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<strong>Related Directives</strong><br><br>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<a href="mod/core.html#limitrequestbody">LimitRequestBody</a><br>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<a href="mod/core.html#limitrequestfields">LimitRequestFields</a><br>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<a href="mod/core.html#limitrequestfieldsize">LimitRequestFieldsize</a><br>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<a href="mod/core.html#limitrequestline">LimitRequestLine</a><br>
53d2fd50ff45e7c568f0588c742a5ef9edf8e275rbowen<a href="mod/core.html#rlimitcpu">RLimitCPU</a><br>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<a href="mod/core.html#rlimitmem">RLimitMEM</a><br>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<a href="mod/core.html#rlimitnproc">RLimitNPROC</a><br>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<a href="mod/core.html#threadstacksize">ThreadStackSize</a><br>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi</td></tr></table>
5ae30adbe59946de742ab0cd6be3b7457471a698takashi
97a9a944b5887e91042b019776c41d5dd74557aferikabele<p>The <code>LimitRequest</code>* directives are used to place limits
97a9a944b5887e91042b019776c41d5dd74557aferikabeleon the amount of resources Apache will use in reading requests
97a9a944b5887e91042b019776c41d5dd74557aferikabelefrom clients. By limiting these values, some kinds of denial
97a9a944b5887e91042b019776c41d5dd74557aferikabeleof service attacks can be mitigated.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele<p>The <code>RLimit</code>* directives are used to limit the amount
06ba4a61654b3763ad65f52283832ebf058fdf1csliveof resources which can be used by processes forked off from
06ba4a61654b3763ad65f52283832ebf058fdf1cslivethe Apache children. In particular, this will control
06ba4a61654b3763ad65f52283832ebf058fdf1csliveresources used by CGI scripts and SSI exec commands.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele<p>The <code>ThreadStackSize</code> directive is used only
97a9a944b5887e91042b019776c41d5dd74557aferikabeleon Netware to control the stack size.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!--#include virtual="footer.html" -->
97a9a944b5887e91042b019776c41d5dd74557aferikabele</BODY>
97a9a944b5887e91042b019776c41d5dd74557aferikabele</HTML>
97a9a944b5887e91042b019776c41d5dd74557aferikabele