You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Hari Om <ha...@hotmail.com> on 2004/03/23 16:55:45 UTC
RE: Apache+Tomcat + MOD_JK on different machine
Thanks Randall for your reply... appreciate that!
My MOD_JK.CONF file is AUTOGENERATED on my AppServer. I start my App Server
FIRST which AUTOGENERATES "mod_jk.conf" file. So, how can I reference this
file on my HTTPD.CONF ("Include conf/mod_jk.conf") - which is indeed located
on a different machine?
Where should I place my workers.properties? should it be on App Server or
Web Server?
Should I first start App Server or Web Server or it does'nt matter?
In my HTTPD.CONF I have different mount points (example 'abc') so when I
type http://IPADDRESS/abc it shows "HTTP 400 Bad Request" on my browser
Howevere, when I type http://IPADDRESS/lmn it shows "HTTP 404 Page Not
Found" (Note: lmn is not added a JKMount in my Httpd.conf)
My MOD_JK.log file shows it added all the JKMounts.
My ACCESS_LOG file shows:
[23/Mar/2004:08:44:05 -0700] "GET /abc HTTP/1.1" 400 0
[23/Mar/2004:08:50:24 -0700] "GET /lmn HTTP/1.1" 404 301
My ERROR_LOG file shows:
[Tue Mar 23 08:41:46 2004] [notice] Apache/2.0.47 (Unix) mod_jk/1.2.2
configured -- resuming normal operations
Any related information on above is appreciated.
THANKS again!
HARI OM
>From: "Randall Svancara" <rs...@adaweb.net>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Subject: RE: Apache+Tomcat + MOD_JK on different machine Date: Tue, 23 Mar
>2004 08:15:40 -0700
>
>I would leave your httpd.conf file the same as you have it shown below. I
>would also confirm in you logs that everything is working ok. However,
>Apache should not even startup if the included configuration file,
>mod_jk.conf is not present.
>
>------------------------------
>httpd.conf (on Web Server)
>------------------------------
>LoadModule jk_module modules/mod_jk.so
>ServerName xyz.com
>
>Include conf/mod_jk.conf
>
>JkWorkersFile "conf/workers.properties"
>JkLogFile "logs/mod_jk.log"
>
>JkLogLevel debug
>
>JkMount /examples ajp13
>JkMount /examples/* ajp13
>
>
>The trick here is to make some changes to your workers.properties in order
>to connect to another box.
>It looks as if your are trying to configure a load balancer. If you are
>connecting to only one instance
>of tomcat this is not necessary. Also you need to look in your server.xml
>and see that you have the coyote connector
>running on port 8009. I would exclude the line: worker.ajp13.lbfactor=5
>from this configuration. Besides, you have not defined
>a worker for load balancer, so i believe this line is not necessary.
>I would probably write your workers.properties files the following way:
>
>------------------------------------
>workers.properties (on Web Server)
>------------------------------------
>
>workers.CATALINA_HOME=/usr/local/tomcat4
>workers.java_home=$(JAVA_HOME)
>ps=/
>
>worker.list=ajp13
>worker.ajp13.port=8009
>worker.ajp13.host=101.102.103.104
>#above is IP address of abc.com
>worker.ajp13.type=ajp13
>#Remove the following line.
>#worker.ajp13.lbfactor=5
>
>
>
>I am going to send you my workers.properties for reference. IF AND ONLY IF
>you do configure a load balancer, then make sure in your server.xml to
>change following line from:
> <Engine name="Standalone" defaultHost="localhost" debug="0">
>
>to
>
> <Engine name="Standalone" defaultHost="localhost" debug="0"
>jvmRoute="worker2" >
>This is necessary for load balancing. The value of jvmRoute should be
>equal to the worker that you want to connect to that particular instance of
>tomcat.
>
>
>#*****Begin worker.properties*****
>#
>worker.worker2.type=ajp13
>worker.worker1.type=ajp13
>#
>#Specifies the load balance factor when used with a load balancing worker.
>#Note:
>#-----> lbfactor must be > 0
>#-----> Low lbfactor means less work done by the worker.
>#
>worker.worker1.lbfactor=1
>worker.worker2.lbfactor=10
>#
>#Specify the size of the open connection cache.
>#worker.ajp13.cachesize
>#
>#------DEFAULT LOAD BALANCER WORKER DEFINITION-----------
>#
>#The loadbalancer (type lb) worker perform weighted round-robin
>#load balancing with sticky sessions.
>#Note:
>#---> If a worker dies, the load balancer will check its state once
>#in a while. Until then all work is redirected to peer worker.
>#
>worker.loadbalancer.type=lb
>worker.loadbalancer.balanced_workers=worker2,worker1
>#
>#worker.tomcat_home should point to the location where you installed
>#tomcat. This is where you have your conf, webapps and lib directories.
>#Note: Please make sure to enter the appropriate path from your machine.
>#
>worker.tomcat_home=/usr/local/tomcat
>#
>#worker.java_home should point to your Java installation.
>#Normally you should have a bin and lib directories beneath it.
>#Note: Please make sure to enter the appropriate path from your machine.
>#
>worker.java_home=/usr/local/java
>#
>#You should configure your environment slash...ps=\on NT and / on UNIX
>#and may be different elsewhere.
>#
>ps=/
>#-------ADVANCED MODE-------
>#------------------------------
>#
>#
>#-------DEFAULT worker list------
>#----------------------------------
>#
>#The worker that your plugins should create and work with
>#
>worker.list=worker2,loadbalancer, worker1
>#
>#----DEFAULT ajp13 WORKER DEFINITION-----
>#
>#Defining a worker named ajp13 and of type ajp13
>#Note that the name and the type do not have to match.
>#
>worker.worker2.port=8009
>worker.worker2.host=localhost
>worker.worker2.cachesize=100
>worker.worker2.cache_timeout=1000
>worker.worker2.socket_keepalive=3
>worker.worker2.socket_timeout=1000
>
>worker.worker1.port=8019
>worker.worker1.host=216.222.102.252
>worker.worker1.cachesize=100
>worker.worker1.cache_timeout=1000
>worker.worker1.socket_keepalive=3
>worker.worker1.socket_timeout=1000
>
>#
>#*****End worker.properties*****
>
>
>
>
>
>
>
>
>------------------------------------
>workers.properties (on Web Server)
>------------------------------------
>
>workers.CATALINA_HOME=/usr/local/tomcat4
>workers.java_home=$(JAVA_HOME)
>ps=/
>
>worker.list=ajp13
>worker.ajp13.port=8009
>worker.ajp13.host=101.102.103.104
>#above is IP address of abc.com
>worker.ajp13.type=ajp13
>worker.ajp13.lbfactor=5
>
>
>
>-----Original Message-----
>From: Hari Om [mailto:hari_om@hotmail.com]
>Sent: Tuesday, March 23, 2004 7:58 AM
>To: users@httpd.apache.org; tomcat-user@jakarta.apache.org
>Subject: Apache+Tomcat + MOD_JK on different machine
>
>
>SUBJECT: Apache+Tomcat + MOD_JK on different machine
>
>I am using Apache 2.0.47 and Tomcat 4.1.27 on my SuSE Linux. I had
>configured my mod_jk and it works just great! (My Web and App Server were
>on
>same box)
>
>Now I have a Web Server and App Server on a different box and was wondering
>what changes do I have to make to "MOD_JK" for the Integration to work.
>
>My old settings were:
>----------
>httpd.conf
>----------
>LoadModule jk_module modules/mod_jk.so
>ServerName abc.com
>
>Include /usr/local/tomcat4/conf/auto/mod_jk.conf
>
>JkWorkersFile "/usr/local/apa2047/conf/workers.properties"
>JkLogFile "/usr/local/apa2047/logs/mod_jk.log"
>
>JkLogLevel debug
>
>JkMount /examples ajp13
>JkMount /examples/* ajp13
>
>--------------------
>workers.properties
>--------------------
>
>workers.CATALINA_HOME=/usr/local/tomcat4
>workers.java_home=$(JAVA_HOME)
>ps=/
>
>worker.list=ajp13
>worker.ajp13.port=8009
>worker.ajp13.host=101.102.103.104
>#above is IP address of abc.com
>worker.ajp13.type=ajp13
>worker.ajp13.lbfactor=5
>
>
>Now that I have both APACHE and TOMCAT on DIFFERENT Boxes, I was wondering
>what changes do I have to make for the above to work.
>
>My Web Server is "xyz.com" and my App Server is "abc.com". I have mod_jk
>configured in my Web Server.
>
>My new HTTPD.CONF file is:
>My NEW settings are:
>------------------------------
>httpd.conf (on Web Server)
>------------------------------
>LoadModule jk_module modules/mod_jk.so
>ServerName xyz.com
>
>Include conf/mod_jk.conf
>
>JkWorkersFile "conf/workers.properties"
>JkLogFile "logs/mod_jk.log"
>
>JkLogLevel debug
>
>JkMount /examples ajp13
>JkMount /examples/* ajp13
>
>------------------------------------
>workers.properties (on Web Server)
>------------------------------------
>
>workers.CATALINA_HOME=/usr/local/tomcat4
>workers.java_home=$(JAVA_HOME)
>ps=/
>
>worker.list=ajp13
>worker.ajp13.port=8009
>worker.ajp13.host=101.102.103.104
>#above is IP address of abc.com
>worker.ajp13.type=ajp13
>worker.ajp13.lbfactor=5
>
>_________________________________________________________________
>Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ
>Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page FREE
download! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Apache+Tomcat + MOD_JK on different machine
Posted by Henry Martin <he...@littleplanet.com>.
On Tuesday, March 23, 2004, at 09:55 AM, Hari Om wrote:
> My MOD_JK.CONF file is AUTOGENERATED on my AppServer. I start my App
> Server FIRST which AUTOGENERATES "mod_jk.conf" file. So, how can I
> reference this file on my HTTPD.CONF ("Include conf/mod_jk.conf") -
> which is indeed located on a different machine?
I am still new to Tomcat and learning way too much every day. I have
spent a lot of time studying the documentation recently. I don't know
how to do all the setup, but remembered that the documentation says you
cannot use auto configuration when the web server and app server are on
different machines.
In tomcat-docs/jk2/jk/aphowto.html:
> Custom mod_jk configuration
>
> You should use custom configuration when :
>
> You couldn't use mod_jk.conf-auto since Tomcat engine isn't on the
> same machine that your Apache WebServer, ie when you have an Apache
> in front of a Tomcat Farm.
>
> Another case for custom configuration is when your Apache is in front
> of many differents Tomcat engines, each one having it's own
> configuration, a general case in ISP hosting
Henry Martin
Little Planet Learning, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org