You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by gu...@resolution.com on 2006/09/14 01:03:51 UTC

Three hostnames in one instance of tomcat

I want to configure Tomcat so that I can have three hostnames live
on the same physical machine, but each have their own separate areas.
with one instance of Tomcat?

Users would hit URL's such as:

http://host1/
http://host2/
http://host3/

where each host should have its own webapps directory on the machine.
For example,

host1 --> /tomcat5/access/WEB-INF
host2 --> /tomcat5/ihl/WEB-INF
host3 --> /tomcat5/ulc/WEB-INF

I've tried several things including the addition of a three <Host>
directive underneath <Engine> but I can't seem to make it work. I
would appreciate a tip or a sample configuration file.

I've searched the web a bit and there seem to be several references to
having Apache (HTTP Server) in front of Tomcat. However, I don't
need/want a separate HTTP Server for now.

my server.xml
--------------------------------------------------
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener
className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
  <GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />

  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />
    <Connector port="8009" 
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <Engine name="Standalone" defaultHost="access1.resolution.com" debug="0"
jvmRoute="jvm1">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
      <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true">
                <Context path="" docBase="ROOT" debug="0"/>
      </Host>

      <Host name="access1.resolution.com" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

	<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
                driverName="com.edb.Driver"                 
                connectionURL="jdbc:edb://baba1:9999/development"
		connectionName="test"
		connectionPassword="test"
                userTable="dbuser"
                userNameCol="username"
                userCredCol="password"
                userRoleTable="user_classes"
                roleNameCol="classDescription" 
        />

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="access1_log." suffix=".txt" debug="99"
                timestamp="true"/>

        <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                 managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                 expireSessionsOnShutdown="false"
                 useDirtyFlag="true"
                 notifyListenersOnReplication="true">

            <Membership 
                className="org.apache.catalina.cluster.mcast.McastService"
                mcastAddr="228.0.0.4"
                mcastPort="45564"
                mcastFrequency="500"
                mcastDropTime="3000"/>
            
            <Receiver 
                className="org.apache.catalina.cluster.tcp.ReplicationListener"
                tcpListenAddress="access1"
                tcpListenPort="4001"
                tcpSelectorTimeout="100"
                tcpThreadCount="6"/>

            <Sender
                className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                replicationMode="pooled"
                ackTimeout="15000"
                waitForAck="true"/>

            <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
                  
filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
                   
            <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                      tempDir="/tmp/war-temp/"
                      deployDir="/tmp/war-deploy/"
                      watchDir="/tmp/war-listen/"
                      watchEnabled="false"/>
                      
            <ClusterListener
className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
        </Cluster>
        
        <Context    path="/access" 
                    docBase="/web/sites/dbAccess" 
                    debug="0" 
                    reloadable="true">
        
        <Logger     className="org.apache.catalina.logger.FileLogger"
                    prefix="access_log." suffix=".txt" debug="99"
                    timestamp="true"/>
                                  
        <Resource   name="jdbc/ifx"
                    auth="Container"
                    type="javax.sql.DataSource"
                    username="test"
                    password="test"
                    driverClassName="com.edb.Driver"
                    url="jdbc:edb://baba1:9999/development"
                    validationQuery="SELECT dbuser.id FROM dbuser WHERE id = 1"
                    maxActive="20"
                    maxIdle="20"
                    maxWait="10000"/>
               
        <Resource   name="jdbc/workflow"
                    auth="Container"
                    type="javax.sql.DataSource"
                    username="test"
                    password="test"
                    driverClassName="com.edb.Driver"
                    url="jdbc:edb://baba1:9999/workflowdb"
                    maxActive="0"
                    maxIdle="20"
                    maxWait="10000"/>

        <Resource   name="jdbc/azure"
                    auth="Container"
                    type="javax.sql.DataSource"                    
                    username="test"
                    password="test"                    
                    driverClassName="org.objectweb.cjdbc.driver.Driver"        
           
                    url="jdbc:edb://baba1:9999/azure"
                    maxActive="0"
                    maxIdle="20"
                    maxWait="10000"/>        
        </Context>
        
      </Host>
      
      
      <Host name="ihl1.resolution.com" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

       
	<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
                driverName="com.edb.Driver"                 
                connectionURL="jdbc:edb://baba1:9999/development"
		connectionName="test"
		connectionPassword="test"
                userTable="dbuser"
                userNameCol="username"
                userCredCol="password"
                userRoleTable="user_classes"
                roleNameCol="classDescription" 
        />
        

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="ihl1_log." suffix=".txt" debug="99"
                timestamp="true"/>
        
        <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                 managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                 expireSessionsOnShutdown="false"
                 useDirtyFlag="true"
                 notifyListenersOnReplication="true">

            <Membership 
                className="org.apache.catalina.cluster.mcast.McastService"
                mcastAddr="228.0.0.4"
                mcastPort="45564"
                mcastFrequency="500"
                mcastDropTime="3000"/>
            
            <Receiver 
                className="org.apache.catalina.cluster.tcp.ReplicationListener"
                tcpListenAddress="ihl1"
                tcpListenPort="4001"
                tcpSelectorTimeout="100"
                tcpThreadCount="6"/>

            <Sender
                className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                replicationMode="pooled"
                ackTimeout="15000"
                waitForAck="true"/>

            <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
                  
filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
                   
            <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                      tempDir="/tmp/war-temp/"
                      deployDir="/tmp/war-deploy/"
                      watchDir="/tmp/war-listen/"
                      watchEnabled="false"/>
                      
            <ClusterListener
className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
        </Cluster>
                
        
        <Context    path="/ihl" 
                    docBase="/web/sites/ihl" 
                    debug="0" 
                    reloadable="true">
        
        <Logger     className="org.apache.catalina.logger.FileLogger"
                    prefix="ihl_log." suffix=".txt" debug="99"
                    timestamp="true"/>
                                  
        <Resource   name="jdbc/ifx"
                    auth="Container"
                    type="javax.sql.DataSource"
                    username="test"
                    password="test"
                    driverClassName="com.edb.Driver"
                    url="jdbc:edb://baba1:9999/development"
                    validationQuery="SELECT dbuser.id FROM dbuser WHERE id = 1"
                    maxActive="20"
                    maxIdle="20"
                    maxWait="10000"/>
               
        <Resource   name="jdbc/pgsql"
                    auth="Container"
                    type="javax.sql.DataSource"
                    username="test"
                    password="test"
                    driverClassName="com.edb.Driver"
                    url="jdbc:edb://baba1:9999/workflowdb"
                    maxActive="2"
                    maxIdle="2"
                    maxWait="10000"/>        
        </Context>
	
      </Host>
      
      
      <Host name="ulc1.resolution.com" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

	<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
                driverName="com.edb.Driver"                 
                connectionURL="jdbc:edb://baba1:9999/development"
		connectionName="test"
		connectionPassword="test"
                userTable="dbuser"
                userNameCol="username"
                userCredCol="password"
                userRoleTable="user_classes"
                roleNameCol="classDescription" 
        />

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="ulc1_log." suffix=".txt" debug="99"
                timestamp="true"/>
        
        <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                 managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                 expireSessionsOnShutdown="false"
                 useDirtyFlag="true"
                 notifyListenersOnReplication="true">

            <Membership 
                className="org.apache.catalina.cluster.mcast.McastService"
                mcastAddr="228.0.0.4"
                mcastPort="45564"
                mcastFrequency="500"
                mcastDropTime="3000"/>
            
            <Receiver 
                className="org.apache.catalina.cluster.tcp.ReplicationListener"
                tcpListenAddress="ulc1"
                tcpListenPort="4001"
                tcpSelectorTimeout="100"
                tcpThreadCount="6"/>

            <Sender
                className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                replicationMode="pooled"
                ackTimeout="15000"
                waitForAck="true"/>

            <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
                  
filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
                   
            <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                      tempDir="/tmp/war-temp/"
                      deployDir="/tmp/war-deploy/"
                      watchDir="/tmp/war-listen/"
                      watchEnabled="false"/>
                      
            <ClusterListener
