mod_jk, apache, Tomcat - need some help
am 06.07.2007 19:12:04 von Jeff I
Hello,
I am having a heck of a time getting apache to talk to tomcat via
mod_jk. The tomcat servlets run great, I just need (for example)
www.mysite.com/home instead of www.mysite:8080/home. Currently
mod_jk.conf is generated by Tomcat in ${CATALINA_HOME}/conf/auto.
Here are some of the other details:
Info:
Tomcat 6.0.13
Apache 2.0.54
Java 1.6.0-02
OS Mandriva 2006
Workers.properies:
# Define 1 real worker using ajp13
worker.list=ajp13
workers.tomcat_home=/opt/tomcat/apache-tomcat-6.0.13
workers.java_home=/usr/java/jdk1.6.0_02
ps=/
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
server.xml:
.....
modJk="/etc/httpd/modules/mod_jk.so" />
.....
....
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
append="true" forwardAll="false"
modJk="/etc/httpd/modules/mod_jk.so" />
....
httpd.conf
....
#To add mod_jk support
LoadModule jk_module modules/mod_jk.so
....
Include /opt/tomcat/apache-tomcat-6.0.13/conf/auto/mod_jk.conf
#end of file
Re: mod_jk, apache, Tomcat - need some help
am 09.07.2007 17:57:52 von AMBhatti
On Jul 6, 10:12 am, Jeff I wrote:
> Hello,
>
> I am having a heck of a time getting apache to talk to tomcat via
> mod_jk. The tomcat servlets run great, I just need (for example)www.mysite.com/homeinstead ofwww.mysite:8080/home. Currently
> mod_jk.conf is generated by Tomcat in ${CATALINA_HOME}/conf/auto.
>
I just went through this myself - but on WinOS. The difference for me
was using Apache 2.2 and Tomcat 5.5 so my advice may not be quite on
target for your needs. However, the final issue was not Apache so
much as it was understanding how Tomcat works. Read through the
Tomcat documentation again and note the ROOT and WEBINF directores -
they have specific purposes.
read:
http://tomcat.apache.org/connectors-doc/generic_howto/quick. html
Two things I noticed off the top:
httpd.conf
Need a line like:
# Send everything for context /examples to worker named worker1
(ajp13)
JkMount /examples/* worker1
server.xml
-- do you have an AJP13 connector defined?
allowTrace="true" />
-- to get it to respond (Tomcat) back to Apache correctly, you will
also need to define a HOST element
unpackWARs="false" autoDeploy="false" workDir="e:/http-test">
swallowOutput="true">
-- Also note that the above HOST points to the /ROOT folder as the
starting place - ie. the place where all my html files are located. I
pointed the Apache virtual host (DocumentRoot "e:\http-test\ROOT") to
this location as well. Then things started working "properly".
=== hope this helps!!