mpm_common.html.en revision 7e8f5c6496b3825b6b128e2aacc4b1b09d28553d
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<?xml version="1.0" encoding="ISO-8859-1"?>
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
a72f7ea693101cc48bafbb4db6bb437d828011c4ql XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a72f7ea693101cc48bafbb4db6bb437d828011c4ql This file is generated from xml source: DO NOT EDIT
a72f7ea693101cc48bafbb4db6bb437d828011c4ql XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a72f7ea693101cc48bafbb4db6bb437d828011c4ql -->
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<title>mpm_common - Apache HTTP Server</title>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<link href="/images/favicon.ico" rel="shortcut icon" /></head>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<body>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div id="page-header">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<p class="apache">Apache HTTP Server Version 2.1</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<img alt="" src="/images/feather.gif" /></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div id="path">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Modules</a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div id="page-content">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div id="preamble"><h1>Apache MPM Common Directives</h1>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="toplang">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<p><span>Available Languages: </span><a href="/de/mod/mpm_common.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<a href="/en/mod/mpm_common.html" title="English">&nbsp;en&nbsp;</a> |
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<a href="/ja/mod/mpm_common.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>A collection of directives that are implemented by
a72f7ea693101cc48bafbb4db6bb437d828011c4qlmore than one multi-processing module (MPM)</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="module-dict.html#Status">Status:</a></th><td>MPM</td></tr></table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div id="quickview"><h3 class="directives">Directives</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<ul id="toc">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#acceptmutex">AcceptMutex</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#coredumpdirectory">CoreDumpDirectory</a></li>
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<li><img alt="" src="/images/down.gif" /> <a href="#enableexceptionhook">EnableExceptionHook</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#group">Group</a></li>
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<li><img alt="" src="/images/down.gif" /> <a href="#listen">Listen</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#listenbacklog">ListenBackLog</a></li>
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<li><img alt="" src="/images/down.gif" /> <a href="#lockfile">LockFile</a></li>
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<li><img alt="" src="/images/down.gif" /> <a href="#maxclients">MaxClients</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#maxmemfree">MaxMemFree</a></li>
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<li><img alt="" src="/images/down.gif" /> <a href="#maxrequestsperchild">MaxRequestsPerChild</a></li>
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer<li><img alt="" src="/images/down.gif" /> <a href="#maxsparethreads">MaxSpareThreads</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#minsparethreads">MinSpareThreads</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#pidfile">PidFile</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#scoreboardfile">ScoreBoardFile</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#sendbuffersize">SendBufferSize</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#serverlimit">ServerLimit</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#startservers">StartServers</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#startthreads">StartThreads</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#threadlimit">ThreadLimit</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#threadsperchild">ThreadsPerChild</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#threadstacksize">ThreadStackSize</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><img alt="" src="/images/down.gif" /> <a href="#user">User</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="AcceptMutex" id="AcceptMutex">AcceptMutex</a> <a name="acceptmutex" id="acceptmutex">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Method that Apache uses to serialize multiple children
a72f7ea693101cc48bafbb4db6bb437d828011c4qlaccepting requests on network sockets</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptMutex Default|<var>method</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptMutex Default</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">AcceptMutex</code> directives sets the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql method that Apache uses to serialize multiple children accepting
a72f7ea693101cc48bafbb4db6bb437d828011c4ql requests on network sockets. Prior to Apache 2.0, the method was
a72f7ea693101cc48bafbb4db6bb437d828011c4ql selectable only at compile time. The optimal method to use is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql highly architecture and platform dependent. For further details,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql see the <a href="/misc/perf-tuning.html">performance tuning</a>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql documentation.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>If this directive is set to <code>Default</code>, then the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql compile-time selected default will be used. Other possible
a72f7ea693101cc48bafbb4db6bb437d828011c4ql methods are listed below. Note that not all methods are
a72f7ea693101cc48bafbb4db6bb437d828011c4ql available on all platforms. If a method is specified which is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql not available, a message will be written to the error log
020c47705d28102a8df83a43ddf08e34dde21f22ql listing the available methods.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dl>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dt><code>flock</code></dt>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dd>uses the <code>flock(2)</code> system call to lock the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dt><code>fcntl</code></dt>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dd>uses the <code>fcntl(2)</code> system call to lock the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dt><code>posixsem</code></dt>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dd>uses POSIX compatible semaphores to implement the mutex.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dt><code>pthread</code></dt>
020c47705d28102a8df83a43ddf08e34dde21f22ql <dd>uses POSIX mutexes as implemented by the POSIX Threads
a72f7ea693101cc48bafbb4db6bb437d828011c4ql (PThreads) specification.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dt><code>sysvsem</code></dt>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dd>uses SySV-style semaphores to implement the mutex.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </dl>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>If you want to find out the compile time chosen default
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 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>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="warning"><h3>Warning</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>On most systems, when the <code>pthread</code> option
a72f7ea693101cc48bafbb4db6bb437d828011c4ql is selected, if a child process terminates abnormally
a72f7ea693101cc48bafbb4db6bb437d828011c4ql while holding the <code>AcceptCntl</code> mutex the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql server will stop responding to requests. When this
020c47705d28102a8df83a43ddf08e34dde21f22ql occurs, the server will require a manual restart to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql recover.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Solaris is a notable exception as it provides a
a72f7ea693101cc48bafbb4db6bb437d828011c4ql mechanism, used by Apache, which usually allows the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql mutex to be recovered after a child process terminates
a72f7ea693101cc48bafbb4db6bb437d828011c4ql abnormally while holding a mutex.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>If your system implements the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>pthread_mutexattr_setrobust_np()</code> function,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql you may be able to use the <code>pthread</code> option safely.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="CoreDumpDirectory" id="CoreDumpDirectory">CoreDumpDirectory</a> <a name="coredumpdirectory" id="coredumpdirectory">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory where Apache attempts to
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Liswitch before dumping core</td></tr>
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CoreDumpDirectory <var>directory</var></code></td></tr>
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for the default setting</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>This controls the directory to which Apache attempts to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql switch before dumping core. The default is in the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> directory, however
a72f7ea693101cc48bafbb4db6bb437d828011c4ql since this should not be writable by the user the server runs
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li as, core dumps won't normally get written. If you want a core
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li dump for debugging, you can use this directive to place it in a
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li different location.</p>
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer <div class="note"><h3>Core Dumps on Linux</h3>
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer <p>If Apache starts as root and switches to another user, the
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li Linux kernel <em>disables</em> core dumps even if the directory is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql writable for the process. Apache (2.0.46 and later) reenables core dumps
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer on Linux 2.4 and beyond, but only if you explicitly configure a <code class="directive">CoreDumpDirectory</code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="EnableExceptionHook" id="EnableExceptionHook">EnableExceptionHook</a> <a name="enableexceptionhook" id="enableexceptionhook">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables a hook that runs exception handlers
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyerafter a crash</td></tr>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableExceptionHook On|Off</code></td></tr>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableExceptionHook Off</code></td></tr>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.49 and later</td></tr>
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For safety reasons this directive is only available if the server was
a72f7ea693101cc48bafbb4db6bb437d828011c4ql configured with the <code>--enable-exception-hook</code> option. It
a72f7ea693101cc48bafbb4db6bb437d828011c4ql enables a hook that allows external modules to plug in and do something
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li after a child crashed.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>There are already two modules, <code>mod_whatkilledus</code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>mod_backtrace</code> that make use of this hook. Please have a
9aa73b6813b3fd35e78fcc44fd17535e765e504cQin Michael Li look at Jeff Trawick's <a href="http://www.apache.org/~trawick/exception_hook.html">EnableExceptionHook site</a> for more information about these.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="Group" id="Group">Group</a> <a name="group" id="group">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Group under which the server will answer
a72f7ea693101cc48bafbb4db6bb437d828011c4qlrequests</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Group <var>unix-group</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Group #-1</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Only valid in global server config since Apache
a72f7ea693101cc48bafbb4db6bb437d828011c4ql2.0</td></tr>
020c47705d28102a8df83a43ddf08e34dde21f22ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">Group</code> directive sets the group under
a72f7ea693101cc48bafbb4db6bb437d828011c4ql which the server will answer requests. In order to use this
a72f7ea693101cc48bafbb4db6bb437d828011c4ql directive, the server must be run initially as <code>root</code>. If
a72f7ea693101cc48bafbb4db6bb437d828011c4ql you start the server as a non-root user, it will fail to change to the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql specified group, and will instead continue to run as the group of the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql original user. <var>Unix-group</var> is one of:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li <dl>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li <dt>A group name</dt>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li <dd>Refers to the given group by name.</dd>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li <dt><code>#</code> followed by a group number.</dt>
94d05f6c7f329fdf908da99ab50b37d3d33f9fe5Qin Michael Li <dd>Refers to a group by its number.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </dl>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="example"><h3>Example</h3><p><code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Group www-group
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </code></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>It is recommended that you set up a new group specifically for
a72f7ea693101cc48bafbb4db6bb437d828011c4ql running the server. Some admins use user <code>nobody</code>,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql but this is not always possible or desirable.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="warning"><h3>Security</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Don't set <code class="directive">Group</code> (or <code class="directive"><a href="#user">User</a></code>) to <code>root</code> unless
a72f7ea693101cc48bafbb4db6bb437d828011c4ql you know exactly what you are doing, and what the dangers are.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Special note: Use of this directive in <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> is no longer supported. To
a72f7ea693101cc48bafbb4db6bb437d828011c4ql configure your server for <code class="program"><a href="/programs/suexec.html">suexec</a></code> use
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="/mod/mod_suexec.html#suexecusergroup">SuexecUserGroup</a></code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Note</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Although the <code class="directive">Group</code> directive is present
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 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,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql it is actually a no-op there and only exists for compatibility
a72f7ea693101cc48bafbb4db6bb437d828011c4ql reasons.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="Listen" id="Listen">Listen</a> <a name="listen" id="listen">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>IP addresses and ports that the server
a72f7ea693101cc48bafbb4db6bb437d828011c4qllistens to</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Listen [<var>IP-address</var>:]<var>portnumber</var> [<var>protocol</var>]</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code>, <code class="module"><a href="/mod/event.html">event</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Required directive since Apache 2.0<br />
a72f7ea693101cc48bafbb4db6bb437d828011c4qlThe <var>protocol</var> argument was added in 2.1.5</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">Listen</code> directive instructs Apache to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql listen to only specific IP addresses or ports; by default it
a72f7ea693101cc48bafbb4db6bb437d828011c4ql responds to requests on all IP interfaces. <code class="directive">Listen</code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql is now a required directive. If it is not in the config file, the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql server will fail to start. This is a change from previous versions
a72f7ea693101cc48bafbb4db6bb437d828011c4ql of Apache.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">Listen</code> directive tells the server to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql accept incoming requests on the specified port or address-and-port
a72f7ea693101cc48bafbb4db6bb437d828011c4ql combination. If only a port number is specified, the server listens to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the given port on all interfaces. If an IP address is given as well
a72f7ea693101cc48bafbb4db6bb437d828011c4ql as a port, the server will listen on the given port and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql interface.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Multiple <code class="directive">Listen</code> directives may be used to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql specify a number of addresses and ports to listen to. The server will
a72f7ea693101cc48bafbb4db6bb437d828011c4ql respond to requests from any of the listed addresses and ports.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For example, to make the server accept connections on both
a72f7ea693101cc48bafbb4db6bb437d828011c4ql port 80 and port 8000, use:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="example"><p><code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Listen 80<br />
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Listen 8000
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </code></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>To make the server accept connections on two specified
a72f7ea693101cc48bafbb4db6bb437d828011c4ql interfaces and port numbers, use </p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="example"><p><code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Listen 192.170.2.1:80<br />
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Listen 192.170.2.5:8000
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </code></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>IPv6 addresses must be surrounded in square brackets, as in the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql following example:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="example"><p><code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Listen [fe80::a00:20ff:fea7:ccea]:80
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </code></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The optional <var>protocol</var> argument is not required for most
a72f7ea693101cc48bafbb4db6bb437d828011c4ql configurations. If not specified, <code>https</code> is the default for
a72f7ea693101cc48bafbb4db6bb437d828011c4ql port 443 and <code>http</code> the default for all other ports. The
a72f7ea693101cc48bafbb4db6bb437d828011c4ql protocol is used to determine which module should handle a request, and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql to apply protocol specific optimizations with the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="/mod/core.html#acceptfilter">AcceptFilter</a></code> directive.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>You only need to set the protocol if you are running on non-standard
a72f7ea693101cc48bafbb4db6bb437d828011c4ql ports. For example, running an <code>https</code> site on port 443:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="example"><p><code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Listen 192.170.2.1:8443 https
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </code></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Error condition</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Multiple <code class="directive">Listen</code> directives for the same ip
a72f7ea693101cc48bafbb4db6bb437d828011c4ql address and port will result in an <code>Address already in use</code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql error message.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<h3>See also</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><a href="/dns-caveats.html">DNS Issues</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><a href="/bind.html">Setting which addresses and ports Apache
a72f7ea693101cc48bafbb4db6bb437d828011c4ql uses</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="ListenBackLog" id="ListenBackLog">ListenBackLog</a> <a name="listenbacklog" id="listenbacklog">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum length of the queue of pending connections</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ListenBacklog <var>backlog</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ListenBacklog 511</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The maximum length of the queue of pending connections.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Generally no tuning is needed or desired, however on some
a72f7ea693101cc48bafbb4db6bb437d828011c4ql systems it is desirable to increase this when under a TCP SYN
a72f7ea693101cc48bafbb4db6bb437d828011c4ql flood attack. See the backlog parameter to the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>listen(2)</code> system call.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>This will often be limited to a smaller number by the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql operating system. This varies from OS to OS. Also note that
a72f7ea693101cc48bafbb4db6bb437d828011c4ql many OSes do not use exactly what is specified as the backlog,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql but use a number based on (but normally larger than) what is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql set.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="LockFile" id="LockFile">LockFile</a> <a name="lockfile" id="lockfile">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location of the accept serialization lock file</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LockFile <var>filename</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LockFile logs/accept.lock</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">LockFile</code> directive sets the path to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the lockfile used when Apache is used with an <code class="directive"><a href="#acceptmutex">AcceptMutex</a></code> value of either
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>fcntl</code> or <code>flock</code>. This directive should
a72f7ea693101cc48bafbb4db6bb437d828011c4ql normally be left at its default value. The main reason for changing
a72f7ea693101cc48bafbb4db6bb437d828011c4ql it is if the <code>logs</code> directory is NFS mounted, since
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <strong>the lockfile must be stored on a local disk</strong>. The PID
a72f7ea693101cc48bafbb4db6bb437d828011c4ql of the main server process is automatically appended to the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql filename.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="warning"><h3>Security</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>It is best to <em>avoid</em> putting this file in a world writable
a72f7ea693101cc48bafbb4db6bb437d828011c4ql directory such as <code>/var/tmp</code> because someone could create
a72f7ea693101cc48bafbb4db6bb437d828011c4ql a denial of service attack and prevent the server from starting by
a72f7ea693101cc48bafbb4db6bb437d828011c4ql creating a lockfile with the same name as the one the server will try
a72f7ea693101cc48bafbb4db6bb437d828011c4ql to create.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<h3>See also</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><code class="directive"><a href="#acceptmutex">AcceptMutex</a></code></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="MaxClients" id="MaxClients">MaxClients</a> <a name="maxclients" id="maxclients">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum number of child processes that will be created
a72f7ea693101cc48bafbb4db6bb437d828011c4qlto serve requests</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxClients <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">MaxClients</code> directive sets the limit
a72f7ea693101cc48bafbb4db6bb437d828011c4ql on the number of simultaneous requests that will be served. Any
a72f7ea693101cc48bafbb4db6bb437d828011c4ql connection attempts over the <code class="directive">MaxClients</code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql limit will normally be queued, up to a number based on the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="#listenbacklog">ListenBacklog</a></code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql directive. Once a child process is freed at the end of a different
a72f7ea693101cc48bafbb4db6bb437d828011c4ql request, the connection will then be serviced.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For non-threaded servers (<em>i.e.</em>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>),
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive">MaxClients</code> translates into the maximum
a72f7ea693101cc48bafbb4db6bb437d828011c4ql number of child processes that will be launched to serve requests.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql The default value is <code>256</code>; to increase it, you must also raise
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="#serverlimit">ServerLimit</a></code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For threaded and hybrid servers (<em>e.g.</em> <code class="module"><a href="/mod/beos.html">beos</a></code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql or <code class="module"><a href="/mod/worker.html">worker</a></code>) <code class="directive">MaxClients</code> restricts
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the total number of threads that will be available to serve clients.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql The default value for <code class="module"><a href="/mod/beos.html">beos</a></code> is <code>50</code>. For
a72f7ea693101cc48bafbb4db6bb437d828011c4ql hybrid MPMs the default value is <code>16</code> (<code class="directive"><a href="#serverlimit">ServerLimit</a></code>) multiplied by the value of
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <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,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql you must also raise <code class="directive"><a href="#serverlimit">ServerLimit</a></code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="MaxMemFree" id="MaxMemFree">MaxMemFree</a> <a name="maxmemfree" id="maxmemfree">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum amount of memory that the main allocator is allowed
a72f7ea693101cc48bafbb4db6bb437d828011c4qlto hold without calling <code>free()</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxMemFree <var>KBytes</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxMemFree 0</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">MaxMemFree</code> directive sets the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql maximum number of free Kbytes that the main allocator is allowed
a72f7ea693101cc48bafbb4db6bb437d828011c4ql to hold without calling <code>free()</code>. When not set, or when set
a72f7ea693101cc48bafbb4db6bb437d828011c4ql to zero, the threshold will be set to unlimited.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="MaxRequestsPerChild" id="MaxRequestsPerChild">MaxRequestsPerChild</a> <a name="maxrequestsperchild" id="maxrequestsperchild">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit on the number of requests that an individual child server
a72f7ea693101cc48bafbb4db6bb437d828011c4qlwill handle during its life</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxRequestsPerChild <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxRequestsPerChild 10000</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">MaxRequestsPerChild</code> directive sets
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the limit on the number of requests that an individual child
a72f7ea693101cc48bafbb4db6bb437d828011c4ql server process will handle. After
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive">MaxRequestsPerChild</code> requests, the child
a72f7ea693101cc48bafbb4db6bb437d828011c4ql process will die. If <code class="directive">MaxRequestsPerChild</code> is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>0</code>, then the process will never expire.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Different default values</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The default value for <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code> is <code>0</code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Setting <code class="directive">MaxRequestsPerChild</code> to a
a72f7ea693101cc48bafbb4db6bb437d828011c4ql non-zero limit has two beneficial effects:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <li>it limits the amount of memory that process can consume
a72f7ea693101cc48bafbb4db6bb437d828011c4ql by (accidental) memory leakage;</li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <li>by giving processes a finite lifetime, it helps reduce
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the number of processes when the server load reduces.</li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Note</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For <code class="directive"><a href="/mod/core.html#keepalive">KeepAlive</a></code> requests, only
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the first request is counted towards this limit. In effect, it
a72f7ea693101cc48bafbb4db6bb437d828011c4ql changes the behavior to limit the number of <em>connections</em> per
a72f7ea693101cc48bafbb4db6bb437d828011c4ql child.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="MaxSpareThreads" id="MaxSpareThreads">MaxSpareThreads</a> <a name="maxsparethreads" id="maxsparethreads">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum number of idle threads</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxSpareThreads <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Maximum number of idle threads. Different MPMs deal with this
a72f7ea693101cc48bafbb4db6bb437d828011c4ql directive differently.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For <code class="module"><a href="/mod/perchild.html">perchild</a></code> the default is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>MaxSpareThreads 10</code>. This MPM monitors the number of
a72f7ea693101cc48bafbb4db6bb437d828011c4ql idle threads on a per-child basis. If there are too many idle
a72f7ea693101cc48bafbb4db6bb437d828011c4ql threads in that child, the server will begin to kill threads
a72f7ea693101cc48bafbb4db6bb437d828011c4ql within that child.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For <code class="module"><a href="/mod/worker.html">worker</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code> and <code class="module"><a href="/mod/threadpool.html">threadpool</a></code> the default is <code>MaxSpareThreads 250</code>.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql These MPMs deal with idle threads on a server-wide basis. If there
a72f7ea693101cc48bafbb4db6bb437d828011c4ql are too many idle threads in the server then child processes are
a72f7ea693101cc48bafbb4db6bb437d828011c4ql killed until the number of idle threads is less than this number.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code> the default is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>MaxSpareThreads 100</code>. Since this MPM runs a
a72f7ea693101cc48bafbb4db6bb437d828011c4ql single-process, the spare thread count is also server-wide.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p><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> work
a72f7ea693101cc48bafbb4db6bb437d828011c4ql similar to <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>. The default for
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/beos.html">beos</a></code> is <code>MaxSpareThreads 50</code>. For
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code> the default value is <code>10</code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Restrictions</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The range of the <code class="directive">MaxSpareThreads</code> value
a72f7ea693101cc48bafbb4db6bb437d828011c4ql is restricted. Apache will correct the given value automatically
a72f7ea693101cc48bafbb4db6bb437d828011c4ql according to the following rules:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <li><code class="module"><a href="/mod/perchild.html">perchild</a></code> requires <code class="directive">MaxSpareThreads</code> to be less or equal than <code class="directive"><a href="#threadlimit">ThreadLimit</a></code>.</li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <li><code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code> wants the value to be greater than
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code>.</li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <li>For <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/worker.html">worker</a></code> the value must be greater or equal than
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the sum of <code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>.</li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<h3>See also</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><code class="directive"><a href="#startservers">StartServers</a></code></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="MinSpareThreads" id="MinSpareThreads">MinSpareThreads</a> <a name="minsparethreads" id="minsparethreads">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Minimum number of idle threads available to handle request
a72f7ea693101cc48bafbb4db6bb437d828011c4qlspikes</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MinSpareThreads <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Minimum number of idle threads to handle request spikes.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Different MPMs deal with this directive
a72f7ea693101cc48bafbb4db6bb437d828011c4ql differently.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p><code class="module"><a href="/mod/perchild.html">perchild</a></code> uses a default of
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>MinSpareThreads 5</code> and monitors the number of idle
a72f7ea693101cc48bafbb4db6bb437d828011c4ql threads on a per-child basis. If there aren't enough idle threads
a72f7ea693101cc48bafbb4db6bb437d828011c4ql in that child, the server will begin to create new threads within
a72f7ea693101cc48bafbb4db6bb437d828011c4ql that child. Thus, if you set <code class="directive"><a href="/mod/perchild.html#numservers">NumServers</a></code> to <code>10</code> and a <code class="directive">MinSpareThreads</code> value of <code>5</code>, you'll have
a72f7ea693101cc48bafbb4db6bb437d828011c4ql at least 50 idle threads on your system.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p><code class="module"><a href="/mod/worker.html">worker</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/threadpool.html">threadpool</a></code> use a default of <code>MinSpareThreads
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 75</code> and deal with idle threads on a server-wide basis. If
a72f7ea693101cc48bafbb4db6bb437d828011c4ql there aren't enough idle threads in the server then child
a72f7ea693101cc48bafbb4db6bb437d828011c4ql processes are created until the number of idle threads is greater
a72f7ea693101cc48bafbb4db6bb437d828011c4ql than number.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p><code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code> uses a default of
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>MinSpareThreads 10</code> and, since it is a single-process
a72f7ea693101cc48bafbb4db6bb437d828011c4ql MPM, tracks this on a server-wide bases.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p><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> work
a72f7ea693101cc48bafbb4db6bb437d828011c4ql similar to <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>. The default for
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/beos.html">beos</a></code> is <code>MinSpareThreads 1</code>. For
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code> the default value is <code>5</code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<h3>See also</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><code class="directive"><a href="#maxsparethreads">MaxSpareThreads</a></code></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><code class="directive"><a href="#startservers">StartServers</a></code></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="PidFile" id="PidFile">PidFile</a> <a name="pidfile" id="pidfile">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File where the server records the process ID
a72f7ea693101cc48bafbb4db6bb437d828011c4qlof the daemon</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PidFile <var>filename</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>PidFile logs/httpd.pid</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">PidFile</code> directive sets the file to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql which the server records the process id of the daemon. If the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql filename is not absolute then it is assumed to be relative to the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="example"><h3>Example</h3><p><code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql PidFile /var/run/apache.pid
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </code></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>It is often useful to be able to send the server a signal,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 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
a72f7ea693101cc48bafbb4db6bb437d828011c4ql re-reads its configuration files. This is done by sending a
a72f7ea693101cc48bafbb4db6bb437d828011c4ql SIGHUP (kill -1) signal to the process id listed in the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive">PidFile</code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">PidFile</code> is subject to the same
a72f7ea693101cc48bafbb4db6bb437d828011c4ql warnings about log file placement and <a href="/misc/security_tips.html#serverroot">security</a>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Note</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <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>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="ScoreBoardFile" id="ScoreBoardFile">ScoreBoardFile</a> <a name="scoreboardfile" id="scoreboardfile">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location of the file used to store coordination data for
a72f7ea693101cc48bafbb4db6bb437d828011c4qlthe child processes</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScoreBoardFile <var>file-path</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScoreBoardFile logs/apache_status</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Apache uses a scoreboard to communicate between its parent
a72f7ea693101cc48bafbb4db6bb437d828011c4ql and child processes. Some architectures require a file to facilitate
a72f7ea693101cc48bafbb4db6bb437d828011c4ql this communication. If the file is left unspecified, Apache first
a72f7ea693101cc48bafbb4db6bb437d828011c4ql attempts to create the scoreboard entirely in memory (using anonymous
a72f7ea693101cc48bafbb4db6bb437d828011c4ql shared memory) and, failing that, will attempt to create the file on
a72f7ea693101cc48bafbb4db6bb437d828011c4ql disk (using file-based shared memory). Specifying this directive causes
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Apache to always create the file on the disk.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="example"><h3>Example</h3><p><code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql ScoreBoardFile /var/run/apache_status
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </code></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>File-based shared memory is useful for third-party applications
a72f7ea693101cc48bafbb4db6bb437d828011c4ql that require direct access to the scoreboard.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>If you use a <code class="directive">ScoreBoardFile</code> then
a72f7ea693101cc48bafbb4db6bb437d828011c4ql you may see improved speed by placing it on a RAM disk. But be
a72f7ea693101cc48bafbb4db6bb437d828011c4ql careful that you heed the same warnings about log file placement
a72f7ea693101cc48bafbb4db6bb437d828011c4ql and <a href="/misc/security_tips.html">security</a>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<h3>See also</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><a href="/stopping.html">Stopping and Restarting
a72f7ea693101cc48bafbb4db6bb437d828011c4qlApache</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="SendBufferSize" id="SendBufferSize">SendBufferSize</a> <a name="sendbuffersize" id="sendbuffersize">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>TCP buffer size</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SendBufferSize <var>bytes</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SendBufferSize 0</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The server will set the TCP buffer size to the number of bytes
a72f7ea693101cc48bafbb4db6bb437d828011c4ql specified. Very useful to increase past standard OS defaults on
a72f7ea693101cc48bafbb4db6bb437d828011c4ql high speed high latency (<em>i.e.</em>, 100ms or so, such as
a72f7ea693101cc48bafbb4db6bb437d828011c4ql transcontinental fast pipes).</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>If set to the value of <code>0</code>, the server will use the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql OS deault.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="ServerLimit" id="ServerLimit">ServerLimit</a> <a name="serverlimit" id="serverlimit">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Upper limit on configurable number of processes</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerLimit <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For the <code class="module"><a href="/mod/prefork.html">prefork</a></code> MPM, this directive sets the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql maximum configured value for <code class="directive"><a href="#maxclients">MaxClients</a></code> for the lifetime of the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Apache process. For the <code class="module"><a href="/mod/worker.html">worker</a></code> MPM, this directive
a72f7ea693101cc48bafbb4db6bb437d828011c4ql in combination with <code class="directive"><a href="#threadlimit">ThreadLimit</a></code> sets
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the maximum configured value for <code class="directive"><a href="#maxclients">MaxClients</a></code> for the lifetime of the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Apache process. Any attempts to change this directive during a
a72f7ea693101cc48bafbb4db6bb437d828011c4ql restart will be ignored, but <code class="directive"><a href="#maxclients">MaxClients</a></code> can be modified during
a72f7ea693101cc48bafbb4db6bb437d828011c4ql a restart.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Special care must be taken when using this directive. If
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive">ServerLimit</code> is set to a value much higher
a72f7ea693101cc48bafbb4db6bb437d828011c4ql than necessary, extra, unused shared memory will be allocated. If
a72f7ea693101cc48bafbb4db6bb437d828011c4ql both <code class="directive">ServerLimit</code> and <code class="directive"><a href="#maxclients">MaxClients</a></code> are set to values
a72f7ea693101cc48bafbb4db6bb437d828011c4ql higher than the system can handle, Apache may not start or the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql system may become unstable.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>With the <code class="module"><a href="/mod/prefork.html">prefork</a></code> MPM, use this directive only
a72f7ea693101cc48bafbb4db6bb437d828011c4ql if you need to set <code class="directive"><a href="#maxclients">MaxClients</a></code> higher than 256 (default).
a72f7ea693101cc48bafbb4db6bb437d828011c4ql Do not set the value of this directive any higher than what you
a72f7ea693101cc48bafbb4db6bb437d828011c4ql might want to set <code class="directive"><a href="#maxclients">MaxClients</a></code> to.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>With <code class="module"><a href="/mod/worker.html">worker</a></code>, <code class="module"><a href="/mod/leader.html">leader</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/threadpool.html">threadpool</a></code> use this directive only
a72f7ea693101cc48bafbb4db6bb437d828011c4ql if your <code class="directive"><a href="#maxclients">MaxClients</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql settings require more than 16 server processes (default). Do not set
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the value of this directive any higher than the number of server
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 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>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>With the <code class="module"><a href="/mod/perchild.html">perchild</a></code> MPM, use this directive only
a72f7ea693101cc48bafbb4db6bb437d828011c4ql if you need to set <code class="directive"><a href="/mod/perchild.html#numservers">NumServers</a></code> higher than 8 (default).</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Note</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>There is a hard limit of <code>ServerLimit 20000</code> compiled
a72f7ea693101cc48bafbb4db6bb437d828011c4ql into the server (for the <code class="module"><a href="/mod/prefork.html">prefork</a></code> MPM 200000). This is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql intended to avoid nasty effects caused by typos.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<h3>See also</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<li><a href="/stopping.html">Stopping and Restarting Apache</a></li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="StartServers" id="StartServers">StartServers</a> <a name="startservers" id="startservers">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of child server processes created at startup</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>StartServers <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">StartServers</code> directive sets the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql number of child server processes created on startup. As the number
a72f7ea693101cc48bafbb4db6bb437d828011c4ql of processes is dynamically controlled depending on the load,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql there is usually little reason to adjust this parameter.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The default value differs from MPM to MPM. For
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/worker.html">worker</a></code> the default is <code>StartServers 3</code>.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql For <code class="module"><a href="/mod/prefork.html">prefork</a></code> defaults to <code>5</code> and for
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code> to <code>2</code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="StartThreads" id="StartThreads">StartThreads</a> <a name="startthreads" id="startthreads">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of threads created on startup</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>StartThreads <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/beos.html">beos</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Number of threads created on startup. As the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql number of threads is dynamically controlled depending on the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql load, there is usually little reason to adjust this
a72f7ea693101cc48bafbb4db6bb437d828011c4ql parameter.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For <code class="module"><a href="/mod/perchild.html">perchild</a></code> the default is <code>StartThreads
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 5</code> and this directive tracks the number of threads per
a72f7ea693101cc48bafbb4db6bb437d828011c4ql process at startup.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code> the default is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>StartThreads 50</code> and, since there is only a single
a72f7ea693101cc48bafbb4db6bb437d828011c4ql process, this is the total number of threads created at startup to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql serve requests.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>For <code class="module"><a href="/mod/beos.html">beos</a></code> the default is <code>StartThreads
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 10</code>. It also reflects the total number of threads created
a72f7ea693101cc48bafbb4db6bb437d828011c4ql at startup to serve requests.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="ThreadLimit" id="ThreadLimit">ThreadLimit</a> <a name="threadlimit" id="threadlimit">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the upper limit on the configurable number of threads
a72f7ea693101cc48bafbb4db6bb437d828011c4qlper child process</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadLimit <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<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
a72f7ea693101cc48bafbb4db6bb437d828011c4qland later</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>This directive sets the maximum configured value for <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the lifetime
a72f7ea693101cc48bafbb4db6bb437d828011c4ql of the Apache process. Any attempts to change this directive
a72f7ea693101cc48bafbb4db6bb437d828011c4ql during a restart will be ignored, but <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> can be modified
a72f7ea693101cc48bafbb4db6bb437d828011c4ql during a restart up to the value of this directive.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Special care must be taken when using this directive. If
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive">ThreadLimit</code> is set to a value much higher
a72f7ea693101cc48bafbb4db6bb437d828011c4ql than <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql extra unused shared memory will be allocated. If both
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive">ThreadLimit</code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> are set to values
a72f7ea693101cc48bafbb4db6bb437d828011c4ql higher than the system can handle, Apache may not start or the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql system may become unstable. Do not set the value of this directive
a72f7ea693101cc48bafbb4db6bb437d828011c4ql any higher than your greatest predicted setting of <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql current run of Apache.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The default value for <code class="directive">ThreadLimit</code> is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>1920</code> when used with <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>64</code> when used with the others.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Note</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>There is a hard limit of <code>ThreadLimit 20000</code> (or
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>ThreadLimit 15000</code> with <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>)
a72f7ea693101cc48bafbb4db6bb437d828011c4ql compiled into the server. This is intended to avoid nasty effects
a72f7ea693101cc48bafbb4db6bb437d828011c4ql caused by typos.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="ThreadsPerChild" id="ThreadsPerChild">ThreadsPerChild</a> <a name="threadsperchild" id="threadsperchild">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of threads created by each child process</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadsPerChild <var>number</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>This directive sets the number of threads created by each
a72f7ea693101cc48bafbb4db6bb437d828011c4ql child process. The child creates these threads at startup and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql never creates more. If using an MPM like <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql where there is only one child process, this number should be high
a72f7ea693101cc48bafbb4db6bb437d828011c4ql enough to handle the entire load of the server. If using an MPM
a72f7ea693101cc48bafbb4db6bb437d828011c4ql like <code class="module"><a href="/mod/worker.html">worker</a></code>, where there are multiple child processes,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the <em>total</em> number of threads should be high enough to handle
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the common load on the server.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The default value for <code class="directive">ThreadsPerChild</code> is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>64</code> when used with <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code> and
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code>25</code> when used with the others.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="ThreadStackSize" id="ThreadStackSize">ThreadStackSize</a> <a name="threadstacksize" id="threadstacksize">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The size in bytes of the stack used by threads handling
a72f7ea693101cc48bafbb4db6bb437d828011c4qlclient connections</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadStackSize <var>size</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>65536 on NetWare; varies on other operating systems</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.1 and later</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">ThreadStackSize</code> directive sets the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql size of the stack (for autodata) of threads which handle client
a72f7ea693101cc48bafbb4db6bb437d828011c4ql connections and call modules to help process those connections.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql In most cases the operating system default for stack size is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql reasonable, but there are some conditions where it may need to be
a72f7ea693101cc48bafbb4db6bb437d828011c4ql adjusted:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <li>On platforms with a relatively small default thread stack size
a72f7ea693101cc48bafbb4db6bb437d828011c4ql (e.g., HP-UX), Apache may crash when using some third-party modules
a72f7ea693101cc48bafbb4db6bb437d828011c4ql which use a relatively large amount of autodata storage. Those
a72f7ea693101cc48bafbb4db6bb437d828011c4ql same modules may have worked fine on other platforms where the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql default thread stack size is larger. This type of crash is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql resolved by setting <code class="directive">ThreadStackSize</code> to a
a72f7ea693101cc48bafbb4db6bb437d828011c4ql value higher than the operating system default. This type of
a72f7ea693101cc48bafbb4db6bb437d828011c4ql adjustment is necessary only if the provider of the third-party
a72f7ea693101cc48bafbb4db6bb437d828011c4ql module specifies that it is required, or if diagnosis of an Apache
a72f7ea693101cc48bafbb4db6bb437d828011c4ql crash indicates that the thread stack size was too small.</li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <li>On platforms where the default thread stack size is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql significantly larger than necessary for the web server
a72f7ea693101cc48bafbb4db6bb437d828011c4ql configuration, a higher number of threads per child process
a72f7ea693101cc48bafbb4db6bb437d828011c4ql will be achievable if <code class="directive">ThreadStackSize</code> is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql set to a value lower than the operating system default. This type
a72f7ea693101cc48bafbb4db6bb437d828011c4ql of adjustment should only be made in a test environment which allows
a72f7ea693101cc48bafbb4db6bb437d828011c4ql the full set of web server processing can be exercised, as there
a72f7ea693101cc48bafbb4db6bb437d828011c4ql may be infrequent requests which require more stack to process.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql A change in the web server configuration can invalidate the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql current <code class="directive">ThreadStackSize</code> setting.</li>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </ul>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="directive-section"><h2><a name="User" id="User">User</a> <a name="user" id="user">Directive</a></h2>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<table class="directive">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The userid under which the server will answer
a72f7ea693101cc48bafbb4db6bb437d828011c4qlrequests</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>User <var>unix-userid</var></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>User #-1</code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="/mod/leader.html">leader</a></code>, <code class="module"><a href="/mod/perchild.html">perchild</a></code>, <code class="module"><a href="/mod/prefork.html">prefork</a></code>, <code class="module"><a href="/mod/threadpool.html">threadpool</a></code>, <code class="module"><a href="/mod/worker.html">worker</a></code></td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Only valid in global server config since Apache
a72f7ea693101cc48bafbb4db6bb437d828011c4ql2.0</td></tr>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</table>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The <code class="directive">User</code> directive sets the user ID as
a72f7ea693101cc48bafbb4db6bb437d828011c4ql which the server will answer requests. In order to use this
a72f7ea693101cc48bafbb4db6bb437d828011c4ql directive, the server must be run initially as <code>root</code>.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql If you start the server as a non-root user, it will fail to change
a72f7ea693101cc48bafbb4db6bb437d828011c4ql to the lesser privileged user, and will instead continue to run as
a72f7ea693101cc48bafbb4db6bb437d828011c4ql that original user. If you do start the server as <code>root</code>,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql then it is normal for the parent process to remain running as root.
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <var>Unix-userid</var> is one of:</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dl>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dt>A username</dt>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dd>Refers to the given user by name.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dt># followed by a user number.</dt>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <dd>Refers to a user by its number.</dd>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </dl>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>The user should have no privileges that result in it being
a72f7ea693101cc48bafbb4db6bb437d828011c4ql able to access files that are not intended to be visible to the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql outside world, and similarly, the user should not be able to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql execute code that is not meant for HTTP requests. It is
a72f7ea693101cc48bafbb4db6bb437d828011c4ql recommended that you set up a new user and group specifically for
a72f7ea693101cc48bafbb4db6bb437d828011c4ql running the server. Some admins use user <code>nobody</code>, but
a72f7ea693101cc48bafbb4db6bb437d828011c4ql this is not always desirable, since the <code>nobody</code> user
a72f7ea693101cc48bafbb4db6bb437d828011c4ql can have other uses on the system.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="warning"><h3>Security</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Don't set <code class="directive">User</code> (or <code class="directive"><a href="#group">Group</a></code>) to <code>root</code> unless
a72f7ea693101cc48bafbb4db6bb437d828011c4ql you know exactly what you are doing, and what the dangers are.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>With the <code class="module"><a href="/mod/perchild.html">perchild</a></code> MPM, which is intended to
a72f7ea693101cc48bafbb4db6bb437d828011c4ql server virtual hosts run under different user IDs, the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive">User</code> directive defines the user ID for the
a72f7ea693101cc48bafbb4db6bb437d828011c4ql main server and the fallback for <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> sections without an
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="/mod/perchild.html#assignuserid">AssignUserID</a></code> directive.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Special note: Use of this directive in <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> is no longer supported. To
a72f7ea693101cc48bafbb4db6bb437d828011c4ql configure your server for <code class="program"><a href="/programs/suexec.html">suexec</a></code> use
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <code class="directive"><a href="/mod/mod_suexec.html#suexecusergroup">SuexecUserGroup</a></code>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <div class="note"><h3>Note</h3>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql <p>Although the <code class="directive">User</code> directive is present
a72f7ea693101cc48bafbb4db6bb437d828011c4ql 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,
a72f7ea693101cc48bafbb4db6bb437d828011c4ql it is actually a no-op there and only exists for compatibility
a72f7ea693101cc48bafbb4db6bb437d828011c4ql reasons.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql </div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<div class="bottomlang">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<p><span>Available Languages: </span><a href="/de/mod/mpm_common.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<a href="/en/mod/mpm_common.html" title="English">&nbsp;en&nbsp;</a> |
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<a href="/ja/mod/mpm_common.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</div><div id="footer">
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<p class="apache">Copyright 1995-2005 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
a72f7ea693101cc48bafbb4db6bb437d828011c4ql</body></html>