perchild.html revision 240a5b8962329911d02566b600be6226e1f857ae
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
f0aad5341752aefe5059832f6cf3abc3283c6e16Tinderbox User This file is generated from xml source: DO NOT EDIT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User--><title>perchild - Apache HTTP Server</title><link rel="stylesheet" type="text/css" href="/style/manual.css"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module perchild</h1><table bgcolor="#cccccc" cellpadding="0" cellspacing="1"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>Multi-Processing Module allowing for daemon processes
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User serving requests to be assigned a variety of different
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User userids</td></tr><tr><td><a class="help" href="module-dict.html#Status">Status:</a></td><td>MPM</td></tr><tr><td><a class="help" href="module-dict.html#ModuleIdentifier">Module&nbsp;Identifier:</a></td><td>mpm_perchild_module</td></tr></table></td></tr></table><h2>Summary</h2>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<blockquote><table><tr><td bgcolor="#ffe5f5">
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark AndrewsThis MPM does not currently work on most platforms. Work is ongoing to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake it functional.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</td></tr></table></blockquote>
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User <p>This Multi-Processing Module (MPM) implements a hybrid
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt multi-process, multi-threaded web server. A fixed number of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein processes create threads to handle requests. Fluctuations in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein load are handled by increasing or decreasing the number of
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User threads in each process.</p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <p>A single control process launches the number of child processes
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein indicated by the <a class="directive" href="mpm_common.html#numservers"><code class="directive">NumServers</code></a> directive at server
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein startup. Each child process creates threads as specified in the
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User <code>StartThreads</code> directive. The individual threads then
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein listen for connections and serve them when they arrive.</p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <p>Apache always tries to maintain a pool of <em>spare</em> or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein idle server threads, which stand ready to serve incoming
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews requests. In this way, clients do not need to wait for new
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews threads to be created. For each child process, Apache assesses
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein the number of idle threads and creates or destroys threads to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein keep this number within the boundaries specified by
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code>MinSpareThreads</code> and <code>MaxSpareThreads</code>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Since this process is very self-regulating, it is rarely
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User necessary to modify these directives from their default values.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User The maximum number of clients that may be served simultaneously
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User is determined by multiplying the number of server processes
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt that will be created (<code>NumServers</code>) by the maximum
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt number of threads created in each process
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User (<code>MaxThreadsPerChild</code>).</p>
0da02c26a6631c25f075a8e4ac6de9e58f49a0c2Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt <p>While the parent process is usually started as root under
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt Unix in order to bind to port 80, the child processes and
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt threads are launched by Apache as a less-privileged user. The
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User <code>User</code> and <code>Group</code> directives are used to
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt set the privileges of the Apache child processes. The child
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt processes must be able to read all the content that will be
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt served, but should have as few privileges beyond that as
0da02c26a6631c25f075a8e4ac6de9e58f49a0c2Tinderbox User possible. In addition, unless <a href="/suexec.html">suexec</a> is used, these directives also
ffe29868b4bbc64953fc5d0de51f988c20158967Tinderbox User set the privileges which will be inherited by CGI scripts.</p>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt <p><code>MaxRequestsPerChild</code> controls how frequently the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt server recycles processes by killing old ones and launching new
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt ones.</p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <p>See also: <a href="/bind.html">Setting which addresses and
f9ce6280cec79deb16ff6d9807aa493ff23e10d9Tinderbox User ports Apache uses</a>.</p>
0da02c26a6631c25f075a8e4ac6de9e58f49a0c2Tinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <p>In addition it adds the extra ability to specify that
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User specific processes should serve requests under different
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt userids. These processes can then be associated with specific
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt virtual hosts.</p>
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
0da02c26a6631c25f075a8e4ac6de9e58f49a0c2Tinderbox User<h2>Directives</h2><ul><li><a href="#assignuserid">AssignUserId</a></li><li><a href="#childperuserid">ChildPerUserId</a></li><li><a href="mpm_common.html#coredumpdirectory">CoreDumpDirectory</a></li><li><a href="mpm_common.html#group">Group</a></li><li><a href="mpm_common.html#listen">Listen</a></li><li><a href="mpm_common.html#listenbacklog">ListenBacklog</a></li><li><a href="mpm_common.html#lockfile">LockFile</a></li><li><a href="mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a></li><li><a href="mpm_common.html#maxsparethreads">MaxSpareThreads</a></li><li><a href="mpm_common.html#maxthreadsperchild">MaxThreadsPerChild</a></li><li><a href="mpm_common.html#minsparethreads">MinSpareThreads</a></li><li><a href="mpm_common.html#numservers">NumServers</a></li><li><a href="mpm_common.html#pidfile">PidFile</a></li><li><a href="mpm_common.html#scoreboardfile">ScoreBoardFile</a></li><li><a href="mpm_common.html#sendbuffersize">SendBufferSize</a></li><li><a href="mpm_common.html#startthreads">StartThreads</a></li><li><a href="mpm_common.html#user">User</a></li></ul><hr/><h2><a name="AssignUserId">AssignUserId</a> <a name="assignuserid">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>AssignUserID <em>user_id</em> <em>group_id</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>virtual host</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>MPM</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>perchild</td></tr></table></td></tr></table>
0da02c26a6631c25f075a8e4ac6de9e58f49a0c2Tinderbox User <p>Tie a virtual host to a specific child process. Requests addressed to
0da02c26a6631c25f075a8e4ac6de9e58f49a0c2Tinderbox Userthe virtual host where this directive appears will be served by the process
0da02c26a6631c25f075a8e4ac6de9e58f49a0c2Tinderbox Userrunning with the specified user and group id.</p>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<hr/><h2><a name="ChildPerUserId">ChildPerUserId</a> <a name="childperuserid">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td/></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>ChildPerUserID <em>user_id</em>
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User<em>group_id</em> <em>child_id</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>MPM</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>perchild</td></tr></table></td></tr></table>
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <p>Specify a user id and group id for a specific child process. The number of
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userchildren if set by the <a href="mpm_common.html#numservers">NumServers</a>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntdirective. For example, the default value for <a href="mpm_common.html#numservers">NumServers</a> is 5 and that means
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntchildren ids 1,2,3,4 and 5 are available for assigment. If a child does not
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userhave an associated ChildPerUserID, it inherits the <a href="mpm_common.html#user">User</a> and <a href="mpm_common.html#group">Group</a> settings from the main server </p>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<hr/><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="/images/index.gif" alt="Index"/></a><a href="../"><img src="/images/home.gif" alt="Home"/></a></blockquote></body></html>