<p>The <code class="directive">AcceptMutex</code> directives sets the
method that Apache uses to serialize multiple children accepting
requests on network sockets. Prior to Apache 2.0, the method was
selectable only at compile time. The optimal method to use is
highly architecture and platform dependent. For further details,
see the <a href="../misc/perf-tuning.html">performance tuning</a>
documentation.</p>
<p>If this directive is set to <code>Default</code>, then the
compile-time selected default will be used. Other possible
methods are listed below. Note that not all methods are
available on all platforms. If a method is specified which is
not available, a message will be written to the error log
listing the available methods.</p>
<dl>
<dt><code>flock</code></dt>
<dd>uses the <code>flock(2)</code> system call to lock the
file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd>
<dt><code>fcntl</code></dt>
<dd>uses the <code>fcntl(2)</code> system call to lock the
file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd>
<dt><code>posixsem</code></dt>
<dd>uses POSIX compatible semaphores to implement the mutex.</dd>
<dt><code>pthread</code></dt>
<dd>uses POSIX mutexes as implemented by the POSIX Threads
(PThreads) specification.</dd>
<dt><code>sysvsem</code></dt>
<dd>uses SySV-style semaphores to implement the mutex.</dd>
</dl>
<p>If you want to find out the compile time chosen default
for your system, you may set your <code class="directive"><a href="../mod/core.html#loglevel">LogLevel</a></code> to <code>debug</code>. Then the default <code class="directive">AcceptMutex</code> will be written into the <code class="directive"><a href="../mod/core.html#errorlog">ErrorLog</a></code>.</p>
<div class="warning"><h3>Warning</h3>
<p>On most systems, when the <code>pthread</code> option
is selected, if a child process terminates abnormally
while holding the <code>AcceptCntl</code> mutex the
server will stop responding to requests. When this
occurs, the server will require a manual restart to
recover.</p>
<p>Solaris is a notable exception as it provides a
mechanism, used by Apache, which usually allows the
mutex to be recovered after a child process terminates
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Only valid in global server config since Apache
2.0</td></tr>
</table>
<p>The <code class="directive">Group</code> directive sets the group under
which the server will answer requests. In order to use this
directive, the server must be run initially as <code>root</code>. If
you start the server as a non-root user, it will fail to change to the
specified group, and will instead continue to run as the group of the
original user. <var>Unix-group</var> is one of:</p>
<dl>
<dt>A group name</dt>
<dd>Refers to the given group by name.</dd>
<dt><code>#</code> followed by a group number.</dt>
<dd>Refers to a group by its number.</dd>
</dl>
<div class="example"><h3>Example</h3><p><code>
Group www-group
</code></p></div>
<p>It is recommended that you set up a new group specifically for
running the server. Some admins use user <code>nobody</code>,
but this is not always possible or desirable.</p>
<div class="warning"><h3>Security</h3>
<p>Don't set <code class="directive">Group</code> (or <code class="directive"><a href="#user">User</a></code>) to <code>root</code> unless
you know exactly what you are doing, and what the dangers are.</p>
</div>
<p>Special note: Use of this directive in <code class="directive"><a href="../mod/core.html#virtualhost"><VirtualHost></a></code> is no longer supported. To
configure your server for <code class="program"><a href="../programs/suexec.html">suexec</a></code> use
<p>Although the <code class="directive">Group</code> directive is present
in the <code class="module"><a href="../mod/beos.html">beos</a></code> and <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> MPMs,
it is actually a no-op there and only exists for compatibility
<p>For threaded and hybrid servers (<em>e.g.</em> <code class="module"><a href="../mod/beos.html">beos</a></code>
or <code class="module"><a href="../mod/worker.html">worker</a></code>) <code class="directive">MaxClients</code> restricts
the total number of threads that will be available to serve clients.
The default value for <code class="module"><a href="../mod/beos.html">beos</a></code> is <code>50</code>. For
hybrid MPMs the default value is <code>16</code> (<code class="directive"><a href="#serverlimit">ServerLimit</a></code>) multiplied by the value of
<code>25</code> (<code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>). Therefore, to increase <code class="directive">MaxClients</code> to a value that requires more than 16 processes,
you must also raise <code class="directive"><a href="#serverlimit">ServerLimit</a></code>.</p>
<p>It is often useful to be able to send the server a signal,
so that it closes and then re-opens its <code class="directive"><a href="../mod/core.html#errorlog">ErrorLog</a></code> and <code class="directive"><a href="../mod/mod_log_config.html#transferlog">TransferLog</a></code>, and
re-reads its configuration files. This is done by sending a
SIGHUP (kill -1) signal to the process id listed in the
<code class="directive">PidFile</code>.</p>
<p>The <code class="directive">PidFile</code> is subject to the same
warnings about log file placement and <a href="../misc/security_tips.html#serverroot">security</a>.</p>
<div class="note"><h3>Note</h3>
<p>As of Apache 2 it is recommended to use only the <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> script for (re-)starting or stopping the server.</p>
settings require more than 16 server processes (default). Do not set
the value of this directive any higher than the number of server
processes required by what you may want for <code class="directive"><a href="#maxclients ">MaxClients </a></code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>.</p>
<div class="note"><h3>Note</h3>
<p>There is a hard limit of <code>ServerLimit 20000</code> compiled
into the server (for the <code class="module"><a href="../mod/prefork.html">prefork</a></code> MPM 200000). This is
intended to avoid nasty effects caused by typos.</p>
</div>
<h3>See also</h3>
<ul>
<li><a href="../stopping.html">Stopping and Restarting Apache</a></li>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available for <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> in Apache 2.0.41
and later</td></tr>
</table>
<p>This directive sets the maximum configured value for <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the lifetime
of the Apache process. Any attempts to change this directive
during a restart will be ignored, but <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> can be modified
during a restart up to the value of this directive.</p>
<p>Special care must be taken when using this directive. If
<code class="directive">ThreadLimit</code> is set to a value much higher
than <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>,
extra unused shared memory will be allocated. If both
<code class="directive">ThreadLimit</code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> are set to values
higher than the system can handle, Apache may not start or the
system may become unstable. Do not set the value of this directive
any higher than your greatest predicted setting of <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the
current run of Apache.</p>
<p>The default value for <code class="directive">ThreadLimit</code> is
<code>1920</code> when used with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> and
<code>64</code> when used with the others.</p>
<div class="note"><h3>Note</h3>
<p>There is a hard limit of <code>ThreadLimit 20000</code> (or
<code>ThreadLimit 15000</code> with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>)
compiled into the server. This is intended to avoid nasty effects
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Only valid in global server config since Apache
2.0</td></tr>
</table>
<p>The <code class="directive">User</code> directive sets the user ID as
which the server will answer requests. In order to use this
directive, the server must be run initially as <code>root</code>.
If you start the server as a non-root user, it will fail to change
to the lesser privileged user, and will instead continue to run as
that original user. If you do start the server as <code>root</code>,
then it is normal for the parent process to remain running as root.
<var>Unix-userid</var> is one of:</p>
<dl>
<dt>A username</dt>
<dd>Refers to the given user by name.</dd>
<dt># followed by a user number.</dt>
<dd>Refers to a user by its number.</dd>
</dl>
<p>The user should have no privileges that result in it being
able to access files that are not intended to be visible to the
outside world, and similarly, the user should not be able to
execute code that is not meant for HTTP requests. It is
recommended that you set up a new user and group specifically for
running the server. Some admins use user <code>nobody</code>, but
this is not always desirable, since the <code>nobody</code> user
can have other uses on the system.</p>
<div class="warning"><h3>Security</h3>
<p>Don't set <code class="directive">User</code> (or <code class="directive"><a href="#group">Group</a></code>) to <code>root</code> unless
you know exactly what you are doing, and what the dangers are.</p>
</div>
<p>Special note: Use of this directive in <code class="directive"><a href="../mod/core.html#virtualhost"><VirtualHost></a></code> is no longer supported. To
configure your server for <code class="program"><a href="../programs/suexec.html">suexec</a></code> use
<p>Although the <code class="directive">User</code> directive is present
in the <code class="module"><a href="../mod/beos.html">beos</a></code> and <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> MPMs,
it is actually a no-op there and only exists for compatibility
reasons.</p>
</div>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../de/mod/mpm_common.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
<a href="../en/mod/mpm_common.html" title="English"> en </a> |
<a href="../ja/mod/mpm_common.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
</div><div id="footer">
<p class="apache">Copyright 2007 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>