You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mon Cab <fu...@yahoo.com> on 2007/06/05 05:19:25 UTC

virtual Hosts multiple IP's (one to one mapping)


I will hosting several domains on tomcat, and have configured each
domain with it's own IP address through DNS, such that domain1.com, as
well as www.domain1.com resolve to the ip address of the domain1. 
(I.e. multiple hosts for each domain on each IP address).  

I am trying to get tomcat to serve the appropriate website for each
respective domain (by assigning docbases appropriately in server.xml -
requests for www.domain.com, domain.com, anything.domain.com should all
result in the domain.com welcome page displaying.  

Unfortunately I cant seem to get it working using Tomcat as a
standalone webserver.  (I am not forwarding requests through apache.)  


I configures the server as follows (server.xml): 

 

 <Service name="Catalina1">

    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
               maxThreads="150" minSpareThreads="25"
maxSpareThreads="75"
               enableLookups="false" redirectPort="8443"
acceptCount="100"
               debug="0" connectionTimeout="20000"
               disableUploadTimeout="true"
               address="111.111.111.111" />

	 <Host name="localhost" debug="0" appBase="webapps"
       		unpackWARs="true" autoDeploy="true"
       		xmlValidation="false" xmlNamespaceAware="false">

 		<Context path="" docBase="webapp1"
				debug="5" reloadable="true" crossContext="true">
		...........

	</service>


 <Service name="Catalina2">

    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
               maxThreads="150" minSpareThreads="25"
maxSpareThreads="75"
               enableLookups="false" redirectPort="8443"
acceptCount="100"
               debug="0" connectionTimeout="20000"
               disableUploadTimeout="true"
               address="222.222.222.222" />

	 <Host name="localhost" debug="0" appBase="webapps"
       		unpackWARs="true" autoDeploy="true"
       		xmlValidation="false" xmlNamespaceAware="false">

 		<Context path="" docBase="webapp2"
				debug="5" reloadable="true" crossContext="true">
		...........

	</service>
		

With the above configuration, domain1.com is returing the domain2.com
site.  

It seems that the host configuration in service catalina2, is
overriding the definition in catalina1, so tha even though the 
IP request is for www.domain1.com which resolves to IP 111.111.111.111,
the webapp2 docbase is te one which is being served up.  

I dont want to define multiple hosts for each service, as I want to
anything.domain1.com to return doamin1's welcome page.  

Does anyone have a solution for this?  




       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.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