Forum Moderators: phranque

Message Too Old, No Replies

Integrating Apache and Tomcat

How integrate Apache with Tomcat?

         

jroblesfu

6:24 pm on Aug 18, 2005 (gmt 0)

10+ Year Member



Hi, Im stuck trying to integrate apache and tomcat Im using Apache 2.0.54 Tomcat 5.5.9 and mod_jk-1.2.14 module on Windows XP Prof. Each of them works fine, Apache (http://localhost) Tomcat (http://localhost:8080) but when I try to load content of tomcat through apache i get error 404 page (file not found).
I modify the httpd.conf file to load the module with this:

LoadModule jk_module modules/mod_jk.so
JkWorkersFile "C:/Apache2/conf/workers2.properties"

I created the workers2.properties file:

[logger.apache2]
file=”C:\Apache2\logs\error.log”
level=INFO
debug=1

[config]
file=C:/Apache2/conf/workers2.properties
debug=0

[shm]
file=C:\Apache2\conf\jk2.shm
size=1000000

[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
tomcatId=localhost:8009

[ajp13:localhost:8009]
channel=channel.socket:myTomcat

[status:status]

[uri:/jsp-examples/*]
info=mapping the jsp-examples context of Tomcat

[uri:/tomcat-docs/*]
info=mapping the docs of Tomcat

Thanks if you can help me

Jesus

jbarilow

1:27 pm on Sep 22, 2005 (gmt 0)



Did you ever get this to work? I am having the same issues. I found where a document said to have tomcat start and generate an apache auto config file, but I cannot get that to work.

I am running
Apache 2
Tomcat 5.5

jroblesfu

1:42 pm on Sep 23, 2005 (gmt 0)

10+ Year Member



Hi, the only way that I found to get this work was using Apache 2 and Tomcat 5.5 but using mod jk2 connector, I got mod_jk2.dll file and placed in \Apache2\modules directory.
I used this directive in httpd.conf file:

LoadModule jk2_module modules/mod_jk2.dll

Placed the workers2.properties on \Apache2\conf directory, here is it:

#define the shared memory file
[shm]
file=c:/Apache2/logs/jk2.shm
size=1048576

# Define the communication channel
[channel.socket:localhost:8009]
tomcatId=localhost:8009
port=8009
host=127.0.0.1

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[uri:/servlets-examples/*]
worker=ajp13:localhost:8009

[uri:/jsp-examples/*]
worker=ajp13:localhost:8009

[uri:/servlets-examples]
worker=ajp13:localhost:8009

[uri:/jsp-examples]
worker=ajp13:localhost:8009

[uri:/servlets-examples/servlet/*]
info=Prefix mapping

[uri:/jsp-examples/*.jsp]
info=Extension mapping

[uri:/tomcat-docs/*]
worker=ajp13:localhost:8009

[uri:/manager/html/*]
worker=ajp13:localhost:8009

[uri:/admin/*]
worker=ajp13:localhost:8009

[uri:/balancer/*]
worker=ajp13:localhost:8009

[status:]
info=Status worker, displays runtime information
channel=channel.socket:localhost:8009

[uri:/status/*]
worker=status:localhost:8009
group=status:

Finally I placed the jk2.properties file in \Tomcat5\conf directory, here is it:

#Shared memory directive
shm.file=c:/Apache2/logs/jk2.shm
channelJni.disabled = 0
channelSocket.port=8009

I hope this can help you, that was the only way that i found to get it work, there's not much info about it, and the available is old.

Jesus