Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed all content of the page. The jk2 connector is obsolete and should not be used. If anyone is interested, they can see the old version of the page in the history.

This document is intended to explain how to get the JK2 connector to work with Apache2 and Tomcat 4.1.18+. This document provides a step by step process for doing so.

(error) JK2 is deprecated!

Building

  1. Download the jakarta-tomcat-connectors package
  2. install httpd-devel and httpd RPMs
  3. Ensure you have libtool, gcc and the various build tools
  4. go into the jakarta-tomcat-connectors/jk/ directory
    1. edit build.properties. Set "apache2.home" to /usr and "apache2.include" to /usr/include/httpd.
    2. if you have apache13 installed in a separate dir - set apache13.home=DIR, otherwise set it to "none"
    3. if you are on gentoo - apache2.include will be /usr/include/apache2
    4. if you built your own apache - it must be APACHE/include
    5. On Red Hat 8, make a symlink between /usr/lib/libapr.so to /usr/lib/libapr-0.so ( the "right" name )

If you are building using configure/make:

  1. See note (below) regarding some changes you may need to make to a Makefile
  2. go into the jk/native2 directory
  3. type ./buildconf.sh
  4. type ./configure --with-apxs=(location of your apxs installed by apache-devel)
    1. an actual sample configure:./configure --with-apxs2=/usr/sbin/apxs --with-apache2-lib=/usr/lib --with-tomcat41=/usr/local/tomcat-4 --with-apr-lib=/usr/lib --with-jni
  5. type make
    1. mod_jk2.so and libjkjni.so will be in jk/build/jk2/apache2/
    2. instructions on using libtool to finish are emitted at the end of the make process

If you are building using ant:

  1. do "ant jkant" ( in j-t-c/jk ). This will build the ant tasks
  2. cd native2
  3. "ant"
  4. mod_jk2.so will be in jk/build/jk2/apache2,
  5. libjkjni.so will be in jk/builld/jk2/jni

After you compile:

  1. copy mod_jk2.so to APACHE/modules
  2. copy libjkjni.so to JAVA_HOME/jre/lib/i386 ( you can also modify java.library.path - but this is simpler )

Note: depending upon version and configuration, you may need to modify the Makefile. Those changes are needed if the sources are older than JTC_M1 ( Apr 10, 2003 ? )

In native2/server/apache/Makefile.in, find the line:

No Format

JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt -lapr-0 <at:var at:name="PCRE_LIBS" />

In order to compile and run on my Red Hat 8.0 installation the following changes are required:

No Format

JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt -lapr-0 '''-laprutil -lgdbm -lexpat -ldb''' <at:var at:name="PCRE_LIBS" />

The changes are in bold. The changes are only necessary if you actually intend to use jkini.so, e.g., for UNIX domain sockets.

NOTE: this was to build with the RH 8 binary distribution of Apache, which provides libapr. Notice the difference between what RH 8 distributes, and an official Apache distribution of 2.0.44:

No Format

1356728 Feb 16 23:45 httpd-2.0.44/srclib/apr/.libs/libapr-0.so.0.9.2 
 772970 Feb 16 23:46 httpd-2.0.44/srclib/apr-util/.libs/libaprutil-0.so.0.9.2
No Format
 
 205700 Oct 9 08:04  /usr/lib/libapr.so.0.0.0
 102532 Oct 9 08:04  /usr/lib/libaprutil.so.0.0.0

You should also replace jkjni with libjkjni.

Configuration

page is obsolete. All content was removed. See the Connectors documentation on the Tomcat site.

...

CategoryObsoleteSee Tomcat/Jk2Connector (Using the JK2 Connector)