mpm_common.xml revision d04082f91ffc8a4a0ca04d5eccbdf90c00033a57
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<description>A collection of directives that are implemented by
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallynmore than one multi-processing module (MPM)</description>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<description>Method that Apache uses to serialize multiple children
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallynaccepting requests on network sockets</description>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<syntax>AcceptMutex Default|<var>method</var></syntax>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<contextlist><context>server config</context></contextlist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<modulelist><module>leader</module><module>perchild</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>prefork</module><module>threadpool</module><module>worker</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn</modulelist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>The <directive>AcceptMutex</directive> directives sets the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn method that Apache uses to serialize multiple children accepting
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn requests on network sockets. Prior to Apache 2.0, the method was
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn selectable only at compile time. The optimal method to use is
9ec45e7faa3648a36cb01aed9e230bd49b450fe0Serge Hallyn highly architecture and platform dependent. For further details,
9ec45e7faa3648a36cb01aed9e230bd49b450fe0Serge Hallyn see the <a href="/misc/perf-tuning.html">performance tuning</a>
9ec45e7faa3648a36cb01aed9e230bd49b450fe0Serge Hallyn documentation.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>If this directive is set to <code>Default</code>, then the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn compile-time selected default will be used. Other possible
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn methods are listed below. Note that not all methods are
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn available on all platforms. If a method is specified which is
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn not available, a message will be written to the error log
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn listing the available methods.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <dd>uses the <code>flock(2)</code> system call to lock the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn file defined by the <directive module="mpm_common"
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <dd>uses the <code>fcntl(2)</code> system call to lock the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn file defined by the <directive module="mpm_common"
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <dd>uses POSIX compatible semaphores to implement the mutex.</dd>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <dd>uses POSIX mutexes as implemented by the POSIX Threads
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn (PThreads) specification.</dd>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <dd>uses SySV-style semaphores to implement the mutex.</dd>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>If you want to find out the compile time chosen default
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn for your system, you may set your <directive module="core"
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn >LogLevel</directive> to <code>debug</code>. Then the default <directive
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn >AcceptMutex</directive> will be written into the <directive
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>On most systems, when the <code>pthread</code> option
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn is selected, if a child process terminates abnormally
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn while holding the <code>AcceptCntl</code> mutex the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn server will stop responding to requests. When this
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn occurs, the server will require a manual restart to
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn recover.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>Solaris is a notable exception as it provides a
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn mechanism, used by Apache, which usually allows the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn mutex to be recovered after a child process terminates
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn abnormally while holding a mutex.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>If your system implements the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <code>pthread_mutexattr_setrobust_np()</code> function,
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn you may be able to use the <code>pthread</code> option safely.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn</directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<description>Directory where Apache attempts to
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallynswitch before dumping core</description>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<syntax>CoreDumpDirectory <var>directory</var></syntax>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<default>See usage for the default setting</default>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<contextlist><context>server config</context></contextlist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<modulelist><module>beos</module><module>leader</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>mpm_winnt</module><module>perchild</module><module>prefork</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>threadpool</module><module>worker</module></modulelist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>This controls the directory to which Apache attempts to
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn switch before dumping core. The default is in the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <directive module="core">ServerRoot</directive> directory, however
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn since this should not be writable by the user the server runs
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn as, core dumps won't normally get written. If you want a core
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn dump for debugging, you can use this directive to place it in a
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn different location.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>If Apache starts as root and switches to another user, the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn Linux kernel <em>disables</em> core dumps even if the directory is
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn writable for the process. Apache (2.0.46 and later) reenables core dumps
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn on Linux 2.4 and beyond, but only if you explicitly configure a <directive
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn</directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<description>Group under which the server will answer
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallynrequests</description>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<contextlist><context>server config</context></contextlist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<modulelist><module>beos</module><module>leader</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>mpmt_os2</module><module>perchild</module><module>prefork</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>threadpool</module><module>worker</module></modulelist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<compatibility>Only valid in global server config since Apache
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn2.0</compatibility>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>The <directive>Group</directive> directive sets the group under
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn which the server will answer requests. In order to use this
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn directive, the server must be run initially as <code>root</code>. If
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn you start the server as a non-root user, it will fail to change to the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn specified group, and will instead continue to run as the group of the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn original user. <var>Unix-group</var> is one of:</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <dt><code>#</code> followed by a group number.</dt>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn Group www-group
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>It is recommended that you set up a new group specifically for
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn running the server. Some admins use user <code>nobody</code>,
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn but this is not always possible or desirable.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>Don't set <directive>Group</directive> (or <directive
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn module="mpm_common">User</directive>) to <code>root</code> unless
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn you know exactly what you are doing, and what the dangers are.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>Special note: Use of this directive in <directive module="core"
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn type="section">VirtualHost</directive> is no longer supported. To
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn configure your server for <a href="mod_suexec.html">suexec</a> use
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <directive module="mod_suexec">SuexecUserGroup</directive>.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>Although the <directive>Group</directive> directive is present
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn in the <module>beos</module> and <module>mpmt_os2</module> MPMs,
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn it is actually a no-op there and only exists for compatibility
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn reasons.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn</directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<description>File where the server records the process ID
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallynof the daemon</description>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<contextlist><context>server config</context></contextlist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<modulelist><module>beos</module><module>leader</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>mpm_winnt</module><module>mpmt_os2</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>perchild</module><module>prefork</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>threadpool</module><module>worker</module></modulelist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>The <directive>PidFile</directive> directive sets the file to
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn which the server records the process id of the daemon. If the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn filename is not absolute then it is assumed to be relative to the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <directive module="core">ServerRoot</directive>.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>It is often useful to be able to send the server a signal,
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn so that it closes and then re-opens its <directive
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn module="core">ErrorLog</directive> and <directive
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn module="mod_log_config">TransferLog</directive>, and
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn re-reads its configuration files. This is done by sending a
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn SIGHUP (kill -1) signal to the process id listed in the
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>The <directive>PidFile</directive> is subject to the same
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn warnings about log file placement and <a
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn href="/misc/security_tips.html#serverroot">security</a>.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn <p>As of Apache 2 it is recommended to use only the <a
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn href="/programs/apachectl.html">apachectl</a> script for
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn (re-)starting or stopping the server.</p>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn</directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<directivesynopsis>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<description>IP addresses and ports that the server
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallynlistens to</description>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<syntax>Listen [<var>IP-address</var>:]<var>portnumber</var></syntax>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<contextlist><context>server config</context></contextlist>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<modulelist><module>beos</module><module>leader</module>
8aa1044fd83c407e38c66a1ff46a9edfe02d7c78Serge Hallyn<module>mpm_netware</module><module>mpm_winnt</module>