mpm_common.xml revision b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<?xml version="1.0"?>
64154a07803c72f624008f5c77de844607fcc5a5patrikj<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mpm_common.xml.meta">
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>mpm_common</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>A collection of directives that are implemented by
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivemore than one multi-processing module (MPM)</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<status>MPM</status>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<name>AcceptMutex</name>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<description>Method that Apache uses to serialize multiple children
9cd774340b4867bf4803ab6998450c8d39d0c0c3ndaccepting requests on network sockets</description>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<syntax>AcceptMutex Default|<var>method</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>AcceptMutex Default</default>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>perchild</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</modulelist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<usage>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The <directive>AcceptMutex</directive> directives sets the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd method that Apache uses to serialize multiple children accepting
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd requests on network sockets. Prior to Apache 2.0, the method was
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd selectable only at compile time. The optimal method to use is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd highly architecture and platform dependent. For further details,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd see the <a href="/misc/perf-tuning.html">performance tuning</a>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd documentation.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>If this directive is set to <code>Default</code>, then the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd compile-time selected default will be used. Other possible
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd methods are listed below. Note that not all methods are
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd available on all platforms. If a method is specified which is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd not available, a message will be written to the error log
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd listing the available methods.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dl>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dt><code>flock</code></dt>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>uses the <code>flock(2)</code> system call to lock the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd file defined by the <directive module="mpm_common"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >LockFile</directive> directive.</dd>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dt><code>fcntl</code></dt>
54240e863796e3f085dd1783897201a5d99c33d9nd <dd>uses the <code>fcntl(2)</code> system call to lock the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd file defined by the <directive module="mpm_common"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >LockFile</directive> directive.</dd>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dt><code>posixsem</code></dt>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>uses POSIX compatible semaphores to implement the mutex.</dd>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dt><code>pthread</code></dt>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>uses POSIX mutexes as implemented by the POSIX Threads
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd (PThreads) specification.</dd>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dt><code>sysvsem</code></dt>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>uses SySV-style semaphores to implement the mutex.</dd>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </dl>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>If you want to find out the compile time chosen default
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd for your system, you may set your <directive module="core"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >LogLevel</directive> to <code>debug</code>. Then the default <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >AcceptMutex</directive> will be written into the <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="core">ErrorLog</directive>.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</usage>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>CoreDumpDirectory</name>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>Directory where Apache attempts to
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveswitch before dumping core</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>CoreDumpDirectory <var>directory</var></syntax>
23819e87bf36fbb02a63119408034b3818413983patrikj<default>See usage for the default setting</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_winnt</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This controls the directory to which Apache attempts to
ab93a4c4615ab47c08b7f6058c37d36f9bcb9c30kess switch before dumping core. The default is in the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="core">ServerRoot</directive> directory, however
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive since this should not be writable by the user the server runs
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive as, core dumps won't normally get written. If you want a core
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive dump for debugging, you can use this directive to place it in a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive different location.</p>
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd <note><title>Core Dumps on Linux</title>
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd <p>If Apache starts as root and switches to another user, the
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd Linux kernel <em>disables</em> core dumps even if the directory is
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd writable for the process. Apache (2.0.46 and later) reenables core dumps
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd on Linux 2.4 and beyond, but only if you explicitly configure a <directive
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd >CoreDumpDirectory</directive>.</p>
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>Group</name>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>Group under which the server will answer
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliverequests</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>Group <var>unix-group</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>Group #-1</default>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpmt_os2</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<compatibility>Only valid in global server config since Apache
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd2.0</compatibility>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>Group</directive> directive sets the group under
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive which the server will answer requests. In order to use this
54240e863796e3f085dd1783897201a5d99c33d9nd directive, the server must be run initially as <code>root</code>. If
54240e863796e3f085dd1783897201a5d99c33d9nd you start the server as a non-root user, it will fail to change to the
54240e863796e3f085dd1783897201a5d99c33d9nd specified group, and will instead continue to run as the group of the
54240e863796e3f085dd1783897201a5d99c33d9nd original user. <var>Unix-group</var> is one of:</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dl>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dt>A group name</dt>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dd>Refers to the given group by name.</dd>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dt><code>#</code> followed by a group number.</dt>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dd>Refers to a group by its number.</dd>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive </dl>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <example><title>Example</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd Group www-group
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </example>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>It is recommended that you set up a new group specifically for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive running the server. Some admins use user <code>nobody</code>,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive but this is not always possible or desirable.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note type="warning"><title>Security</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>Don't set <directive>Group</directive> (or <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mpm_common">User</directive>) to <code>root</code> unless
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd you know exactly what you are doing, and what the dangers are.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
2bbccf25be90e913bd716b5c11e5146245d4209arbowen
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>Special note: Use of this directive in <directive module="core"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd type="section">VirtualHost</directive> is no longer supported. To
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd configure your server for <a href="mod_suexec.html">suexec</a> use
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="mod_suexec">SuexecUserGroup</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note><title>Note</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>Although the <directive>Group</directive> directive is present
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd in the <module>beos</module> and <module>mpmt_os2</module> MPMs,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd it is actually a no-op there and only exists for compatibility
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd reasons.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>PidFile</name>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>File where the server records the process ID
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveof the daemon</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>PidFile <var>filename</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>PidFile logs/httpd.pid</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_winnt</module><module>mpmt_os2</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>PidFile</directive> directive sets the file to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive which the server records the process id of the daemon. If the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd filename is not absolute then it is assumed to be relative to the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="core">ServerRoot</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
3d7d50a35be9639b40d1dd0a44b00c078ea97b86rbowen <example><title>Example</title>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd PidFile /var/run/apache.pid
3d7d50a35be9639b40d1dd0a44b00c078ea97b86rbowen </example>
3d7d50a35be9639b40d1dd0a44b00c078ea97b86rbowen
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>It is often useful to be able to send the server a signal,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd so that it closes and then re-opens its <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="core">ErrorLog</directive> and <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mod_log_config">TransferLog</directive>, and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive re-reads its configuration files. This is done by sending a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive SIGHUP (kill -1) signal to the process id listed in the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive>PidFile</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
54240e863796e3f085dd1783897201a5d99c33d9nd <p>The <directive>PidFile</directive> is subject to the same
54240e863796e3f085dd1783897201a5d99c33d9nd warnings about log file placement and <a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive href="/misc/security_tips.html#serverroot">security</a>.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note><title>Note</title>
54240e863796e3f085dd1783897201a5d99c33d9nd <p>As of Apache 2 it is recommended to use only the <a
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd href="/programs/apachectl.html">apachectl</a> script for
54240e863796e3f085dd1783897201a5d99c33d9nd (re-)starting or stopping the server.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>Listen</name>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>IP addresses and ports that the server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivelistens to</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>Listen [<var>IP-address</var>:]<var>portnumber</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_netware</module><module>mpm_winnt</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpmt_os2</module><module>perchild</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<compatibility>Required directive since Apache 2.0</compatibility>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>Listen</directive> directive instructs Apache to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive listen to only specific IP addresses or ports; by default it
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd responds to requests on all IP interfaces. <directive>Listen</directive>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd is now a required directive. If it is not in the config file, the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive server will fail to start. This is a change from previous versions
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive of Apache.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The <directive>Listen</directive> directive tells the server to
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd accept incoming requests on the specified port or address-and-port
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd combination. If only a port number is specified, the server listens to
ab93a4c4615ab47c08b7f6058c37d36f9bcb9c30kess the given port on all interfaces. If an IP address is given as well
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive as a port, the server will listen on the given port and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive interface.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>Multiple <directive>Listen</directive> directives may be used to
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd specify a number of addresses and ports to listen to. The server will
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd respond to requests from any of the listed addresses and ports.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>For example, to make the server accept connections on both
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive port 80 and port 8000, use:</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd <example>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 80<br />
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 8000
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>To make the server accept connections on two specified
64154a07803c72f624008f5c77de844607fcc5a5patrikj interfaces and port numbers, use </p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd <example>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 192.170.2.1:80<br />
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 192.170.2.5:8000
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>IPv6 addresses must be surrounded in square brackets, as in the
64154a07803c72f624008f5c77de844607fcc5a5patrikj following example:</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd <example>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen [fe80::a00:20ff:fea7:ccea]:80
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><a href="/dns-caveats.html">DNS Issues</a></seealso>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><a href="/bind.html">Setting which addresses and ports Apache
9cd774340b4867bf4803ab6998450c8d39d0c0c3nduses</a></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>ListenBackLog</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum length of the queue of pending connections</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>ListenBacklog <var>backlog</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>ListenBacklog 511</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_netware</module><module>mpm_winnt</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpmt_os2</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The maximum length of the queue of pending connections.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Generally no tuning is needed or desired, however on some
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive systems it is desirable to increase this when under a TCP SYN
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive flood attack. See the backlog parameter to the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <code>listen(2)</code> system call.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This will often be limited to a smaller number by the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive operating system. This varies from OS to OS. Also note that
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive many OSes do not use exactly what is specified as the backlog,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive but use a number based on (but normally larger than) what is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive set.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>LockFile</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Location of the accept serialization lock file</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>LockFile <var>filename</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>LockFile logs/accept.lock</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>perchild</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>LockFile</directive> directive sets the path to
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the lockfile used when Apache is used with an <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mpm_common">AcceptMutex</directive> value of either
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>fcntl</code> or <code>flock</code>. This directive should
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd normally be left at its default value. The main reason for changing
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd it is if the <code>logs</code> directory is NFS mounted, since
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <strong>the lockfile must be stored on a local disk</strong>. The PID
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd of the main server process is automatically appended to the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd filename.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
54240e863796e3f085dd1783897201a5d99c33d9nd <note type="warning"><title>Security</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>It is best to <em>avoid</em> putting this file in a world writable
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd directory such as <code>/var/tmp</code> because someone could create
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd a denial of service attack and prevent the server from starting by
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd creating a lockfile with the same name as the one the server will try
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd to create.</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><directive module="mpm_common">AcceptMutex</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>MaxClients</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of child processes that will be created
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveto serve requests</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>MaxClients <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>MaxClients</directive> directive sets the limit
1f5962de2a7436453ab6197268f483f400af0406slive on the number of simultaneous requests that will be served. Any
1f5962de2a7436453ab6197268f483f400af0406slive connection attempts over the <directive>MaxClients</directive>
1f5962de2a7436453ab6197268f483f400af0406slive limit will normally be queued, up to a number based on the
1f5962de2a7436453ab6197268f483f400af0406slive <directive module="mpm_common">ListenBacklog</directive>
1f5962de2a7436453ab6197268f483f400af0406slive directive. Once a child process is freed at the end of a different
1f5962de2a7436453ab6197268f483f400af0406slive request, the connection will then be serviced.</p>
1f5962de2a7436453ab6197268f483f400af0406slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>For non-threaded servers (<em>i.e.</em>, <module>prefork</module>),
1f5962de2a7436453ab6197268f483f400af0406slive <directive>MaxClients</directive> translates into the maximum
1f5962de2a7436453ab6197268f483f400af0406slive number of child processes that will be launched to serve requests.
54240e863796e3f085dd1783897201a5d99c33d9nd The default value is <code>256</code>; to increase it, you must also raise
1f5962de2a7436453ab6197268f483f400af0406slive <directive module="mpm_common">ServerLimit</directive>.</p>
1f5962de2a7436453ab6197268f483f400af0406slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>For threaded and hybrid servers (<em>e.g.</em> <module>beos</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd or <module>worker</module>) <directive>MaxClients</directive> restricts
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the total number of threads that will be available to serve clients.
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd The default value for <module>beos</module> is <code>50</code>. For
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd hybrid MPMs the default value is <code>16</code> (<directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mpm_common">ServerLimit</directive>) multiplied by the value of
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>25</code> (<directive module="mpm_common"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >ThreadsPerChild</directive>). Therefore, to increase <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >MaxClients</directive> to a value that requires more than 16 processes,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd you must also raise <directive module="mpm_common"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >ServerLimit</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<name>MaxMemFree</name>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<description>Maximum amount of memory that the main allocator is allowed
9cd774340b4867bf4803ab6998450c8d39d0c0c3ndto hold without calling <code>free()</code></description>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<syntax>MaxMemFree <var>KBytes</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>MaxMemFree 0</default>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_netware</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<usage>
ab93a4c4615ab47c08b7f6058c37d36f9bcb9c30kess <p>The <directive>MaxMemFree</directive> directive sets the
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick maximum number of free Kbytes that the main allocator is allowed
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd to hold without calling <code>free()</code>. When not set, or when set
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd to zero, the threshold will be set to unlimited.</p>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick</usage>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick</directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
10237492cb0500e2c0351db6e52775578a2af624slive<name>MaxRequestsPerChild</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Limit on the number of requests that an individual child server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivewill handle during its life</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>MaxRequestsPerChild <var>number</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>MaxRequestsPerChild 10000</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>mpm_netware</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_winnt</module><module>mpmt_os2</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>MaxRequestsPerChild</directive> directive sets
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the limit on the number of requests that an individual child
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive server process will handle. After
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive>MaxRequestsPerChild</directive> requests, the child
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive process will die. If <directive>MaxRequestsPerChild</directive> is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>0</code>, then the process will never expire.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
54240e863796e3f085dd1783897201a5d99c33d9nd <note><title>Different default values</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The default value for <module>mpm_netware</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>mpm_winnt</module> is <code>0</code>.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Setting <directive>MaxRequestsPerChild</directive> to a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive non-zero limit has two beneficial effects:</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <ul>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <li>it limits the amount of memory that process can consume
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive by (accidental) memory leakage;</li>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <li>by giving processes a finite lifetime, it helps reduce
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the number of processes when the server load reduces.</li>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive </ul>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
54240e863796e3f085dd1783897201a5d99c33d9nd <note><title>Note</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>For <directive module="core">KeepAlive</directive> requests, only
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the first request is counted towards this limit. In effect, it
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd changes the behavior to limit the number of <em>connections</em> per
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd child.</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>MaxSpareThreads</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of idle threads</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>MaxSpareThreads <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_netware</module><module>mpmt_os2</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Maximum number of idle threads. Different MPMs deal with this
9ccc5ea873440dd766924e16d9dab2989d81a175slive directive differently.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>For <module>perchild</module> the default is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>MaxSpareThreads 10</code>. This MPM monitors the number of
9ccc5ea873440dd766924e16d9dab2989d81a175slive idle threads on a per-child basis. If there are too many idle
9ccc5ea873440dd766924e16d9dab2989d81a175slive threads in that child, the server will begin to kill threads
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive within that child.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>For <module>worker</module>, <module>leader</module> and <module
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >threadpool</module> the default is <code>MaxSpareThreads 250</code>.
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd These MPMs deal with idle threads on a server-wide basis. If there
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd are too many idle threads in the server then child processes are
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd killed until the number of idle threads is less than this number.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>For <module>mpm_netware</module> the default is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>MaxSpareThreads 100</code>. Since this MPM runs a
9ccc5ea873440dd766924e16d9dab2989d81a175slive single-process, the spare thread count is also server-wide.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p><module>beos</module> and <module>mpmt_os2</module> work
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd similar to <module>mpm_netware</module>. The default for
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>beos</module> is <code>MaxSpareThreads 50</code>. For
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>mpmt_os2</module> the default value is <code>10</code>.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note><title>Restrictions</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The range of the <directive>MaxSpareThreads</directive> value
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd is restricted. Apache will correct the given value automatically
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd according to the following rules:</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <ul>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <li><module>perchild</module> requires <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >MaxSpareThreads</directive> to be less or equal than <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mpm_common">ThreadLimit</directive>.</li>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <li><module>mpm_netware</module> wants the value to be greater than
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="mpm_common">MinSpareThreads</directive>.</li>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <li>For <module>leader</module>, <module>threadpool</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>worker</module> the value must be greater or equal than
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the sum of <directive module="mpm_common">MinSpareThreads</directive>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd and <directive module="mpm_common">ThreadsPerChild</directive>.</li>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </ul>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>MinSpareThreads</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Minimum number of idle threads available to handle request
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivespikes</description>
489aba0c56a8f21d6d0253cfdf71486ef6ea9e0dslive<syntax>MinSpareThreads <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_netware</module><module>mpmt_os2</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Minimum number of idle threads to handle request spikes.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Different MPMs deal with this directive
9ccc5ea873440dd766924e16d9dab2989d81a175slive differently.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p><module>perchild</module> uses a default of
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>MinSpareThreads 5</code> and monitors the number of idle
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive threads on a per-child basis. If there aren't enough idle threads
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive in that child, the server will begin to create new threads within
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd that child. Thus, if you set <directive module="perchild"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >NumServers</directive> to <code>10</code> and a <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >MinSpareThreads</directive> value of <code>5</code>, you'll have
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd at least 50 idle threads on your system.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p><module>worker</module>, <module>leader</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>threadpool</module> use a default of <code>MinSpareThreads
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd 75</code> and deal with idle threads on a server-wide basis. If
9ccc5ea873440dd766924e16d9dab2989d81a175slive there aren't enough idle threads in the server then child
9ccc5ea873440dd766924e16d9dab2989d81a175slive processes are created until the number of idle threads is greater
9ccc5ea873440dd766924e16d9dab2989d81a175slive than number.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p><module>mpm_netware</module> uses a default of
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>MinSpareThreads 10</code> and, since it is a single-process
9ccc5ea873440dd766924e16d9dab2989d81a175slive MPM, tracks this on a server-wide bases.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p><module>beos</module> and <module>mpmt_os2</module> work
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd similar to <module>mpm_netware</module>. The default for
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>beos</module> is <code>MinSpareThreads 1</code>. For
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>mpmt_os2</module> the default value is <code>5</code>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>ScoreBoardFile</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Location of the file used to store coordination data for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivethe child processes</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>ScoreBoardFile <var>file-path</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>ScoreBoardFile logs/apache_status</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_winnt</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley <p>Apache uses a scoreboard to communicate between its parent
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley and child processes. Some architectures require a file to facilitate
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley this communication. If the file is left unspecified, Apache first
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley attempts to create the scoreboard entirely in memory (using anonymous
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley shared memory) and, failing that, will attempt to create the file on
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley disk (using file-based shared memory). Specifying this directive causes
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron Apache to always create the file on the disk.</p>
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron
f143e4751c45b0c3854d17318975da221bd36aa7rbowen <example><title>Example</title>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd ScoreBoardFile /var/run/apache_status
f143e4751c45b0c3854d17318975da221bd36aa7rbowen </example>
f143e4751c45b0c3854d17318975da221bd36aa7rbowen
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron <p>File-based shared memory is useful for third-party applications
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron that require direct access to the scoreboard.</p>
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron <p>If you use a <directive>ScoreBoardFile</directive> then
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive you may see improved speed by placing it on a RAM disk. But be
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive careful that you heed the same warnings about log file placement
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive and <a href="/misc/security_tips.html">security</a>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><a href="/stopping.html">Stopping and Restarting
9cd774340b4867bf4803ab6998450c8d39d0c0c3ndApache</a></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>SendBufferSize</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>TCP buffer size</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>SendBufferSize <var>bytes</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>SendBufferSize 0</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>leader</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_netware</module><module>mpm_winnt</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpmt_os2</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The server will set the TCP buffer size to the number of bytes
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive specified. Very useful to increase past standard OS defaults on
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive high speed high latency (<em>i.e.</em>, 100ms or so, such as
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive transcontinental fast pipes).</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>If set to the value of <code>0</code>, the server will use the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd OS deault.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>ServerLimit</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Upper limit on configurable number of processes</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>ServerLimit <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>perchild</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>For the <module>prefork</module> MPM, this directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive maximum configured value for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> for the lifetime of the
54240e863796e3f085dd1783897201a5d99c33d9nd Apache process. For the <module>worker</module> MPM, this directive
54240e863796e3f085dd1783897201a5d99c33d9nd in combination with <directive
54240e863796e3f085dd1783897201a5d99c33d9nd module="mpm_common">ThreadLimit</directive> sets
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the maximum configured value for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> for the lifetime of the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Apache process. Any attempts to change this directive during a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive restart will be ignored, but <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> can be modified during
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive a restart.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Special care must be taken when using this directive. If
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive>ServerLimit</directive> is set to a value much higher
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive than necessary, extra, unused shared memory will be allocated. If
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive both <directive>ServerLimit</directive> and <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> are set to values
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive higher than the system can handle, Apache may not start or the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive system may become unstable.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>With the <module>prefork</module> MPM, use this directive only
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive if you need to set <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mpm_common">MaxClients</directive> higher than 256 (default).
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Do not set the value of this directive any higher than what you
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive might want to set <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> to.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>With <module>worker</module>, <module>leader</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>threadpool</module> use this directive only
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive if your <directive module="mpm_common">MaxClients</directive> and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mpm_common">ThreadsPerChild</directive>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd settings require more than 16 server processes (default). Do not set
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the value of this directive any higher than the number of server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive processes required by what you may want for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients </directive> and <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive>.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>With the <module>perchild</module> MPM, use this directive only
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd if you need to set <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="perchild">NumServers</directive> higher than 8 (default).</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note><title>Note</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>There is a hard limit of <code>ServerLimit 20000</code> compiled
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd into the server. This is intended to avoid nasty effects caused by
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd typos.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><a href="/stopping.html">Stopping and Restarting Apache</a></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>StartServers</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of child server processes created at startup</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>StartServers <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>mpmt_os2</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>StartServers</directive> directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive number of child server processes created on startup. As the number
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive of processes is dynamically controlled depending on the load,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive there is usually little reason to adjust this parameter.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The default value differs from MPM to MPM. For
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>leader</module>, <module>threadpool</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>worker</module> the default is <code>StartServers 3</code>.
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd For <module>prefork</module> defaults to <code>5</code> and for
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>mpmt_os2</module> to <code>2</code>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>StartThreads</name>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<description>Number of threads created on startup</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>StartThreads <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>mpm_netware</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>Number of threads created on startup. As the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive number of threads is dynamically controlled depending on the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive load, there is usually little reason to adjust this
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive parameter.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>For <module>perchild</module> the default is <code>StartThreads
9ccc5ea873440dd766924e16d9dab2989d81a175slive 5</code> and this directive tracks the number of threads per
9ccc5ea873440dd766924e16d9dab2989d81a175slive process at startup.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>For <module>mpm_netware</module> the default is
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>StartThreads 50</code> and, since there is only a single
9ccc5ea873440dd766924e16d9dab2989d81a175slive process, this is the total number of threads created at startup to
9ccc5ea873440dd766924e16d9dab2989d81a175slive serve requests.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>For <module>beos</module> the default is <code>StartThreads
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd 10</code>. It also reflects the total number of threads created
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd at startup to serve requests.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>ThreadLimit</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Sets the upper limit on the configurable number of threads
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveper child process</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>ThreadLimit <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>mpm_winnt</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module><module>threadpool</module><module>worker</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</modulelist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<compatibility>Available for <module>mpm_winnt</module> in Apache 2.0.41
9cd774340b4867bf4803ab6998450c8d39d0c0c3ndand later</compatibility>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This directive sets the maximum configured value for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive> for the lifetime
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive of the Apache process. Any attempts to change this directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive during a restart will be ignored, but <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive> can be modified
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive during a restart up to the value of this directive.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Special care must be taken when using this directive. If
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive>ThreadLimit</directive> is set to a value much higher
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive than <directive module="mpm_common">ThreadsPerChild</directive>,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive extra unused shared memory will be allocated. If both
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive>ThreadLimit</directive> and <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive> are set to values
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive higher than the system can handle, Apache may not start or the
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive system may become unstable. Do not set the value of this directive
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive any higher than your greatest predicted setting of <directive
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive module="mpm_common">ThreadsPerChild</directive> for the
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive current run of Apache.</p>
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive <p>The default value for <directive>ThreadLimit</directive> is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>1920</code> when used with <module>mpm_winnt</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>64</code> when used with the others.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note><title>Note</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>There is a hard limit of <code>ThreadLimit 20000</code> (or
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>ThreadLimit 15000</code> with <module>mpm_winnt</module>)
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd compiled into the server. This is intended to avoid nasty effects
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd caused by typos.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>ThreadsPerChild</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of threads created by each child process</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>ThreadsPerChild <var>number</var></syntax>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<default>See usage for details</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>mpm_winnt</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This directive sets the number of threads created by each
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive child process. The child creates these threads at startup and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd never creates more. If using an MPM like <module>mpm_winnt</module>,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd where there is only one child process, this number should be high
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive enough to handle the entire load of the server. If using an MPM
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd like <module>worker</module>, where there are multiple child processes,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the <em>total</em> number of threads should be high enough to handle
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the common load on the server.</p>
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The default value for <directive>ThreadsPerChild</directive> is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>64</code> when used with <module>mpm_winnt</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>25</code> when used with the others.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<name>User</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>The userid under which the server will answer
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliverequests</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>User <var>unix-userid</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>User #-1</default>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>perchild</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</modulelist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<compatibility>Only valid in global server config since Apache
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd2.0</compatibility>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<usage>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The <directive>User</directive> directive sets the user ID as
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive which the server will answer requests. In order to use this
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd directive, the server must be run initially as <code>root</code>.
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd If you start the server as a non-root user, it will fail to change
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd to the lesser privileged user, and will instead continue to run as
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd that original user. If you do start the server as <code>root</code>,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd then it is normal for the parent process to remain running as root.
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <var>Unix-userid</var> is one of:</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dl>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dt>A username</dt>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dd>Refers to the given user by name.</dd>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <dt># followed by a user number.</dt>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>Refers to a user by its number.</dd>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive </dl>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive <p>The user should have no privileges that result in it being
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive able to access files that are not intended to be visible to the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive outside world, and similarly, the user should not be able to
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd execute code that is not meant for HTTP requests. It is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive recommended that you set up a new user and group specifically for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive running the server. Some admins use user <code>nobody</code>, but
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive this is not always desirable, since the <code>nobody</code> user
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive can have other uses on the system.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note type="warning"><title>Security</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>Don't set <directive>User</directive> (or <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mpm_common">Group</directive>) to <code>root</code> unless
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd you know exactly what you are doing, and what the dangers are.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>With the <module>perchild</module> MPM, which is intended to
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd server virtual hosts run under different user IDs, the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive>User</directive> directive defines the user ID for the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd main server and the fallback for <directive type="section"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="core">VirtualHost</directive> sections without an
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="perchild">AssignUserID</directive> directive.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Special note: Use of this directive in <directive module="core"
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive type="section">VirtualHost</directive> is no longer supported. To
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd configure your server for <a href="/suexec.html">suexec</a> use
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mod_suexec">SuexecUserGroup</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <note><title>Note</title>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>Although the <directive>User</directive> directive is present
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd in the <module>beos</module> and <module>mpmt_os2</module> MPMs,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd it is actually a no-op there and only exists for compatibility
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd reasons.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</usage>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive
19a4850f339153b25a487667acb21ad8cced8825nd</modulesynopsis>