14.2.2 mod_jk.conf (Redirector action definition file for Cosminexus HTTP Server)
- Organization of this subsection
(1) Format
Specify the key as follows:
key-name value
- Specification method
-
-
The string up to the linefeed is a value.
-
The line beginning with a hash mark (#) is a comment.
-
Separate the key name and the value with a single-byte space. If you specify multiple values, separate them with single-byte spaces.
-
If the specified value contains a space in the file path, you need to enclose the entire path within double quotation marks ("").
-
The command coding methods and the formats for describing the types of characters that you can code must be compliant with Cosminexus HTTP Server specifications.
-
The key name is not case sensitive.
-
(2) File storage location
-
In Windows
Cosminexus-installation-directory\CC\web\redirector\mod_jk.conf
-
In UNIX
/opt/Cosminexus/CC/web/redirector/mod_jk.conf
(3) Functionality
Define the action of the redirector.
(4) Specifiable keys
-
You define the library for processing the communication between the Web container server and the Cosminexus HTTP Server.
- Format
-
LoadModule jk_module library-name
You specify the library name as an absolute path. You cannot specify multiple library names.
- Examples of specification
-
In Windows
LoadModule jk_module "Cosminexus-installation-directory\CC\web\redirector\mod_jk.dll"
In UNIX
LoadModule jk_module /opt/Cosminexus/CC/web/redirector/mod_jk.so
- Precautions
-
You must code the key specifying the module definition before other keys.
-
You define the URL pattern to be transferred to the Web container server through the request to Cosminexus HTTP Server.
- Format
-
JkMount URL-pattern worker-name
Code any one worker out of those specified in the worker.list of the workers.properties. You can code multiple combinations of the URL pattern and worker name. If you set an invalid value in this file, the operations may not produce the desired results. If you specify a URL pattern which does not start with a forward slash (/), an error message is output in the log when the redirector starts and the specified content becomes ignored.
If you specify a URL pattern containing an extension with a length of 0 characters (when the URL pattern ends with /*.), the message KDJE41041-W is output to the log and the specified content is ignored.
For details on the JkMount key, see 5.4 Distributing requests by the round-robin format and 5.5 Distributing requests by the POST data size.
-
You can specify the following keys. If you specify an invalid value in these keys, the operations may not produce the desired results.
The Related information column lists the reference locations for information related to the specified key. Note that Application Server is omitted from the manual names.
Key name
Contents
Default value
Related information
Specify the timeout value used for connecting to the Web container when a request is sent. Specify the timeout value as an integer (units: seconds) from 0 to 3600.
If you specify a non-numeric value, or a numeric value outside the range, a message will be output and the default value will be used.
If you set the timeout as 0 or a time period longer than the resend timer of data transmission in TCP, the timeout value becomes the timeout value of TCP. In such a case, a message indicating that an invalid timeout value has been specified will not be output.
30
Specify the host name or the IP address of the gateway.
When requests without a Host header are redirected to files, such as the welcome file, the host name of the Location header URL becomes the specified value.
None
When a client request uses https as a scheme, and the scheme for a Web server will become http by using an SSL accelerator, specify On.
If On is specified, https is assumed to be used as the scheme for requests sent to the Web server. If you specify Off, no action occurs.
Off
Specify the port number of the gateway. If a request has no Host header and the request is to be redirected to a location such as a welcome file, the port number portion of the URL that is specified in the Location header becomes the specified value.
Always specify this parameter together with JkGatewayHost.
If you specify JkGatewayHost and omit this parameter, an access via http uses 80, and an access via hppts uses 443.
None
Specify the output location directory of the log file. In Windows, specify either as a relative path or as an absolute path. In UNIX, specify as an absolute path.
- When specified as a relative path:
-
Specify a directory name present in Cosminexus-installation-directory\CC\web\redirector.
- When specified as an absolute path:
-
Specify the coded directory name.
Note that you must specify write permission to the execution account of Cosminexus HTTP Server in the access permission to the directory specified as the output destination#1. If access permission is not set, the log file is not output.
If the same value has been specified in JkLogFilePrefix and JkTraceLogFilePrefix, you need to specify a value different from JkTraceLogFileDir in this key. If you specify the same value, the redirector will not run.
-
In Windows
logs
-
In UNIX
/opt/Cosminexus/CC/web/redirector/logs
Specify the maximum number of redirector log files. If this number is exceeded, the old log files are overwritten. Specify an integer value in the following range:
-
In Windows
1≤ JkLogFileNum≤ 16
-
In UNIX
1≤ JkLogFileNum≤ 64
5
This is a prefix for the log file name. The actual log file name will be the value specified by this key with serial-number.log added.
If the same value has been specified in JkLogFileDir and JkTraceLogFileDir, you need to specify a value different from JkTraceLogFilePrefix in this key. If you specify the same value, the redirector will not run.
hws_redirect
Specify the size for each redirector log file in bytes. Specify an integer value in the following range:
-
In Windows
4096≤ JkLogFileSize≤ 2147483647
-
In UNIX
4096≤ JkLogFileSize≤ 16777216
4194304
Specify the log output level of message logs for redirectors and of trace logs for maintenance. You specify only one log level. You can specify debug, info, error (default value), and emerg. You can specify emerg only in Windows.
If you specify a value other than those specified above, the operation will be carried out assuming that error has been specified.
error
When registering an external module other than the redirector in the Cosminexus HTTP Server, specify the execution order of the redirector for the other external modules.
The values that can be specified are as follows:
-
Integers from -10 to 30
-
REALLY_FIRST (corresponds to integer value -10)
-
FIRST (corresponds to integer value 0)
-
MIDDLE (corresponds to integer value 10)
-
LAST (corresponds to integer value 20)
-
REALLY_LAST (corresponds to integer value 30)
Smaller the value specified, higher the position in the execution order.
FIRST
Specify whether to decode the requested URL. Note that this key is used for UNIX.
- ForwardURICompatUnparsed (default):
-
Do not decode the requested URL.
- ForwardURICompat:
-
Decode the requested URL.
URL decoding was performed in version 02-00, therefore, when using URLs containing character strings that are converted due to URL decoding, specify ForwardURICompat only when URL decoding needs to be performed as in the case of version 02-00.
ForwardURICompatUnparsed
Specify the character string that was specified in the PRF identifier when invoking the PRF daemon.
PRF_ID
Specify an integer (units: number of times) from 1 to 16 for the retry count to connect to the Web container when a request is sent and the retry count to send requests.
The retry count also includes the first establishment of connection and the request sending process.
When a timeout occurs, retry occurs in the following cases:
-
When a timeout occurs while connection is being established
-
When a timeout occurs while the request header is being sent
After the above processes, if a timeout occurs while the request body is being sent, retry does not occur.
If you set the retry count to an abnormal value, such as a value outside the range or a value that is not an integer, the default value is set.
3
Specify an integer (units: seconds) from 0 to 3600 for the timeout period for sending requests.
If you specify a non-numeric value, or a numeric value outside the range, a message will be output and the default value will be used.
If you set the timeout as 0 or a time period longer than the resend timer of data transmission in TCP, the timeout value becomes the timeout value of TCP. In such a case, a message indicating that an invalid timeout value has been specified will not be output.
100
Specify whether to output the trace log for the maintenance of redirector. Specify On (default value) if trace log is to be output and Off if it is not to be output.
On
Specify the output destination directory for the maintenance trace log files. In Windows, specify either as a relative path or as an absolute path. In UNIX, specify as an absolute path.
- When coded as a relative path:
-
Specify a directory name present in Cosminexus-installation-directory\CC\web\redirector.
- When coded as an absolute path:
-
Specify the coded directory name.
If the same value has been specified in JkLogFilePrefix and JkTraceLogFilePrefix, you need to specify a value different from JkLogFileDir in this key. If you specify the same value, the redirector will not run.
-
In Windows
logs
-
In UNIX
/opt/Cosminexus/CC/web/redirector/logs
Specify the maximum number of maintenance trace log files.
-
In Windows
1 to 16
-
In UNIX
1 to 64
If this number is exceeded, the old log files are overwritten.
4
Specify the prefix for the maintenance trace log file name. The actual log file name will be the value specified by this key with serial-number.log added.
If the same value has been specified in JkLogFileDir and JkTraceLogFileDir, you need to specify a value different from JkLogFilePrefix in this key. If you specify the same value, the redirector will not run.
hws_rd_trace
Specify the size for each maintenance trace log file as an integer value (units: bytes).
-
In Windows
4096 to 2147483647
-
In UNIX
4096 to 16777216
16777216
The key for compatibility with versions older than 05-05.
Specify whether the translate_handler function of the module executed after the redirector is to be invoked from the Cosminexus HTTP Server, if a request sent to the Cosminexus HTTP Server is a URL pattern transferred to the Web container.
If you specify On, the translate_handler function of the module executed after the redirector is invoked.
If you specify Off, the translate_handler function of the module executed after the redirector is not invoked.
Off
Specify the file name of the worker definition file. In Windows, specify either as a relative path or as an absolute path. In UNIX, specify as an absolute path.
- When specified as a relative path:
-
Specify a file name present in Cosminexus-installation-directory\CC\web\redirector.
- When specified as an absolute path:
-
Specify the coded file name.
-
In Windows
workers.properties
-
In UNIX
/opt/Cosminexus/CC/web/redirector/workers.properties#2
- Note:
-
When you specify multiple keys, the last specified value becomes valid.
- #1
-
For integration with Cosminexus HTTP Server:
For a new installation, the default log output destination directory does not exist. You either create a directory and grant the access permission or grant the access permission to the directory redirector that exists one level above.
Moreover, if the log output destination directory of the redirector is changed and only half of that path exists, you either grant the access permission to the lowest level of the existing directory or create the entire specified path, and then grant the access permission.
- #2
-
If /opt/Cosminexus/CC/web/redirector/workers.properties does not exist, Cosminexus HTTP Server does not start.
(5) Examples of coding
-
In Windows
LoadModule jk_module "C:\Program Files\Hitachi\Cosminexus\CC\web\redirector\mod_jk.dll"# JkGatewayHost hostA JkGatewayHttpsScheme On JkGatewayPort 443 JkLogLevel error JkLogFileSize 4194304 JkLogFileNum 5 JkLogFileDir logs JkLogFilePrefix hws_redirect JkPrfId prfid JkTraceLog On JkTraceLogFileSize 16777216 JkTraceLogFileNum 4 JkTraceLogFileDir logs JkTraceLogFilePrefix hws_rd_trace JkTranslateBackcompat Off JkWorkersFile workers.properties JkMount /examples/* worker1
- #
-
Specify LoadModule in one line in the file.
-
In UNIX
LoadModule jk_module /opt/Cosminexus/CC/web/redirector/mod_jk.so JkWorkersFile /opt/Cosminexus/CC/web/redirector/workers.properties JkLogLevel error JkLogFileSize 4194304 JkLogFileNum 5 JkLogFileDir /opt/Cosminexus/CC/web/redirector/logs JkLogFilePrefix hws_redirect JkTraceLog On JkTraceLogFileSize 16777216 JkTraceLogFileNum 4 JkTraceLogFileDir /opt/Cosminexus/CC/web/redirector/logs JkTraceLogFilePrefix hws_rd_trace JkMount /examples/* worker1
(6) Precautions
-
In Windows, you need to restart the Web server to change the user definition of the redirector. The changed definition will be applied after the Web server is restarted.
-
In UNIX, you need to perform the following operations to apply the changed contents once the user definition of the redirector is changed:
- When you change the file size or the number of files:
-
-
Stop the Web server.
-
Either move or delete the log files and the management file used by HNTRLib.
<Management file used by HNTRLib>
In the case of message log file: JkLogFilePrefix-settings.mm
In the case of maintenance trace log file: JkTraceLogFilePrefix-settings.mm
-
Start the Web server.
Note that the default storage location of management files used in HNTRLib is as follows:
Cosminexus-installation-directory/CC/web/redirector/logs/mmap
-
- When you do not change the file size or the number of files:
-
Restart the Web server.