Hitachi

uCosminexus Application Server HTTP Server User Guide


6.2.3 Directives starting with B, C, and D

Organization of this subsection

(1) BindAddress {IP-address | *}

~<<*>>

(a) Contents

The BindAddress directive specifies the IP address to which the Web server can be connected, from the allocated IP addresses in the server machine on which the Web server is installed. An IPv6 address cannot be specified for IP-address. To enable connection to the Web server from any IPv4 address, specify an asterisk (*). If you specify the Listen directive, the specification of the BindAddress directive is ignored.

(b) Location where you can code

httpsd.conf

(2) BrowserMatch "browser-name" environment-variable[=value] [environment-variable[=value] ...]

(a) Contents

Specify the BrowserMatch directive when you set the environment variables for each Web browser. Default setting value is 1. When ! (exclamation mark) is added before the environment variable, the settings of that environment variable are cancelled. You can specify the case sensitive browser names with the regular expressions.

(b) Location where you can code

httpsd.conf, <VirtualHost>, <Directory>, .htaccess

(c) Specification example

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully

The meaning of environment variables shown in the specification example is as follows:

Environment variable

Contents

nokeepalive

This environment variable disables the KeepAlive connection. You cannot disable the KeepAlive connection when Via header is added in the request.

downgrade-1.0

This environment variable handles the requests of HTTP/1.1 and above as requests of HTTP/1.0.

force-response-1.0

This environment variable always responds with HTTP/1.0 to the requests of HTTP/1.0.

redirect-carefully

When accessing the directory if '/' is not added at the end of the URL, and a method other than the GET method is used, redirect is not requested to the client.

(3) BrowserMatchNoCase "browser-name" environment-variable[=value] [environment-variable[=value] ...]

(a) Contents

Specify the BrowserMatchNoCase directive when you set the environment variables for each Web browser. The default value is 1. When ! (exclamation mark) is added before the environment variable, the settings of that environment variable are cancelled. You can specify the browser name with the regular expressions, and the browser name is not case sensitive.

(b) Location where you can code

httpsd.conf, <VirtualHost>, <Directory>, .htaccess

(4) CacheNegotiatedDocs [{On | Off}]

(a) Contents

The CacheNegotiatedDocs directive specifies whether to enable cache in the client during the request for content negotiation. When you omit the directive arguments, the Web server operates in the same manner as when On was specified. If you do not specify the directive, the Web server operates in the same manner as when Off was specified. The specification of this directive is invalid for the HTTP/1.1 requests.

On: Contents are cached.

Off: Expires header is added and contents are not cached.

(b) Location where you can code

httpsd.conf

(5) CoreDumpDirectory directory-name [Figure]

~<<ServerRoot directive specified value>>

(a) Contents

The CoreDumpDirectory directive specifies the directory for the core dump. You can specify the absolute path or the relative path from the specified value of the ServerRoot directive. Note that the specified directory must have write access to the users and groups that are specified in the User and Group directives. In the Linux version, this directive is applied only when it is specified in the configuration file.

(b) Location where you can code

httpsd.conf

(6) CustomLog {file-name | pipe} {"format" | label-name} [env=[!]environment-variable]

(a) Contents

Specify the CustomLog directive when the log in any format is to be output to the file. The format is similar to the one that is specified in the LogFormat directives.

When specifying multiple specifications of this directive, you cannot specify the same file name multiple times.

file-name: Specifies the log file name. In the file name, you can specify the absolute path or the relative path from the specified value of the ServerRoot directive.

pipe: Specifies the program that receives log information from the standard input in the "| Program name" format. The Web server converts the linefeed codes contained in the log information to CRLF and passes it on.

(Notes for Windows version)

