Tomcat5.5.9 + Apache2.2+ ModJK

K

kris

Hi,

I need to set up connector between Tomcat5.5.9 and Apache 2.2.
Can I know how JK_MOD can be set between both of them. can give the
details of version of modjk I have to use and if you know a step by
step procedure also .

Thanks in Advance
Krishna prasad.VCVR.
 
I

IchBin

kris said:
Hi,

I need to set up connector between Tomcat5.5.9 and Apache 2.2.
Can I know how JK_MOD can be set between both of them. can give the
details of version of modjk I have to use and if you know a step by
step procedure also .

Thanks in Advance
Krishna prasad.VCVR.

Here are some instructions for Integration of Apache2 and Tomcat. I have
it on my website but my current website is down. My asshole ISP did not
like that I was running Servers off of my personal PC. So after a year
and a half they are filtering my ports. Anyway, these instructions I
wrote are for windoze but will not matter what OS.

There are two ways to integrate Apache and Tomcat: mod_jk and mod_jk2.
Mod_jk is the older but more stable version, which supports load
balancing and non-standard web application locations. Mod_jk2 is newer,
has bugs, and, as of 11/15/04, is no longer being actively developed.

*Requirements*
The first thing you need to do is:
Download the latest Apache binary from apache.org
Download the latest Tomcat binary from the Tomcat 5 section of
jakarta.apache.org.

1. Install Apache
Note the location of your Apache installation , this will be referred as
APACHE2_HOME

2. Install Tomcat 5
Note the location of your Tomcat installation, this will be referred as
TOMCAT_HOME

*Installing mod_jk*
Go to the JK 1.2 section for the mod_jk and look in the folder for
windows and download the latest mod_jk.

- Rename the downloaded file to mod_jk.so
This is very confusing but use the .so extension. Apache2 doesn't care
and DOES NOT need a DLL extension.

- Copy mod_jk.so to APACHE2_HOME/modules

*Workers Properties*
Create a workers.properties file in APACHE2_HOME/conf with the following
contents:
workers.tomcat_home=c:/tomcat5
workers.java_home=c:/jdk1_5_0_02
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1

Naturally, you will take care to set workers.tomcat_home and
workers.java_home as appropriate for your environment.

Often, people put the workers.properties file in TOMCAT_HOME/conf/jk,
however putting it in APACHE2_HOME/conf is more appropriate since its
purpose is to tell Apache about one or more local or remote Tomcat
installations.


*httpd Conf Changes*
Edit APACHE2_HOME/conf/httpd.conf and add the following to the
LoadModules section:

LoadModule jk_module modules/mod_jk.so

Edit APACHE2_HOME/conf/httpd.conf and add the following before Section 3
in the httpd.conf file:
#
# Mod_jk settings
#

JkWorkersFile "conf/workers.properties"
JkLogFile "logs/mod_jk.log"
JkLogLevel error
JkMount /jsp-examples default
JkMount /jsp-examples/* default

# End of mod_jk settings


In this test, we are directing all URLs that begin with "/jsp-examples"
to Tomcat. The name "default" corresponds to the JK worker that we
defined in APACHE2_HOME/conf/workers.properties. We define two JKMounts
in order to match the URL of "/jsp-examples" as well as any that start
with "/jsp-examples". In a real world situation, we might only direct
JSPs or servlets to the JK worker.

The location of the Jk workers.properties and log files are relative to
APACHE2_HOME. If you prefer other locations, make sure you fully qualify
the paths.

Find the line in APACHE2_HOME/httpd.conf that starts with "Port"

Make sure you have it pointing to a port that is not in use. Lately,
Apache has been coming with the "Port" directive set to "8080", which is
the same port that Tomcat will listen on. If you don't have any other
web server running, you can set it to "80" instead.

Test the httpd.conf by starting a dos command session and typing the
following at the c:> prompt:

CD APACHE2_HOME/bin apache.exe -t


*Testing*
In this test, we are directing all URLs that begin with "/jsp-examples"
to Tomcat. In a real world situation, we might only direct JSPs or
servlets to the JK worker.

Make sure no other server is running on the default Tomcat ports of
8005, 8009 and 8080. Make sure no other server is running on the Apache
port, which is normally 8080 or 80.

Start Tomcat first: Always start Tomcat first and then start Apache. If
you have to bounce Tomcat, remember to take down Apache first and
restart it after Tomcat restarts.

Start Apache: Point your browser to http://localhost and verify that you
get the default Apache page. Substitute "localhost" for the actual
machine name/IP if necessary.

Point your browser to http://localhost:8080 and verify that you get the
default Tomcat page.

Point your browser to http://localhost/jsp-examples/ and verify that you
get the index page for the Tomcat examples.

This will be served by Apache and will indicate that you have completed
your integration of Apache and Tomcat successfully.


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top