Charles

Since you have the same context being used for both sites, the traffic gets
load-balanced across both sites. 
[uri:/*]
info=JSP examples, map requests for all JSP pages to Tomcat.
context=/

If you need certain kinds of traffic to go to one site and certain others to
go to the other site, then you will need to specific different contexts for
the two sites.
-- Kartheek Hirode
    


-----Original Message-----
From: Charles P. Killmer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 26, 2004 2:33 PM
To: Tomcat Users List
Subject: Load balancing


I have two sites set up and currently they are acting like they are load
balanced.  That's the problem. They shouldn't be.  This is my
workers2.properties file.  Does anyone have an idea of why it would be
alternating between the two sites?

[shm:]
info=Shared memory file. Required for multiprocess servers 
file=C:\Tomcat\work\jk2.shm 
size=1000000

[channel.socket:172.16.10.39:8009]
info=Ajp13 worker, connects to tomcat instance using AJP 1.3 protocol
tomcatId=172.16.10.39:8009

[channel.socket:172.16.10.38:8009]
info=Ajp13 worker, connects to tomcat instance using AJP 1.3 protocol
tomcatId=172.16.10.38:8009

[uri:/*]
info=JSP examples, map requests for all JSP pages to Tomcat.
context=/


This is my server.xml

<?xml version='1.0' encoding='utf-8'?>
<Server>
  <Listener
className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/
>
  <GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer"
value="30"/>
    <Resource auth="Container" description="User database that can be
updated and saved" name="UserDatabase"
type="org.apache.catalina.UserDatabase"/>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
 
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>
  <Service name="Site1">
    <Connector acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true" port="8080" address="172.16.10.39"
redirectPort="8443">
    </Connector>
    <Connector port="8009" address="172.16.10.39" protocol="AJP/1.3"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
redirectPort="8443">
    </Connector>
    <Engine defaultHost="Site1.com" name="Site1">
        <Host name="Site1.com" debug="0" appBase="c:\sites\Site1"
unpackWARs="true" autoDeploy="false" xmlValidation="false"
xmlNamespaceAware="false">
        <Context path="" docBase="c:/sites/Site1" debug="0"/>
        <Valve
className="org.apache.catalina.authenticator.SingleSignOn" debug="0"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"  prefix="client-domain." suffix=".txt" pattern="common"
resolveHosts="false"/>
        <Logger className="org.apache.catalina.logger.FileLogger"
directory="logs"  prefix="client-domain2." suffix=".txt"
timestamp="true"/></Host>

      <Logger className="org.apache.catalina.logger.FileLogger"
prefix="Site1_log." suffix=".txt" timestamp="true"/>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
    </Engine>
  </Service>

  <Service name="Site1">
    <Connector acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true" port="8080" address="172.16.10.38"
redirectPort="8443">
    </Connector>
    <Connector port="8009" address="172.16.10.38" protocol="AJP/1.3"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
redirectPort="8443">
    </Connector>
    <Engine defaultHost="Site2.com" name="Site2">
        <Host name="Site2.com" debug="0" appBase="c:\sites\Site2"
unpackWARs="true" autoDeploy="false" xmlValidation="false"
xmlNamespaceAware="false">
        <Context path="" docBase="c:/sites/Site2" debug="0"/>
        <Valve
className="org.apache.catalina.authenticator.SingleSignOn" debug="0"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"  prefix="client-domain." suffix=".txt" pattern="common"
resolveHosts="false"/>
        <Logger className="org.apache.catalina.logger.FileLogger"
directory="logs"  prefix="client-domain2." suffix=".txt"
timestamp="true"/></Host>

      <Logger className="org.apache.catalina.logger.FileLogger"
prefix="Site2_log." suffix=".txt" timestamp="true"/>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
    </Engine>

  </Service>
</Server>


I have a file called test.jsp in the root of each site.  If I run with
this setup, I get site1's test.jsp then if I hit refresh I get site2's
test.jsp.

This is IIS using the Isapi_redirector.dll to proxy requests to the
tomcat engine.

Thanks for any help
Charles Killmer

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

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

Reply via email to