Each program specified in the pipe is generated as a separate process that receives the log information for the control process and Web server process. This process is called the Pipe process. Note the following points when you start the Web server as a service:

  • Unable to obtain the log information of the control process

    When you start the Web server as a service, the standard input for receiving the log information from the control process is associated with the NUL device, and hence the pipe process for control cannot receive the log information from the control process. The log information from the control process refers to the error log information when the Web server starts and stops, and you cannot collect this information. The information of the error log and the access log after starting the Web server is the log information from the Web server process, and hence the information is received in the pipe process for the Web server process.

  • Points to be remembered during program creation

    The pipe process used for the control process is the process for reading the data from the NUL device, where the pipe process has a small read() buffer and the input data is in the waiting state. Set the read() buffer with a bigger value so that the pipe process is not in the input data waiting state.

  • When an argument is specified in the program

    When the programs and the arguments contain a blank, enclose them with a [Figure]".

    When the programs and arguments are enclosed with [Figure]", enclose the entire statement with a [Figure]".

    (Example)

    CustomLog "|[Figure]"[Figure]"Application-Server-installation-directory/httpsd/sbin/rotatelogs.exe[Figure]" [Figure]"Application-Server-installation-directory/httpsd/logs/access [Figure]" 86400 -diff 540[Figure]"" common

  • When an argument is not specified correctly in the program

    If an argument is not specified correctly in the program, the program fails to start but the Web server starts properly. In this case, logs are not output. When you specify a program, make sure that the log files are created and the files are divided as you intended.

"Format": Specifies the log format. the following tables describe the formats that you can specify.

label-name: Specifies the label name that is specified in the LogFormat directive.

env=environment-variable: Collects the log when the specified environment variable is set.

env=!environment-variable: Collects the log when the specified environment variable is not set.

Table 6‒3: The format list

Format

Meaning

%A#1

IP address of the Web server.

%a#1

IP address of the client.

%B

Number of bytes sent (excluding the data added by the HTTP header and chunked encoding).

%b

Number of bytes sent (excluding the data added by the HTTP header and chunked encoding). However in the case of 0, - (hyphen).

%{cookie_name}C

Value of the cookie name cookie_name included in the Cookie header value.

%D

Display the request processing time in microseconds.

%{env_name}e

Value of the environment variables specified in env_name.

%f

Directory or the file name requested by the client.

%H

Request protocol (such as HTTP/1.0).

%h#2

Host name of the client.

%I

Total number of bytes received including the request and the header.

%{header_name}i

Value of the request header specified in header_name.

%l

Identification information of the client (when IdentityCheck directive is On, and identd is running on the client).

%m

Request method (such as GET, POST).

%{note_name}n

Value of the note of Web server module specified in the note_name.

hws_ap_root: Root application information#3

hws_ap_client: Client application information#3

%O

Total number of bytes sent including header.

%{header_name}o

Value of the response header specified in header_name.

%P

Process ID that processes the request of HTTP communication.

%{hws_thread_id}P

Thread ID that processes the request of HTTP communication. Valid for Windows version.

%{tid}P

Thread ID that processes the request of HTTP communication. Valid for UNIX version.

%p

Port number.

%q

Query character string.

%r

First line of the HTTP communication request.

%s

Status (for the logs that are internally redirected, original status is shown).

%T

Time taken for request processing (seconds). If On is specified in the HWSLogTimeVerbose directive, then time is displayed up to milliseconds.

%t

Time when request processing starts. If On is specified in the HWSLogTimeVerbose directive, then time is displayed up to milliseconds.

%{format}t

Time when request processing starts. The format defined by strftime() is specified in format.

%U

The URL.

%u

User name of client (when the user authentication is performed).

%V#2

The ServerName directive specification value, server name, or IP address as per the specifications of the UseCanonicalName directive.

%v

Server name.

%X

Connection status when the response ends.

+: Connected even after sending the response.

-: Disconnected after sending the response.

X: Disconnected before the response ends.

%>s

End status.

Note

{ } displayed in the format does not denote the selection. Bold characters in the { } denote the variable name that collects the log and small characters describes the character string without changing it.

#1

If %A or %a is specified in the format, IPv6 addresses can also be output.

#2

If %h or %V is specified in the format, IPv6 addresses or host names corresponding to IPv6 addresses can also be output.

#3

Root application information and client application information are output when a request with AP information set is received from the client and when a request is forwarded by using the reverse proxy, not a redirector.

Table 6‒4: The log format list related to SSL

Format

Meaning

%{version}c

SSL version

%{cipher}c

Encryption type used in the current communication

%{clientcert}c

Distinguished Name of the subject of the SSL client certificate.

You can describe the status code after the % in the format.

(Example) For error status codes 400 and 501, collect the log of User-Agent request header value.
%400,501 {User-Agent}i
(Example) For error status codes other than 200, 304, and 302, collect the log of the Referer request header value.
%!200,304,302 {Referer}i

