⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpm_common.html.en

📁 Apache HTTP Server 是一个功能强大的灵活的与HTTP/1.1相兼容的web服务器.这里给出的是Apache HTTP服务器的源码。
💻 EN
📖 第 1 页 / 共 5 页
字号:
<ul><li><a href="../stopping.html">Stopping and Restarting Apache</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="StartServers" id="StartServers">StartServers</a> <a name="startservers" id="startservers">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of child server processes created at startup</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>StartServers <var>number</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</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/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></table>    <p>The <code class="directive">StartServers</code> directive sets the    number of child server processes created on startup. As the number    of processes is dynamically controlled depending on the load,    there is usually little reason to adjust this parameter.</p>    <p>The default value differs from MPM to MPM. For    <code class="module"><a href="../mod/leader.html">leader</a></code>, <code class="module"><a href="../mod/threadpool.html">threadpool</a></code> and    <code class="module"><a href="../mod/worker.html">worker</a></code> the default is <code>StartServers 3</code>.    For <code class="module"><a href="../mod/prefork.html">prefork</a></code> defaults to <code>5</code> and for    <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> to <code>2</code>.</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="StartThreads" id="StartThreads">StartThreads</a> <a name="startthreads" id="startthreads">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of threads created on startup</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>StartThreads <var>number</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</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_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/perchild.html">perchild</a></code></td></tr></table>    <p>Number of threads created on startup. As the    number of threads is dynamically controlled depending on the    load, there is usually little reason to adjust this    parameter.</p>    <p>For <code class="module"><a href="../mod/perchild.html">perchild</a></code> the default is <code>StartThreads    5</code> and this directive tracks the number of threads per    process at startup.</p>    <p>For <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> the default is    <code>StartThreads 50</code> and, since there is only a single    process, this is the total number of threads created at startup to    serve requests.</p>    <p>For <code class="module"><a href="../mod/beos.html">beos</a></code> the default is <code>StartThreads    10</code>. It also reflects the total number of threads created    at startup to serve requests.</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="ThreadLimit" id="ThreadLimit">ThreadLimit</a> <a name="threadlimit" id="threadlimit">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the upper limit on the configurable number of threadsper child process</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadLimit <var>number</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</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/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><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.41and later</td></tr></table>    <p>This directive sets the maximum configured value for <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the lifetime    of the Apache process.  Any attempts to change this directive    during a restart will be ignored, but <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> can be modified    during a restart up to the value of this directive.</p>    <p>Special care must be taken when using this directive.  If    <code class="directive">ThreadLimit</code> is set to a value much higher    than <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>,    extra unused shared memory will be allocated.  If both    <code class="directive">ThreadLimit</code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> are set to values    higher than the system can handle, Apache may not start or the    system may become unstable. Do not set the value of this directive    any higher than your greatest predicted setting of <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the    current run of Apache.</p>    <p>The default value for <code class="directive">ThreadLimit</code> is    <code>1920</code> when used with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> and    <code>64</code> when used with the others.</p>    <div class="note"><h3>Note</h3>      <p>There is a hard limit of <code>ThreadLimit 20000</code> (or      <code>ThreadLimit 15000</code> with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>)      compiled into the server. This is intended to avoid nasty effects      caused by typos.</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="ThreadsPerChild" id="ThreadsPerChild">ThreadsPerChild</a> <a name="threadsperchild" id="threadsperchild">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of threads created by each child process</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadsPerChild <var>number</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</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/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></table>    <p>This directive sets the number of threads created by each    child process. The child creates these threads at startup and    never creates more. If using an MPM like <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>,    where there is only one child process, this number should be high    enough to handle the entire load of the server. If using an MPM    like <code class="module"><a href="../mod/worker.html">worker</a></code>, where there are multiple child processes,    the <em>total</em> number of threads should be high enough to handle    the common load on the server.</p>    <p>The default value for <code class="directive">ThreadsPerChild</code> is    <code>64</code> when used with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> and    <code>25</code> when used with the others.</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="User" id="User">User</a> <a name="user" id="user">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The userid under which the server will answerrequests</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>User <var>unix-userid</var></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>User #-1</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/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><tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Only valid in global server config since Apache2.0</td></tr></table>    <p>The <code class="directive">User</code> directive sets the user ID as    which the server will answer requests. In order to use this    directive, the server must be run initially as <code>root</code>.    If you start the server as a non-root user, it will fail to change    to the lesser privileged user, and will instead continue to run as    that original user. If you do start the server as <code>root</code>,    then it is normal for the parent process to remain running as root.    <var>Unix-userid</var> is one of:</p>    <dl>      <dt>A username</dt>      <dd>Refers to the given user by name.</dd>      <dt># followed by a user number.</dt>      <dd>Refers to a user by its number.</dd>    </dl>    <p>The user should have no privileges that result in it being    able to access files that are not intended to be visible to the    outside world, and similarly, the user should not be able to    execute code that is not meant for HTTP requests. It is    recommended that you set up a new user and group specifically for    running the server. Some admins use user <code>nobody</code>, but    this is not always desirable, since the <code>nobody</code> user    can have other uses on the system.</p>    <div class="warning"><h3>Security</h3>      <p>Don't set <code class="directive">User</code> (or <code class="directive"><a href="#group">Group</a></code>) to <code>root</code> unless      you know exactly what you are doing, and what the dangers are.</p>    </div>    <p>With the <code class="module"><a href="../mod/perchild.html">perchild</a></code> MPM, which is intended to    server virtual hosts run under different user IDs, the    <code class="directive">User</code> directive defines the user ID for the    main server and the fallback for <code class="directive"><a href="../mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> sections without an    <code class="directive"><a href="../mod/perchild.html#assignuserid">AssignUserID</a></code> directive.</p>    <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    configure your server for <code class="program"><a href="../programs/suexec.html">suexec</a></code> use    <code class="directive"><a href="../mod/mod_suexec.html#suexecusergroup">SuexecUserGroup</a></code>.</

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -