tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Williams <>
Subject Re: Apache 2.0.43, Tomcat 4.1.18 and mod_jk2 problems
Date Tue, 15 Apr 2003 22:43:47 GMT
John and any other mod_jk2 installation people having issues,

Maybe these instructions will help.  After HOURS of frustration, I
documented (and reproduced on another machine) the EXACT steps to
install and configure apache, tomcat, and mod_jk2 (all documents I found
covered parts of these three steps but never all).  Obviously additional
configurations need to be made to make the situation production quality,
but it gets everything integrated and running together!

If anyone has comments about these steps, please let me know.


Kevin Williams

Steps to combine apache and tomcat:

I decided to use mod_jk2 since there were no binaries of either mod_jk
or that worked for me, and mod_jk2 is supposed to replace
mod_jk.  Through trial and error, an
advantage that mod_jk has over mod_jk2 is the auto configure option. 
mod_jk2 does NOT 
have this option.

The default RPM Apache install from Redhat does NOT work!  Something to
do w/ the wrong 
version of the mod_jk2.c file.  Instead use the latest source download. 
I used 2.0.45.

Steps to install apache.
1.  Download the apache source file.  I used the latest (v.2.0.45). 
This can be found
2.  Extract the file to wherever you want.
3.  Navigate into the {install_root_folder}
4.  execute: ./configure --enable-mods-shared=all
5.  execute:  make
6.  execute:  make install
7.  To start, execute: PREFIX/bin/apachectl start (to stop
PREFIX/bin/apachectl stop)
9.  Make any custom changes required in the httpd.conf file
8.  verify it runs

Steps to install tomcat4:
1.  Download the tomcat4 RPM.  I used the latest (v4.1.18).  This can be
found at
2.  log in as root and run the rpm (rpm -xvf {file})
3.  This will add tomcat as a service, start the service
4.  Make any custom changes required in the server.xml file
5.  Add your application
4.  Type in http://www.localhost:8080/app_name to make sure it works

Steps to create
1.  Download the mod_jk2 source file.  I used the latest at the time
(which was v.2.0.2).
I found it at
2.  extract the file to wherever you want.
3.  find the apxs file on your computer.  For me, it was in
4.  navigate to
5.  execute:  ./
6.  execute:  ./configure --with-apxs2=/usr/local/apache2/bin/apxs
--with-apache2-lib=/usr/local/apache2/lib --with-tomcat41=/var/tomcat4
7.  execute:  make (the is now created)
8.  move to the
9.  Verify the and files are created.
10.  Copy these file to your appache modules install folder.  For me, it

Steps to integrate w/ Tomcat and Apache:
1.  Add the following line into httpd.conf file:
LoadModule jk2_module modules/

2.  create a file in the same conf folder as
httpd.conf.  This file should
contain something like (this file configures apache to work with jk2):
#jk2 config


# Define the communication channel

#define worker

# Map the dev webapp to the Web server uri space
info=Map the whole webapp

3.  navigate to tomcat's conf directory.  For me, it is /etc/tomcat4
4.  if there is no jk directory, create it.
5.  navigate into the jk directory
6.  Create/Edit the file.  It should contain something
similar to the following:

# added by kevin--this is the tomcat portion of jk2.  the channelsocket
uses tcp/ip
#(unixSocket is available as well)

7.  Edit the server.xml file in tomcat's configuration directory.  The
default install
	had the mod_jk2 connector uncommented, and the mod_jk commented out. 
Make sure
	the mod_jk2 connector is active.  It should be the only connector
listening on port 8009.
	It looks like:

		    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
				<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="0"

8.  Restart Tomcat
9.  Restart Apache
10.  enter your app's name w/ the tomcat standalone port of 8080 (make
sure it works)
11.  remove the 8080 and see if the apache to tomcat forwarding works.
12.  If desired remove the Connector that listens to port 8080 from
tomcat's server.xml file.

On Tue, 2003-04-15 at 13:56, O'Neill, John wrote:
> We have recently tried to move to the and have problems getting
> it configured correctly.  I tried to use the some documentation provided in
> JBoss, but have not gotten there yet.
> We've created a new and, changed
> httpd.conf LoadModule to load  I'm including the files below.
> Does anyone have a clue?  Is anyone using mod_jk2?
> Thanks,
> John
> #---
> # Shared memory handling. Needs to be set.
> [shm]
> file=/u/web/apache/apache20/logs/shm.file
> size=1048576
> # Example socket channel, explicitly set port and host.
> [channel.socket:myip:8009]
> #[channel.socket:localhost:8009]
> port=8009
> host=myip
> # Example UNIX domain socket
> [channel.un:/u/web/tomcat/tomcat4118/work/jk2.socket]
> tomcatId=myip:8009
> #tomcatId=localhost:8009
> debug=0
> # define the worker
> #[ajp13:localhost:8009]
> [ajp13:myip:8009]
> channel=channel.un:/u/web/tomcat/tomcat4118/work/jk2.socket
> # To use the TCP/IP socket instead, just comment out the above
> # line, and uncomment the one below
> #channel=channel.socket:localhost:8009
> # Announce a "status" worker
> [status:status]
> # Uri mapping
> [uri:/examples/*]
> #worker=ajp13:localhost:8009
> worker=ajp13:/u/web/tomcat/tomcat4118/work/jk2.socket
> [uri:/status/*]
> worker=status:status
> #---- end of
> #---- begin
> # list of needed handlers.
> #handler.list=apr,channelSocket,channelUnix,request
> handler.list=channelSocket,channelUnix,request
> # Set the default port for the channelSocket
> channelSocket.port=8009
> # State where the UNIX domain socket is located
> channelUnix.file=/u/web/tomcat/tomcat4118/work/jk2.socket
> # Dynamic library
> serverRoot=/u/web/apache/apache2
> #apr.NativeSo=/usr/local/tomcat/lib/
> #---- end of
> ****************************************************************************
> This email may contain confidential material.
> If you were not an intended recipient, 
> please notify the sender and delete all copies.
> We may monitor email to and from our network.
> ****************************************************************************
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message