Sun GlassFish Enterprise Server v3 Prelude Developer's Guide

Using mod_jk

To set up mod_jk, follow these steps:

  1. Obtain and install Apache 2.0.x or 2.2.x HTTP Server (

  2. 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.

  3. Start httpd.

  4. Enable mod_jk using the following command:

    asadmin set

    For example:

    asadmin set

    Or you can use the following deprecated command, provided for backward compatibility:

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

    asadmin create-jvm-options 
  6. 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)