Specify env= when you divide the log collection as per the settings of the specified environment variables.

(Example) Collect the log for the gif image access in gif.log, and collect the log for other accesses in nongif.log.
SetEnvIf Request_URI \.gif$ gif-image
CustomLog logs/gif.log common env=gif-image
CustomLog logs/nongif.log common env=!gif-image

(b) Locations where you can code

httpsd.conf,<VirtualHost>

(c) Specification example

CustomLog logs/access.log common
CustomLog logs/ssl.log "%t %{version}c %{cipher}c %{clientcert}c"

(7) DefaultIcon URL

(a) Contents

The DefaultIcon directive specifies the icons displayed in the directory index. Specify the URL of the icon to be displayed when the specified icons do not correspond to any of the AddIcon, AddIconByType, and the AddIconByEncoding directives.Note that if you specify the IPv6 address without omitting http://IP-address of the URL, enclose the IPv6 address in square brackets ([ ]).

(b) Location where you can code

httpsd.conf, <VirtualHost>, <Directory>, .htaccess

(c) Overwrite permission

Indexes level

(d) Specification example

DefaultIcon /icons/unknown.gif

(8) DefaultLanguage language-code

(a) Contents

The DefaultLanguage directive specifies the default language used in the document. The specified language code is set in the Content-Language response header. The specified language code becomes the default value for the settings of the AddLanguage directive. If the default value is not set, the response header of the Content-Language is not sent.

(b) Location where you can code

httpsd.conf, <VirtualHost>, <directory>, .htaccess

(c) Overwrite permission

FileInfo level

(9) Deny from {host | all | env=environment-variable} [{Host | env=environment-variable} ...]

(a) Contents

Specify the 'Deny from' directive when restricting the clients that can access the Web server. In the host, you can specify the domain name, IP address, subnet, and the netmask of the host that permits the access. Specify all when prohibiting the access from all hosts.

The domain name, address, and prefix length of the IPv6 address can also be specified for a host. Do not specify the IPv6 address by enclosing it in square brackets ([ ]). The prefix length is specified in the IPv6-address/prefix-length format. Specify the prefix length as a decimal value.

If you specify env=environment-variable, you can control server access with the value set for the environment variable. You can restrict access based on the HTTP request header field if you use this directive in combination with the BrowserMatch, BrowserMatchNoCase, SetEnvIf, and the SetEnvIfNoCase directive.

You can use the Order directive to set the evaluation order for the Allow directive (access permission) and the Deny directive (access restriction).

Host

Meaning

Domain name

Prohibit access from the host displayed in the domain name

IP address

Prohibit access from the host displayed in the IP address

Subnet

Prohibit access from the host specified in the subnet (First three bytes of the IP address).

Netmask

Prohibit access from the host specified in the netmask (Example: 10.1.0.0/255.255.0.0).

If the notation is in 10.1.0.0/16 format, it means same as 10.1.0.0/255.255.0.0.

(b) Location where you can code

<Directory>, and .htaccess

(c) Overwrite permission

Limit level

(10) DirectoryIndex file-name [file-name ...]

~<<index.html>>

(a) Contents

When the requests from the Web browser do not specify any specific contents, the DirectoryIndex directive specifies the default file name of the contents to be sent to the client. If you specify multiple file names, file name specified first will be sent first.

When the specified file is not present in the requested directory, the Web browser display changes according to the Options directive.

  • When Indexes are enabled

    The Web browser displays the index of the directory created in the Web server.

  • When Indexes are disabled

    The Web browser responds with the status code 403 Forbidden.

(b) Location where you can code

httpsd.conf,<VirtualHost>,<Directory>,.htaccess

(c) Overwrite permission

Indexes level

(d) Specification example

DirectoryIndex index.html

If a file name is not specified in the request, display index.html file if present in the directory).

(11) DocumentRoot directory-name

~<</opt/hitachi/httpsd/htdocs>> (UNIX version)

~<<ServerRoot directive default value/htdocs>> (Windows version)

(a) Contents

The DocumentRoot directive specifies the document root directory that stores the contents, with an absolute path. Do not add a forward slash (/) at the end of the directory name.

Specify the directory name with an absolute path.

(b) Location where you can code

httpsd.conf, <VirtualHost>

(c) Specification example

DocumentRoot "Application-Server-installation-directory/httpsd/htdocs"