Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes how to use connectors for apache and tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to use connectors for apache and tomcat" Watch "how to use connectors for apache and tomcat" New topic

how to use connectors for apache and tomcat

D.Ajay Kumar

Joined: Oct 19, 2002
Posts: 2
if anybody can help me in useing the jk2 connectors how to have connection with apache and tomcat
Afroz Ahmed
Ranch Hand

Joined: Jan 18, 2004
Posts: 64
Here is the procedure for connecting Apache and Tomcat using JK1.2. on windows systems.
1)download following things(Apache site)
Apache 1.3.27
Jakarta-Tomcat 4.1.12
mod_jk v1.2

2)install apache,tomcat and test them.
3)Add <connector> element to in server.xml file like below so that tomcat is listening for AJP13 requests coming from JK1.2. like below
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>

Above element makes sure that the incoming requests coming at port 8009 will be sericed by Ajp13Connector.
4)Now we need to create a tomcat worker in tomcat worker file,which tells Apache how and when to talk with tomcat.

And save the file as and place it at Tomcat's [/B][/B]<CATALINA_HOME>/conf directory.
5)Now tell Apache to talk to that worker whenever needed by modifying the httpd.conf file at <APACHE_HOME>/conf directory.
6)copy mod_jk(dll file) module to the <APACHE_HOME>/libexec directory.
7)Tell Apache to load the module by adding below to httpd.conf file
LoadModule jk_module libexec/mod_jk-1.3.26.dll
AddModule mod_jk.c

and tell the wrokers file location by
JkWorkersFile C:/Tomcat/conf/
8)Tell Apache that we want all requests like /examples/servlet/* and /examples/*.jsp to be rerouted and serviced by the worker named myWorker.This is accomplished using the JkMount directive, as follows.
JkMount /examples/servlet/* myWorker
JkMount /examples/*.jsp myWorker

9)Start Apache and tomcat and test them first.
10)Test connection by typing
http://localhost/examples/servlets/index.html or
http://localhost/examples/a.jsp (if already a.jsp at tomcat/examples)
on adress location of your browser.
If you get any problem,check the whole above things..Thanks.

[ April 14, 2004: Message edited by: Mohd Afroz Ahmed ]

The value of an idea lies in the usage of it.
I agree. Here's the link:
subject: how to use connectors for apache and tomcat
It's not a secret anymore!