File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes mod_jk tomcat 4.1 with apache 1.3.27 on Redhat 7.2 box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "mod_jk tomcat 4.1 with apache 1.3.27 on Redhat 7.2 box" Watch "mod_jk tomcat 4.1 with apache 1.3.27 on Redhat 7.2 box" New topic
Author

mod_jk tomcat 4.1 with apache 1.3.27 on Redhat 7.2 box

Shraga van Shufel
Ranch Hand

Joined: Apr 20, 2003
Posts: 33
Hello,
I both Apache and Tomcat running as expected when I each of them separately, however I have some problems when I try to connect them.
The mod_jk is loaded correctly (as stated in the apache logs) but Apache insists of not talking to the tomcat app.
There are virtual hosts configure in the apache (which works fine with Resin btw)
I have the following lines in my httpd.conf
LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c
JkWorkersFile /tomcat/conf/workers.properties
JkLogFile /apache/log/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

In addition I have the following added to each virtual host which I like to connect to Tomcat
<IfModule mod_jk.c>
JkMount /<Path to host root dir>/* worker1
</IfModule>
I edit the /tomcat/conf/workers.properties file to point to the correspond host but still the jsp test file doesn't render correctly.
can anyone point to me what am I doing wrong ??
thanks in advance
/Shraga.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

First off, you haven't defined "worker1". Most of the examples I've seen actually call this "ajp13" and define it in the workers.properties, but you didn't list the workers.properties, so we don't know if you did that right.
A typical workers.properties (using worker name "ajp13" looks like this:
pa=\
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
You didn't mention configuration of the Connector that will be listening on tcp/ip port 8009. If you don't set that up then tomcat can't hear the requests that Apache wants to forward to it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Shraga van Shufel
Ranch Hand

Joined: Apr 20, 2003
Posts: 33
Hello,
Sorry I didn't include the settings from the worker.properties file.
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=<my virtual host>
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
thanks in advance for your help
/Shraga.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mod_jk tomcat 4.1 with apache 1.3.27 on Redhat 7.2 box