mpm_common.html revision 4fce4d712dcc163130e2fa68c113abe4706b1263
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<HTML>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<HEAD>
b99dbaab171d91e1b664397cc40e039d0c087c65fielding<TITLE>Apache MPM Common Directives</TITLE>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding</HEAD>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<BODY
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding BGCOLOR="#FFFFFF"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding TEXT="#000000"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding LINK="#0000FF"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding VLINK="#000080"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding ALINK="#FF0000"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--#include virtual="header.html" -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H1 ALIGN="CENTER">Multi-Processing Module Common Directives</H1>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<P>This file documents directives that are implemented by more
f3091cedd4abeda1026d9117c34e8f625754e8aefieldingthan one multi-processing module (MPM).
f3091cedd4abeda1026d9117c34e8f625754e8aefielding</P>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<H2>Directives</H2>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<UL>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<li><a href="#connectionstatus">ConnectionStatus</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#coredumpdirectory">CoreDumpDirectory</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#group">Group</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#pidfile">PidFile</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#listen">Listen</a></li>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<li><a href="#listenbacklog">ListenBacklog</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#lockfile">LockFile</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#maxclients">MaxClients</a></li>
64185f9824e42f21ca7b9ae6c004484215c031a7rbb<li><a href="#maxrequestsperchild">MaxRequestsPerChild</a></li>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<li><a href="#maxsparethreads">MaxSpareThreads</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#maxthreadsperchild">MaxThreadsPerChild</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#minsparethreads">MinSpareThreads</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#numservers">NumServers</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#scoreboardfile">ScoreBoardFile</a></li>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<li><a href="#sendbuffersize">SendBufferSize</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#startservers">StartServers</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#startthreads">StartThreads</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#threadsperchild">ThreadsPerChild</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#user">User</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding</UL>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<HR>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="connectionstatus">ConnectionStatus directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Syntax"
f3091cedd4abeda1026d9117c34e8f625754e8aefielding REL="Help"
f3091cedd4abeda1026d9117c34e8f625754e8aefielding><STRONG>Syntax:</STRONG></A>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding ConnectionStatus on|off<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
f3091cedd4abeda1026d9117c34e8f625754e8aefielding HREF="directive-dict.html#Default"
f3091cedd4abeda1026d9117c34e8f625754e8aefielding REL="Help"
f3091cedd4abeda1026d9117c34e8f625754e8aefielding><STRONG>Default:</STRONG></A>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding <CODE>ConnectionStatus on</CODE><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Context"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Context:</STRONG></A> server config<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Status"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Status:</STRONG></A> MPM<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Module"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Module:</STRONG></A> perchild</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p>Whether or not to maintain status information on current
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingconnections. If this is off then mod_status will not work properly.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<hr>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="coredumpdirectory">CoreDumpDirectory directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--%plaintext &lt;?INDEX {\tt CoreDumpDirectory} directive&gt; -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Syntax"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Syntax:</STRONG></A> CoreDumpDirectory <EM>directory</EM><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Default"
d0a46853bff16e9598a3298f262b0d3fd58d6c53martin REL="Help"
c53a68af52e2428d833746388b412fb4793759b2trawick><STRONG>Default:</STRONG></A> the same location as ServerRoot<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Context:</STRONG></A> server config<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> MPM<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>This controls the directory to which Apache attempts to switch
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxbefore dumping core. The default is in the <A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxHREF="core.html#serverroot">ServerRoot</A> directory, however since
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthis should not be writable by the user the server runs as, core dumps
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingwon't normally get written. If you want a core dump for debugging,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingyou can use this directive to place it in a different location.<P><HR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="group">Group directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--%plaintext &lt;?INDEX {\tt Group} directive&gt; -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Syntax"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Syntax:</STRONG></A> Group <EM>unix-group</EM><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Default"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Default:</STRONG></A> <CODE>Group #-1</CODE><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Context"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb><STRONG>Context:</STRONG></A> server config, virtual host<BR>
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<A
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb HREF="directive-dict.html#Status"
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb REL="Help"
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb><STRONG>Status:</STRONG></A> MPM<BR>
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<A
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb HREF="directive-dict.html#Module"
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingThe Group directive sets the group under which the server will answer requests.
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinIn order to use this directive, the stand-alone server must be run initially
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinas root. <EM>Unix-group</EM> is one of:
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<DL>
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<DT>A group name
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<DD>Refers to the given group by name.
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<DT># followed by a group number.
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein<DD>Refers to a group by its number.
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx</DL>
314ad8e9005a0266a2e7f61a44834c58893293b4rbb
54c358157ff30a1c4f4f8b27f3a687f254afa493wroweIt is recommended that you set up a new group specifically for running the
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinserver. Some admins use user <CODE>nobody</CODE>, but this is not always
480e6d6e3fbf8fc23af721f430a97afb0012be6ftrawickpossible or desirable.<P>
480e6d6e3fbf8fc23af721f430a97afb0012be6ftrawick
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinNote: if you start the server as a non-root user, it will fail to change
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxto the specified group, and will instead continue to run as the group of the
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinoriginal user. <P>
1860b2b5f1de31f8cf9d95f1b394fe98c8dbfab7rbb
1860b2b5f1de31f8cf9d95f1b394fe98c8dbfab7rbbSpecial note: Use of this directive in &lt;VirtualHost&lt; is no longer
1860b2b5f1de31f8cf9d95f1b394fe98c8dbfab7rbbsupported. To implement the <A HREF="/suexec.html">suEXEC wrapper</A>
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinwith Apache 2.0, use the <A HREF=mod_suexec.html#suexecusergroup>
b980ad7fdc218b4855cde9f75a747527f50c554dwroweSuexecUserGroup</A> directive.
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbbSECURITY: See <A HREF="#user">User</A> for a discussion of the security
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingconsiderations.<P><HR>
bb65aeae7af1d33b64252bbc1b966942d757ac60wrowe
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<H2><A NAME="pidfile">PidFile directive</A></H2>
48d7c43629323c8d5ee9f7bd0d194de0a376b391rbb<!--%plaintext &lt;?INDEX {\tt PidFile} directive&gt; -->
bb65aeae7af1d33b64252bbc1b966942d757ac60wrowe<p><A
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb HREF="directive-dict.html#Syntax"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> PidFile <EM>filename</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>PidFile logs/httpd.pid</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Context:</STRONG></A> server config<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> MPM<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>The PidFile directive sets the file to which the server records the
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxprocess id of the daemon. If the filename does not begin with a slash
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx(/) then it is assumed to be relative to the <A
48d7c43629323c8d5ee9f7bd0d194de0a376b391rbbHREF="core.html#serverroot">ServerRoot</A>.</p>
bb65aeae7af1d33b64252bbc1b966942d757ac60wrowe
cf721750997514b9cbed94bf3672ff6b3e2c2132trawick<p>It is often useful to be able to send the server a signal, so that
48d7c43629323c8d5ee9f7bd0d194de0a376b391rbbit closes and then reopens its <A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingHREF="core.html#errorlog">ErrorLog</A> and TransferLog, and re-reads
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingits configuration files. This is done by sending a SIGHUP (kill -1)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingsignal to the process id listed in the PidFile.</p>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<p>The PidFile is subject to the same warnings about log file placement and
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<A HREF="/misc/security_tips.html#serverroot">security</A>.</p>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<p><hr>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="listen">Listen directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Syntax"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Syntax:</STRONG></A>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingListen [<EM>IP-address</EM>:]<EM>port number</EM><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Context:</STRONG></A> server config<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
30309f86bfd564437654aa822a19cd0cb29ca6f8wrowe HREF="directive-dict.html#Status"
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Status:</STRONG></A> MPM<BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Module"
30309f86bfd564437654aa822a19cd0cb29ca6f8wrowe REL="Help"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<P>The Listen directive instructs Apache to listen to only specific IP
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxaddresses or ports; by default it responds to requests on all IP
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxinterfaces, but only on the port given by the <CODE><A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxHREF="core.html#port">Port</A></CODE> directive.</P>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>The Listen directive tells
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe server to accept incoming requests on the specified port or
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxaddress-and-port combination. If only a port number is specified,
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe server listens to the given port on all interfaces,
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxinstead of the port given by the <TT>Port</TT> directive. If an IP
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbbaddress is given as well as a port, the server will listen on the
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxgiven port and interface. <P>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxNote that you may still require a <TT>Port</TT> directive so
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingthat URLs that Apache generates that point to your server still
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingwork.<P>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxMultiple Listen directives may be used
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxto specify a number of addresses and ports to listen to. The server
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxwill respond to requests from any of the listed addresses and
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fieldingports.
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<P>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fieldingFor example, to make the server accept connections on both port
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding80 and port 8000, use:
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<PRE>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding Listen 80
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding Listen 8000
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding</PRE>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingTo make the server accept connections on two specified
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinginterfaces and port numbers, use
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<PRE>
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb Listen 192.170.2.1:80
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx Listen 192.170.2.5:8000
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx</PRE>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P><STRONG>See Also:</STRONG>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A HREF="/dns-caveats.html">DNS Issues</A><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<STRONG>See Also:</STRONG>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A HREF="/bind.html">Setting which addresses and ports Apache uses</A><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<STRONG>See Also:</STRONG>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A HREF="http://www.apache.org/info/known_bugs.html#listenbug">Known Bugs</A>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx</P>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<HR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<H2><A NAME="listenbacklog">ListenBacklog directive</A></H2>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<p><A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Syntax"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Syntax:</STRONG></A> ListenBacklog <EM>backlog</EM><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Default"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Default:</STRONG></A> <CODE>ListenBacklog 511</CODE><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Context:</STRONG></A> server config<BR>
30309f86bfd564437654aa822a19cd0cb29ca6f8wrowe<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> MPM<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
30309f86bfd564437654aa822a19cd0cb29ca6f8wrowe REL="Help"
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx<P>The maximum length of the queue of pending connections. Generally no
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxtuning is needed or desired, however on some systems it is desirable
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxto increase this when under a TCP SYN flood attack. See
0bcc11df5f030cf62289599a25f5831913a4b438trawickthe backlog parameter to the <CODE>listen(2)</CODE> system call.
0bcc11df5f030cf62289599a25f5831913a4b438trawick
0bcc11df5f030cf62289599a25f5831913a4b438trawick<P>This will often be limited to a smaller number by the operating
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingsystem. This varies from OS to OS. Also note that many OSes do not
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxuse exactly what is specified as the backlog, but use a number based on
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx(but normally larger than) what is set.
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<HR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="lockfile">LockFile directive</A></H2>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p><A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Syntax"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> LockFile <EM>filename</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>LockFile logs/accept.lock</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Context"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Context:</STRONG></A> server config<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Status"
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Status:</STRONG></A> MPM<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Module"
0906f649b3d720299e47ed1148e79051e8941b2adirkx REL="Help"
446b877d2ab69d9bbcd9152a2d54814f05f1c00brbb><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p>The LockFile directive sets the path to the lockfile used when
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingApache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingUSE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxleft at its default value. The main reason for changing it is if
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe <CODE>logs</CODE> directory is NFS mounted, since <STRONG>the lockfile
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxmust be stored on a local disk</STRONG>. The PID of the main
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxserver process is automatically appended to the filename. <P>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm<p><STRONG>SECURITY:</STRONG> It is best to avoid putting this file in a
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingworld writable directory such as <CODE>/var/tmp</CODE> because someone
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmcould create a denial of service attack and prevent the server from
06e2d72d72d35442e1ba8cfe9f343ac0fb2b8cffdreidstarting by creating a lockfile with the same name as the one the
30309f86bfd564437654aa822a19cd0cb29ca6f8wroweserver will try to create.</p>
30309f86bfd564437654aa822a19cd0cb29ca6f8wrowe
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<hr>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm
bbe866808ba50d71809ab58bbee377cadf60d3b7dreid<H2><A NAME="maxclients">MaxClients directive</A></H2>
bbe866808ba50d71809ab58bbee377cadf60d3b7dreid<!--%plaintext &lt;?INDEX {\tt MaxClients} directive&gt; -->
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Syntax"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick><STRONG>Syntax:</STRONG></A> MaxClients <EM>number</EM><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Default"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
dcde46ca353d5d66bbac2b8e1135ac828992b808dreid><STRONG>Default:</STRONG></A> <CODE>MaxClients 8</code> (with threads)
dcde46ca353d5d66bbac2b8e1135ac828992b808dreid<code>MaxClients 256</code> (no threads)<BR>
dcde46ca353d5d66bbac2b8e1135ac828992b808dreid<A
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick HREF="directive-dict.html#Context"
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick REL="Help"
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick><STRONG>Context:</STRONG></A> server config<BR>
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick<A
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick HREF="directive-dict.html#Status"
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm REL="Help"
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick><STRONG>Status:</STRONG></A> MPM<BR>
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick<A
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick HREF="directive-dict.html#Module"
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Module:</STRONG></A> threaded, prefork</p>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
dcde46ca353d5d66bbac2b8e1135ac828992b808dreid<P>The MaxClients directive sets the limit on the number of child
dcde46ca353d5d66bbac2b8e1135ac828992b808dreidprocesses that will be created to serve requests. When the server is
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawickbuilt without threading, no more than this number of clients can be
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingserved simultaneously. To configure more than 256 clients, you must
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingedit the <code>HARD_SERVER_LIMIT</code> entry in
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<code>mpm_default.h</code> and recompile.
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx<P>Any connection attempts over the MaxClients limit will normally
62ba6bde073be4d332ffc9c89768757d3f646da5dirkxbe queued, up to a number based on the <A HREF="#listenbacklog">
62ba6bde073be4d332ffc9c89768757d3f646da5dirkxListenBacklog</A> directive. Once a child process is freed at the
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxend of a different request, the connection will then be serviced.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
0906f649b3d720299e47ed1148e79051e8941b2adirkx<p>When the server is compiled with threading, then the maximum number
0906f649b3d720299e47ed1148e79051e8941b2adirkxof simultaneous requests that can be served is obtained from the value
f5c43b553ca92a2adc39be43155b26c2b07ac40ctrawickof this directive multiplied by <a
0906f649b3d720299e47ed1148e79051e8941b2adirkxhref="#threadsperchild">ThreadsPerChild</a>.</p>
0906f649b3d720299e47ed1148e79051e8941b2adirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<HR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="maxrequestsperchild">MaxRequestsPerChild directive</A></H2>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<!--%plaintext &lt;?INDEX {\tt MaxRequestsPerChild} directive&gt; -->
0906f649b3d720299e47ed1148e79051e8941b2adirkx<p><A
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Syntax"
0906f649b3d720299e47ed1148e79051e8941b2adirkx REL="Help"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Syntax:</STRONG></A> MaxRequestsPerChild <EM>number</EM><BR>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<A
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Default"
0906f649b3d720299e47ed1148e79051e8941b2adirkx REL="Help"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Default:</STRONG></A> <CODE>MaxRequestsPerChild 10000</CODE><BR>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<A
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Context"
0906f649b3d720299e47ed1148e79051e8941b2adirkx REL="Help"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Context:</STRONG></A> server config<BR>
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx<A
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Status"
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx REL="Help"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Status:</STRONG></A> MPM<BR>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<A
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Module"
0906f649b3d720299e47ed1148e79051e8941b2adirkx REL="Help"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Module:</STRONG></A> threaded, prefork, perchild, mpm_winnt</p>
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx
0906f649b3d720299e47ed1148e79051e8941b2adirkx<p>The MaxRequestsPerChild directive sets the limit on the number of requests
0906f649b3d720299e47ed1148e79051e8941b2adirkxthat an individual child server process will handle. After MaxRequestsPerChild
0906f649b3d720299e47ed1148e79051e8941b2adirkxrequests, the child process will die. If MaxRequestsPerChild is 0, then
0906f649b3d720299e47ed1148e79051e8941b2adirkxthe process will never expire.<P>
0906f649b3d720299e47ed1148e79051e8941b2adirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxSetting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
0906f649b3d720299e47ed1148e79051e8941b2adirkx<UL>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<LI>it limits the amount of memory that process can consume by (accidental)
0906f649b3d720299e47ed1148e79051e8941b2adirkxmemory leakage;
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<LI> by giving processes a finite lifetime, it helps reduce the
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxnumber of processes when the server load reduces.
0906f649b3d720299e47ed1148e79051e8941b2adirkx</UL>
0906f649b3d720299e47ed1148e79051e8941b2adirkx
0906f649b3d720299e47ed1148e79051e8941b2adirkx<P><STRONG>NOTE:</STRONG> For <EM>KeepAlive</EM> requests, only the first
0906f649b3d720299e47ed1148e79051e8941b2adirkxrequest is counted towards this limit. In effect, it changes the
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxbehavior to limit the number of <EM>connections</EM> per child.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P><HR>
066877f1a045103acfdd376d48cdd473c33f409bdougm
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="maxsparethreads">MaxSpareThreads directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Syntax"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Syntax:</STRONG></A> MaxSpareThreads <EM>number</EM><BR>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 10 (Perchild) or 500 (threaded) </CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Context:</STRONG></A> server config<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> core<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P>Maximum number of idle threads. Different MPMs deal with this directive
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbdifferently. Perchild monitor the number of idle threads on a
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxper-child basis. If there are too many idle threads in that child, the server
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fieldingwill begin to kill threads within that child.</P>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<P>threaded deals with idle threads on a server-wide basis. If there are
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxtoo many idle threads in the server then child processes are killed
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxuntil the number of idle threads is less than this number.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>See also <A HREF="#minsparethreads">MinSpareThreads</A> and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A HREF="#startservers">StartServers</A>.
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P><HR>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="maxthreadsperchild">MaxThreadsPerChild directive</A></H2>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p><A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Syntax"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> MaxThreadsPerChild <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Default:</STRONG></A> <CODE>MaxThreadsPerChild 64</code>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding HREF="directive-dict.html#Context"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Context:</STRONG></A> server config<BR>
066877f1a045103acfdd376d48cdd473c33f409bdougm<A
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding HREF="directive-dict.html#Status"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding REL="Help"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Status:</STRONG></A> core<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Module"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
b7faa60a6790e84452c16e5dfb3bde2c52a1030dtrawick><STRONG>Module:</STRONG></A> threaded, perchild</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<P>Maximum number of threads per child. For MPMs with a variable
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingnumber of threads per child, this directive sets the maximum number of
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingthreads that will be created in each child process. To increase this
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingvalue beyond its default, it is necessary to change the value of
4cd6952360b49b5f229e1d6db699b051f90d403cwrowethe compile-time define <code>HARD_THREAD_LIMIT</code> and recompile
4cd6952360b49b5f229e1d6db699b051f90d403cwrowethe server.</p>
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<P><HR>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="minsparethreads">MinSpareThreads directive</A></H2>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<!--%plaintext &lt;?INDEX {\tt MinSpareServers} directive&gt; -->
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<p><A
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb HREF="directive-dict.html#Syntax"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Syntax:</STRONG></A> MinSpareServers <EM>number</EM><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb HREF="directive-dict.html#Default"
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 5 (Perchild) or 250 (threaded) </CODE><BR>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<A
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb HREF="directive-dict.html#Context"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Context:</STRONG></A> server config<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe HREF="directive-dict.html#Status"
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe REL="Help"
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe><STRONG>Status:</STRONG></A> core<BR>
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe<A
16478631d2fd87116d7e41b3ed8748343b453d88jwoolley HREF="directive-dict.html#Module"
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild</p>
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<P>Minimum number of idle threads to handle request spikes. Different MPMs
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxdeal with this directive differently. Perchild monitor the number
4cd6952360b49b5f229e1d6db699b051f90d403cwroweof idle threads on a per-child basis. If there aren't enough idle threads in
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxthat child, the server will begin to create new threads within that child.
4cd6952360b49b5f229e1d6db699b051f90d403cwrowe</P>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<P>threaded deals with idle threads on a server-wide basis. If there
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingaren't enough idle threads in the server then child processes are created
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinguntil the number of idle threads is greater than number.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxSee also <A HREF="#maxsparethreads">MaxSpareThreads</A> and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A HREF="#startservers">StartServers</A>.<P><HR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<H2><A NAME="numservers">NumServers directive</A></H2>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<p><A
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe HREF="directive-dict.html#Syntax"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Syntax:</STRONG></A> NumServers <EM>number</EM><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Default"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Default:</STRONG></A> <CODE>NumServers 2</CODE><BR>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Context:</STRONG></A> server config<BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> MPM<BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> perchild</p>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>Number of children alive at the same time. MPMs that use this directive
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxdo not dynamically create new child processes so this number should be
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxlarge enough to handle the requests for the entire site.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<hr>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="scoreboardfile">ScoreBoardFile directive</A></H2>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<!--%plaintext &lt;?INDEX {\tt ScoreBoardFile} directive&gt; -->
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p><A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Syntax"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> ScoreBoardFile <EM>filename</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>ScoreBoardFile logs/apache_status</CODE>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Context:</STRONG></A> server config<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> MPM<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding HREF="directive-dict.html#Compatibility"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx></a>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
9676a1b0eec9cb7934d7a1739f07c346e2e63f16trawick<p>The ScoreBoardFile directive is required on some architectures to place
9676a1b0eec9cb7934d7a1739f07c346e2e63f16trawicka file that the server will use to communicate between its children and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe parent. The easiest way to find out if your architecture requires
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxa scoreboard file is to run Apache and see if it creates the file named
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxby the directive. If your architecture requires it then you must ensure
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthat this file is not used at the same time by more than one invocation
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxof Apache.</p>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>If you have to use a ScoreBoardFile then you may see improved speed by
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxplacing it on a RAM disk. But be careful that you heed the same warnings
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxabout log file placement and
9676a1b0eec9cb7934d7a1739f07c346e2e63f16trawick<A HREF="/misc/security_tips.html">security</A>.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p><STRONG>See Also</STRONG>:
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A HREF="/stopping.html">Stopping and Restarting Apache</A></P>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<P><HR>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<H2><A NAME="sendbuffersize">SendBufferSize directive</A></H2>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<!--%plaintext &lt;?INDEX {\tt SendBufferSize} directive&gt; -->
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<p><A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Syntax"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> SendBufferSize <EM>bytes</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Context:</STRONG></A> server config<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> MPM<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkxThe server will set the TCP buffer size to the number of bytes
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxspecified. Very useful to increase past standard OS defaults on high
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkxspeed high latency (<EM>i.e.</EM>, 100ms or so, such as transcontinental
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxfast pipes)
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P><HR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkx<H2><A NAME="startservers">StartServers directive</A></H2>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<!--%plaintext &lt;?INDEX {\tt StartServers} directive&gt; -->
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkx<p><A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Syntax"
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> StartServers <EM>number</EM><BR>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Default:</STRONG></A> <CODE>StartServers 5</CODE><BR>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<A
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding HREF="directive-dict.html#Context"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe REL="Help"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Context:</STRONG></A> server config<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding HREF="directive-dict.html#Status"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe REL="Help"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Status:</STRONG></A> MPM<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, prefork</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>The StartServers directive sets the number of child server processes created
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxon startup. As the number of processes is dynamically controlled depending
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxon the load, there is usually little reason to adjust this parameter.</P>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<P>See also <A HREF="#minsparethreads">MinSpareThreads</A> and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A HREF="#maxsparethreads">MaxSpareThreads</A>.<P><HR>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="startthreads">StartThreads directive</A></H2>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p><A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Syntax"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> StartThreads <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx REL="Help"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Default:</STRONG></A> <CODE>StartThreads 5</CODE><BR>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<A
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe HREF="directive-dict.html#Context"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding REL="Help"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe><STRONG>Context:</STRONG></A> server config<BR>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<A
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe HREF="directive-dict.html#Status"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe REL="Help"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Status:</STRONG></A> MPM<BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> perchild</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>Number of threads each child creates on startup. As the number of threads
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxis dynamically controlled depending on the load, there is usually little
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxreason to adjust this parameter.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<hr>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<H2><A NAME="threadsperchild">ThreadsPerChild</A></H2>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<p><A
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe HREF="directive-dict.html#Syntax"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe REL="Help"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe><STRONG>Syntax:</STRONG></A> ThreadsPerChild <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>ThreadsPerChild 50</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Context:</STRONG></A> server config<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Status"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Status:</STRONG></A> MPM<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Module"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, mpm_winnt</p>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P>This directive sets the number of threads created by each child
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxprocess. The child creates these threads at startup and never creates
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowemore. if using an MPM like mpmt_winnt, where there is only one child process,
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthis number should be high enough to handle the entire load of the server.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingIf using an MPM like threaded, where there are multiple child processes,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingthe total number of threads should be high enough to handle the common load
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingon the server.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p><hr>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="user">User directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--%plaintext &lt;?INDEX {\tt User} directive&gt; -->
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Syntax"
066877f1a045103acfdd376d48cdd473c33f409bdougm REL="Help"
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb><STRONG>Syntax:</STRONG></A> User <EM>unix-userid</EM><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Default"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Default:</STRONG></A> <CODE>User #-1</CODE><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding HREF="directive-dict.html#Context"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Context:</STRONG></A> server config, virtual host<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Status"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Status:</STRONG></A> core<BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Module"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding REL="Help"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingThe User directive sets the userid as which the server will answer requests.
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxIn order to use this directive, the standalone server must be run initially
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxas root. <EM>Unix-userid</EM> is one of:
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<DL>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<DT>A username
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<DD>Refers to the given user by name.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<DT># followed by a user number.
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<DD>Refers to a user by their number.
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx</DL>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbThe user should have no privileges which result in it being able to access
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxfiles which are not intended to be visible to the outside world, and
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingsimilarly, the user should not be able to execute code which is not
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxmeant for httpd requests. It is recommended that you set up a new user and
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxgroup specifically for running the server. Some admins use user
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<CODE>nobody</CODE>, but this is not always possible or desirable.
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxFor example mod_proxy's cache, when enabled, must be accessible to this user
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx(see <A HREF="mod_proxy.html">mod_proxy's</A> <CODE>CacheRoot</CODE>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxdirective).<P>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxNotes: If you start the server as a non-root user, it will fail to change
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbto the lesser privileged user, and will instead continue to run as
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxthat original user. If you do start the server as root, then it is normal
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingfor the parent process to remain running as root.<P>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxSpecial note: Use of this directive in &lt;VirtualHost&gt; is no longer
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxsupported. To configure your server for <A HREF="mod_suexec.html">
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxsuexec</A> use <A HREF="mod_suexec.html#suexecusergroup">SuexecUserGroup</A>.
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxSECURITY: Don't set User (or <A HREF="#group">Group</A>) to
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<CODE>root</CODE> unless you know exactly what you are doing, and what the
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbdangers are.<P>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--#include virtual="footer.html" -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding</BODY>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding</HTML>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx