Now I am definitely getting files from both sites.  Though something
weird is happening.  I have a file in the root of each named test.jsp.
In the file it is simply do out.print("site1.com"); and the other file
is doing out.print("site2.com");

When I point a broewser to the site, it alternates between the two when
I hit refresh.  I think it has something to do with my
workers2.properties file.

[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=/


Do you see anything wrong with this?
Charles

-----Original Message-----
From: Mike Curwen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 26, 2004 12:45 PM
To: 'Tomcat Users List'
Subject: RE: Host Directive

Upon further reading of the docs, it appears you do need more than one
service.  From the docs:
"A Service element represents the combination of one or more Connector
components that share a single Engine component for processing incoming
requests"
and:
"Exactly one Engine element MUST be nested inside a Service element,
following all of the corresponding Connector elements associated with
this Service."
 
Here's what I propose (with extraneous elements removed):


<?xml version='1.0' encoding='utf-8'?>
<Server>

  <Service name="Site1Service">
    
    <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"/>
                </Host>
    </Engine>

        </Service>
        
        <Service name="Site2Service">
        
    <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"/>
    </Engine>

  </Service>
</Server>


> -----Original Message-----
> From: Charles P. Killmer [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 26, 2004 11:59 AM
> To: Tomcat Users List
> Subject: RE: Host Directive
> 
> 
> Additional <Service elements, Would I then create additional <Engine 
> elements?  And if so, how do I tell the connector to you the 
> appropriate Engine?
> 
> IE  This doesn't work though.  It always gives me Site2.
> 
> <?xml version='1.0' encoding='utf-8'?> <Server>
>   <Listener
> className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
>   <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycle
> Listener"/
> >
>   <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>
> 
>     <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>
> 
> 
> Thanks for your help.  Its these forums that I love about open source.

> Charles
> 


---------------------------------------------------------------------
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