Este documento explica algunas de la directivas proporcionadas por el servidor básico y usadas para las operaciones básicas del servidor.
Directivas relevantes ServerName ServerAdmin ServerSignature ServerTokens UseCanonicalName |
Las directivas ServerAdmin
y ServerTokens
controlan qué información sobre el servidor será presentada en documentos
generados por el servidor, como por ejemplo mensajes de error.
La directiva ServerTokens
fija el contenido del campo de
encabezado en la respuesta del servidor HTTP.
El servidor usa las directivas ServerName
y
UseCanonicalName
para determinar como construir URLs con
referencias a ellas mismas. Por ejemplo, cuando un cliente pide un directorio
pero no incluye el "slash" al final del nombre, Apache tiene que redireccionar
el cliente hacia el nombre completo incluyendo el slash final, de forma que
el servidor pueda construir correctamente las referencias relativas en el
documento.
Directivas relevantes CoreDumpDirectory DocumentRoot ErrorLog Lockfile PidFile ScoreBoardFile ServerRoot |
Estas directivas controlan la localización de los diferentes ficheros que
Apache necesita para su correcto funcionamiento. Cuando el camino usado no
comienza con un slash "/", los ficheros son localizados relativamente al valor
de ServerRoot
. Tenga cuidado cuando coloque ficheros en
directorios donde puedan escribir usuarios diferentes de "root". Para más
detalles consulte la documentación sobre
consejos de seguridad.
Directivas relevantes BS2000Account Group MaxClients MaxRequestsPerChild MaxSpareServers MinSpareServers ServerType StartServers ThreadsPerChild User |
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.
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
(swapping memory to disk and back). More information about tuning
process creation is provided in the performance hints documentation.
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-privileged 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.
In addition, unless suexec is used,
these directives also set the privileges which will be inherited
by CGI scripts.
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.
Directivas relevantes BindAddress KeepAlive KeepAliveTimeout Listen ListenBackLog MaxKeepAliveRequests Port SendBufferSize TimeOut |
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 than one port, 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.
Directivas relevantes LimitRequestBody LimitRequestFields LimitRequestFieldsize LimitRequestLine RLimitCPU RLimitMEM RLimitNPROC ThreadStackSize |
The LimitRequest
* 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 stack size.