mpm_common.xml revision db479b48bd4d75423ed4a45e15b75089d1a8ad72
64154a07803c72f624008f5c77de844607fcc5a5patrikj<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>A collection of directives that are implemented by
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivemore than one multi-processing module (MPM)</description>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<description>Method that Apache uses to serialize multiple children
9cd774340b4867bf4803ab6998450c8d39d0c0c3ndaccepting requests on network sockets</description>
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 <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 <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 <dd>uses the <code>flock(2)</code> system call to lock the
54240e863796e3f085dd1783897201a5d99c33d9nd <dd>uses the <code>fcntl(2)</code> system call to lock the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>uses POSIX compatible semaphores to implement the mutex.</dd>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>uses POSIX mutexes as implemented by the POSIX Threads
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd (PThreads) specification.</dd>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <dd>uses SySV-style semaphores to implement the mutex.</dd>
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
326a65297c83c82414fe53aa055623a93193e0d1rederpj <p>On most systems, when the <code>pthread</code> option
326a65297c83c82414fe53aa055623a93193e0d1rederpj is selected, if a child process terminates abnormally
326a65297c83c82414fe53aa055623a93193e0d1rederpj server will stop responding to requests. When this
326a65297c83c82414fe53aa055623a93193e0d1rederpj occurs, the server will require a manual restart to
326a65297c83c82414fe53aa055623a93193e0d1rederpj recover.</p>
326a65297c83c82414fe53aa055623a93193e0d1rederpj <p>Solaris is a notable exception as it provides a
326a65297c83c82414fe53aa055623a93193e0d1rederpj mechanism, used by Apache, which usually allows the
326a65297c83c82414fe53aa055623a93193e0d1rederpj mutex to be recovered after a child process terminates
326a65297c83c82414fe53aa055623a93193e0d1rederpj abnormally while holding a mutex.</p>
326a65297c83c82414fe53aa055623a93193e0d1rederpj <p>If your system implements the
326a65297c83c82414fe53aa055623a93193e0d1rederpj <code>pthread_mutexattr_setrobust_np()</code> function,
326a65297c83c82414fe53aa055623a93193e0d1rederpj you may be able to use the <code>pthread</code> option safely.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>Directory where Apache attempts to
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveswitch before dumping core</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_winnt</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
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 <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
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd<directivesynopsis>
c14a429adc9ca5470465227e394d7d09e0489c0fnd<description>Enables a hook that runs exception handlers
c14a429adc9ca5470465227e394d7d09e0489c0fndafter a crash</description>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd<contextlist><context>server config</context></contextlist>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd<modulelist><module>leader</module><module>perchild</module>
b486875444fd9dbe1a7fe6137616639f3e5d6d86nd<compatibility>Available in version 2.0.49 and later</compatibility>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd <p>For safety reasons this directive is only available if the server was
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd configured with the <code>--enable-exception-hook</code> option. It
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd enables a hook that allows external modules to plug in and do something
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd after a child crashed.</p>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd <p>There are already two modules, <code>mod_whatkilledus</code> and
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd <code>mod_backtrace</code> that make use of this hook. Please have a
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd look at Jeff Trawick's <a
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd href="http://www.apache.org/~trawick/exception_hook.html"
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd >EnableExceptionHook site</a> for more information about these.</p>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd</directivesynopsis>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<directivesynopsis>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<description>Specify a timeout after which a gracefully shutdown server
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colmwill exit.</description>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<syntax>GracefulShutDownTimeout <var>seconds</var></syntax>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<contextlist><context>server config</context></contextlist>
2a869ee6594f1e3e9039af332cd73f939509483acolm<modulelist><module>prefork</module><module>worker</module>
d7473ba3fbde7fc5c254f44fe515f6cfa765e2f2colm<compatibility>Available in version 2.2 and later</compatibility>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm <p>The <directive>GracefulShutdownTimeout</directive> specifies
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm how many seconds after receiving a "graceful-stop" signal, a
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm server should continue to run, handling the existing connections.</p>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm <p>Setting this value to zero means that the server will wait
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm indefinitely until all remaining requests have been fully served.</p>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>Group under which the server will answer
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliverequests</description>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<contextlist><context>server config</context></contextlist>
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 <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
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd Group www-group
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd </example>
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>
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 <p>Special note: Use of this directive in <directive module="core"
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd type="section">VirtualHost</directive> is no longer supported. To
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="mod_suexec">SuexecUserGroup</directive>.</p>
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>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>File where the server records the process ID
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveof the daemon</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
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
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
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive re-reads its configuration files. This is done by sending a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive SIGHUP (kill -1) signal to the process id listed in the
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>
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd <p>As of Apache 2 it is recommended to use only the <program>
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd apachectl</program> script for (re-)starting or stopping the server.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>IP addresses and ports that the server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivelistens to</description>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<syntax>Listen [<var>IP-address</var>:]<var>portnumber</var> [<var>protocol</var>]</syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<compatibility>Required directive since Apache 2.0<br/>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquernaThe <var>protocol</var> argument was added in 2.1.5</compatibility>
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>
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>
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 <p>For example, to make the server accept connections on both
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive port 80 and port 8000, use:</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 80<br />
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 8000
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>To make the server accept connections on two specified
64154a07803c72f624008f5c77de844607fcc5a5patrikj interfaces and port numbers, use </p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 192.170.2.1:80<br />
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 192.170.2.5:8000
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>IPv6 addresses must be surrounded in square brackets, as in the
64154a07803c72f624008f5c77de844607fcc5a5patrikj following example:</p>
cf02129aebf73dd0bdf369b172eb481ff76ac5f6colm Listen [2001:db8::a00:20ff:fea7:ccea]:80
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <p>The optional <var>protocol</var> argument is not required for most
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna configurations. If not specified, <code>https</code> is the default for
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna port 443 and <code>http</code> the default for all other ports. The
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna protocol is used to determine which module should handle a request, and
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna to apply protocol specific optimizations with the
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <directive module="core">AcceptFilter</directive> directive.</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <p>You only need to set the protocol if you are running on non-standard
f56793983a4c02ae0b0a6b0c4060a2e1dc0e2ee6colm ports. For example, running an <code>https</code> site on port 8443:</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna Listen 192.170.2.1:8443 https
8ebf547c0bfe76d92570d7cec20fa0e1d3d8df00nd Multiple <directive>Listen</directive> directives for the same ip
8ebf547c0bfe76d92570d7cec20fa0e1d3d8df00nd address and port will result in an <code>Address already in use</code>
8ebf547c0bfe76d92570d7cec20fa0e1d3d8df00nd error message.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><a href="/dns-caveats.html">DNS Issues</a></seealso>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><a href="/bind.html">Setting which addresses and ports Apache
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum length of the queue of pending connections</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpmt_os2</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
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 <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</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Location of the accept serialization lock file</description>
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 <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>
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>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><directive module="mpm_common">AcceptMutex</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of child processes that will be created
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveto serve requests</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>prefork</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
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>
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>
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 >ThreadsPerChild</directive>). Therefore, to increase <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >MaxClients</directive> to a value that requires more than 16 processes,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<description>Maximum amount of memory that the main allocator is allowed
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<contextlist><context>server config</context></contextlist>
d04082f91ffc8a4a0ca04d5eccbdf90c00033a57stoddard<module>threadpool</module><module>worker</module><module>mpm_winnt</module></modulelist>
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</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Limit on the number of requests that an individual child server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivewill handle during its life</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>leader</module><module>mpm_netware</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
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 <p>The default value for <module>mpm_netware</module> and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Setting <directive>MaxRequestsPerChild</directive> to a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive non-zero limit has two beneficial effects:</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <li>it limits the amount of memory that process can consume
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive by (accidental) memory leakage;</li>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <li>by giving processes a finite lifetime, it helps reduce
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the number of processes when the server load reduces.</li>
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>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of idle threads</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Maximum number of idle threads. Different MPMs deal with this
9ccc5ea873440dd766924e16d9dab2989d81a175slive directive differently.</p>
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>
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>
9ccc5ea873440dd766924e16d9dab2989d81a175slive single-process, the spare thread count is also server-wide.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p><module>beos</module> and <module>mpmt_os2</module> work
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>beos</module> is <code>MaxSpareThreads 50</code>. For
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>mpmt_os2</module> the default value is <code>10</code>.</p>
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 >MaxSpareThreads</directive> to be less or equal than <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <li><module>mpm_netware</module> wants the value to be greater than
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="mpm_common">MinSpareThreads</directive>.</li>
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>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Minimum number of idle threads available to handle request
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivespikes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>perchild</module><module>threadpool</module><module>worker</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Minimum number of idle threads to handle request spikes.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Different MPMs deal with this directive
9ccc5ea873440dd766924e16d9dab2989d81a175slive differently.</p>
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 <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 <code>MinSpareThreads 10</code> and, since it is a single-process
9ccc5ea873440dd766924e16d9dab2989d81a175slive MPM, tracks this on a server-wide bases.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p><module>beos</module> and <module>mpmt_os2</module> work
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>beos</module> is <code>MinSpareThreads 1</code>. For
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>mpmt_os2</module> the default value is <code>5</code>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Location of the file used to store coordination data for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivethe child processes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpm_winnt</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
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 <p>File-based shared memory is useful for third-party applications
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron that require direct access to the scoreboard.</p>
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</directivesynopsis>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<directivesynopsis>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<contextlist><context>server config</context></contextlist>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<modulelist><module>beos</module><module>leader</module>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<module>mpmt_os2</module><module>perchild</module><module>prefork</module>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<module>threadpool</module><module>worker</module></modulelist>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas <p>The server will set the TCP receive buffer size to the number of
cc934828f4a719743a3387516f6fa71dd2cc88ffstas bytes specified.</p>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas <p>If set to the value of <code>0</code>, the server will use the
cc934828f4a719743a3387516f6fa71dd2cc88ffstas OS default.</p>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>mpmt_os2</module><module>perchild</module><module>prefork</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<module>threadpool</module><module>worker</module></modulelist>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas <p>The server will set the TCP send 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 <p>If set to the value of <code>0</code>, the server will use the
cc934828f4a719743a3387516f6fa71dd2cc88ffstas OS default.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Upper limit on configurable number of processes</description>
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 <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
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 <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 <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
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>With <module>worker</module>, <module>leader</module> and
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
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 <p>There is a hard limit of <code>ServerLimit 20000</code> compiled
ebfb4ab01e55fba4cb5e4b30be6a8ed71f650deferikabele into the server (for the <module>prefork</module> MPM 200000). This is
ebfb4ab01e55fba4cb5e4b30be6a8ed71f650deferikabele intended to avoid nasty effects caused by typos.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><a href="/stopping.html">Stopping and Restarting Apache</a></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of child server processes created at startup</description>
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 <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 <p>The default value differs from MPM to MPM. For
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <module>worker</module> the default is <code>StartServers 3</code>.
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd For <module>prefork</module> defaults to <code>5</code> and for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<description>Number of threads created on startup</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<modulelist><module>beos</module><module>mpm_netware</module>
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 <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 <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>
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</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Sets the upper limit on the configurable number of threads
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveper child process</description>
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 <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 <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 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 <p>The default value for <directive>ThreadLimit</directive> is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>1920</code> when used with <module>mpm_winnt</module> and
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>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of threads created by each child process</description>
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 <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>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The default value for <directive>ThreadsPerChild</directive> is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>64</code> when used with <module>mpm_winnt</module> and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<directivesynopsis>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<description>The size in bytes of the stack used by threads handling
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawickclient connections</description>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<default>65536 on NetWare; varies on other operating systems</default>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<contextlist><context>server config</context></contextlist>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<modulelist><module>leader</module><module>mpm_netware</module>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick</modulelist>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<compatibility>Available in Apache 2.1 and later</compatibility>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick <p>The <directive>ThreadStackSize</directive> directive sets the
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick size of the stack (for autodata) of threads which handle client
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick connections and call modules to help process those connections.
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick In most cases the operating system default for stack size is
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick reasonable, but there are some conditions where it may need to be
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick adjusted:</p>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick <li>On platforms with a relatively small default thread stack size
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick (e.g., HP-UX), Apache may crash when using some third-party modules
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick which use a relatively large amount of autodata storage. Those
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick same modules may have worked fine on other platforms where the
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick default thread stack size is larger. This type of crash is
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick resolved by setting <directive>ThreadStackSize</directive> to a
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick value higher than the operating system default. This type of
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick adjustment is necessary only if the provider of the third-party
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick module specifies that it is required, or if diagnosis of an Apache
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick crash indicates that the thread stack size was too small.</li>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick <li>On platforms where the default thread stack size is
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick significantly larger than necessary for the web server
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick configuration, a higher number of threads per child process
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick will be achievable if <directive>ThreadStackSize</directive> is
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick set to a value lower than the operating system default. This type
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick of adjustment should only be made in a test environment which allows
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick the full set of web server processing can be exercised, as there
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick may be infrequent requests which require more stack to process.
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick A change in the web server configuration can invalidate the
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick current <directive>ThreadStackSize</directive> setting.</li>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>The userid under which the server will answer
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliverequests</description>
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>
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.
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>
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 <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 <p>Special note: Use of this directive in <directive module="core"
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive type="section">VirtualHost</directive> is no longer supported. To
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mod_suexec">SuexecUserGroup</directive>.</p>
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>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
19a4850f339153b25a487667acb21ad8cced8825nd</modulesynopsis>