6.2.5 Directives starting with K and L
- Organization of this subsection
(1) KeepAlive {On | Off}
(a) Contents
The KeepAlive directive specifies whether to enable the KeepAlive connection. Actually the KeepAlive is executed only when the client also supports the KeepAlive. As the KeepAlive keeps the persistent connection between server process and the client, the response to continuous requests is good. On the other hand, as a server process is exclusively reserved for specific clients, the service efficiency of the Web server as a whole may decline. You need to make adjustments by using the KeepAliveTimeout and the MaxKeepAliveRequests directives.
On: Enables the persistent connection (KeepAlive).
Off: Disables the persistent connection (KeepAlive).
(b) Location where you can code
httpsd.conf
(c) Specification example
KeepAlive On
(2) KeepAliveTimeout time
~((0 - 65535))<<5>> (Unit: Seconds)
(a) Contents
This directive specifies the request waiting time during the KeepAlive connection in seconds. If the request waiting time elapses and the next request does not come from the client, the connection is disconnected. In the KeepAlive connection, persistent clients occupy the server process. Specify the settings in such a way that when the standard time required for moving from one Web page to the next Web page is exceeded, the timeout disconnects the connection and the server process is applied for processing other request. If the time is set to 0, the KeepAlive connection becomes invalid.
(b) Location where you can code
httpsd.conf
(c) Specification example
KeepAliveTimeout 15
The request waiting time is 15 seconds in the case of KeepAlive connection.
(3) LanguagePriority language-code [language-code ...]
(a) Contents
The LanguagePriority directive specifies the used languages in the order of descending priorities. In the content negotiation, if the priority order (Accept-Language header) of the language code is not included in the request from the Web browser, the specified priority order is used. For the language code specified here, see AddLanguage directive.
(b) Location where you can code
httpsd.conf, <VirtualHost>, <Directory>, .htaccess
(c) Overwrite permission
FileInfo level
(d) Specification example
LanguagePriority ja en fr de
The priority order is Japanese, English, French, and German.
(4) LimitRequestBody request-body-size
~((0 - 2147483647))<<0>> (Unit: bytes)
(a) Contents
This directive specifies the upper limit for the object body (data) size when the server receives a request from the Web browser using the HTTP communication. The object body is used when the request is sent by <FORM METHOD=POST ACTION=...> from the Web server. When the upper limit is not specified, it is set to 0.
(b) Location where you can code
httpsd.conf, <VirtualHost>, <Directory>, .htaccess
(5) LimitRequestFields number-of-headers
~((0 - 32767))<<100>>
(a) Contents
This directive specifies the upper limit for the number of HTTP headers when the server receives a request from the Web browser using the HTTP communication. The number of HTTP headers of the request changes as per the specification of the proxy that links the Web browser and requests. When the upper limit is not specified, it is set to 0.
To apply the value specified in this directive to requests to the virtual host, you need to specify this directive before the <VirtualHost> block.
(b) Location where you can code
httpsd.conf
(6) LimitRequestFieldsize header-size
~((0 - 8190))<<8190>> (Unit: bytes)
(a) Contents
This directive specifies the upper limit for the size of one HTTP header when the server receives the request from the Web browser using the HTTP communication. The size of request header changes as per the specification of the proxy that links the Web browser and requests.
To apply the value specified in this directive to requests to the virtual host, you need to specify this directive before the <VirtualHost> block.
(b) Location where you can code
httpsd.conf
(7) LimitRequestLine request-line-length
~((0 - 8190))<<8190>> (Unit: bytes)
(a) Contents
This directive specifies the upper limit for the length of the request string (including the URI, HTTP version, the method and the inquiry character string) when the server receives the request from the Web browser using the HTTP communication. When the request is sent from the Web browser by <FORM METHOD=GET ACTION...>, the request string is used as a query string. Note that the number of bytes sent from the Web browser as the request line changes as per the specification of the proxy that links the Web browser and requests.
To apply the value specified in this directive to requests to the virtual host, you need to specify this directive before the <VirtualHost> block.
(b) Location where you can code
httpsd.conf
(8) Listen [IP-address:] port-number
(a) Contents
The 'Listen' directive specifies the IP address and the port number that receives the request. Unlike 'Port' directive, you can perform multiple specifications. Specify this directive when defining the virtual host. When you specify the Listen directive, the specifications of Port directive and BindAddress directive are ignored.
You can specify an IPv6 address for IP-address. Specify an IPv6 address by enclosing it in square brackets ([ ]). However, if you omit IP-address and specify only the port number, only requests using IPv4 addresses are accepted. Therefore, when using an IPv6 address, be sure to specify the IPv6 address in the Listen directive.
To restart the server after changing the IP address specified in the Listen directive, stop the server, and then start it. If you use other means to restart the server, such as a command, startup might fail.
(b) Location where you can code
httpsd.conf
(c) Specification example
Listen 80 Listen [2001::123:4567:89ab:cdef]:8080 Listen [::]:80
(9) ListenBacklog number-of-backlogs
~((1 - 2147483647))<<511>>
(a) Contents
The ListenBacklog directive specifies the maximum queue size for the connection requests from the client. The specified value is set as the number of backlogs of system call listen( ). However, as the limit for the specification value and the actual maximum value for queue size differ according to the OS, see the OS manual for listen( ) and documents that explain TCP/IP implementation for each OS.
(b) Location where you can code
httpsd.conf
(10) LoadFile file-name [file-name ...]
(a) Contents
The LoadFile directive specifies the object file or the library containing the codes that are referred by the module incorporated by the DSO. In the file name, you can specify the absolute path, or the relative path from the specified value of the ServerRoot directive.
When you specify the modules that refer to this file in the LoadModule directive, you need to specify this directive before these modules are used in httpsd.conf.
(b) Location where you can code
httpsd.conf
(11) LoadModule module-structure-name library-file-name
(a) Contents
This directive specifies a module to be dynamically embedded in the Web server. You can specify absolute path, or the relative path from the specified value of the ServerRoot directive in the library file name.
In the UNIX version, you need to embed one prefork MPM module or worker MPM module. If neither module is specified, the prefork MPM module will be embedded.
(b) Location where you can code
httpsd.conf
(c) Specification example
- To embed the prefork MPM module, specify as follows:
LoadModule mpm_prefork_module libexec/mod_mpm_prefork.so
- To embed the worker MPM module, specify as follows:
LoadModule mpm_worker_module libexec/mod_mpm_worker.so
(12) LogFormat "format" [label-name]
~<<"%h %l %u %t "%r
" %>s %b">>
(a) Contents
The LogFormat directive defines the label name in log format. You can specify the label name defined here in the CustomLog directive. For the format that you can specify, see CustomLog directive. If label name is not attached, you cannot specify this directive multiple times. If %A or %a is specified in the format, IPv6 addresses can also be output. If %h or %V is specified in the format, host names corresponding to IPv6 addresses or the IPv6 addresses can also be output.
If no label name is assigned, you cannot specify this directive multiple times.
(b) Location where you can code
httpsd.conf, <VirtualHost>
(c) Specification example
LogFormat "%h %l %u %t"%r
" %>s %b
"%{Referer}i
"
"%{User-Agent}i
"" combined LogFormat "%h %l %u %t
"%r
" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent
(13) LogLevel {debug | info | notice | warn | error | crit | alert | emerg}
(a) Contents
This directive specifies the level of the errors that are output to the error log. The Web Server outputs the upper level error log than the specified level. Note that notice level logs are output regardless of this specification. Messages that are output before the analysis of the level specification finishes (for example, during HTTP Server startup) may be output regardless of this specification.
The following table describes the error levels in the ascending order:
Level |
Meaning |
---|---|
emerg |
Emergency message |
alert |
Message that requests instant processing |
crit |
Critical state message |
error |
General error message |
warn |
Warning level message |
notice |
Standard but important message |
info |
Information messages, and module trace information# collected when external modules and CGI programs are executed |
debug |
Debug level messages, trace information for internal modules, and info-level module trace information# |
#: You can specify that module trace information is to be output not to the error log but to the request log. For details, see 4.2.2(6) Locations to which trace information is output and 4.2.6 Collecting the module trace.
(b) Location where you can code
httpsd.conf, <VirtualHost>
(c) Specification example
LogLevel info