mpm_common - Apache HTTP Server Version 2.5
Modules | Directives | FAQ | Glossary | Sitemap | Report a bug Apache HTTP Server Version 2.5 Apache > HTTP Server > Documentation > Version 2.5 > Modules Apache MPM Common Directives Available Languages: de | en | fr | ja | tr Description: A collection of directives that are implemented by more than one multi-processing module (MPM) Status: MPM Directives AcceptErrorsNonFatal CoreDumpDirectory EnableExceptionHook GracefulShutdownTimeout Listen ListenBackLog ListenCoresBucketsRatio ListenTCPDeferAccept MaxConnectionsPerChild MaxMemFree MaxRequestWorkers MaxSpareThreads MinSpareThreads PidFile ReceiveBufferSize ScoreBoardFile SendBufferSize ServerLimit StartServers StartThreads ThreadLimit ThreadsPerChild ThreadStackSize Bugfix checklist httpd changelog Known issues Report a bug AcceptErrorsNonFatal Directive ¶ Description: Treat some errors accepting a new connection as non-fatal to the httpd process.
Syntax: AcceptErrorsNonFatal ON Default: OFF (ECONNREFUSED, ECONNABORTED, ECONNRESET cause the process to exit) Context: server config Status: MPM Module: event , worker , prefork Compatibility: 2.5.1 and later The AcceptErrorsNonFatal alters the servers behavior under some rare errors that may occur while accepting a new client connection. By default, the child process handling a request will gracefully exit when nearly any socket error occurs during the accept() system call.
This is to ensure a potentially unhealthy child process does not try to take on more new connections. With AcceptErrorsNonFatal set to "ON", the process will not begin to exit if the accept() error is ECONNREFUSED, ECONNABORTED, or ECONNRESET. Some third-party firewall software components may inject errors into accept() processing, using return codes not specified by the operating system. CoreDumpDirectory Directive ¶ Description: Directory where Apache HTTP Server attempts to switch before dumping core Syntax: CoreDumpDirectory directory Default: See usage for the default setting Context: server config Status: MPM Module: event , worker , prefork This controls the directory to which Apache httpd attempts to switch before dumping core.
If your operating system is configured to create core files in the working directory of the crashing process, CoreDumpDirectory is necessary to change working directory from the default ServerRoot directory, which should not be writable by the user the server runs as. If you want a core dump for debugging, you can use this directive to place it in a different location. This directive has no effect if your operating system is not configured to write core files to the working directory of the crashing processes.
Security note for Linux systems Using this directive on Linux may allow other processes on the system (if running with similar privileges, such as CGI scripts) to attach to httpd children via the ptrace system call. This may make weaken the protection from certain security attacks. It is not recommended to use this directive on production systems. Core Dumps on Linux If Apache httpd starts as root and switches to another user, the Linux kernel disables core dumps even if the directory is writable for the process.
Apache httpd (2.0.46 and later) reenables core dumps on Linux 2.4 and beyond, but only if you explicitly configure a CoreDumpDirectory . Core Dumps on BSD To enable core-dumping of suid-executables on BSD-systems (such as FreeBSD), set kern.sugid_coredump to 1. Specific signals CoreDumpDirectory processing only occurs for a select set of fatal signals: SIGFPE, SIGILL, SIGABRT, SIGSEGV, and SIGBUS. On some operating systems, SIGQUIT also results in a core dump but does not go through CoreDumpDirectory or EnableExceptionHook processing, so the core location is dictated entirely by the operating system.
EnableExceptionHook Directive ¶ Description: Enables a hook that runs exception handlers after a crash Syntax: EnableExceptionHook On|Off Default: EnableExceptionHook Off Context: server config Status: MPM Module: event , worker , prefork For safety reasons this directive is only available if the server was configured with the --enable-exception-hook option. It enables a hook that allows external modules to plug in and do something after a child crashed.
There are already two modules, mod_whatkilledus and mod_backtrace that make use of this hook. Please have a look at Jeff Trawick's EnableExceptionHook site for more information about these. GracefulShutdownTimeout Directive ¶ Description: Specify a timeout after which a gracefully shutdown server will exit. Syntax: GracefulShutdownTimeout seconds Default: GracefulShutdownTimeout 0 Context: server config Status: MPM Module: event , worker , prefork , motorz The GracefulShutdownTimeout specifies how many seconds after receiving a "graceful-stop" signal, a server should continue to run, handling the existing connections.
Setting this value to zero means that the server will wait indefinitely until all remaining requests have been fully served. Listen Directive ¶ Description: IP addresses and ports that the server listens to Syntax: Listen [ IP-address :] portnumber [ protocol ] [options= flag [, flag.. ]] Context: server config Status: MPM Module: event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2 Compatibility: The optional options= argument is available in httpd 2.5.1 and later.
The Listen directive instructs Apache httpd to listen to only specific IP addresses or ports; by default it responds to requests on all IP interfaces. Listen is now a required directive. If it is not in the config file, the server will fail to start. This is a change from previous versions of Apache httpd. The Listen directive tells the server to accept incoming requests on the specified port or address-and-port combination.
If only a port number is specified, the server listens to the given port on all interfaces. If an IP address is given as well as a port, the server will listen on the given port and interface. Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports. For example, to make the server accept connections on both port 80 and port 8000, use: Listen 80 Listen 8000 To make the server accept connections on two specified interfaces and port numbers, use Listen 192.170.2.1:80 Listen 192.170.2.5:8000 IPv6 addresses must be surrounded in square brackets, as in the following example: Listen [2001:db8::a00:20ff:fea7:ccea]:80 In httpd 2.5.1 and later, if built against APR 1.7.0 or later, scoped (or "zoned") literal IPv6 addresses are accepted in the Listen directive, such as the following example.
Listen [fe80::4bfe:88aa:5d42:64d0%eth2]:8081 The optional protocol argument is not required for most configurations. If not specified, https is the default for port 443 and http the default for all other ports. The protocol is used to determine which module should handle a request, and to apply protocol specific optimizations with the AcceptFilter directive. You only need to set the protocol if you are running on non-standard ports.
For example, running an https site on port 8443: Listen 192.170.2.1:8443 https The optional options=flag,flag... argument can be used to enable certain socket options for the listening port. These options are not required for most configurations and should be used with care. Availability of each flag varies across operating systems. The available flag s are: freebind : The IP_FREEBIND socket option is enabled, allowing a Listen directive to be used for an address which is not (yet) available on the system. (Linux only) reuseport : The SO_REUSEPORT socket option is enabled, allowing a Listen directive to bind to a port which may already be in use by another process. v6only : The IPV6_V6ONLY socket option is enabled, allowing a Listen directive to bind to an IPv6 address without also accepting connections via IPv4, or conflicting with a Listen directive usi
The rest of this page is on the live site.