OBJECTIVE:
     I have apache (actually stronghold) running on a solaris
machine that I would like to use to load balance two tomcat
instances (on separate machines).

PROBLEM EXPERIENCED:
     When I make a request to apache which I expect to be load
balanced over the two tomcat instances, I receive an "Internal
Server Error" (HTTP code 500) and there are no entries in the
error_log, the mod_jk.log nor the tomcat.log



PROCEDURE:
     Being a newcomer to tomcat, take what I say with a grain of
salt.  I have three physical machines (i.e. host1, host2, host3)
on which I am running apache, tomcat instance 1 and tomcat
instance 2, respectively.  I am able to kick off the two tomcat
processes (i.e. JVMs) correctly and I can make HTTP requests
directly to them.  In the  server.xml file each of the instances,
I have the following tags to allow for ajp12 and ajp13
communication with apache:

        <!-- Apache AJP12 support. This is also used to shut down
tomcat. -->
        <Connector
className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler
"/>
            <Parameter name="port" value="8000"/>
        </Connector>

        <!-- adding support for ajp13 -->
        <Connector
className="org.apache.tomcat.service.PoolTcpConnector">
          <Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler
"/>
          <Parameter name="port" value="8001"/>
        </Connector>


In apache's httpd.conf file, I have added an include tag for
mod_jk.conf and in the mod_jk.conf file I reference the
workers.properties that I would like to use (i.e. JkWorkersFile).
I define the following in the workers.properties.  The intent of
this is to have apache load balance the JVMs on host2 and host3:






======================== begin workers.properties
======================================
#
# workers.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and
lib
# directories.
#
workers.tomcat_home=/home/myUsername/tomcat

#
# workers.java_home should point to your Java installation.
Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/usr/java

#
# You should configure your environment slash... ps=\ on NT and /
on UNIX
# and maybe something different elsewhere.
#
ps=/

##########################################
# define 4 tomcat workers
#########################################

# tomcat1, ajp12 and 13
worker.tomcat1_ajp12.port=8000
worker.tomcat1_ajp12.host=host2
worker.tomcat1_ajp12.type=ajp12
worker.tomcat1_ajp12.lbfactor=1

worker.tomcat1_ajp13.port=8001
worker.tomcat1_ajp13.host=host2
worker.tomcat1_ajp13.type=ajp13
worker.tomcat1_ajp13.lbfactor=1
# worker.tomcat1_ajp13.cachesize=10


# tomcat2, ajp12 and 13
worker.tomcat2_ajp12.port=8000
worker.tomcat2_ajp12.host=host3
worker.tomcat2_ajp12.type=ajp12
worker.tomcat2_ajp12.lbfactor=1

worker.tomcat2_ajp13.port=8001
worker.tomcat2_ajp13.host=host3
worker.tomcat2_ajp13.type=ajp13
worker.tomcat2_ajp13.lbfactor=1
# worker.tomcat2_ajp13.cachesize=10


##########################################
# define the worker list to be empty
# because I would like to the run the JVMs
# in a separate process
#########################################
worker.list=

##############################################
# tell apache to load balance the 4 workers
#############################################
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1_ajp12,
tomcat1_ajp13, tomcat2_ajp12, tomcat2_ajp13
======================== end workers.properties
======================================







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to