className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
        </Cluster>
        
                
        <Context    path="/ulc" 
                    docBase="/web/sites/ulc" 
                    debug="0" 
                    reloadable="true">
        
        <Logger     className="org.apache.catalina.logger.FileLogger"
                    prefix="ulc_log." suffix=".txt" debug="99"
                    timestamp="true"/>
                                  
        <Resource   name="jdbc/ifx"
                    auth="Container"
                    type="javax.sql.DataSource"
                    username="test"
                    password="test"
                    driverClassName="com.edb.Driver"
                    url="jdbc:edb://baba1:9999/development"
                    validationQuery="SELECT dbuser.id FROM dbuser WHERE id = 1"
                    maxActive="20"
                    maxIdle="20"
                    maxWait="10000"/>
               
        <Resource   name="jdbc/pgsql"
                    auth="Container"
                    type="javax.sql.DataSource"
                    username="test"
                    password="test"
                    driverClassName="com.edb.Driver"
                    url="jdbc:edb://baba1:9999/workflowdb"
                    maxActive="2"
                    maxIdle="2"
                    maxWait="10000"/>        
        </Context>

      </Host>

    </Engine>

  </Service>

</Server>
--------------------------------------------------

-------------------------------------------------
This mail sent through IMP: www.resolution.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Three hostnames in one instance of tomcat

Posted by Mark Thomas <ma...@apache.org>.
Eric Berry wrote:
>> This will fail in later versions of Tomcat 5. appBase should not equal
>> docbase. The correct configuration is:
>> <Host name="www.host1.com" appBase="/opt/projects/www/host1/web">
>>    <Context docBase="/ROOT" />
>> </Host>
> 
> Does this mean that there must be a "ROOT" directory under
> "/opt/projects/www/host1/web"?

Yes.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Three hostnames in one instance of tomcat

Posted by Eric Berry <el...@gmail.com>.
> This will fail in later versions of Tomcat 5. appBase should not equal
> docbase. The correct configuration is:
> <Host name="www.host1.com" appBase="/opt/projects/www/host1/web">
>    <Context docBase="/ROOT" />
> </Host>

Does this mean that there must be a "ROOT" directory under
"/opt/projects/www/host1/web"?

In my current configuration I have
"/opt/projects/www/host1/web/[index.jsp,jsp/,html/,images/,js/,
etc...]". So for future versions of tomcat 5, I'll need
"/opt/projects/www/host1/web/ROOT/[index.jsp,jsp/,html/,ect...]"?

Thanks for correcting me on this, I'm still quite new at this myself.

Thanks again,
Eric

-- 
Learn from the past. Live in the present. Plan for the future.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Three hostnames in one instance of tomcat

Posted by Mark Thomas <ma...@apache.org>.
Eric Berry wrote:
> Here's the jist of what I have:
> <Host name="www.host1.com" appBase="/opt/projects/www/host1/web">
>    <Context path="" docBase="/opt/projects/www/host1/web" />
> </Host>

This will fail in later versions of Tomcat 5. appBase should not equal
docbase. The correct configuration is:
<Host name="www.host1.com" appBase="/opt/projects/www/host1/web">
   <Context docBase="/ROOT" />
</Host>

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Three hostnames in one instance of tomcat

Posted by Eric Berry <el...@gmail.com>.
I have my development box setup how I think you want yours done
(though, I only access it locally from that machine). The 3 hosts
should have separate app bases and the context paths should be empty
(meaning the default path). What you've done up there should work if
you have your hosts file pointing access1.resolution.com,
ulc1.resolution.com and ihl1.resolution.com to your local machine and
you access your applications like this,
"http://ulc1.resolution.com/ihl" (because you have the context path
set to "/ihl" and you don't define a default path).

Here's the jist of what I have:
<Host name="www.host1.com" appBase="/opt/projects/www/host1/web">
    <Context path="" docBase="/opt/projects/www/host1/web" />
</Host>
<Host name="www.host2.com" appBase="/opt/projects/www/host2/web">
    <Context path="" docBase="/opt/projects/www/host2/web" />
</Host>
<Host name="www.host3.com" appBase="/opt/projects/www/host3/web">
    <Context path="" docBase="/opt/projects/www/host3/web" />
</Host>

I think the docBase can be blank in this case as well, as it should
default to the appBase (Someone please correct me if I'm wrong).

This should get you 3 hosts on 1 instance of Tomcat. A better idea (if
you're using this for production) might be to have 1 installation of
Tomcat, but have 3 separate instances - so you can start, stop or
reload the instance for any one host.

Instructions on how to do that can be found in the RUNNING.txt file
that came with your install.

Eric
-- 
Learn from the past. Live in the present. Plan for the future.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Three hostnames in one instance of tomcat

Posted by Ben Stringer <be...@burbong.com>.
I'm interested to hear other ideas, but I have used multiple <service>
entries to achieve this. In my case, each hostname has a dedicated IP
and a DNS entry.

Having multiple service entries allows you to have separation of almost
all the config elements, like ports, appbase, logging etc.

Cheers, Ben

On Wed, 2006-09-13 at 19:03 -0400, gurkan@resolution.com wrote:
> I want to configure Tomcat so that I can have three hostnames live
> on the same physical machine, but each have their own separate areas.
> with one instance of Tomcat?
> 
> Users would hit URL's such as:
> 
> http://host1/
> http://host2/
> http://host3/
> 
> where each host should have its own webapps directory on the machine.
> For example,
> 
> host1 --> /tomcat5/access/WEB-INF
> host2 --> /tomcat5/ihl/WEB-INF
> host3 --> /tomcat5/ulc/WEB-INF
> 
> I've tried several things including the addition of a three <Host>
> directive underneath <Engine> but I can't seem to make it work. I
> would appreciate a tip or a sample configuration file.
> 
> I've searched the web a bit and there seem to be several references to
> having Apache (HTTP Server) in front of Tomcat. However, I don't
> need/want a separate HTTP Server for now.
> 
> my server.xml
> --------------------------------------------------
> <Server port="8005" shutdown="SHUTDOWN">
>   <Listener className="org.apache.catalina.core.AprLifecycleListener" />
>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
>   <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>   <Listener
> className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
>   <GlobalNamingResources>
>     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.UserDatabase"
>        description="User database that can be updated and saved"
>            factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>           pathname="conf/tomcat-users.xml" />
> 
>   </GlobalNamingResources>
>   <Service name="Catalina">
>     <Connector port="8080" maxHttpHeaderSize="8192"
>                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
>                enableLookups="false" redirectPort="8443" acceptCount="100"
>                connectionTimeout="20000" disableUploadTimeout="true" />
>     <Connector port="8009" 
>                enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
>     <Engine name="Standalone" defaultHost="access1.resolution.com" debug="0"
> jvmRoute="jvm1">
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase"/>
>       <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
> autoDeploy="true">
>                 <Context path="" docBase="ROOT" debug="0"/>
>       </Host>
> 
>       <Host name="access1.resolution.com" appBase="webapps"
>        unpackWARs="true" autoDeploy="true"
>        xmlValidation="false" xmlNamespaceAware="false">
> 
> 	<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
>                 driverName="com.edb.Driver"                 
>                 connectionURL="jdbc:edb://baba1:9999/development"
> 		connectionName="test"
> 		connectionPassword="test"
>                 userTable="dbuser"
>                 userNameCol="username"
>                 userCredCol="password"
>                 userRoleTable="user_classes"
>                 roleNameCol="classDescription" 
>         />
> 
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="access1_log." suffix=".txt" debug="99"
>                 timestamp="true"/>
> 
>         <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>                  managerClassName="org.apache.catalina.cluster.session.DeltaManager"
>                  expireSessionsOnShutdown="false"
>                  useDirtyFlag="true"
>                  notifyListenersOnReplication="true">
> 
>             <Membership 
>                 className="org.apache.catalina.cluster.mcast.McastService"
>                 mcastAddr="228.0.0.4"
>                 mcastPort="45564"
>                 mcastFrequency="500"
>                 mcastDropTime="3000"/>
>             
>             <Receiver 
>                 className="org.apache.catalina.cluster.tcp.ReplicationListener"
>                 tcpListenAddress="access1"
>                 tcpListenPort="4001"
>                 tcpSelectorTimeout="100"
>                 tcpThreadCount="6"/>
> 
>             <Sender
>                 className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>                 replicationMode="pooled"
>                 ackTimeout="15000"
>                 waitForAck="true"/>
> 
>             <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
>                   
> filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
>                    
>             <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
>                       tempDir="/tmp/war-temp/"
>                       deployDir="/tmp/war-deploy/"
>                       watchDir="/tmp/war-listen/"
>                       watchEnabled="false"/>
>                       
>             <ClusterListener
> className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
>         </Cluster>
>         
>         <Context    path="/access" 
>                     docBase="/web/sites/dbAccess" 
>                     debug="0" 
>                     reloadable="true">
>         
>         <Logger     className="org.apache.catalina.logger.FileLogger"
>                     prefix="access_log." suffix=".txt" debug="99"
>                     timestamp="true"/>
>                                   
>         <Resource   name="jdbc/ifx"
>                     auth="Container"
>                     type="javax.sql.DataSource"
>                     username="test"
>                     password="test"
>                     driverClassName="com.edb.Driver"
>                     url="jdbc:edb://baba1:9999/development"
>                     validationQuery="SELECT dbuser.id FROM dbuser WHERE id = 1"
>                     maxActive="20"
>                     maxIdle="20"
>                     maxWait="10000"/>
>                
>         <Resource   name="jdbc/workflow"
>                     auth="Container"
>                     type="javax.sql.DataSource"
>                     username="test"
>                     password="test"
>                     driverClassName="com.edb.Driver"
>                     url="jdbc:edb://baba1:9999/workflowdb"
>                     maxActive="0"
>                     maxIdle="20"
>                     maxWait="10000"/>
> 
>         <Resource   name="jdbc/azure"
>                     auth="Container"
>                     type="javax.sql.DataSource"                    
>                     username="test"
>                     password="test"                    
>                     driverClassName="org.objectweb.cjdbc.driver.Driver"        
>            
>                     url="jdbc:edb://baba1:9999/azure"
>                     maxActive="0"
>                     maxIdle="20"
>                     maxWait="10000"/>        
>         </Context>
>         
>       </Host>
>       
>       
>       <Host name="ihl1.resolution.com" appBase="webapps"
>        unpackWARs="true" autoDeploy="true"
>        xmlValidation="false" xmlNamespaceAware="false">
> 
>        
> 	<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
>                 driverName="com.edb.Driver"                 
>                 connectionURL="jdbc:edb://baba1:9999/development"
> 		connectionName="test"
> 		connectionPassword="test"
>                 userTable="dbuser"
>                 userNameCol="username"
>                 userCredCol="password"
>                 userRoleTable="user_classes"
>                 roleNameCol="classDescription" 
>         />
>         
> 
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="ihl1_log." suffix=".txt" debug="99"
>                 timestamp="true"/>
>         
>         <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>                  managerClassName="org.apache.catalina.cluster.session.DeltaManager"
>                  expireSessionsOnShutdown="false"
>                  useDirtyFlag="true"
>                  notifyListenersOnReplication="true">
> 
>             <Membership 
>                 className="org.apache.catalina.cluster.mcast.McastService"
>                 mcastAddr="228.0.0.4"
>                 mcastPort="45564"
>                 mcastFrequency="500"
>                 mcastDropTime="3000"/>
>             
>             <Receiver 
>                 className="org.apache.catalina.cluster.tcp.ReplicationListener"
>                 tcpListenAddress="ihl1"
>                 tcpListenPort="4001"
>                 tcpSelectorTimeout="100"
>                 tcpThreadCount="6"/>
> 
>             <Sender
>                 className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>                 replicationMode="pooled"
>                 ackTimeout="15000"
>                 waitForAck="true"/>
> 
>             <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
>                   
> filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
>                    
>             <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
>                       tempDir="/tmp/war-temp/"
>                       deployDir="/tmp/war-deploy/"
>                       watchDir="/tmp/war-listen/"
>                       watchEnabled="false"/>
>                       
>             <ClusterListener
> className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
>         </Cluster>
>                 
>         
>         <Context    path="/ihl" 
>                     docBase="/web/sites/ihl" 
>                     debug="0" 
>                     reloadable="true">
>         
>         <Logger     className="org.apache.catalina.logger.FileLogger"
>                     prefix="ihl_log." suffix=".txt" debug="99"
>                     timestamp="true"/>
>                                   
>         <Resource   name="jdbc/ifx"
>                     auth="Container"
>                     type="javax.sql.DataSource"
>                     username="test"
>                     password="test"
>                     driverClassName="com.edb.Driver"
>                     url="jdbc:edb://baba1:9999/development"
>                     validationQuery="SELECT dbuser.id FROM dbuser WHERE id = 1"
>                     maxActive="20"
>                     maxIdle="20"
>                     maxWait="10000"/>
>                
>         <Resource   name="jdbc/pgsql"
>                     auth="Container"
>                     type="javax.sql.DataSource"
>                     username="test"
>                     password="test"
>                     driverClassName="com.edb.Driver"
>                     url="jdbc:edb://baba1:9999/workflowdb"
>                     maxActive="2"
>                     maxIdle="2"
>                     maxWait="10000"/>        
>         </Context>
> 	
>       </Host>
>       
>       
>       <Host name="ulc1.resolution.com" appBase="webapps"
>        unpackWARs="true" autoDeploy="true"
>        xmlValidation="false" xmlNamespaceAware="false">
> 
> 	<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
>                 driverName="com.edb.Driver"                 
>                 connectionURL="jdbc:edb://baba1:9999/development"
> 		connectionName="test"
> 		connectionPassword="test"
>                 userTable="dbuser"
>                 userNameCol="username"
>                 userCredCol="password"
>                 userRoleTable="user_classes"
>                 roleNameCol="classDescription" 
>         />
> 
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="ulc1_log." suffix=".txt" debug="99"
>                 timestamp="true"/>
>         
>         <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>                  managerClassName="org.apache.catalina.cluster.session.DeltaManager"
>                  expireSessionsOnShutdown="false"
>                  useDirtyFlag="true"
>                  notifyListenersOnReplication="true">
> 
>             <Membership 
>                 className="org.apache.catalina.cluster.mcast.McastService"
>                 mcastAddr="228.0.0.4"
>                 mcastPort="45564"
>                 mcastFrequency="500"
>                 mcastDropTime="3000"/>
>             
>             <Receiver 
>                 className="org.apache.catalina.cluster.tcp.ReplicationListener"
>                 tcpListenAddress="ulc1"
>                 tcpListenPort="4001"
>                 tcpSelectorTimeout="100"
>                 tcpThreadCount="6"/>
> 
>             <Sender
>                 className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>                 replicationMode="pooled"
>                 ackTimeout="15000"
>                 waitForAck="true"/>
> 
>             <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
>                   
> filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
>                    
>             <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
>                       tempDir="/tmp/war-temp/"
>                       deployDir="/tmp/war-deploy/"
>                       watchDir="/tmp/war-listen/"
>                       watchEnabled="false"/>
>                       
>             <ClusterListener
> className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
>         </Cluster>
>         
>                 
>         <Context    path="/ulc" 
>                     docBase="/web/sites/ulc" 
>                     debug="0" 
>                     reloadable="true">
>         
>         <Logger     className="org.apache.catalina.logger.FileLogger"
>                     prefix="ulc_log." suffix=".txt" debug="99"
>                     timestamp="true"/>
>                                   
>         <Resource   name="jdbc/ifx"
>                     auth="Container"
>                     type="javax.sql.DataSource"
>                     username="test"
>                     password="test"
>                     driverClassName="com.edb.Driver"
>                     url="jdbc:edb://baba1:9999/development"
>                     validationQuery="SELECT dbuser.id FROM dbuser WHERE id = 1"
>                     maxActive="20"
>                     maxIdle="20"
>                     maxWait="10000"/>
>                
>         <Resource   name="jdbc/pgsql"
>                     auth="Container"
>                     type="javax.sql.DataSource"
>                     username="test"
>                     password="test"
>                     driverClassName="com.edb.Driver"
>                     url="jdbc:edb://baba1:9999/workflowdb"
>                     maxActive="2"
>                     maxIdle="2"
>                     maxWait="10000"/>        
>         </Context>
> 
>       </Host>
> 
>     </Engine>
> 
>   </Service>
> 
> </Server>
> --------------------------------------------------
> 
> -------------------------------------------------
> This mail sent through IMP: www.resolution.com
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Three hostnames in one instance of tomcat

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: gurkan@resolution.com [mailto:gurkan@resolution.com] 
> Subject: Three hostnames in one instance of tomcat
> 
> Users would hit URL's such as:
> 
> http://host1/
> http://host2/
> http://host3/

What version (exactly) of Tomcat are you using?  For versions 5.0 and
5.5, you should not put <Context> elements in server.xml.  Use a
separate appBase for each <Host>, and have the default app named ROOT
for each.

Do you have DNS entries for each host name?

I'd definitely try it without clustering first.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org