mpm_common.html revision 23ce412bd50a47accab4dd26019b78810bbf46eb
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <meta name="generator" content="HTML Tidy, see www.w3.org" />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--#include virtual="header.html" -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Directives</h1>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>This file documents directives that are implemented by more
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync than one multi-processing module (MPM).</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#connectionstatus">ConnectionStatus</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#coredumpdirectory">CoreDumpDirectory</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#listenbacklog">ListenBacklog</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="#maxrequestsperchild">MaxRequestsPerChild</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#maxsparethreads">MaxSpareThreads</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#maxthreadsperchild">MaxThreadsPerChild</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#minsparethreads">MinSpareThreads</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#scoreboardfile">ScoreBoardFile</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#sendbuffersize">SendBufferSize</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li><a href="#threadsperchild">ThreadsPerChild</a></li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync name="connectionstatus">ConnectionStatus directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> ConnectionStatus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync on|off<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>ConnectionStatus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> perchild</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Whether or not to maintain status information on current
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync connections. If this is off then mod_status will not work
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync properly.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync name="coredumpdirectory">CoreDumpDirectory directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt CoreDumpDirectory} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> CoreDumpDirectory
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> the same location as
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ServerRoot<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork, mpm_winnt</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>This controls the directory to which Apache attempts to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync switch before dumping core. The default is in the <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="core.html#serverroot">ServerRoot</a> directory, however
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync since this should not be writable by the user the server runs
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync as, core dumps won't normally get written. If you want a core
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync dump for debugging, you can use this directive to place it in a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync different location.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="group" name="group">Group directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt Group} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>Group
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config, virtual
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The Group directive sets the group under which the server will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync answer requests. In order to use this directive, the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync stand-alone server must be run initially as root.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It is recommended that you set up a new group specifically for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync running the server. Some admins use user <code>nobody</code>,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync but this is not always possible or desirable.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Note: if you start the server as a non-root user, it will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync fail to change to the specified group, and will instead
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync continue to run as the group of the original user.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Special note: Use of this directive in <VirtualHost<
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is no longer supported. To implement the <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="/suexec.html">suEXEC wrapper</a> with Apache 2.0, use
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="mod_suexec.html#suexecusergroup">SuexecUserGroup</a>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync directive. SECURITY: See <a href="#user">User</a> for a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync discussion of the security considerations.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="pidfile" name="pidfile">PidFile directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt PidFile} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>PidFile
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork, mpm_winnt</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The PidFile directive sets the file to which the server
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync records the process id of the daemon. If the filename does not
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync begin with a slash (/) then it is assumed to be relative to the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>It is often useful to be able to send the server a signal,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync so that it closes and then reopens its <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="core.html#errorlog">ErrorLog</a> and TransferLog, and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync re-reads its configuration files. This is done by sending a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync SIGHUP (kill -1) signal to the process id listed in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync PidFile.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The PidFile is subject to the same warnings about log file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync placement and <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="/misc/security_tips.html#serverroot">security</a>.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="listen" name="listen">Listen directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork, mpm_winnt</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The Listen directive instructs Apache to listen to only
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specific IP addresses or ports; by default it responds to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync requests on all IP interfaces. The Listen directive is now
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync a required directive. If it is not in the config file, the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync server will fail to start. This is a change from previous
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync versions of Apache.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The Listen directive tells the server to accept incoming
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync requests on the specified port or address-and-port combination.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If only a port number is specified, the server listens to the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync given port on all interfaces. If an IP address is given as well
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync as a port, the server will listen on the given port and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync interface.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Multiple Listen directives may be used to specify a number
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of addresses and ports to listen to. The server will respond to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync requests from any of the listed addresses and ports.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>For example, to make the server accept connections on both
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync port 80 and port 8000, use:</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Listen 8000
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync To make the server accept connections on two specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync interfaces and port numbers, use
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Listen 192.170.2.1:80
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Listen 192.170.2.5:8000
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p><strong>See Also:</strong> <a href="/dns-caveats.html">DNS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <strong>See Also:</strong> <a href="/bind.html">Setting
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="http://www.apache.org/info/known_bugs.html#listenbug">Known
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="listenbacklog" name="listenbacklog">ListenBacklog
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> ListenBacklog
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>ListenBacklog
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork, mpm_winnt</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The maximum length of the queue of pending connections.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Generally no tuning is needed or desired, however on some
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync systems it is desirable to increase this when under a TCP SYN
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync flood attack. See the backlog parameter to the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>This will often be limited to a smaller number by the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync operating system. This varies from OS to OS. Also note that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync many OSes do not use exactly what is specified as the backlog,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync but use a number based on (but normally larger than) what is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>LockFile
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The LockFile directive sets the path to the lockfile used
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync when Apache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync or USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync be left at its default value. The main reason for changing it
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is if the <code>logs</code> directory is NFS mounted, since
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <strong>the lockfile must be stored on a local disk</strong>.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The PID of the main server process is automatically appended to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the filename.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p><strong>SECURITY:</strong> It is best to avoid putting this
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync file in a world writable directory such as
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <code>/var/tmp</code> because someone could create a denial of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync service attack and prevent the server from starting by creating
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync a lockfile with the same name as the one the server will try to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync create.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="maxclients" name="maxclients">MaxClients
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt MaxClients} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>MaxClients
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 8</code> (with threads) <code>MaxClients 256</code> (no
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync threads)<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, prefork</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The MaxClients directive sets the limit on the number of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync child processes that will be created to serve requests. When
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the server is built without threading, no more than this number
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of clients can be served simultaneously. To configure more than
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 256 clients, you must edit the <code>HARD_SERVER_LIMIT</code>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync entry in <code>mpm_default.h</code> and recompile.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Any connection attempts over the MaxClients limit will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync normally be queued, up to a number based on the <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="#listenbacklog">ListenBacklog</a> directive. Once a child
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync process is freed at the end of a different request, the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync connection will then be serviced.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>When the server is compiled with threading, then the maximum
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of simultaneous requests that can be served is obtained
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync from the value of this directive multiplied by <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync name="maxrequestsperchild">MaxRequestsPerChild
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt MaxRequestsPerChild} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> MaxRequestsPerChild
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, prefork,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync perchild, mpm_winnt</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The MaxRequestsPerChild directive sets the limit on the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of requests that an individual child server process will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync handle. After MaxRequestsPerChild requests, the child process
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync will die. If MaxRequestsPerChild is 0, then the process will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync never expire.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Setting MaxRequestsPerChild to a non-zero limit has two
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync beneficial effects:</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li>it limits the amount of memory that process can consume
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by (accidental) memory leakage;</li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <li>by giving processes a finite lifetime, it helps reduce
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the number of processes when the server load reduces.</li>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p><strong>NOTE:</strong> For <em>KeepAlive</em> requests, only
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the first request is counted towards this limit. In effect, it
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync changes the behavior to limit the number of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync name="maxsparethreads">MaxSpareThreads directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> MaxSpareThreads
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>MaxSpareThreads
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Maximum number of idle threads. Different MPMs deal with
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync this directive differently. Perchild monitors the number of idle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync threads on a per-child basis. If there are too many idle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync threads in that child, the server will begin to kill threads
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync within that child.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>worker deals with idle threads on a server-wide basis. If
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync there are too many idle threads in the server then child
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync processes are killed until the number of idle threads is less
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync than this number.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>See also <a href="#minsparethreads">MinSpareThreads</a> and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync name="maxthreadsperchild">MaxThreadsPerChild directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> MaxThreadsPerChild
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Maximum number of threads per child. For MPMs with a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync variable number of threads per child, this directive sets the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync maximum number of threads that will be created in each child
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync process. To increase this value beyond its default, it is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync necessary to change the value of the compile-time define
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <code>HARD_THREAD_LIMIT</code> and recompile the server.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync name="minsparethreads">MinSpareThreads directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt MinSpareServers} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> MinSpareServers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>MaxSpareThreads
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Minimum number of idle threads to handle request spikes.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Different MPMs deal with this directive differently. Perchild
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync monitors the number of idle threads on a per-child basis. If
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync there aren't enough idle threads in that child, the server will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync begin to create new threads within that child.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>worker deals with idle threads on a server-wide basis. If
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync there aren't enough idle threads in the server then child
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync processes are created until the number of idle threads is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync greater than number.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync See also <a href="#maxsparethreads">MaxSpareThreads</a> and <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="numservers" name="numservers">NumServers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>NumServers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> perchild</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Number of children alive at the same time. MPMs that use
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync this directive do not dynamically create new child processes so
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync this number should be large enough to handle the requests for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the entire site.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="scoreboardfile" name="scoreboardfile">ScoreBoardFile
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt ScoreBoardFile} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> ScoreBoardFile
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>ScoreBoardFile
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <a href="directive-dict.html#Compatibility" rel="Help"></a> <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The ScoreBoardFile directive is required on some
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync architectures to place a file that the server will use to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync communicate between its children and the parent. The easiest
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync way to find out if your architecture requires a scoreboard file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is to run Apache and see if it creates the file named by the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync directive. If your architecture requires it then you must
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ensure that this file is not used at the same time by more than
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync one invocation of Apache.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>If you have to use a ScoreBoardFile then you may see
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync improved speed by placing it on a RAM disk. But be careful that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync you heed the same warnings about log file placement and <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="/stopping.html">Stopping and Restarting Apache</a></p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="sendbuffersize" name="sendbuffersize">SendBufferSize
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt SendBufferSize} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> SendBufferSize
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork, mpm_winnt</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The server will set the TCP buffer size to the number of bytes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified. Very useful to increase past standard OS defaults on
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync high speed high latency (<em>i.e.</em>, 100ms or so, such as
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync transcontinental fast pipes)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="startservers" name="startservers">StartServers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt StartServers} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> StartServers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>StartServers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, prefork</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>The StartServers directive sets the number of child server
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync processes created on startup. As the number of processes is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync dynamically controlled depending on the load, there is usually
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync little reason to adjust this parameter.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>See also <a href="#minsparethreads">MinSpareThreads</a> and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <a href="#maxsparethreads">MaxSpareThreads</a>.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="startthreads" name="startthreads">StartThreads
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> StartThreads
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>StartThreads
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> perchild</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Number of threads each child creates on startup. As the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of threads is dynamically controlled depending on the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync load, there is usually little reason to adjust this
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync parameter.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Syntax:</strong></a> ThreadsPerChild
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>ThreadsPerChild
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config<br />
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, mpm_winnt</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>This directive sets the number of threads created by each
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync child process. The child creates these threads at startup and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync never creates more. if using an MPM like mpmt_winnt, where
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync there is only one child process, this number should be high
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync enough to handle the entire load of the server. If using an MPM
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync like worker, where there are multiple child processes, the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync total number of threads should be high enough to handle the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync common load on the server.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <h2><a id="user" name="user">User directive</a></h2>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <!--%plaintext <?INDEX {\tt User} directive> -->
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Default:</strong></a> <code>User
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Context:</strong></a> server config, virtual
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rel="Help"><strong>Module:</strong></a> worker, perchild,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync prefork</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The User directive sets the userid as which the server will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync answer requests. In order to use this directive, the standalone
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync server must be run initially as root. <em>Unix-userid</em> is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The user should have no privileges which result in it being
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync able to access files which are not intended to be visible to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the outside world, and similarly, the user should not be able
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to execute code which is not meant for httpd requests. It is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync recommended that you set up a new user and group specifically
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync for running the server. Some admins use user
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <code>nobody</code>, but this is not always possible or
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync desirable. For example mod_proxy's cache, when enabled, must be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync accessible to this user (see <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="mod_proxy.html">mod_proxy's</a> <code>CacheRoot</code>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync directive).
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Notes: If you start the server as a non-root user, it will
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync fail to change to the lesser privileged user, and will instead
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync continue to run as that original user. If you do start the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync server as root, then it is normal for the parent process to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync remain running as root.</p>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <p>Special note: Use of this directive in <VirtualHost>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is no longer supported. To configure your server for <a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync href="mod_suexec.html#suexecusergroup">SuexecUserGroup</a>.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync SECURITY: Don't set User (or <a href="#group">Group</a>) to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync <code>root</code> unless you know exactly what you are doing,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and what the dangers are.</p>