mpm_common.xml revision 10237492cb0500e2c0351db6e52775578a2af624
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<?xml version="1.0"?>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<?xml-stylesheet type="text/xsl" href="/style/manual.xsl"?>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>mpm_common</name>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg<description>A collection of directives that are implemented by
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesmore than one multi-processing module (MPM)</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<status>MPM</status>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>CoreDumpDirectory</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Sets the directory where Apache attempts to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesswitch before dumping core</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<syntax>CoreDumpDirectory <em>directory</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<default>CoreDumpDirectory <em>ServerRoot</em></default>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<contextlist><context>server config</context></contextlist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulelist><module>worker</module><module>perchild</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<module>prefork</module><module>mpm_winnt</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</modulelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>This controls the directory to which Apache attempts to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes switch before dumping core. The default is in the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <directive module="core">ServerRoot</directive> directory, however
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes since this should not be writable by the user the server runs
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes as, core dumps won't normally get written. If you want a core
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes dump for debugging, you can use this directive to place it in a
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes different location.</p>
cfb941e9ad5276eef7bc8f3eedcd270f30cfec35fuankg</usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</directivesynopsis>
892aaf5c314ef8e7b3ba53b5c5259b729f014bc1bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>Group</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Sets the group under which the server will answer
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesrequests</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<syntax>Group <em>unix-group</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<default>Group #-1</default>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<contextlist><context>server config</context><context>virtual host</context>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</contextlist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulelist><module>worker</module><module>perchild</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<module>prefork</module></modulelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>The <directive>Group</directive> directive sets the group under
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes which the server will answer requests. In order to use this
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes directive, the stand-alone server must be run initially as root.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <em>Unix-group</em> is one of:</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <dl>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <dt>A group name</dt>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <dd>Refers to the given group by name.</dd>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <dt># followed by a group number.</dt>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <dd>Refers to a group by its number.</dd>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </dl>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>It is recommended that you set up a new group specifically for
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes running the server. Some admins use user <code>nobody</code>,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes but this is not always possible or desirable.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>Note: if you start the server as a non-root user, it will
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes fail to change to the specified group, and will instead
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes continue to run as the group of the original user.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>Special note: Use of this directive in &lt;VirtualHost&lt; is
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes no longer supported. To implement the <a
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg href="/suexec.html">suEXEC wrapper</a> with Apache 2.0, use the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <directive module="mod_suexec">SuexecUserGroup</directive>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes directive. SECURITY: See <directive
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes module="mpm_common">User</directive> for a discussion of the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes security considerations.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>PidFile</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Sets the file where the server records the process ID
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesof the daemon</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<syntax>PidFile <em>filename</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<default>PidFile logs/httpd.pid</default>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg<contextlist><context>server config</context></contextlist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulelist><module>worker</module><module>perchilde</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<module>prefork</module><module>mpm_winnt</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</modulelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>The <directive>PidFile</directive> directive sets the file to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes which the server records the process id of the daemon. If the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes filename does not begin with a slash (/) then it is assumed to be
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes relative to the <directive module="core">ServerRoot</directive>.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>It is often useful to be able to send the server a signal,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes so that it closes and then reopens its <directive
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes module="core">ErrorLog</directive> and TransferLog, and
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes re-reads its configuration files. This is done by sending a
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes SIGHUP (kill -1) signal to the process id listed in the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes PidFile.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>The PidFile is subject to the same warnings about log file
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes placement and <a
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes href="/misc/security_tips.html#serverroot">security</a>.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</usage>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg</directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<directivesynopsis>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg<name>Listen</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Sets the IP addresses and ports that the server
bb2b38cd44b032118359afbc743efbea12f48e61bnicholeslistens to</description>
0a39e7683f6611d66c55712f50bb240428d832a1bnicholes<syntax>Listen [<em>IP-address</em>:]<em>portnumber</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<contextlist><context>server config</context></contextlist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulelist><module>worker</module><module>perchild</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<module>prefork</module><module>mpm_winnt</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</modulelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>The <directive>Listen</directive> directive instructs Apache to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes listen to only specific IP addresses or ports; by default it
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg responds to requests on all IP interfaces. The Listen directive is
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes now a required directive. If it is not in the config file, the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes server will fail to start. This is a change from previous versions
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg of Apache.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>The Listen directive tells the server to accept incoming
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes requests on the specified port or address-and-port combination.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes If only a port number is specified, the server listens to the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes given port on all interfaces. If an IP address is given as well
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg as a port, the server will listen on the given port and
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes interface.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>Multiple Listen directives may be used to specify a number
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes of addresses and ports to listen to. The server will respond to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes requests from any of the listed addresses and ports.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>For example, to make the server accept connections on both
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes port 80 and port 8000, use:</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<example>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Listen 80<br />
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Listen 8000
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</example>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes To make the server accept connections on two specified
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes interfaces and port numbers, use
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<example>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Listen 192.170.2.1:80<br />
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Listen 192.170.2.5:8000
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</example>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes IPv6 addresses must be surrounded in square brackets, as in the
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg following example:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<example>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Listen [fe80::a00:20ff:fea7:ccea]:80
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</example>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<seealso><a href="/dns-caveats.html">DNS Issues</a></seealso>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<seealso><a href="/bind.html">Setting
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes which addresses and ports Apache uses</a></seealso>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>ListenBackLog</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Maximum length of the queue of pending connections</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<syntax>ListenBacklog <em>backlog</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<default>ListenBacklog 511</default>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<contextlist><context>server config</context></contextlist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulelist><module>worker</module><module>perchild</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<module>prefork</module><module>mpm_winnt</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</modulelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>The maximum length of the queue of pending connections.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Generally no tuning is needed or desired, however on some
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes systems it is desirable to increase this when under a TCP SYN
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes flood attack. See the backlog parameter to the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <code>listen(2)</code> system call.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>This will often be limited to a smaller number by the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes operating system. This varies from OS to OS. Also note that
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes many OSes do not use exactly what is specified as the backlog,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes but use a number based on (but normally larger than) what is
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes set.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg<directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>LockFile</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Location of the accept serialization lock file</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<syntax>LockFile <em>filename</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<default>LockFile logs/accept.lock</default>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<contextlist><context>server config</context></contextlist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulelist><module>worker</module><module>perchild</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<module>prefork</module></modulelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<usage>
9046ab142ed19505e034af0afb8c15be512b8526bnicholes <p>The <directive>LockFile</directive> directive sets the path to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes the lockfile used when Apache is compiled with either
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. This
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes directive should normally be left at its default value. The main
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes reason for changing it is if the <code>logs</code> directory is
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes NFS mounted, since <strong>the lockfile must be stored on a local
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes disk</strong>. The PID of the main server process is
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg automatically appended to the filename.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p><strong>SECURITY:</strong> It is best to avoid putting this
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes file in a world writable directory such as
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <code>/var/tmp</code> because someone could create a denial of
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes service attack and prevent the server from starting by creating
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes a lockfile with the same name as the one the server will try to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes create.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>MaxClients</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Maximum number of child processes that will be created
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesto serve requests</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<syntax>MaxClients <em>number</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<default>>MaxClients
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes 8 (with threads) MaxClients 256</default>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<contextlist><context>server config</context></contextlist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<modulelist><module>worker</module><module>prefork</module>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg</modulelist>
609ef720afd62ca63391c9fdb415cd2faf29aa46bnicholes
609ef720afd62ca63391c9fdb415cd2faf29aa46bnicholes<usage>
609ef720afd62ca63391c9fdb415cd2faf29aa46bnicholes <p>The <directive>MaxClients</directive> directive sets the limit
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg on the number of child processes that will be created to serve
609ef720afd62ca63391c9fdb415cd2faf29aa46bnicholes requests. When the server is built without threading, no more than
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg this number of clients can be served simultaneously. To configure
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg more than 256 clients with the prefork MPM, you must use the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <directive module="mpm_common">ServerLimit</directive> directive.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes To configure more than 1024 clients with the worker MPM, you must
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes use the <directive module="mpm_common">ServerLimit</directive> and
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <directive module="mpm_common">ThreadLimit</directive> directives.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg <p>Any connection attempts over the
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg <directive>MaxClients</directive> limit will normally be queued,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes up to a number based on the <directive module="mpm_common"
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes >ListenBacklog</directive> directive. Once a child
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes process is freed at the end of a different request, the connection
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes will then be serviced.</p>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>When the server is compiled with threading, then the maximum
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes number of simultaneous requests that can be served is obtained
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes from the value of this directive multiplied by
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <directive module="mpm_common">ThreadsPerChild</directive>.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</usage>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<directivesynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<name>MaxRequestsPerChild</name>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<description>Limit on the number of requests that an individual child server
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgwill handle during its life</description>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<syntax>MaxRequestsPerChild <em>number</em></syntax>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<default>MaxRequestsPerChild 10000</default>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<contextlist><context>server config</context></contextlist>
f2f3f241c00a7a4bd597e57a19023940e072918abnicholes<modulelist><module>worker</module><module>perchild</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<module>prefork</module><module>mpm_winnt</module>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</modulelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<usage>
8410c53aaf5e0372a19d5f4d2bc696b9c609ce3cbnicholes <p>The <directive>MaxRequestsPerChild</directive> directive sets
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes the limit on the number of requests that an individual child
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes server process will handle. After
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <directive>MaxRequestsPerChild</directive> requests, the child
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes process will die. If <directive>MaxRequestsPerChild</directive> is
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes 0, then the process will never expire.</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <p>Setting <directive>MaxRequestsPerChild</directive> to a
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes non-zero limit has two beneficial effects:</p>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
<ul>
<li>it limits the amount of memory that process can consume
by (accidental) memory leakage;</li>
<li>by giving processes a finite lifetime, it helps reduce
the number of processes when the server load reduces.</li>
</ul>
<p><strong>NOTE:</strong> For <em>KeepAlive</em> requests, only
the first request is counted towards this limit. In effect, it
changes the behavior to limit the number of
<em>connections</em> per child.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>MaxSpareThreads</name>
<description>Maximum number of idle threads</description>
<syntax>MaxSpareThreads <em>number</em></syntax>
<default>MaxSpareThreads 10 (Perchild) or 500 (worker)</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module><module>perchild</module>
</modulelist>
<usage>
<p>Maximum number of idle threads. Different MPMs deal with this
directive differently. <module>perchild</module> monitors the
number of idle threads on a per-child basis. If there are too many
idle threads in that child, the server will begin to kill threads
within that child.</p>
<p><module>worker</module> deals with idle threads on a
server-wide basis. If there are too many idle threads in the
server then child processes are killed until the number of idle
threads is less than this number.</p>
</usage>
<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
<seealso><directive module="mpm_common">StartServers</directive></seealso>
</directivesynopsis>
<directivesynopsis>
<name>MaxThreadsPerChild</name>
<description>Maximum number of threads per child process</description>
<syntax>MaxThreadsPerChild <em>number</em></syntax>
<default>MaxThreadsPerChild 64</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module><module>perchild</module>
</modulelist>
<usage>
<p>Maximum number of threads per child. For MPMs with a
variable number of threads per child, this directive sets the
maximum number of threads that will be created in each child
process. To increase this value beyond its default, it is
necessary to change the value of the compile-time define
<code>HARD_THREAD_LIMIT</code> and recompile the server.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>MinSpareThreads</name>
<description>Minimum number of idle threads available to handle request
spikes</description>
<syntax>MinSpareServers <em>number</em></syntax>
<default>MinSpareThreads 5 (Perchild) or 250 (worker)</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module><module>perchild</module>
</modulelist>
<usage>
<p>Minimum number of idle threads to handle request spikes.
Different MPMs deal with this directive
differently. <module>perchild</module> monitors the number of idle
threads on a per-child basis. If there aren't enough idle threads
in that child, the server will begin to create new threads within
that child.</p>
<p><module>worker</module> deals with idle threads on a
server-wide basis. If there aren't enough idle threads in the
server then child processes are created until the number of idle
threads is greater than number.</p>
</usage>
<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
<seealso><directive module="mpm_common">StartServers</directive></seealso>
</directivesynopsis>
<directivesynopsis>
<name>NumServers</name>
<description>Total number of children alive at the same time</description>
<syntax>NumServers <em>number</em></syntax>
<default>NumServers 2</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>perchild</module></modulelist>
<usage>
<p>Number of children alive at the same time. MPMs that use
this directive do not dynamically create new child processes so
this number should be large enough to handle the requests for
the entire site.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>ScoreBoardFile</name>
<description>Location of the file used to store coordination data for
the child processes</description>
<syntax>ScoreBoardFile <em>file-path</em></syntax>
<default>ScoreBoardFile logs/apache_status</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module><module>perchild</module>
<module>prefork</module></modulelist>
<usage>
<p>The <directive>ScoreBoardFile</directive> 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 of Apache.</p>
<p>If you have to use a <directive>ScoreBoardFile</directive> 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 href="/misc/security_tips.html">security</a>.</p>
</usage>
<seealso><a
href="/stopping.html">Stopping and Restarting Apache</a></seealso>
</directivesynopsis>
<directivesynopsis>
<name>SendBufferSize</name>
<description>TCP buffer size</description>
<syntax>SendBufferSize <em>bytes</em></syntax>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module><module>perchild</module>
<module>prefork</module><module>mpm_winnt</module>
</modulelist>
<usage>
<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 (<em>i.e.</em>, 100ms or so, such as
transcontinental fast pipes).</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>ServerLimit</name>
<description>Upper limit on configurable number of processes</description>
<syntax>ServerLimit <em>number</em></syntax>
<default>ServerLimit 256 (prefork), ServerLimit 16 (worker)</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module><module>prefork</module>
</modulelist>
<usage>
<p>For the <module>prefork</module> MPM, this directive sets the
maximum configured value for <directive
module="mpm_common">MaxClients</directive> for the lifetime of the
Apache process. For the worker MPM, this directive in combination
with <directive module="mpm_common">ThreadLimit</directive> sets
the maximum configured value for <directive
module="mpm_common">MaxClients</directive> for the lifetime of the
Apache process. Any attempts to change this directive during a
restart will be ignored, but <directive
module="mpm_common">MaxClients</directive> can be modified during
a restart.</p>
<p>Special care must be taken when using this directive. If
<directive>ServerLimit</directive> is set to a value much higher
than necessary, extra, unused shared memory will be allocated. If
both <directive>ServerLimit</directive> and <directive
module="mpm_common">MaxClients</directive> are set to values
higher than the system can handle, Apache may not start or the
system may become unstable.</p>
<p>With the <module>prefork</module> MPM, use this directive only
if you need to set <directive
module="mpm_common">MaxClients</directive> higher higher than 256.
Do not set the value of this directive any higher than what you
might want to set <directive
module="mpm_common">MaxClients</directive> to.</p>
<p>With the <module>worker</module> MPM, use this directive only
if your <directive module="mpm_common">MaxClients</directive> and
<directive module="mpm_common">ThreadsPerChild</directive>
settings require more than 16 server processes. Do not set the
value of this directive any higher than the number of server
processes required by what you may want for <directive
module="mpm_common">MaxClients </directive> and <directive
module="mpm_common">ThreadsPerChild</directive>.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>StartServers</name>
<description>Number of child server processes created at startup</description>
<syntax>StartServers <em>number</em></syntax>
<default>StartServers 5</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module></modulelist>
<usage>
<p>The <directive>StartServers</directive> 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>
</usage>
<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
</directivesynopsis>
<directivesynopsis>
<name>StartThreads</name>
<description>Nubmer of threads each child creates on startup</description>
<syntax>StartThreads <em>number</em></syntax>
<default>StartThreads 5</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>perchild</module></modulelist>
<usage>
<p>Number of threads each child creates on startup. As the
number of threads is dynamically controlled depending on the
load, there is usually little reason to adjust this
parameter.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>ThreadLimit</name>
<description>Sets the upper limit on the configurable number of threads
per child process</description>
<syntax>ThreadLimit <em>number</em></syntax>
<default>ThreadLimit 64</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module></modulelist>
<usage>
<p>This directive sets the maximum configured value for <directive
module="mpm_common">ThreadsPerChild</directive> for the lifetime
of the Apache process. Any attempts to change this directive
during a restart will be ignored, but <directive
module="mpm_common">ThreadsPerChild</directive> can be modified
during a restart up to the value of this directive.</p>
<p>Special care must be taken when using this directive. If
<directive>ThreadLimit</directive> is set to a value much higher
than <directive module="mpm_common">ThreadsPerChild</directive>,
extra unused shared memory will be allocated. If both
<directive>ThreadLimit</directive> and <directive
module="mpm_common">ThreadsPerChild</directive> are set to values
higher than the system can handle, Apache may not start or the
system may become unstable.</p>
<p>Use this directive only if you need to set <directive
module="mpm_common">ThreadsPerChild</directive> higher than 64. Do
not set the value of this directive any higher than what you might
want to set <directive
module="mpm_common">ThreadsPerChild</directive> to.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>ThreadsPerChild</name>
<description>Number of threads created by each child process</description>
<syntax>ThreadsPerChild <em>number</em></syntax>
<default>ThreadsPerChild 50</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>worker</module><module>mpm_winnt</module>
</modulelist>
<usage>
<p>This directive sets the number of threads created by each
child process. The child creates these threads at startup and
never creates more. if using an MPM like mpmt_winnt, where
there is only one child process, this number should be high
enough to handle the entire load of the server. If using an MPM
like worker, where there are multiple child processes, the
total number of threads should be high enough to handle the
common load on the server.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>User</name>
<description>The userid under which the server will answer
requests</description>
<syntax>User <em>unix-userid</em></syntax>
<default>User #-1</default>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<modulelist><module>worker</module><module>perchild</module>
<module>prefork</module></modulelist>
<usage>
<p>The <directive>User</directive> 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:</p>
<dl>
<dt>A username</dt>
<dd>Refers to the given user by name.</dd>
<dt># followed by a user number.</dt>
<dd>Refers to a user by their number.</dd>
</dl>
<p>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. For example
<module>mod_proxy</module>'s cache, when enabled, must be
accessible to this user (see <directive
module="mod_proxy">CacheRoot</directive>).</p>
<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>
<p>Special note: Use of this directive in <directive module="core"
type="section">VirtualHost</directive> is no longer supported. To
configure your server for <a href="mod_suexec.html">suexec</a> use
<directive module="mod_suexec">SuexecUserGroup</directive>.</p>
<note><title>Security</title> <p>Don't set <directive>User</directive>
(or <directive module="mpm_common">Group</directive>) to
<code>root</code> unless you know exactly what you are doing, and what
the dangers are.</p></note>
</usage>
</directivesynopsis>
</modulesynopsis>