Proxy for Tomcat

{quote} 1 This snip requires cleanup {quote}

1 Overview
- Configure Tomcat
- Configure Apache

1 Details
1.1 Apache Configuration

- Install the
- Include the auto or custom mod_jk.conf file
- Configure Tomcat Workers file

1.1.1 Install mo
- Download the JK from
- Rename to before putting it in your Apache2/modules directory.

1.1.1 Standard Tomcat uses auto jk

Tomcat auto generates a file, ~~mod_jk.conf-auto~~ that you include from the apache conf. If you are running just one tomcat server, and it is on the same system as apache, simply include a line in your httpd.conf like follows;

Include $TOMCAT_HOME/conf/jk/mod_jk.conf-auto

1.1.1 Non Standard Tomcat uses custom jk

If you are using a instance not on the same box, or multiple tomcats, you must create a custom mod_jk.conf file. Here is a sample one from a windows host. Save it in ~~conf/extra/mod_jk.conf~~ and include it in your httpd.conf as above

Include conf/extra/mod_jk.conf

# Load The Module
LoadModule    jk_module  modules/

# Declare the module for <IfModule directive> (remove this line on Apache 2.0.x)
#AddModule mod_jk.c

# Where to find
JkWorkersFile conf/extra/

# Where to put jk shared memory
JkShmFile logs/mod_jk.shm

# Where to put jk logs
JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# Send servlet for context /examples to worker named worker1
#JkMount /examples/servlet/* worker1
JkMount /manager* wlb

# Send JSPs for context /examples to worker named worker1
#JkMount /examples/*.jsp worker1

1.1.1 Worker configuration

# -
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
# The workers that jk should create and work with


# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.

# Defining a load balancer


# Define status worker


1.1 Tomcat Configuration

reating your file at $TOMCAT_HOME/conf/jk/ and adding the listener to the Engine element in the server.xml

  <Engine ...>
    <Listener className="org.apache.jk.config.ApacheConfig" modJk="/path/to/" />


Custom mod_jk conf

1 Other Topics

- Configuring Apache to serve static web application files
- Getting mod_jk linked statically with Apache

1 Links