Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache2+Tomcat4 on Win2k? How-to setup?

Status
Not open for further replies.

josephlai

Technical User
Aug 7, 2002
8
MO
Hi, I'm trying to setup Apache2.0 + Tomcat4.0 (using the AJP Connector). I am doing this on Windows2000 Platform. I read the document on Tomcat4 & Apache2 but still very confusing. I downloaded the mod_jk.dll and modified the config. file of both Tomcat & Apache. Then I started Tomcat (it started OK) and Apache -- it failed to start.

Does anyone has a step-to-step instruction on how to connect Tomcat+Apache correctly?

thank you very much.
Joseph.





 
Apache 2.0.39 and Tomcat 4.0.4 configuration instructions:

NOTE: Avoid empty spaces in your installation directory names!!!
Do not place anything under Program Files/Apache Group...etc.

If you have already installed Tomcat and Apache in folders with spaces, after renaming the folders,
execute regedit and change all the file paths for Apache and Tomcat. Simple reinstall will not work.

1. Install java standard edition, j2sdk1.4.0
a. set JAVA_HOME={j2sdk install dir}
b. add entry to Path variable %java_home%\bin
c. add new user variable classpath = %java_home%\bin

2. Install Apache and Tomcat.
a. set APACHE_HOME={Apache_dir}
b. set TOMCAT_HOME={Tomcat dir}


2. In tomcat_home/conf dir:
a. Modify server.xml file:
after the Server port="8005"..., add these lines :

<Listener className=&quot;org.apache.ajp.tomcat4.config.ApacheConfig&quot; modJk=&quot;{apache_home}/modules/mod_jk.dll&quot;
jkDebug=&quot;info&quot; workersConfig=&quot;{tomcat_home}/conf/workers.properties&quot; jkLog=&quot;{tomcat_home}/logs/mod_jk.log&quot; />

b. Version 4.0.4 of Tomcat does not have a workers.properties file, so you may use the following
lines to put in you {tomcat_home}/conf directory as workers.properties file:

workers.tomcat_home={tomcat_home}\conf
workers.java_home=$(JAVA_HOME)
ps=
worker.list=ajp13, ajp14
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1

worker.ajp14.port=8010
worker.ajp14.host=localhost
worker.ajp14.type=ajp14
worker.ajp14.secretkey=secret
worker.ajp14.credentials=myveryrandomentropy
worker.ajp14.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr



3. You need the mod_jk.dll file, its available from (Windows), make sure its the version for Apache2.

4. in {apache_home}/conf in httpd.conf file:


a. After the lines LoadModule...add this line:

Include {Tomcat_home}/conf/auto/mod_jk.conf

b. At the very bottom of this file, add the following lines:

JkWorkersFile &quot;{tomcat_home}/conf/workers.properties&quot;
JkLogFile &quot;{tomcat_home}/logs/mod_jk.log&quot;

JkLogLevel debug

JkMount /{your_webapp_here} ajp13
JkMount /{your_webapp_here}/* ajp13

JkMount /examples ajp13
JkMount /examples/* ajp13

JkMount /jk ajp13
JkMount /jk/* ajp13

JkMount /cocoon ajp13
JkMount /cocoon/* ajp13

5. Remember to start the Tomcat first, on port 8080(default). After its started, if all goes well, check the
{tomcat_home}/conf directory, it should contain auto folder (its automatically created at startup)
with mod_jk.conf file in it.
Start Apache.
Point your browser to The index page for the examples should display.

Congratulations, You have successfully configured Apache to work with Tomcat through ajp13 connector!

check it out, it seems to work.
alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top