Module mod_jk

Important: Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . It is recommended that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm Link outside Information Center for more information.

Summary

Five directives are provided by mod_jk to specify how the HTTP Server communicates with the ASF Tomcat Servlet Engine. These directives go into the HTTP Server (powered by Apache) server configuration file (httpd.conf). Any mod_jk directive usage must be preceded by loading the Service Program that supports mod_jk. The following LoadModule must be in the configuration file prior to the use of any mod_jk directives.

LoadModule mod_jk /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM

Directives

JkAsfTomcat

Module: mod_jk
Syntax: JkAsfTomcat On | Off
Default: JkAsfTomcat On
Context: server config
Override: none
Origin: iSeries™
Usage Considerations: A LoadModule is required in the config file prior to using the directive. The statement should be as follows: LoadModule mod_jk /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM
Example: JkAsfTomcat Off

The JkAsfTomcat directive allows the ASF Tomcat plugin to be turned off without deleting particular plugin directives from the HTTP Server (powered by Apache) configuration file. When this directive is set to Off, it appears to the user as if the servlet engine is not enabled.

Parameter: On | Off
  • When set to On, the ASF Tomcat module is enabled.
  • When set to Off, the module loads, but URL requests are not redirected to the ASF Tomcat servlet engine.

JkLogFile

Module: mod_jk
Syntax: JkLogFile directory-filename
Default: none
Context: server config
Override: none
Origin: Apache
Usage Considerations: A LoadModule is required in the config file prior to using the directive. The statement should be as follows: LoadModule mod_jk /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM
Example: JkLogFile /QIBM/UserData/HTTPA/tomcat/logs/tomcat.log

The JkLogFile directive is used to specify the full path and file name of the log file for the ASF Tomcat module. For example:

JkLogFile /QIBM/UserData/HTTPA/tomcat/logs/tomcat.log

The log file describes the flows of header and data between the HTTP Server (powered by Apache) and the ASF Tomcat servlet engine. It does not contain information relative to what happens while the servlet engine is processing a request. See the ASF Tomcat servlet engine log for this information. The plugin log file is never purged or wrapped. The file may need to be periodically purged by the administrator.

Parameter: directory-filename
  • The directory-filename parameter specifies the fully-qualified directory path and filename for the ASF Tomcat module log file.

The directive supports both the Root and QOpenSys file systems.

JkLogLevel

Module: mod_jk
Syntax: JkLogLevel log-level
Default: JkLogLevel emerg
Context: server config
Override: none
Origin: Apache
Usage Considerations: A LoadModule is required in the config file prior to using the directive. The statement should be as follows: LoadModule mod_jk /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM
Example: JkLogLevel error

The JkLogLevel directive is used to describe what level of detail is written to the log file defined by JkLogFile.

Parameter: log-level
  • Possible log level values are:
    • debug
    • info
    • error
    • emerg

    These values correspond to the HTTP Server (powered by Apache) logging level descriptions. For more information, see LogLevel

JkMount

Module: mod_jk
Syntax: JkMount URI-path workername
Default: none
Context: server config, virtual host
Override: none
Origin: Apache
Usage Considerations: A LoadModule is required in the config file prior to using the directive. The statement should be as follows: LoadModule mod_jk /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM
Example: JkMount /servlet/* workerajp12

The JkMount directive specifies a mapping between a URI context (or URI pattern) and an ASF Tomcat module worker. The URI context is used to identify which requests are to be handled by the module, and the worker name identifies which worker is used to forward matching requests to the servlet engine.

ASF Tomcat workers are defined in a file specified by the JkWorkersFile directive. This file is used to map a worker name to a worker type and various other settings. The worker type determines whether requests are forwarded by the module to an in-process ASF Tomcat server or an out-of-process ASF Tomcat server.

Parameter One: URI-path
  • The URI-path parameter used by this directive is compared to the incoming URL from the client browser to determine if the request must be forwarded to the ASF Tomcat servlet engine.
Parameter Two: workername
  • The workername can include the following characters: alpha, numeric, dash (-), underscore (_), percent (%), and question mark (?).

The URI-path parameter can assume three different forms: exact match, context match and suffix match. All URL path forms must be preceded by a forward slash (/) character (for instance, /Example, /Example/* or /Example/*.jsp).

JkMountCopy

Module: mod_jk
Syntax: JkMountCopy On | Off
Default: JkMountCopy Off
Context: virtual host
Override: none
Origin: Apache
Usage Considerations: A LoadModule is required in the config file prior to using the directive. The statement should be as follows: LoadModule mod_jk /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM
Example: JkMountCopy On

The JkMountCopy directive indicates whether the base server mount points should be copied to the virtual server. Any mount points defined outside <VirtualHost> </VirtualHost> are inherited by the virtual host.

Parameter: On | Off
  • When set to On, the base server mount points are copied to the virtual server.
  • When set to Off, the base server mount points are not copied to the virtual server.

JkWorkersFile

Module: mod_jk
Syntax: JkWorkersFile directory-filename
Default: none
Context: server config
Override: none
Origin: Apache
Usage Considerations: A LoadModule is required in the config file prior to using the directive. The statement should be as follows: LoadModule mod_jk /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM
Example: JkWorkersFile /home/Tomcat/conf/workers.properties

The JkWorkersFile directive is used to define the name of a file that contains configuration information that describes how the ASF Tomcat module forwards requests to the servlet engine. The two interfaces, used to support the connection between HTTP Server (powered by Apache) and ASF Tomcat, are JNI (Java™ Native Interface) and sockets connections. The JNI interface is used for an in-process ASF Tomcat server. An in-process ASF Tomcat server runs within the HTTP Server process, or job, and starts up and ends at the same times as the HTTP server. The socket interface is for use with an out-of-process ASF Tomcat server that runs within its own process, or job. With an out-of-process ASF Tomcat server, the server could be on the same system or on a different system. Either the AJP12 or AJP13 protocol may be used by a worker to communicate with an out-of-process ASF Tomcat server.

Parameter: directory-filename
  • The directory-filename parameter defines the directory path and filename for the file that contains configuration information that describes how the ASF Tomcat module forwards requests to the servlet engine.

There is no default; this directive must be specified or ASF Tomcat will not function. The typical file name is workers.properties.

This directive supports both the Root and QOpenSys file systems.