You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by hg...@apache.org on 2001/07/24 08:25:37 UTC
cvs commit: jakarta-tomcat/src/doc mod_jk-howto.html
hgomez 01/07/23 23:25:36
Modified: src/doc mod_jk-howto.html
Log:
Fixed docs (bugzilla #1809) and
removed reference to fdatasync in mod_jk which is no more used
Revision Changes Path
1.10 +756 -744 jakarta-tomcat/src/doc/mod_jk-howto.html
Index: mod_jk-howto.html
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/doc/mod_jk-howto.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mod_jk-howto.html 2001/06/22 14:45:53 1.9
+++ mod_jk-howto.html 2001/07/24 06:25:36 1.10
@@ -1,11 +1,13 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
- <!-- $Id $ -->
- <!-- Copyright 2001, Apache Software Foundation -->
-
- <meta http-equiv=Content-Type content="text/html">
- <link rel="stylesheet" href="style.css">
- <style type="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; Linux 2.2.19-6.2.7 i686) [Netscape]">
+ <title>Working with mod_jk</title>
+<!-- $Id $ -->
+<!-- Copyright 2001, Apache Software Foundation -->
+<link rel="stylesheet" href="style.css">
+<style type="text/css">
.inlinetd {
background-color: #E0E0E0;
vertical-align: text-top;
@@ -30,689 +32,680 @@
.note { margin:20pt; padding:5pt; background-color:#e0e0ff; }
</style>
-
-<title>Working with mod_jk</title>
</head>
-
<body>
<!-- Banner element, all hail the Project! -->
-<table border="0" width="100%" cellspacing="0" cellpadding="0">
- <tr>
- <td width="50%" align="left">
- <a href="http://jakarta.apache.org/index.html">
- <img src="images/banner.gif" width="350" height="100" alt="The Jakarta Project" border="0">
- </a>
- </td>
- <td width="50%" align="right">
- <img border="0" src="images/tomcat.gif" width="100" height="71" alt="The mighty Tomcat - Meow!">
- </td>
- </tr>
+<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" >
+<tr>
+<td ALIGN=LEFT WIDTH="50%"><a href="http://jakarta.apache.org/index.html"><img SRC="banner.gif" ALT="The Jakarta Project" BORDER=0 height=100 width=350></a></td>
+
+<td ALIGN=RIGHT WIDTH="50%"><img SRC="tomcat.gif" ALT="The mighty Tomcat - Meow!" BORDER=0 height=71 width=100></td>
+</tr>
</table>
-<h1>Working with mod_jk</h1>
-<p>By Gal Shachor <tt><<a href="mailto:shachor@il.ibm.com">shachor@il.ibm.com</a>></tt></p>
+<h1>
+Working with mod_jk</h1>
+By Gal Shachor <tt><<a href="mailto:shachor@il.ibm.com">shachor@il.ibm.com</a>></tt>
+<h2>
+Table of Contents</h2>
-<h2>Table of Contents</h2>
-<ul>
-<li><a href="#s2">What is mod_jk?</a></li>
-<li><a href="#s3">Why mod_jk?</a></li>
-<li><a href="#s4">What does it mean to me?</a></li>
-<li><a href="#s5">Definitions and Terminology</a></li>
-<li><a href="#s6">Obtaining mod_jk</a>
- <ul>
- <li><a href="#s61">mod_jk Binaries</a></li>
- <li><a href="#s62">Building mod_jk</a></li>
- <li><a href="#s63">Building mod_jk for NT</a></li>
- <li><a href="#s64">Building mod_jk for Unix</a></li>
- </ul>
-</li>
-<li><a href="#s7">Configuring Apache</a>
<ul>
-<li><a href="#s71">Removing mod_jserv directives</a></li>
-<li><a href="#s72">Configuring Apache to use mod_jk</a></li>
-<li><a href="#s73">Assigning URLs to be redirected to Tomcat</a></li>
-</ul></li>
-<li><a href="#s8">Configuring Tomcat</a>
- <ul>
- <li><a href="#s81">Enabling Tomcat's Apache Auto-Config</a></li>
- <li><a href="#s82">Configuring Tomcat to use the AJPv13 Protocol</a></li>
- <li><a href="#s83">Defining Workers</a></li>
- </ul>
-</li>
-<li><a href="#s9">Example Configuration</a></li>
-<li><a href="#s10">Troubleshooting and F.A.Q's</a></li>
-<li><a href="#s11">Credits</a></li>
-</ul>
-<hr>
-<h2><a name=s2>What is mod_jk?</a></h2>
+<li>
+<a href="#s2">What is mod_jk?</a></li>
-<p>mod_jk is a replacement to the elderly mod_jserv. It is a completely new
-Tomcat-Apache plug-in that handles the communication between Tomcat and Apache.</p>
-<hr>
-<h2><a name=s3>Why mod_jk?</a></h2>
+<li>
+<a href="#s3">Why mod_jk?</a></li>
+
+<li>
+<a href="#s4">What does it mean to me?</a></li>
-<p>Several reasons: </p>
+<li>
+<a href="#s5">Definitions and Terminology</a></li>
+<li>
+<a href="#s6">Obtaining mod_jk</a></li>
+
<ul>
- <li><b>mod_jserv was too complex</b>. Because it was ported from Apache/JServ, it
- brought with it lots of JServ specific bits that aren't needed by Apache.
- <li><b>mod_jserv supported only Apache</b>. Tomcat supports many web servers
- through a compatibility layer named the jk library. Supporting two different
- modes of work became problematic in terms of support, documentation and bug
- fixes. mod_jk should fix that.</li>
- <li>The layered approach provided
- by the jk library makes it easier to support both <b>Apache1.3.x <i>and</i>
- Apache2.xx.</b></li>
- <li><b>Better support for SSL</b>. mod_jserv couldn't reliably identify whether a
- request was made via HTTP or HTTPS. mod_jk can, using the newer Ajpv13 protocol.</li>
-</ul>
-<hr>
-<h2><a name=s4>What does it mean to me?</a></h2>
+<li>
+<a href="#s61">mod_jk Binaries</a></li>
-<p>You will need to get to know a new simplified configuration mechanism. The
-advantage is that learning this mechanism will give you a head start if you
-want to deploy Tomcat on Apache and other web servers, such as Microsoft's
-Internet Information Server (IIS) and the iPlanet Enterprise Web Server.</p>
-
-<hr>
-<h2><a name=s5>Definitions and Terminology</a></h2>
-
-<p>In this document I am going to use a few terms, so let's define them:</p>
-
-<table class=inlinetable>
- <tr>
- <th class=inlineth>
- <p>Term</p>
- </th>
- <th class=inlineth>
- <p>Meaning</p>
- </th>
- </tr>
- <tr>
- <td class=inlinetd>
- <p>Worker Process</p>
- </td>
- <td class=inlinetd>
- <p>A worker is a tomcat instance that is running to serve
- servlet requests coming from the web server. In most cases there is only a
- single worker (the one and only tomcat process) but sometimes you will run
- multiple workers to achieve load balancing or site partitioning. Each worker
- is identified to the web server by the host were it is located, the port
- where it listens and the communication protocol used to exchange messages.</p>
- </td>
- </tr>
- <tr>
- <td class=inlinetd>
- <p>In-Process Worker</p>
- </td>
- <td class=inlinetd>
- <p>This is a special worker. Instead of working with a Tomcat
- process residing on another process, the web server opens a JVM and executes
- Tomcat inside the web server process address space. Our discussion in this
- document is not going to get into this special worker.</p>
- </td>
- </tr>
- <tr>
- <td class=inlinetd>
- <p>Web Server Plug-in/Tomcat Redirector</p>
- </td>
- <td class=inlinetd>
- <p>For Tomcat to cooperate with any web server it needs an
- "agent" to reside in the web server and send him servlet requests.
- This is the web server plug-in, and in our case the web server plug-in is
- mod_jk. The redirector usually comes in the shape of a DLL or shared object
- module that you plug into the web server.</p>
- </td>
- </tr>
- <tr>
- <td class=inlinetd>
- <p>Plug-in Configuration</p>
- </td>
- <td class=inlinetd>
- <p>We need to configure the web server plug-in so that it
- knows where the different Tomcat workers are and to which of them it should
- forward requests. This information, accompanied with some internal parameter,
- such as the log level, comprises the plug-in configuration. </p>
- </td>
- </tr>
- <tr>
- <td class=inlinetd>
- <p>Web Server Configuration</p>
- </td>
- <td class=inlinetd>
- <p>Each web server has some configuration that defines its behavior, e.g. on which port to listen, what files to serve, what web server
- plug-ins to load, etc. You will need to modify your web server configuration
- to instruct it to load the Tomcat redirector mod_jk.</p>
- </td>
- </tr>
-</table>
-
-<hr>
-<h2><a name="s6">Obtaining mod_jk</a></h2>
+<li>
+<a href="#s62">Building mod_jk</a></li>
-<p>mod_jk can be obtained in two formats - binary and source. Depending on
-the platform you are running your web server on, a binary version of mod_jk may
-be available. It is recommended to use the binary version if one is
-available. If the binary is not available, follow the instructions for
-building mod_jk from source. Notes at the end of this section offer
-recommendations for specific platforms. </p>
-
-<h3><a name="s61">mod_jk Binaries</a></h3>
-
-<p>Binaries for mod_jk are available for several platforms in the same area as
-the Tomcat Binary Release. The binaries are located in subdirectories by platform. For some
-platforms, such as Windows, this is the typical way of obtaining mod_jk since
-most Windows systems do not have C compilers. For others, the binary
-distribution of mod_jk offers simpler installation. </p>
+<li>
+<a href="#s63">Building mod_jk for NT</a></li>
-<p>For example, the Tomcat 3.3 M1 Release at <a href="http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3-m1/bin/">http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3-m1/bin/</a>
- contains the following: </p>
+<li>
+<a href="#s64">Building mod_jk for Unix</a></li>
+</ul>
-<table border="1" cellspacing="0" bordercolor="#000000" cellpadding="2" width="600">
- <tr>
- <td width="15%">linux/i386/</td>
- <td width="85%">Contains mod_jk.so for Apache 1.3 for the standard API as
- well as EAPI and mod_jk.so for Apache 2.0</td>
- </tr>
- <tr>
- <td width="15%">netware/</td>
- <td width="85%">Contains the mod_jk.nlm and nsapi.nlm</td>
- </tr>
- <tr>
- <td width="15%">win32/</td>
- <td width="85%">Contains the mod_jk.dll for Windows as well as other useful
- binaries.</td>
- </tr>
-</table>
-<p>Check the site for the latest binaries.</p>
-<p>Note: The version of mod_jk is not dependent on the version of Tomcat.
-The Tomcat 3.3 distribution of mod_jk will function correctly with other 3.x
-versions of Tomcat, such as Tomcat 3.2.1.</p>
-<h3><a name="s62">Building mod_jk</a></h3>
-
-<p>mod_jk is available in source distribution for all Windows and most Unix
-platforms. The source for mod_jk is included in the Binary Distribution of
-Tomcat in the TOMCAT_HOME/native/mod_jk/ directory. This directory is
-organized by Web Server name and version. Each directory contains the
-source as well as the appropriate build scripts, make files, or project files. </p>
+<li>
+<a href="#s7">Configuring Apache</a></li>
-<h3><a name="s63">Building mod_jk for NT</a></h3>
+<ul>
+<li>
+<a href="#s71">Removing mod_jserv directives</a></li>
-<p>The redirector was developed using Visual C++ version 6.0, so having this
-environment is a prerequisite if you want to perform a custom build.</p>
+<li>
+<a href="#s72">Configuring Apache to use mod_jk</a></li>
-<p>The steps that you need to take are: </p>
+<li>
+<a href="#s73">Assigning URLs to be redirected to Tomcat</a></li>
+</ul>
-<ol>
- <li>Change directory to the apache1.3 or apache2.0 source directory depending
- on your version of Apache. </li>
- <li>Set an APACHE1_HOME environment variable which points to where your Apache is
- installed.</li>
- <li>Execute the following
- command:<br><br>
- <tt><span>MSDEV mod_jk.dsp /MAKE ALL</span></tt><br><br>
- If msdev is not in your path, enter the full path to msdev.exe. Also, ApacheCore.lib
- is expected to exist in the APACHE1_HOME\src\CoreD and APACHE1_HOME\src\CoreR
- directories before linking will succeed. You will need to build enough of the
- Apache source to create these libraries.</li>
- <li>Copy mod_jk.dll to Apache's modules directory.</li>
-</ol>
+<li>
+<a href="#s8">Configuring Tomcat</a></li>
-<p>This will build both release and debug versions of the redirector plug-in (mod_jk). </p>
+<ul>
+<li>
+<a href="#s81">Enabling Tomcat's Apache Auto-Config</a></li>
-<p>An alternative will be to open <tt>mod_jk.dsp</tt> in msdev and build it using the build
-menu.</p>
+<li>
+<a href="#s82">Configuring Tomcat to use the AJPv13 Protocol</a></li>
-<h3><a name="s64">Building mod_jk for Unix</a></h3>
+<li>
+<a href="#s83">Defining Workers</a></li>
+</ul>
-<h4> Apache</h4>
+<li>
+<a href="#s9">Example Configuration</a></li>
-<ol>
- <li>Make sure your Apache has DSO support. You can check this
- with <tt>$APACHE_HOME/bin/httpd -l</tt>. If you see
- "mod_so.c" in the output, DSO support is available. If it's
- missing, you may have to recompile or reinstall Apache.</li>
-
- <li>Find out whether your Apache has EAPI support. If you
- compiled it yourself from source, EAPI is probably not compiled
- in, unless you added it yourself (perhaps with mod_ssl). You
- need to build mod_jk.so with or without EAPI to match your
- Apache configuration. If you install a mismatched mod_jk.so,
- <tt>$APACHE_HOME/bin/apachectl configtest</tt> will warn
- you.</li>
-
- <li>Make sure you have Perl 5 installed. The <tt>apxs</tt>
- script used to build the module is written in Perl.
-
- <li>Change directory to <tt>TOMCAT_HOME/native/mod_jk/apache1.3</tt> (or
- <tt>apache2.0</tt>).
-
- <li>
- <p>Build mod_jk.so. Following are three techniques you can try,
- in order of simplicity:</p>
-
- <ol>
- <li>Run the build script for your platform. If a build script is
- not available for your platform, you may be able to build mod_jk using <tt>./build-unix.sh</tt>. This script will set some variables, call
- <tt>apxs</tt> as below, and try to copy mod_jk.so to
- $APACHE_HOME/libexec. If it fails, you need to do
- the following manually:
-
- <ul>
- <li>set JAVA_HOME in your shell, e.g. "<tt>set
- JAVA_HOME=/usr/local/jdk1.2.2; export
- JAVA_HOME</tt>"</li>
- <li>set APACHE_HOME in your shell, e.g.
- "<tt>set APACHE_HOME=/usr/local/apache;
- export APACHE_HOME</tt>"</li>
- <li>uncomment the following line in the
- <tt>build-unix.sh</tt> file,
- replacing "linux" with the name of your
- platform as specified in the
- Java include directory for your installation
-
- <blockquote><tt># JAVA_INCLUDE="-I
- ${JAVA_HOME}/include -I
- ${JAVA_HOME}/include/linux"</tt></blockquote>
- </li>
-
- </ul>
- </li>
-
- <li>If build-unix.sh fails, you may have better luck
- with the Makefiles in the same directory, e.g.
- "<tt>make -f Makefile.linux mod_jk.so</tt>"
- </li>
-
- <li>
- <p>Finally, you can try to build it manually. Run the
- <tt>apxs</tt> command that came with your apache
- distribution (hint: look in /usr/local/apache/bin,
- /usr/sbin, or wherever you installed apache). Type the
- command all on one line.</p>
-
- <hr>
-
- <p>For Linux:</p>
-
- <blockquote><tt>apxs -o mod_jk.so -I../jk
- -I/usr/local/jdk/include -I/usr/local/jdk/include/linux
- -c *.c ../jk/*.c</tt></blockquote>
-
- <p>Your build may fail because the object files from
- the <tt>../jk</tt> directory have been compiled to the
- current directory, rather than their source directory.
- Running <tt>gcc -shared -o mod_jk.so *.o</tt>
- should finish the build.</p>
-
- <hr>
-
- <p>For Solaris:</p>
-
- <p>Use the <tt>build-solaris.sh</tt> script as follows:</p>
-
- <blockquote><tt># sh build-solaris.sh</tt></blockquote>
-
- <p>This will build and install mod_jk.so in your apache/libexec
- directory. This script contains settings for your Java and Apache
- home locations. Make sure that these are set according to your
- installation. The default settings are <tt>JAVA_HOME=/usr/java</tt> and
- <tt>APACHE_HOME=/usr/local/apache</tt>. If your installation is different,
- you will need to edit the <tt>build-solaris.sh</tt> script and change these
- values appropriately.</p>
-
- <p>See <tt>README.solaris</tt> located in <tt>TOMCAT_HOME/native/mod_jk/apache1.3</tt>
- for more information.</p>
-
- <p>If the build script does not work, you can also build mod_jk as
- follows:</p>
-
- <blockquote><tt>$APACHE_HOME/bin/apxs -o mod_jk.so -DSOLARIS -I../jk -I/usr/java/include
- -I/usr/java/include/solaris -c *.c ../jk/*.c</tt></blockquote>
-
- <p>On some systems, this will build the module
- correctly, but will fail at runtime with a
- "<tt>symbol "fdatasync" not found</tt>". To
- fix, add <tt>-lposix4</tt> just before the
- <tt>-c</tt> in the above command.</p>
-
- <hr>
-
- <p>For HP-UX 11.00:</p>
-
- <p>Use the <tt>build-hpux.sh</tt> script as follows:</p>
-
- <blockquote><tt># sh build-hpux.sh</tt></blockquote>
-
- <p>This will build and install mod_jk.so in your apache/libexec
- directory. This script contains settings for your Java and Apache
- home locations. Make sure that these are set according to your
- installation. The default settings are <tt>JAVA_HOME=/opt/java1.3</tt> and
- <tt>APACHE_HOME=/usr/local/apache</tt>. If your installation is different,
- you will need to edit the <tt>build-hpux.sh</tt> script and change these
- values appropriately.</p>
-
- <p>Also note that there are two HP-UX build scripts. One script
- was written to build mod_jk without JNI support using GNU GCC. The
- other script builds mod_jk with JNI support, however, this script
- requires the HP ANSI C Compiler (not the stripped down C compiler
- included with HP-UX to rebuild the kernel). The HP Compiler is
- required because the dlopen() and related shared libraries are only
- available for 64-bit applications and reliable 64-bit compilation is not
- available with the current version of GCC.</p>
-
- <p>The <tt>build-hpux.sh</tt> script should also work for HP-UX 10.00.</p>
-
- <p>See <tt>README.hpux</tt> located in <tt>TOMCAT_HOME/native/mod_jk/apache1.3</tt>
- for more information.</p>
-
- <hr>
-
- <p>For other Unixes (including FreeBSD):</p>
-
- <p>You may need to replace fdatasync() with fsync() in jk_util.c.</p>
-
- <p>The <tt>build-hpux-cc.sh</tt> script should be modifiable for IRIX and AIX.
- Edit the script and change the APACHE_HOME and JAVA_HOME locations as
- required.</p>
-
- <hr>
-
- <p>If you are using EAPI, try adding
- <tt>-DEAPI</tt> to the apxs command after
- <tt>mod_jk.so</tt>.</p>
-
- <p>If apxs fails with <code>apxs:Break: Command failed
- with rc=255</code>, it may have been damaged by
- mod_ssl. Search for:</p>
+<li>
+<a href="#s10">Troubleshooting and F.A.Q's</a></li>
-<pre>my $CFG_LD_SHLIB = q(); # substituted via Makefile.tmpl
-my $CFG_LDFLAGS_SHLIB = q(); # substituted via Makefile.tmpl
-</pre>
+<li>
+<a href="#s11">Credits</a></li>
+</ul>
- <p>and change to:</p>
+<hr>
+<h2>
+<a NAME="s2"></a>What is mod_jk?</h2>
+mod_jk is a replacement to the elderly mod_jserv. It is a completely new
+Tomcat-Apache plug-in that handles the communication between Tomcat and
+Apache.
+<br>
+<hr>
+<h2>
+<a NAME="s3"></a>Why mod_jk?</h2>
+Several reasons:
+<ul>
+<li>
+<b>mod_jserv was too complex</b>. Because it was ported from Apache/JServ,
+it brought with it lots of JServ specific bits that aren't needed by Apache.</li>
+
+<li>
+<b>mod_jserv supported only Apache</b>. Tomcat supports many web servers
+through a compatibility layer named the jk library. Supporting two different
+modes of work became problematic in terms of support, documentation and
+bug fixes. mod_jk should fix that.</li>
+
+<li>
+The layered approach provided by the jk library makes it easier to support
+both <b>Apache1.3.x <i>and</i> Apache2.xx.</b></li>
+
+<li>
+<b>Better support for SSL</b>. mod_jserv couldn't reliably identify whether
+a request was made via HTTP or HTTPS. mod_jk can, using the newer Ajpv13
+protocol.</li>
+</ul>
-<pre>my $CFG_LD_SHLIB = q(ld); # substituted via Makefile.tmpl
-my $CFG_LDFLAGS_SHLIB = q(-G); # substituted via Makefile.tmpl
-</pre>
+<hr>
+<h2>
+<a NAME="s4"></a>What does it mean to me?</h2>
+You will need to get to know a new simplified configuration mechanism.
+The advantage is that learning this mechanism will give you a head start
+if you want to deploy Tomcat on Apache and other web servers, such as Microsoft's
+Internet Information Server (IIS) and the iPlanet Enterprise Web Server.
+<br>
+<hr>
+<h2>
+<a NAME="s5"></a>Definitions and Terminology</h2>
+In this document I am going to use a few terms, so let's define them:
+<br>
+<table class="inlinetable" >
+<tr>
+<th class="inlineth">Term</th>
+
+<th class="inlineth">Meaning</th>
+</tr>
+
+<tr>
+<td class="inlinetd">Worker Process</td>
+
+<td class="inlinetd">A worker is a tomcat instance that is running to serve
+servlet requests coming from the web server. In most cases there is only
+a single worker (the one and only tomcat process) but sometimes you will
+run multiple workers to achieve load balancing or site partitioning. Each
+worker is identified to the web server by the host were it is located,
+the port where it listens and the communication protocol used to exchange
+messages.</td>
+</tr>
+
+<tr>
+<td class="inlinetd">In-Process Worker</td>
+
+<td class="inlinetd">This is a special worker. Instead of working with
+a Tomcat process residing on another process, the web server opens a JVM
+and executes Tomcat inside the web server process address space. Our discussion
+in this document is not going to get into this special worker.</td>
+</tr>
+
+<tr>
+<td class="inlinetd">Web Server Plug-in/Tomcat Redirector</td>
+
+<td class="inlinetd">For Tomcat to cooperate with any web server it needs
+an "agent" to reside in the web server and send him servlet requests. This
+is the web server plug-in, and in our case the web server plug-in is mod_jk.
+The redirector usually comes in the shape of a DLL or shared object module
+that you plug into the web server.</td>
+</tr>
+
+<tr>
+<td class="inlinetd">Plug-in Configuration</td>
+
+<td class="inlinetd">We need to configure the web server plug-in so that
+it knows where the different Tomcat workers are and to which of them it
+should forward requests. This information, accompanied with some internal
+parameter, such as the log level, comprises the plug-in configuration. </td>
+</tr>
+
+<tr>
+<td class="inlinetd">Web Server Configuration</td>
+
+<td class="inlinetd">Each web server has some configuration that defines
+its behavior, e.g. on which port to listen, what files to serve, what web
+server plug-ins to load, etc. You will need to modify your web server configuration
+to instruct it to load the Tomcat redirector mod_jk.</td>
+</tr>
+</table>
- <p>If you've installed Java in another directory,
- adjust accordingly.</p>
+<hr>
+<h2>
+<a NAME="s6"></a>Obtaining mod_jk</h2>
+mod_jk can be obtained in two formats - binary and source. Depending
+on the platform you are running your web server on, a binary version of
+mod_jk may be available. It is recommended to use the binary version
+if one is available. If the binary is not available, follow the instructions
+for building mod_jk from source. Notes at the end of this section
+offer recommendations for specific platforms.
+<h3>
+<a NAME="s61"></a>mod_jk Binaries</h3>
+Binaries for mod_jk are available for several platforms in the same area
+as the Tomcat Binary Release. The binaries are located in subdirectories
+by platform. For some platforms, such as Windows, this is the typical
+way of obtaining mod_jk since most Windows systems do not have C compilers.
+For others, the binary distribution of mod_jk offers simpler installation.
+<p>For example, the Tomcat 3.3 M1 Release at <a href="http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3-m1/bin/">http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3-m1/bin/</a>
+contains the following:
+<br>
+<table BORDER CELLSPACING=0 CELLPADDING=2 WIDTH="600" bordercolor="#000000" >
+<tr>
+<td WIDTH="15%">linux/i386/</td>
+
+<td WIDTH="85%">Contains mod_jk.so for Apache 1.3 for the standard API
+as well as EAPI and mod_jk.so for Apache 2.0</td>
+</tr>
+
+<tr>
+<td WIDTH="15%">netware/</td>
+
+<td WIDTH="85%">Contains the mod_jk.nlm and nsapi.nlm</td>
+</tr>
+
+<tr>
+<td WIDTH="15%">win32/</td>
+
+<td WIDTH="85%">Contains the mod_jk.dll for Windows as well as other useful
+binaries.</td>
+</tr>
+</table>
- <p>For other Unixes you should be able to work it out,
- but remember that <strong>the order of the arguments to
- <tt>apxs</tt> is important!</strong>.</p>
- </li>
-
- </ol>
- </li>
-
- <li>Now, copy the mod_jk library. <tt># cp mod_jk.so $APACHE_HOME/libexec</tt>. (Note that
- the build scripts attempt to do this, but you may have to
- <tt>su</tt> first.)</li>
+<p>Check the site for the latest binaries.
+<p>Note: The version of mod_jk is not dependent on the version of Tomcat.
+The Tomcat 3.3 distribution of mod_jk will function correctly with other
+3.x versions of Tomcat, such as Tomcat 3.2.1.
+<h3>
+<a NAME="s62"></a>Building mod_jk</h3>
+mod_jk is available in source distribution for all Windows and most Unix
+platforms. The source for mod_jk is included in the Binary Distribution
+of Tomcat in the TOMCAT_HOME/native/mod_jk/ directory. This directory
+is organized by Web Server name and version. Each directory contains
+the source as well as the appropriate build scripts, make files, or project
+files.
+<h3>
+<a NAME="s63"></a>Building mod_jk for NT</h3>
+The redirector was developed using Visual C++ version 6.0, so having this
+environment is a prerequisite if you want to perform a custom build.
+<p>The steps that you need to take are:
+<ol>
+<li>
+Change directory to the apache1.3 or apache2.0 source directory depending
+on your version of Apache.</li>
+
+<li>
+Set an APACHE1_HOME environment variable which points to where your Apache
+is installed.</li>
+
+<li>
+Execute the following command:</li>
+
+<p><br><span><tt>MSDEV mod_jk.dsp /MAKE ALL</tt></span>
+<p>If msdev is not in your path, enter the full path to msdev.exe. Also,
+ApacheCore.lib is expected to exist in the APACHE1_HOME\src\CoreD and APACHE1_HOME\src\CoreR
+directories before linking will succeed. You will need to build enough
+of the Apache source to create these libraries.
+<li>
+Copy mod_jk.dll to Apache's modules directory.</li>
</ol>
-
-<h4>Other Webservers</h4>
+This will build both release and debug versions of the redirector plug-in
+(mod_jk).
+<p>An alternative will be to open <tt>mod_jk.dsp</tt> in msdev and build
+it using the build menu.
+<h3>
+<a NAME="s64"></a>Building mod_jk for Unix</h3>
-<p>There are several Makefiles in the other directories under the <tt>TOMCAT_HOME/native/mod_jk/</tt>
-directory. You should also check the Tomcat documentation for specific
-information related to other web servers.</p>
+<h4>
+Apache</h4>
-<hr>
-<h2><a name="s7">Configuring Apache</a></h2>
+<ol>
+<li>
+Make sure your Apache has DSO support. You can check this with <tt>$APACHE_HOME/bin/httpd
+-l</tt>. If you see "mod_so.c" in the output, DSO support is available.
+If it's missing, you may have to recompile or reinstall Apache.</li>
+
+<li>
+Find out whether your Apache has EAPI support. If you compiled it yourself
+from source, EAPI is probably not compiled in, unless you added it yourself
+(perhaps with mod_ssl). You need to build mod_jk.so with or without EAPI
+to match your Apache configuration. If you install a mismatched mod_jk.so,
+<tt>$APACHE_HOME/bin/apachectl configtest</tt> will warn you.</li>
+
+<li>
+Make sure you have Perl 5 installed. The <tt>apxs</tt> script used to build
+the module is written in Perl.</li>
-<p>This section details the configuration that is required for the Apache Web
-Server to support mod_jk.</p>
+<li>
+Change directory to <tt>TOMCAT_HOME/native/mod_jk/apache1.3</tt> (or <tt>apache2.0</tt>).</li>
-<h3><a name="s71">Removing mod_jserv directives</a></h3>
-<p class=subsection>
-If you've previously configured Apache to use mod_jserv, remove any <tt>ApJServMount</tt> directives from your httpd.conf. If you're including <tt>tomcat-apache.conf</tt> or <tt>tomcat.conf</tt>, you'll want to remove them as well - they are specific to
-mod_jserv. The mod_jserv configuration directives are not compatible with
-mod_jk!
-</p>
+<p><br>Build mod_jk.so. Following are three techniques you can try, in
+order of simplicity:
+<ol>
+<li>
+Run the build script for your platform. If a build script is not
+available for your platform, you may be able to build mod_jk using <tt>./build-unix.sh</tt>.
+This script will set some variables, call <tt>apxs</tt> as below, and try
+to copy mod_jk.so to $APACHE_HOME/libexec. If it fails, you need to do
+the following manually:</li>
-<h3><a name="s72">Configure Apache to use mod_jk</a></h3>
-<div class=subsection>
-<p>The simplest way to configure Apache to use mod_jk is to turn on the Apache
-auto-configure setting in Tomcat and put the following include directive at the
-end of your Apache httpd.conf file (make sure you replace TOMCAT_HOME with the
-correct path for your Tomcat installation:</p>
+<ul>
+<li>
+set JAVA_HOME in your shell, e.g. "<tt>set JAVA_HOME=/usr/local/jdk1.2.2;
+export JAVA_HOME</tt>"</li>
+
+<li>
+set APACHE_HOME in your shell, e.g. "<tt>set APACHE_HOME=/usr/local/apache;
+export APACHE_HOME</tt>"</li>
+
+<li>
+uncomment the following line in the <tt>build-unix.sh</tt> file, replacing
+"linux" with the name of your platform as specified in the Java include
+directory for your installation</li>
-<p><tt>Include TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt></p>
+<blockquote><tt># JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux"</tt></blockquote>
+</ul>
-<p>Example:</p>
+<li>
+If build-unix.sh fails, you may have better luck with the Makefiles in
+the same directory, e.g. "<tt>make -f Makefile.linux mod_jk.so</tt>"</li>
+
+<p><br>Finally, you can try to build it manually. Run the <tt>apxs</tt>
+command that came with your apache distribution (hint: look in /usr/local/apache/bin,
+/usr/sbin, or wherever you installed apache). Type the command all on one
+line.
+<br>
+<hr>
+<p>For Linux:
+<blockquote><tt>apxs -o mod_jk.so -I../jk -I/usr/local/jdk/include -I/usr/local/jdk/include/linux
+-c *.c ../jk/*.c</tt></blockquote>
+Your build may fail because the object files from the <tt>../jk</tt> directory
+have been compiled to the current directory, rather than their source directory.
+Running <tt>gcc -shared -o mod_jk.so *.o</tt> should finish the build.
+<br>
+<hr>
+<p>For Solaris:
+<p>Use the <tt>build-solaris.sh</tt> script as follows:
+<blockquote><tt># sh build-solaris.sh</tt></blockquote>
+This will build and install mod_jk.so in your apache/libexec directory.
+This script contains settings for your Java and Apache home locations.
+Make sure that these are set according to your installation. The
+default settings are <tt>JAVA_HOME=/usr/java</tt> and <tt>APACHE_HOME=/usr/local/apache</tt>.
+If your installation is different, you will need to edit the <tt>build-solaris.sh</tt>
+script and change these values appropriately.
+<p>See <tt>README.solaris</tt> located in <tt>TOMCAT_HOME/native/mod_jk/apache1.3</tt>
+for more information.
+<p>If the build script does not work, you can also build mod_jk as follows:
+<blockquote><tt>$APACHE_HOME/bin/apxs -o mod_jk.so -DSOLARIS -I../jk -I/usr/java/include
+-I/usr/java/include/solaris -c *.c ../jk/*.c</tt></blockquote>
-<p><tt>Include /usr/local/jakarta-tomcat/conf/jk/mod_jk.conf-auto</tt></p>
+<hr>
+<p>For HP-UX 11.00:
+<p>Use the <tt>build-hpux.sh</tt> script as follows:
+<blockquote><tt># sh build-hpux.sh</tt></blockquote>
+This will build and install mod_jk.so in your apache/libexec directory.
+This script contains settings for your Java and Apache home locations.
+Make sure that these are set according to your installation. The
+default settings are <tt>JAVA_HOME=/opt/java1.3</tt> and <tt>APACHE_HOME=/usr/local/apache</tt>.
+If your installation is different, you will need to edit the <tt>build-hpux.sh</tt>
+script and change these values appropriately.
+<p>Also note that there are two HP-UX build scripts. One script was
+written to build mod_jk without JNI support using GNU GCC. The other
+script builds mod_jk with JNI support, however, this script requires the
+HP ANSI C Compiler (not the stripped down C compiler included with HP-UX
+to rebuild the kernel). The HP Compiler is required because the dlopen()
+and related shared libraries are only available for 64-bit applications
+and reliable 64-bit compilation is not available with the current version
+of GCC.
+<p>The <tt>build-hpux.sh</tt> script should also work for HP-UX 10.00.
+<p>See <tt>README.hpux</tt> located in <tt>TOMCAT_HOME/native/mod_jk/apache1.3</tt>
+for more information.
+<br>
+<hr>
+<p>For other Unixes (including FreeBSD):
+<p>The <tt>build-hpux-cc.sh</tt> script should be modifiable for IRIX and
+AIX. Edit the script and change the APACHE_HOME and JAVA_HOME locations
+as required.
+<br>
+<hr>
+<p>If you are using EAPI, try adding <tt>-DEAPI</tt> to the apxs command
+after <tt>mod_jk.so</tt>.
+<p>If apxs fails with <tt>apxs:Break: Command failed with rc=255</tt>,
+it may have been damaged by mod_ssl. Search for:
+<pre>my $CFG_LD_SHLIB = q(); # substituted via Makefile.tmpl
+my $CFG_LDFLAGS_SHLIB = q(); # substituted via Makefile.tmpl</pre>
+and change to:
+<pre>my $CFG_LD_SHLIB = q(ld); # substituted via Makefile.tmpl
+my $CFG_LDFLAGS_SHLIB = q(-G); # substituted via Makefile.tmpl</pre>
+If you've installed Java in another directory, adjust accordingly.
+<p>For other Unixes you should be able to work it out, but remember that
+<b>the order of the arguments to <tt>apxs</tt> is important!</b>.</ol>
+
+<li>
+Now, copy the mod_jk library. <tt># cp mod_jk.so $APACHE_HOME/libexec</tt>.
+(Note that the build scripts attempt to do this, but you may have to <tt>su</tt>
+first.)</li>
+</ol>
+<h4>
+Other Webservers</h4>
+There are several Makefiles in the other directories under the <tt>TOMCAT_HOME/native/mod_jk/</tt>
+directory. You should also check the Tomcat documentation for specific
+information related to other web servers.
+<br>
+<hr>
+<h2>
+<a NAME="s7"></a>Configuring Apache</h2>
+This section details the configuration that is required for the Apache
+Web Server to support mod_jk.
+<h3>
+<a NAME="s71"></a>Removing mod_jserv directives</h3>
+
+<div class="subsection">If you've previously configured Apache to use mod_jserv,
+remove any <tt>ApJServMount</tt> directives from your httpd.conf. If you're
+including <tt>tomcat-apache.conf</tt> or <tt>tomcat.conf</tt>, you'll want
+to remove them as well - they are specific to mod_jserv. The mod_jserv
+configuration directives are not compatible with mod_jk!</div>
+
+<h3>
+<a NAME="s72"></a>Configure Apache to use mod_jk</h3>
+
+<div class=subsection>The simplest way to configure Apache to use mod_jk
+is to turn on the Apache auto-configure setting in Tomcat and put the following
+include directive at the end of your Apache httpd.conf file (make sure
+you replace TOMCAT_HOME with the correct path for your Tomcat installation:
+<p><tt>Include TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt>
+<p>Example:
+<p><tt>Include /usr/local/jakarta-tomcat/conf/jk/mod_jk.conf-auto</tt>
<p>This will tell Apache to use directives in the mod_jk.conf-auto file
-in the Apache configuration. This file is created by enabling the Apache
-auto-configuration as described in the configuring Tomcat section below [<a href="#s8">Configuring
-Tomcat</a>].</p>
-
-<p><b>NOTE: If you plan to use the Tomcat-Apache auto-configuration, skip
-the rest of this section and continue with the <a href="#s8">Configuring Tomcat</a>
-section.</b></p>
-
-<p>Custom configurations can be created by enabling the auto-configuration and
-copying the <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt> file to your own
-configuration file, such as <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-local</tt>.</p>
-
-<p>The basic configuration is as follows:</p>
-
+in the Apache configuration. This file is created by enabling the
+Apache auto-configuration as described in the configuring Tomcat section
+below [<a href="#s8">Configuring Tomcat</a>].
+<p><b>NOTE: If you plan to use the Tomcat-Apache auto-configuration,
+skip the rest of this section and continue with the <a href="#s8">Configuring
+Tomcat</a> section.</b>
+<p>Custom configurations can be created by enabling the auto-configuration
+and copying the <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt> file to your
+own configuration file, such as <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-local</tt>.
+<p>The basic configuration is as follows:
<ul>
- <li>You will need to instruct Apache to load Tomcat. This can be done with
- Apache's <tt>LoadModule</tt> and <tt>AddModule</tt> configuration directives.</li>
- <li>You must inform mod_jk the location of your <tt>workers.properties</tt> file.
- Use mod_jk's <tt>JkWorkersFile</tt> configuration directive.</li>
- <li>You should specify a location where mod_jk is going to place its log file
- and a log level to be used. Use the <tt>JkLogFile</tt> and <tt>JkLogLevel</tt>
- configuration directives. Possible log levels are <i>debug</i>, <i>info</i>,
- <i>error</i> and <i>emerg</i>, but <i>info</i> should be your default
- selection.</li>
- <li>The directive <tt>JkLogStampFormat</tt> will configure the date/time format
- found on mod_jk logfile. Using <tt>strftime()</tt> format string it's set by
- default to "[%a %b %d %H:%M:%S %Y] "</li>
+<li>
+You will need to instruct Apache to load Tomcat. This can be done with
+Apache's <tt>LoadModule</tt> and <tt>AddModule</tt> configuration directives.</li>
+
+<li>
+You must inform mod_jk the location of your <tt>workers.properties</tt>
+file. Use mod_jk's <tt>JkWorkersFile</tt> configuration directive.</li>
+
+<li>
+You should specify a location where mod_jk is going to place its log file
+and a log level to be used. Use the <tt>JkLogFile</tt> and <tt>JkLogLevel</tt>
+configuration directives. Possible log levels are <i>debug</i>, <i>info</i>,
+<i>error</i> and <i>emerg</i>, but <i>info</i> should be your default selection.</li>
+
+<li>
+The directive <tt>JkLogStampFormat</tt> will configure the date/time format
+found on mod_jk logfile. Using <tt>strftime()</tt> format string it's set
+by default to "[%a %b %d %H:%M:%S %Y] "</li>
</ul>
-A simple example would be to include the following lines in your <tt>httpd.conf</tt> file:
-<blockquote><pre>
-LoadModule jk_module libexec/mod_jk.so
-AddModule mod_jk.c
+A simple example would be to include the following lines in your <tt>httpd.conf</tt>
+file:
+<blockquote>
+<pre>LoadModule jk_module libexec/mod_jk.so
+AddModule mod_jk.c
JkWorkersFile /usr/local/jakarta-tomcat/conf/workers.properties
-JkLogFile /usr/local/apache/logs/mod_jk.log
-JkLogLevel info
-JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
-</pre></blockquote>
+JkLogFile /usr/local/apache/logs/mod_jk.log
+JkLogLevel info
+JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "</pre>
+</blockquote>
</div>
-
-<h3><a name="s73">Assigning URLs to Tomcat</a></h3>
-<div class=subsection>
-<p>If you have created a custom or local version of <tt>mod_jk.conf-local</tt>
- as noted above, you can change settings such as the workers or URL prefix.</p>
-
-<p>Use mod_jk's JkMount directive to assign specific URLs to Tomcat. In general
-the structure of a JkMount directive is:</p>
-
-<pre>
-JkMount <i><URL prefix></i> <i><Worker name></i>
-</pre>
-<p>For example the following directives will send all requests ending in
-<tt>.jsp</tt> or beginning with <tt>/servlet</tt> to the "<tt>ajp13</tt>" worker,
-but jsp requests to files located in /otherworker will go to "<tt>remoteworker</tt>".
+<h3>
+<a NAME="s73"></a>Assigning URLs to Tomcat</h3>
-<blockquote><pre>
-JkMount /*.jsp ajp13
+<div class=subsection>If you have created a custom or local version of
+<tt>mod_jk.conf-local</tt> as noted above, you can change settings such
+as the workers or URL prefix.
+<p>Use mod_jk's JkMount directive to assign specific URLs to Tomcat. In
+general the structure of a JkMount directive is:
+<pre>JkMount <i><URL prefix></i> <i><Worker name></i></pre>
+For example the following directives will send all requests ending in
+<tt>.jsp</tt>
+or beginning with <tt>/servlet</tt> to the "<tt>ajp13</tt>" worker, but
+jsp requests to files located in /otherworker will go to "<tt>remoteworker</tt>".
+<blockquote>
+<pre>JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
-JkMount /otherworker/*.jsp remoteworker
-</pre></blockquote>
-You can use the <tt>JkMount</tt> directive at the top level or inside <tt><VirtualHost></tt>
-sections of your httpd.conf file.
-</div>
+JkMount /otherworker/*.jsp remoteworker</pre>
+</blockquote>
+You can use the <tt>JkMount</tt> directive at the top level or inside <tt><VirtualHost></tt>
+sections of your httpd.conf file.</div>
<hr>
-<h2><a name="s8">Configuring Tomcat</a></h2>
+<h2>
+<a NAME="s8"></a>Configuring Tomcat</h2>
+
+<h3>
+<a NAME="s81"></a>Enabling Tomcat's Apache Auto-Config</h3>
-<h3><a name="s81">Enabling Tomcat's Apache Auto-Config</a></h3>
-<div class=subsection>
-<p>
-In most simple cases Tomcat can generate the needed Apache configuration. You
-can configure Tomcat so that when it starts up it will automatically generate
-a configuration file for Apache to use mod_jk.
-Most of the time you don't need to do anything but
-include this file (appending <tt>"Include TOMCAT_HOME/conf/jk/mod_jk.conf-auto"</tt>)
-in your httpd.conf, as shown in the previous section (<a href="#s7">Configuring
-Apache</a>).
-</p>
-<p>To configure Tomcat to generate the Apache auto-configuration add the following block to your <tt>TOMCAT_HOME/conf/server.xml</tt> file after <tt><AutoWebApp ... /></tt>.
-</p>
-<blockquote><pre>
-<ApacheConfig />
-</pre></blockquote>
-<p>
-That's it, you can
-now start Tomcat and Apache and access Tomcat from the Apache server.
-</p>
+<div class=subsection>In most simple cases Tomcat can generate the needed
+Apache configuration. You can configure Tomcat so that when it starts up
+it will automatically generate a configuration file for Apache to use mod_jk.
+Most of the time you don't need to do anything but include this file (appending
+<tt>"Include TOMCAT_HOME/conf/jk/mod_jk.conf-auto"</tt>) in your httpd.conf,
+as shown in the previous section (<a href="#s7">Configuring Apache</a>).
+<p>To configure Tomcat to generate the Apache auto-configuration add the
+following block to your <tt>TOMCAT_HOME/conf/server.xml</tt> file after
+<tt><AutoWebApp ... /></tt>.
+<blockquote>
+<pre><ApacheConfig /></pre>
+</blockquote>
+That's it, you can now start Tomcat and Apache and access Tomcat from the
+Apache server.
<p>Note: Settings for mod_jk auto-configuration is new in Tomcat 3.3.
-Older versions of Tomcat create the auto-config file without a directive in
-server.xml. The new directive in Tomcat 3.3 allows for additional
+Older versions of Tomcat create the auto-config file without a directive
+in server.xml. The new directive in Tomcat 3.3 allows for additional
configuration options as detailed later in this section. For older
versions of Tomcat, refere to the documentation that came with that version.
-</p>
-<p>
-If you have special needs, for example mounting
-URL prefixes that are not the default, you can use this file as a base for your
-customized configuration and save the results in another file. If you manage
-the Apache configuration yourself you'll need to update it whenever you add a
-new context.
-</p>
-<p>Note that you must restart tomcat and apache after adding a new
-context; Apache doesn't support configuration changes without a restart. Also
-the file <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt> is generated when
-tomcat starts, so you'll need to start Tomcat before Apache. Tomcat will
-overwrite <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt> each startup so
-customized configuration should be kept elsewhere. For example, copy
-<tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt> to <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-local
-</tt>before making changes. You'll need to startup Tomcat once to generate
-this file with your configuration for the first time.
-</p>
-<p>It is also possible to specify the location of the auto generated files by
-setting options in the <ApacheConfig /> block. The following details
-the syntax:
-</p>
-<blockquote><pre>
-< ContextManager ... >
- ...
- <ApacheConfig <i>options</i> />
- ...
-< /ContextManager >
-</pre></blockquote>
-<p>
+<p>If you have special needs, for example mounting URL prefixes that are
+not the default, you can use this file as a base for your customized configuration
+and save the results in another file. If you manage the Apache configuration
+yourself you'll need to update it whenever you add a new context.
+<p>Note that you must restart tomcat and apache after adding a new context;
+Apache doesn't support configuration changes without a restart. Also the
+file <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt> is generated when tomcat
+starts, so you'll need to start Tomcat before Apache. Tomcat will overwrite
+<tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt> each startup so customized
+configuration should be kept elsewhere. For example, copy
+<tt>TOMCAT_HOME/conf/jk/mod_jk.conf-auto</tt>
+to <tt>TOMCAT_HOME/conf/jk/mod_jk.conf-local
+</tt>before making changes.
+You'll need to startup Tomcat once to generate this file with your configuration
+for the first time.
+<p>It is also possible to specify the location of the auto generated files
+by setting options in the <ApacheConfig /> block. The following
+details the syntax:
+<blockquote>
+<pre>< ContextManager ... >
+ ...
+ <ApacheConfig <i>options</i> />
+ ...
+< /ContextManager ></pre>
+</blockquote>
where <i>options</i> can include any of the following attributes:
-</p>
<ul>
- <li><b>confighome</b> - default parent directory for the following paths. If
- not set, this defaults to TOMCAT_HOME. Ignored whenever any of the following
- paths is absolute.
- <li><b>jservconfig</b> - path to write apache jserv conf file to. If not set,
- defaults to "conf/jserv/tomcat-apache.conf".
- <li><b>jkconfig</b> - path to write apacke mod_jk conf file to. If not set,
- defaults to "conf/jk/mod_jk.conf".
- <li><b>workersconfig</b> - path to workers.properties file used by mod_jk. If
- not set, defaults to "conf/jk/workers.properties".
- <li><b>modjserv</b> - path to Apache JServ plugin module file. If not set,
- defaults to "modules/ApacheModuleJServ.dll" on windows,
- "modules/Jserv.nlm" on netware, and "libexec/mod_jserv.so"
- everywhere else.
- <li><b>modjk</b> - path to Apache mod_jk plugin file. If not set, defaults to
- "modules/mod_jk.dll" on windows, "modules/mod_jk.nlm" on
- netware, and "libexec/mod_jk.so" everywhere else.
- <li><b>jklog</b> - path to log file to be used by mod_jk.</li>
+<li>
+<b>confighome</b> - default parent directory for the following paths. If
+not set, this defaults to TOMCAT_HOME. Ignored whenever any of the following
+paths is absolute.</li>
+
+<li>
+<b>jservconfig</b> - path to write apache jserv conf file to. If not set,
+defaults to "conf/jserv/tomcat-apache.conf".</li>
+
+<li>
+<b>jkconfig</b> - path to write apacke mod_jk conf file to. If not set,
+defaults to "conf/jk/mod_jk.conf".</li>
+
+<li>
+<b>workersconfig</b> - path to workers.properties file used by mod_jk.
+If not set, defaults to "conf/jk/workers.properties".</li>
+
+<li>
+<b>modjserv</b> - path to Apache JServ plugin module file. If not set,
+defaults to "modules/ApacheModuleJServ.dll" on windows, "modules/Jserv.nlm"
+on netware, and "libexec/mod_jserv.so" everywhere else.</li>
+
+<li>
+<b>modjk</b> - path to Apache mod_jk plugin file. If not set, defaults
+to "modules/mod_jk.dll" on windows, "modules/mod_jk.nlm" on netware, and
+"libexec/mod_jk.so" everywhere else.</li>
+
+<li>
+<b>jklog</b> - path to log file to be used by mod_jk.</li>
</ul>
-<p>
Example:
-</p>
-<blockquote><pre>...
+<blockquote>
+<pre>...
-<AutoWebApp dir="webapps" host="DEFAULT" />
+<AutoWebApp dir="webapps" host="DEFAULT" />
-<ApacheConfig confighome="/home/mydir" />
+<ApacheConfig confighome="/home/mydir" />
-...</pre></blockquote>
+...</pre>
+</blockquote>
</div>
-<h3><a name="s82">(Optional) Configuring Tomcat to use the Ajpv13 protocol</a></h3>
-<div class=subsection>
-mod_jk can use either the original Ajpv12 protocol or the newer Ajpv13 protocol.
-Both protocols are enabled by default. The "Ajp13" Connection Handler in Tomcat will
-give you the benefit of a faster protocol and the ability to identify requests made via HTTPS.<BR><BR>
-The following block enables Ajpv13 in your <tt>TOMCAT_HOME/conf/server.xml</tt> file.
-<blockquote><pre>
-<RequestInterceptor
- className="org.apache.tomcat.modules.server.Ajp13Interceptor"
- port="8009"/>
-</pre></blockquote>
-
-<p>The <tt>server.xml</tt> file already has a block similar to this for
-Ajp12 connections on port 8007 (as delivered by mod_jserv). Even if you
-think you're only using Ajp13, you probably don't want to delete this
-connector -- it's required to shut down Tomcat.</p>
+<h3>
+<a NAME="s82"></a>(Optional) Configuring Tomcat to use the Ajpv13 protocol</h3>
-</div>
-<h3><a name="s83">(Optional) Defining "workers"</a></h3>
+<div class=subsection>mod_jk can use either the original Ajpv12 protocol
+or the newer Ajpv13 protocol. Both protocols are enabled by default. The
+"Ajp13" Connection Handler in Tomcat will give you the benefit of a faster
+protocol and the ability to identify requests made via HTTPS.
+<p>The following block enables Ajpv13 in your <tt>TOMCAT_HOME/conf/server.xml</tt>
+file.
+<blockquote>
+<pre><RequestInterceptor
+ className="org.apache.tomcat.modules.server.Ajp13Interceptor"
+ port="8009"/></pre>
+</blockquote>
+The <tt>server.xml</tt> file already has a block similar to this for Ajp12
+connections on port 8007 (as delivered by mod_jserv). Even if you think
+you're only using Ajp13, you probably don't want to delete this connector
+-- it's required to shut down Tomcat.</div>
+
+<h3>
+<a NAME="s83"></a>(Optional) Defining "workers"</h3>
-<h4>Configuring workers manually.</h4>
-<div class=subsection>
-<p>
-Workers are configured using the file <tt>TOMCAT_HOME/conf/jk/workers.properties</tt>.
+<h4>
+Configuring workers manually.</h4>
+
+<div class=subsection>Workers are configured using the file <tt>TOMCAT_HOME/conf/jk/workers.properties</tt>.
There is a great deal of information in the
-<a href="Tomcat-Workers-HowTo.html">workers.properties howto</a> document, and you
-should really look at that first. If you're in a hurry however, you can probably get away
-with editing the file <tt>workers.properties</tt> and setting the <tt>workers.tomcat_home</tt>, <tt>workers.java_home</tt> and <tt>ps</tt> variables to the correct values for your system.
-</p>
-</div>
+<a href="Tomcat-Workers-HowTo.html">workers.properties
+howto</a> document, and you should really look at that first. If you're
+in a hurry however, you can probably get away with editing the file <tt>workers.properties</tt>
+and setting the <tt>workers.tomcat_home</tt>, <tt>workers.java_home</tt>
+and <tt>ps</tt> variables to the correct values for your system.</div>
<hr>
-<h2><a name="s9">Example Configuration</a></h2>
-Here's an example configuration which probably reflects many real-world setups. A site
-is using Tomcat and Apache with two virtual hosts (one of them using HTTPS as well, which
-we're assuming is being handled by mod_ssl).
-<BR><BR>
-URLs ending in .jsp and beginning with /servlet are handled by Tomcat, the rest are
-handled by Apache. The files for each Host are server out of /web/host1 and /web/host2
-respectively.<BR><BR>
-The example are over-simplified and incomplete but should get you started. Also note the
-virtual host setup is new in Tomcat 3.2 - <i>this example won't work with Tomcat 3.1</i>.<BR><BR>
-
-<table class=inlinetable><tr><td class=inlinetd>
-<blockquote><pre>
+<h2>
+<a NAME="s9"></a>Example Configuration</h2>
+Here's an example configuration which probably reflects many real-world
+setups. A site is using Tomcat and Apache with two virtual hosts (one of
+them using HTTPS as well, which we're assuming is being handled by mod_ssl).
+<p>URLs ending in .jsp and beginning with /servlet are handled by Tomcat,
+the rest are handled by Apache. The files for each Host are server out
+of /web/host1 and /web/host2 respectively.
+<p>The example are over-simplified and incomplete but should get you started.
+Also note the virtual host setup is new in Tomcat 3.2 - <i>this example
+won't work with Tomcat 3.1</i>.
+<br>
+<table class="inlinetable" >
+<tr>
+<td class="inlinetd">
+<blockquote>
+<pre>.
.
+<Connector className="org.apache.tomcat.service.PoolTcpConnector">
+ <Parameter name="handler" value="org.apache.tomcat.modules.server.Ajp12Interceptor"/>
+ <Parameter name="port" value="8007"/>
+</Connector>
+
+<Connector className="org.apache.tomcat.service.PoolTcpConnector">
+ <Parameter name="handler" value="org.apache.tomcat.modules.server.Ajp13Interceptor"/>
+ <Parameter name="port" value="8009"/>
+</Connector>
+
+<Host name="host1.apache.org">
+ <Context path="" docBase="/web/host1" debug="0"/>
+</Host>
+<Host name="host2.apache.org">
+ <Context path="" docBase="/web/host2" debug="0"/>
+</Host>
.
-<Connector className="org.apache.tomcat.service.PoolTcpConnector">
- <Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
- <Parameter name="port" value="8007"/>
-</Connector>
-
-<Connector className="org.apache.tomcat.service.PoolTcpConnector">
- <Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
- <Parameter name="port" value="8009"/>
-</Connector>
-
-<Host name="host1.apache.org">
- <Context path="" docBase="/web/host1" debug="0"/>
-</Host>
-<Host name="host2.apache.org">
- <Context path="" docBase="/web/host2" debug="0"/>
-</Host>
-.
-.
-</pre></blockquote>
-</td></tr></table>
-<i>Table 1 - Excerpt from server.xml showing the Ajp13 Connector and two virtual
-hosts.</i>
-<BR><BR>
-<table class=inlinetable><tr><td class=inlinetd>
-<blockquote><pre>
-# Setup for Solaris system
+.</pre>
+</blockquote>
+</td>
+</tr>
+</table>
+<i>Table 1 - Excerpt from server.xml showing the Ajp13 Connector and two
+virtual hosts.</i>
+<br>
+<table class="inlinetable" >
+<tr>
+<td class="inlinetd">
+<blockquote>
+<pre># Setup for Solaris system
#
workers.tomcat_home=/usr/local/jakarta-tomcat
workers.java_home=/usr/java
@@ -723,157 +716,176 @@
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
-worker.ajp13.type=ajp13
-</pre></blockquote>
-</td></tr></table>
+worker.ajp13.type=ajp13</pre>
+</blockquote>
+</td>
+</tr>
+</table>
<i>Table 2 - Excerpt from workers.properties showing the Ajp13 worker</i>
-<BR><BR>
-<table class=inlinetable><tr><td class=inlinetd>
-<blockquote><pre>
-# Load mod_jk
+<br>
+<table class="inlinetable" >
+<tr>
+<td class="inlinetd">
+<blockquote>
+<pre># Load mod_jk
#
-LoadModule jk_module libexec/mod_jk.so
-AddModule mod_jk.c
+LoadModule jk_module libexec/mod_jk.so
+AddModule mod_jk.c
# Configure mod_jk
#
JkWorkersFile /usr/local/jakarta-tomcat/conf/jk/workers.properties
-JkLogFile /usr/local/apache/logs/mod_jk.log
-JkLogLevel info
+JkLogFile /usr/local/apache/logs/mod_jk.log
+JkLogLevel info
# First Virtual Host.
#
-<VirtualHost 10.0.0.1:80>
- DocumentRoot /web/host1
- ServerName host1.apache.org
- JkMount /*.jsp ajp13
- JkMount /servlet/* ajp13
-</VirtualHost>
+<VirtualHost 10.0.0.1:80>
+ DocumentRoot /web/host1
+ ServerName host1.apache.org
+ JkMount /*.jsp ajp13
+ JkMount /servlet/* ajp13
+</VirtualHost>
# Second Virtual Host. Also accessible via HTTPS
#
-<VirtualHost 10.0.0.2:80>
- DocumentRoot /web/host2
- ServerName host2.apache.org
- JkMount /*.jsp ajp13
- JkMount /servlet/* ajp13
-</VirtualHost>
-
-<VirtualHost 10.0.0.2:443>
- DocumentRoot /web/host2
- ServerName host2.apache.org
- SSLEngine On
- JkMount /*.jsp ajp13
- JkMount /servlet/* ajp13
-</VirtualHost>
+<VirtualHost 10.0.0.2:80>
+ DocumentRoot /web/host2
+ ServerName host2.apache.org
+ JkMount /*.jsp ajp13
+ JkMount /servlet/* ajp13
+</VirtualHost>
+
+<VirtualHost 10.0.0.2:443>
+ DocumentRoot /web/host2
+ ServerName host2.apache.org
+ SSLEngine On
+ JkMount /*.jsp ajp13
+ JkMount /servlet/* ajp13
+</VirtualHost>
-</pre></blockquote>
-</td></tr></table>
+</pre>
+</blockquote>
+</td>
+</tr>
+</table>
<i>Table 3 - Excerpt from Apaches httpd.conf showing JK directives.</i>
-
-<HR>
-<h2><a name="s10">Troubleshooting and F.A.Q.s</a></h2>
+<hr>
+<h2>
+<a NAME="s10"></a>Troubleshooting and F.A.Q.s</h2>
-<h3>Q. Where can I get help/support for mod_jk?</h3>
+<h3>
+Q. Where can I get help/support for mod_jk?</h3>
A. The primary mechanism for support is through the Tomcat Documentation
included in the TOMCAT_HOME/doc directory. These documents are viewable
via browser through Tomcat <a href="http://localhost:8080/doc/index.html">http://localhost:8080/doc/index.html</a>.
-Documentation is also available on the Apache Jakarta web site for Tomcat at <a href="http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html">http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html</a>.
+Documentation is also available on the Apache Jakarta web site for Tomcat
+at <a href="http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html">http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html</a>.
<p>For additional help, the best resource is the Tomcat Users Discussion
-list. You should start by searching the mail list archives located at <a href="http://">http://mikal.org/interests/java/tomcat/index.html</a>
-before you post questions to the list. If you are unable to locate the
-answer to your question in the archive, you can post questions about Tomcat or
-mod_jk to the user list for assistance. Make sure that you include the
-version of Apache and Tomcat that you are using as well as the platform you are
-running on. <a href="http://">http://jakarta.apache.org/site/mail.html</a></p>
-
-<h3>Q. I can't find mod_jk anywhere. Where is it?</h3>
+list. You should start by searching the mail list archives located
+at <a href="http://">http://mikal.org/interests/java/tomcat/index.html</a>
+before you post questions to the list. If you are unable to locate
+the answer to your question in the archive, you can post questions about
+Tomcat or mod_jk to the user list for assistance. Make sure that
+you include the version of Apache and Tomcat that you are using as well
+as the platform you are running on. <a href="http://">http://jakarta.apache.org/site/mail.html</a>
+<h3>
+Q. I can't find mod_jk anywhere. Where is it?</h3>
A. Starting with Tomcat 3.3, the source for mod_jk is included in the native/mod_jk
-directory. You can also download the Source Distribution of Tomcat to
-obtain the source for mod_jk, which is how it was obtained in versions prior to
-Tomcat 3.3. The Binary Distributions of mod_jk are available at the same
-location as the Binary Distribution of Tomcat. The mod_jk binaries are
-located in subdirectories by platform.
-But in May 2001, the jakarta-tomcat-connectors was started and you'll find here
-up to date featured mod_jk (ie: new protocols AJP14/WARP)
-
-<h3>Q. Which protocol should I use? Ajp12 or Ajp13?</h3>
-A. Ajp13 is a newer protocol, it's faster, and it works better with SSL. You almost
-certainly want to use it. There is more information in the
-<a href="Tomcat-Workers-HowTo.html">workers.properties howto</a> document.
-
-<h3>Q. Whenever I restart Tomcat, Apache locks up!</h3>
-A. The Ajp13 protocol keeps an open socket between Tomcat and Apache. The latest
-release of mod_jk (the one found since Tomcat 3.3-m2 and J-T-C) handle the network failure.
-But with previous release of mod_jk, you may have to restart Apache as well.
-
-<h3>Q. Why did exist two files mod_jk.so (-eapi ad -noeapi) in download dir for Linux ?</h3>
-A. Many versions of Apache use of modified API, known at Extended API. For example,
-Apache using mod_ssl or Apache present in certains recent Linux distributions.
-So if you got such 'Extended Apache', you need to use mod_jk.so-eapi, or use
-mod_jk.so-noeapi for standard Apache. It's wise to avoid using EAPI modules on STD API Apache or to use standard
-API modules on EAPI Apache. Allways be sure to have the mod_jk.so for your version of Apache
-
-
-<h3>Q. What's that message about 'garbled DSO ?'</h3>
-A. It's related to Apache EAPI, the message 'mod_jk.so is garbled - perhaps this is not an Apache module DSO ?'
-just told you are trying to install a mod_jk.so DSO module that was compiled on an Apache using EAPI,
-like apache-mod_ssl or apache from Redhat distro 6.2/7.0 but your system use the standard apache
-with normal API.
-
-<h3>Q. And the message about 'module might crash under EAPI! '</h3>
-A. Also related to EAPI, the message '[warn] Loaded DSO /usr/lib/apache/mod_jk.so uses plain Apache 1.3 API,
-this module might crash under EAPI! (please recompile it with -DEAPI)', the mod_jk.so was compiled under normal
-Apache with standard API and you try to install the module on an Apache using EAPI.
-
-<h3>Q. Where can I get more information?</h3>
-A. The <a href="Tomcat-Workers-HowTo.html">workers.properties howto</a> document has
-considerably more in-depth information than this one, and is worth a look. You could
-also try searching the mailing list archives for "mod_jk" or look at the source.<h3>Q.
-APXS is getting an error during the build of mod_jk, like rc=0 or rc=255.
+directory. You can also download the Source Distribution of Tomcat
+to obtain the source for mod_jk, which is how it was obtained in versions
+prior to Tomcat 3.3. The Binary Distributions of mod_jk are available at
+the same location as the Binary Distribution of Tomcat. The mod_jk
+binaries are located in subdirectories by platform. But in May 2001, the
+jakarta-tomcat-connectors was started and you'll find here up to date featured
+mod_jk (ie: new protocols AJP14/WARP)
+<h3>
+Q. Which protocol should I use? Ajp12 or Ajp13?</h3>
+A. Ajp13 is a newer protocol, it's faster, and it works better with SSL.
+You almost certainly want to use it. There is more information in the
+<a href="Tomcat-Workers-HowTo.html">workers.properties
+howto</a> document.
+<h3>
+Q. Whenever I restart Tomcat, Apache locks up!</h3>
+A. The Ajp13 protocol keeps an open socket between Tomcat and Apache. The
+latest release of mod_jk (the one found since Tomcat 3.3-m2 and J-T-C)
+handle the network failure. But with previous release of mod_jk, you may
+have to restart Apache as well.
+<h3>
+Q. Why did exist two files mod_jk.so (-eapi ad -noeapi) in download dir
+for Linux ?</h3>
+A. Many versions of Apache use of modified API, known at Extended API.
+For example, Apache using mod_ssl or Apache present in certains recent
+Linux distributions. So if you got such 'Extended Apache', you need to
+use mod_jk.so-eapi, or use mod_jk.so-noeapi for standard Apache. It's wise
+to avoid using EAPI modules on STD API Apache or to use standard API modules
+on EAPI Apache. Allways be sure to have the mod_jk.so for your version
+of Apache
+<h3>
+Q. What's that message about 'garbled DSO ?'</h3>
+A. It's related to Apache EAPI, the message 'mod_jk.so is garbled - perhaps
+this is not an Apache module DSO ?' just told you are trying to install
+a mod_jk.so DSO module that was compiled on an Apache using EAPI, like
+apache-mod_ssl or apache from Redhat distro 6.2/7.0 but your system use
+the standard apache with normal API.
+<h3>
+Q. And the message about 'module might crash under EAPI! '</h3>
+A. Also related to EAPI, the message '[warn] Loaded DSO /usr/lib/apache/mod_jk.so
+uses plain Apache 1.3 API, this module might crash under EAPI! (please
+recompile it with -DEAPI)', the mod_jk.so was compiled under normal Apache
+with standard API and you try to install the module on an Apache using
+EAPI.
+<h3>
+Q. Where can I get more information?</h3>
+A. The <a href="Tomcat-Workers-HowTo.html">workers.properties howto</a>
+document has considerably more in-depth information than this one, and
+is worth a look. You could also try searching the mailing list archives
+for "mod_jk" or look at the source.
+<h3>
+Q. APXS is getting an error during the build of mod_jk, like rc=0 or rc=255.
I tried all of the steps in the build section, what do I do now?</h3>
-A. APXS is a Perl script that is created when you build the Apache web server
-from source. Chances are that if you are getting these errors and you
-obtained Apache as a binary distribution, that APXS is not configured correctly
-for your system. Your best bet is to get the Apache source from <a href="http://httpd.apache.org">http://httpd.apache.org</a>
-and build it yourself. Use the following for a basic build (read the
+A. APXS is a Perl script that is created when you build the Apache web
+server from source. Chances are that if you are getting these errors
+and you obtained Apache as a binary distribution, that APXS is not configured
+correctly for your system. Your best bet is to get the Apache source
+from <a href="http://httpd.apache.org">http://httpd.apache.org</a> and
+build it yourself. Use the following for a basic build (read the
Apache docs for other options):
-<blockquote><pre># cd /usr/local/src
+<blockquote>
+<pre># cd /usr/local/src
# gzip -dc apache_1.3.19.tar.gz|tar xvf -
# cd apache_1.3.19
# ./configure --prefix=/usr/local/apache \
- --enable-module=most \
- --enable-shared=max
+ --enable-module=most \
+ --enable-shared=max
# make
-# make install</pre></blockquote>
-
-<p>Note: The above steps assume that you downloaded the Apache source and placed
-it in your /usr/local/src directory.</p>
-
-
+# make install</pre>
+</blockquote>
+Note: The above steps assume that you downloaded the Apache source and
+placed it in your /usr/local/src directory.
+<br>
<hr>
-<h2><a name="s11">Credits</a></h2>
-<p>This document was originally created by
-<a href="mailto:shachor@il.ibm.com">Gal Shachor</a></p>
-
-<p>Revisions by (Alphabetical)</p>
-
-<p>Mike Braden <tt><<a href="mailto:mikeb@mwbinc.com">mikeb@mwbinc.com</a>></tt><br>
-Mike Bremford<br>
-Chris Pepper</p>
-
-<p>With help from countless others on the tomcat-dev and tomcat-user lists!</p>
-
-<table width="100%" border="0" cellpadding="10" cellspacing="0">
- <tr>
- <td>
- <p class="fineprint">
- Copyright ©1999-2001 The Apache Software Foundation<br>
- <a href="http://jakarta.apache.org/legal.html">Legal Stuff They Make Us Say</a><br>
- <a href="http://jakarta.apache.org/contact.html">Contact Information</a> </p>
- </td>
- </tr>
+<h2>
+<a NAME="s11"></a>Credits</h2>
+This document was originally created by
+<a href="mailto:shachor@il.ibm.com">Gal
+Shachor</a>
+<p>Revisions by (Alphabetical)
+<p>Mike Braden <tt><<a href="mailto:mikeb@mwbinc.com">mikeb@mwbinc.com</a>></tt>
+<br>Mike Bremford
+<br>Chris Pepper
+<p>With help from countless others on the tomcat-dev and tomcat-user lists!
+<br>
+<table BORDER=0 CELLSPACING=0 CELLPADDING=10 WIDTH="100%" >
+<tr>
+<td>
+<div class="fineprint">Copyright ©1999-2001 The Apache Software Foundation</div>
+
+<br><a href="http://jakarta.apache.org/legal.html">Legal Stuff They Make
+Us Say</a>
+<br><a href="http://jakarta.apache.org/contact.html">Contact Information</a></td>
+</tr>
</table>
+
</body>
</html>
-