Server-Wide Configuration
The ServerAdmin
and ServerTokens
directives control what information about the server will be presented
in server-generated documents like error messages.
The ServerTokens
directive sets the value of the
Server response HTTP header field. The ServerName
and UseCanonicalName
directives are used
by the server to determine how to construct self-referential
URLs.
These directives control the locations of the various files
that Apache needs for proper operation.
When ServerType
is set to its recommended value of
Standalone
, Apache 1.3 for Unix is a pre-forking web
server. A single control process is responsible for launching child
processes which listen for connections and serve them when they
arrive. Apache always tries to maintain several spare or
idle server processes, which stand ready to serve incoming requests.
In this way, clients do not need to wait for a new child processes to
be forked before their requests can be served.
While the parent process is usually started as root under Unix
in order to bind to port 80, the child processes are launched
by Apache as a less-priveleged user. The User
and
Group
directives are used to set the privileges
of the Apache child processes. The child processes must
be able to read all the content that will be served, but
should have as few privileges beyond that as possible.
The StartServers
, MinSpareServers
,
MaxSpareServers
, and MaxServers
regulate how
the parent process creates children to serve requests. In general,
Apache is very self-regulating, so most sites do not need to adjust
these directives from their default values. Sites which need to serve
more than 256 simultaneous requests may need to increase
MaxClients
, while sites with limited memory may need to
decrease MaxClients
to keep the server from thrashing.
MaxRequestsPerChild
controls how frequently the server
recycles processes by killing old ones and launching new ones.
Under Windows, Apache launches one control process and one
child process. The child process creates multiple threads to
serve requests. The number of threads is controlled by the
ThreadsPerChild
directive.
When Apache starts, it connects to some port and address on the
local machine and waits for incoming requests. By default, it listens
to all addresses on the machine, and to the port as specified by the
Port
directive in the server configuration. However, it
can be told to listen to more the one port, or to listen to only
selected addresses, or a combination. This is often combined with the
Virtual Host feature which determines how Apache
responds to different IP addresses, hostnames and ports.
There are two directives used to restrict or specify which addresses
and ports Apache listens to. The BindAddress
directive
is used to restrict the server to listening to a single IP address.
The Listen
directive can be used to specify multiple
IP addresses and/or Ports to which Apache will listen.
The ListenBackLog
, SendBufferSize
, and
TimeOut
directives are used to adjust how Apache
interacts with the network.
The KeepAlive
, KeepAliveTimeout
,
and MaxKeepAliveRequests
directives are used to
configure how Apache handles persistent connections.
The Limit
* directives are used to place limits
on the amount of resources Apache will use in reading requests
from clients. By limiting these values, some kinds of denial
of service attacks can be mitigated.
The RLimit
* directives are used to limit the amount
of resources which can be used by processes forked off from
the Apache children. In particular, this will control
resources used by CGI scripts and SSI exec commands.
The ThreadStackSize
directive is used only
on Netware to control the stock size.