📄 mpm_common.html.en
字号:
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX This file is generated from xml source: DO NOT EDIT XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --><title>mpm_common - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body><div id="page-header"><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><p class="apache">Apache HTTP Server Version 2.2</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.2</a> > <a href="./">Modules</a></div><div id="page-content"><div id="preamble"><h1>Apache MPM Common Directives</h1><div class="toplang"><p><span>Available Languages: </span><a href="../de/mod/mpm_common.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |<a href="../en/mod/mpm_common.html" title="English"> en </a> |<a href="../ja/mod/mpm_common.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |<a href="../tr/mod/mpm_common.html" hreflang="tr" rel="alternate" title="T黵k鏴"> tr </a></p></div><table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>A collection of directives that are implemented bymore than one multi-processing module (MPM)</td></tr><tr><th><a href="module-dict.html#Status">Status:</a></th><td>MPM</td></tr></table></div><div id="quickview"><h3 class="directives">Directives</h3><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#acceptmutex">AcceptMutex</a></li><li><img alt="" src="../images/down.gif" /> <a href="#chrootdir">ChrootDir</a></li><li><img alt="" src="../images/down.gif" /> <a href="#coredumpdirectory">CoreDumpDirectory</a></li><li><img alt="" src="../images/down.gif" /> <a href="#enableexceptionhook">EnableExceptionHook</a></li><li><img alt="" src="../images/down.gif" /> <a href="#gracefulshutdowntimeout">GracefulShutdownTimeout</a></li><li><img alt="" src="../images/down.gif" /> <a href="#group">Group</a></li><li><img alt="" src="../images/down.gif" /> <a href="#listen">Listen</a></li><li><img alt="" src="../images/down.gif" /> <a href="#listenbacklog">ListenBackLog</a></li><li><img alt="" src="../images/down.gif" /> <a href="#lockfile">LockFile</a></li><li><img alt="" src="../images/down.gif" /> <a href="#maxclients">MaxClients</a></li><li><img alt="" src="../images/down.gif" /> <a href="#maxmemfree">MaxMemFree</a></li><li><img alt="" src="../images/down.gif" /> <a href="#maxrequestsperchild">MaxRequestsPerChild</a></li><li><img alt="" src="../images/down.gif" /> <a href="#maxsparethreads">MaxSpareThreads</a></li><li><img alt="" src="../images/down.gif" /> <a href="#minsparethreads">MinSpareThreads</a></li><li><img alt="" src="../images/down.gif" /> <a href="#pidfile">PidFile</a></li><li><img alt="" src="../images/down.gif" /> <a href="#receivebuffersize">ReceiveBufferSize</a></li><li><img alt="" src="../images/down.gif" /> <a href="#scoreboardfile">ScoreBoardFile</a></li><li><img alt="" src="../images/down.gif" /> <a href="#sendbuffersize">SendBufferSize</a></li><li><img alt="" src="../images/down.gif" /> <a href="#serverlimit">ServerLimit</a></li><li><img alt="" src="../images/down.gif" /> <a href="#startservers">StartServers</a></li><li><img alt="" src="../images/down.gif" /> <a href="#startthreads">StartThreads</a></li><li><img alt="" src="../images/down.gif" /> <a href="#threadlimit">ThreadLimit</a></li><li><img alt="" src="../images/down.gif" /> <a href="#threadsperchild">ThreadsPerChild</a></li><li><img alt="" src="../images/down.gif" /> <a href="#threadstacksize">ThreadStackSize</a></li><li><img alt="" src="../images/down.gif" /> <a href="#user">User</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AcceptMutex" id="AcceptMutex">AcceptMutex</a> <a name="acceptmutex" id="acceptmutex">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Method that Apache uses to serialize multiple childrenaccepting requests on network sockets</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptMutex Default|<var>method</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptMutex Default</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr></table> <p>The <code class="directive">AcceptMutex</code> directives sets the method that Apache uses to serialize multiple children accepting requests on network sockets. Prior to Apache 2.0, the method was selectable only at compile time. The optimal method to use is highly architecture and platform dependent. For further details, see the <a href="../misc/perf-tuning.html">performance tuning</a> documentation.</p> <p>If this directive is set to <code>Default</code>, then the compile-time selected default will be used. Other possible methods are listed below. Note that not all methods are available on all platforms. If a method is specified which is not available, a message will be written to the error log listing the available methods.</p> <dl> <dt><code>flock</code></dt> <dd>uses the <code>flock(2)</code> system call to lock the file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd> <dt><code>fcntl</code></dt> <dd>uses the <code>fcntl(2)</code> system call to lock the file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd> <dt><code>posixsem</code></dt> <dd>uses POSIX compatible semaphores to implement the mutex.</dd> <dt><code>pthread</code></dt> <dd>uses POSIX mutexes as implemented by the POSIX Threads (PThreads) specification.</dd> <dt><code>sysvsem</code></dt> <dd>uses SySV-style semaphores to implement the mutex.</dd> </dl> <p>If you want to find out the compile time chosen default for your system, you may set your <code class="directive"><a href="../mod/core.html#loglevel">LogLevel</a></code> to <code>debug</code>. Then the default <code class="directive">AcceptMutex</code> will be written into the <code class="directive"><a href="../mod/core.html#errorlog">ErrorLog</a></code>.</p> <div class="warning"><h3>Warning</h3> <p>On most systems, when the <code>pthread</code> option is selected, if a child process terminates abnormally while holding the <code>AcceptCntl</code> mutex the server will stop responding to requests. When this occurs, the server will require a manual restart to recover.</p> <p>Solaris is a notable exception as it provides a mechanism, used by Apache, which usually allows the mutex to be recovered after a child process terminates abnormally while holding a mutex.</p> <p>If your system implements the <code>pthread_mutexattr_setrobust_np()</code> function, you may be able to use the <code>pthread</code> option safely.</p> </div></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="ChrootDir" id="ChrootDir">ChrootDir</a> <a name="chrootdir" id="chrootdir">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory for apache to run chroot(8) after startup.</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ChrootDir <var>/path/to/directory</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/event.html">event</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.2.10 and later</td></tr></table> <p>This directive tells the server to <var>chroot(8)</var> to the specified directory after startup, but before accepting requests.</p> <p>Note that running the server under chroot is not simple, and requires additional setup, particularly if you are running scripts such as CGI or PHP. Please make sure you are properly familiar with the operation of chroot before attempting to use this feature.</p></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="CoreDumpDirectory" id="CoreDumpDirectory">CoreDumpDirectory</a> <a name="coredumpdirectory" id="coredumpdirectory">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory where Apache attempts toswitch before dumping core</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CoreDumpDirectory <var>directory</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for the default setting</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr><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_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr></table> <p>This controls the directory to which Apache attempts to switch before dumping core. The default is in the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> directory, however since this should not be writable by the user the server runs as, core dumps won't normally get written. If you want a core dump for debugging, you can use this directive to place it in a different location.</p> <div class="note"><h3>Core Dumps on Linux</h3> <p>If Apache starts as root and switches to another user, the Linux kernel <em>disables</em> core dumps even if the directory is writable for the process. Apache (2.0.46 and later) reenables core dumps on Linux 2.4 and beyond, but only if you explicitly configure a <code class="directive">CoreDumpDirectory</code>.</p> </div></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="EnableExceptionHook" id="EnableExceptionHook">EnableExceptionHook</a> <a name="enableexceptionhook" id="enableexceptionhook">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables a hook that runs exception handlersafter a crash</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableExceptionHook On|Off</code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableExceptionHook Off</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.49 and later</td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -