]> granicus.if.org Git - apache/blob - docs/manual/server-wide.html.en
Fix typo
[apache] / docs / manual / server-wide.html.en
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>Server-Wide Configuration</TITLE>
5 </HEAD>
6
7 <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
8 <BODY
9  BGCOLOR="#FFFFFF"
10  TEXT="#000000"
11  LINK="#0000FF"
12  VLINK="#000080"
13  ALINK="#FF0000"
14 >
15 <!--#include virtual="header.html" -->
16 <h1 align="center">Server-Wide Configuration</h1>
17
18 <p>This document explains some of the directives provided by the
19 <a href="mod/core.html">core</A> server which are used to configure
20 the basic operations of the server.</p>
21
22 <ul>
23 <li><a href="#identification">Server Identification</a></li>
24 <li><a href="#locations">File Locations</a></li>
25 <li><a href="#process">Process Creation</a></li>
26 <li><a href="#network">Network Configuration</a></li>
27 <li><a href="#resource">Limiting Resource Usage</a></li>
28 </ul>
29
30 <hr>
31
32 <h2><a name="identification">Server Identification</a></h2>
33
34 <table border="1">
35 <tr><td valign="top">
36 <strong>Related Directives</strong><br><br>
37
38 <A HREF="mod/core.html#servername">ServerName</A><br>
39 <A HREF="mod/core.html#serveradmin">ServerAdmin</A><br>
40 <A HREF="mod/core.html#serversignature">ServerSignature</A><br>
41 <A HREF="mod/core.html#servertokens">ServerTokens</A><br>
42 <A HREF="mod/core.html#usecanonicalname">UseCanonicalName</A><br>
43 </td></tr></table>
44
45 <p>The <code>ServerAdmin</code> and <code>ServerTokens</code>
46 directives control what information about the server will be presented
47 in server-generated documents such as error messages.
48 The <code>ServerTokens</code> directive sets the value of the 
49 Server HTTP response header field.</p>
50
51 <p>The <code>ServerName</code> and <code>UseCanonicalName</code>
52 directives are used by the server to determine how to construct
53 self-referential URLs.  For example, when a client requests a
54 directory, but does not include the trailing slash in the directory
55 name, Apache must redirect the client to the full name including the
56 trailing slash so that the client will correctly resolve relative
57 references in the document.</p>
58
59 <hr>
60
61 <h2><a name="locations">File Locations</a></h2>
62
63 <table border="1">
64 <tr><td valign="top">
65 <strong>Related Directives</strong><br><br>
66
67 <a href="mod/core.html#coredumpdirectory">CoreDumpDirectory</a><br>
68 <a href="mod/core.html#documentroot">DocumentRoot</a><br>
69 <a href="mod/core.html#errorlog">ErrorLog</a><br>
70 <a href="mod/core.html#lockfile">Lockfile</a><br>
71 <a href="mod/core.html#pidfile">PidFile</a><br>
72 <a href="mod/core.html#scoreboardfile">ScoreBoardFile</a><br>
73 <a href="mod/core.html#serverroot">ServerRoot</a><br>
74 </td></tr></table>
75
76 <p>These directives control the locations of the various files that
77 Apache needs for proper operation.  When the pathname used does not
78 begin with a slash "/", the files are located relative to the
79 <code>ServerRoot</code>.  Be careful about locating files in paths
80 which are writable by non-root users.  See the <a
81 href="misc/security_tips.html">security tips</a> documentation for
82 more details.</p>
83
84 <hr>
85
86 <h2><a name="process">Process Creation</a></h2>
87
88 <table border="1">
89 <tr><td valign="top">
90 <strong>Related Directives</strong><br><br>
91
92 <a href="mod/core.html#bs2000account">BS2000Account</a><br>
93 <a href="mod/core.html#group">Group</a><br>
94 <a href="mod/core.html#baxclients">MaxClients</a><br>
95 <a href="mod/core.html#maxrequestsperchild">MaxRequestsPerChild</a><br>
96 <a href="mod/core.html#maxspareservers">MaxSpareServers</a><br>
97 <a href="mod/core.html#minspareservers">MinSpareServers</a><br>
98 <a href="mod/core.html#servertype">ServerType</a><br>
99 <a href="mod/core.html#startservers">StartServers</a><br>
100 <a href="mod/core.html#threadsperchild">ThreadsPerChild</a><br>
101 <a href="mod/core.html#user">User</a><br>
102 </td></tr></table>
103
104 <p>When <code>ServerType</code> is set to its recommended value of
105 <code>Standalone</code>, Apache 1.3 for Unix is a pre-forking web
106 server.  A single control process is responsible for launching child
107 processes which listen for connections and serve them when they
108 arrive.  Apache always tries to maintain several <em>spare</em> or
109 idle server processes, which stand ready to serve incoming requests.
110 In this way, clients do not need to wait for a new child processes to
111 be forked before their requests can be served.</p>
112
113 <p>The <code>StartServers</code>, <code>MinSpareServers</code>,
114 <code>MaxSpareServers</code>, and <code>MaxServers</code> regulate how
115 the parent process creates children to serve requests.  In general,
116 Apache is very self-regulating, so most sites do not need to adjust
117 these directives from their default values.  Sites which need to serve
118 more than 256 simultaneous requests may need to increase
119 <code>MaxClients</code>, while sites with limited memory may need to
120 decrease <code>MaxClients</code> to keep the server from thrashing
121 (swapping memory to disk and back).  More information about tuning
122 process creation is provided in the <a
123 href="misc/perf-tuning.html">performance hints</a> documentation.</p>
124
125 <p>While the parent process is usually started as root under Unix
126 in order to bind to port 80, the child processes are launched
127 by Apache as a less-privileged user.  The <code>User</code> and
128 <code>Group</code> directives are used to set the privileges
129 of the Apache child processes.  The child processes must
130 be able to read all the content that will be served, but
131 should have as few privileges beyond that as possible.
132 In addition, unless <a href="suexec.html">suexec</a> is used,
133 these directives also set the privileges which will be inherited
134 by CGI scripts.</p>
135
136 <p><code>MaxRequestsPerChild</code> controls how frequently the server
137 recycles processes by killing old ones and launching new ones.</p>
138
139 <p>Under Windows, Apache launches one control process and one
140 child process.  The child process creates multiple threads to
141 serve requests.  The number of threads is controlled by the
142 <code>ThreadsPerChild</code> directive.</p>
143
144 <hr>
145
146 <h2><a name="network">Network Configuration</a></h2>
147
148 <table border="1">
149 <tr><td valign="top">
150 <strong>Related Directives</strong><br><br>
151
152 <a href="mod/core.html#bindaddress">BindAddress</a><br>
153 <a href="mod/core.html#keepalive">KeepAlive</a><br>
154 <a href="mod/core.html#keepalivetimeout">KeepAliveTimeout</a><br>
155 <a href="mod/core.html#listen">Listen</a><br>
156 <a href="mod/core.html#listenbacklog">ListenBackLog</a><br>
157 <a href="mod/core.html#maxKeepaliverequests">MaxKeepAliveRequests</a><br>
158 <a href="mod/core.html#port">Port</a><br>
159 <a href="mod/core.html#sendbuffersize">SendBufferSize</a><br>
160 <a href="mod/core.html#timeOut">TimeOut</a><br>
161 </td></tr></table>
162
163 <p>When Apache starts, it connects to some port and address on the
164 local machine and waits for incoming requests. By default, it listens
165 to all addresses on the machine, and to the port as specified by the
166 <code>Port</code> directive in the server configuration.  However, it
167 can be told to listen to more than one port, to listen to only
168 selected addresses, or a combination. This is often combined with the
169 <a href="vhosts/">Virtual Host</a> feature which determines how Apache
170 responds to different IP addresses, hostnames and ports.</p>
171
172 <p>There are two directives used to restrict or specify which addresses
173 and ports Apache listens to.  The <code>BindAddress</code> directive
174 is used to restrict the server to listening to a single IP address.
175 The <code>Listen</code> directive can be used to specify multiple
176 IP addresses and/or Ports to which Apache will listen.</p>
177
178 <p>The <code>ListenBackLog</code>, <code>SendBufferSize</code>, and
179 <code>TimeOut</code> directives are used to adjust how Apache
180 interacts with the network.</p>
181
182 <p>The <code>KeepAlive</code>, <code>KeepAliveTimeout</code>, 
183 and <code>MaxKeepAliveRequests</code> directives are used to
184 configure how Apache handles persistent connections.</p>
185
186 <hr>
187 <h2><a name="resource">Limiting Resource Usage</a></h2>
188 <table border="1">
189 <tr><td valign="top">
190 <strong>Related Directives</strong><br><br>
191
192 <a href="mod/core.html#limitrequestbody">LimitRequestBody</a><br>
193 <a href="mod/core.html#limitrequestfields">LimitRequestFields</a><br>
194 <a href="mod/core.html#limitrequestfieldsize">LimitRequestFieldsize</a><br>
195 <a href="mod/core.html#limitrequestline">LimitRequestLine</a><br>
196 <a href="mod/core.html#rlimitcpu">RLimitCPU</a><br>
197 <a href="mod/core.html#rlimitmem">RLimitMEM</a><br>
198 <a href="mod/core.html#rlimitnproc">RLimitNPROC</a><br>
199 <a href="mod/core.html#threadstacksize">ThreadStackSize</a><br>
200 </td></tr></table>
201
202 <p>The <code>LimitRequest</code>* directives are used to place limits
203 on the amount of resources Apache will use in reading requests
204 from clients.  By limiting these values, some kinds of denial
205 of service attacks can be mitigated.</p>
206
207 <p>The <code>RLimit</code>* directives are used to limit the amount
208 of resources which can be used by processes forked off from
209 the Apache children.  In particular, this will control
210 resources used by CGI scripts and SSI exec commands.</p>
211
212 <p>The <code>ThreadStackSize</code> directive is used only
213 on Netware to control the stack size.</p>
214
215 <!--#include virtual="footer.html" -->
216 </BODY>
217 </HTML>