Sun GlassFish Enterprise Server v2.1.1 Developer's Guide

Using mod_jk

To set up mod_jk, follow these steps:

  1. Obtain the following software:

  2. Install mod_jk as described at

  3. Copy the following Tomcat and Jakarta Commons files to as-install/lib:

    • tomcat-ajp.jar

    • commons-logging.jar

    • commons-modeler.jar

  4. Create and configure the following files:

    Examples of these files are shown after these steps. If you use both and files, the file referenced by httpd.conf, or referenced by httpd.conf first, takes precedence.

  5. Start httpd.

  6. Enable mod_jk using the following command:

    asadmin create-jvm-options -Dcom.sun.enterprise.web.connector.enableJK=8009
  7. If you are using the file and not referencing it in httpd.conf, point to it using the following command:

    asadmin create-jvm-options 
  8. Restart the Enterprise Server.

Here is an example httpd.conf file:

LoadModule jk_module /usr/lib/httpd/modules/
JkWorkersFile /etc/httpd/conf/
# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel debug
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send all jsp requests to GlassFish
JkMount /*.jsp worker1
# Send all glassfish-test requests to GlassFish
JkMount /glassfish-test/* worker1

Here is an example or file:

# Define 1 real worker using ajp13
# Set properties for worker1 (ajp13)