> Is there a way to enable IP based hosting in tomcat directly
yes. Minimally add a DNS entry to your hosts file:
10.0.1.200 my.subdomain.com
then, add useIPVHosts="true" to your SSL HTTP/1.1 connector
keep the Named Based Virtual Host the same:
<Host name="my.subdomain.com" appBase="webapps/myApp-1.0.0"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="." debug="1"/>
</Host>
Note: If you are going to host more than one domain over https, you
will need to create another ethernet device with
a new LAN IP (for unix, google the 'ifconfig' command). Then add the
new ip/domain name mapping to the host file:
10.0.1.201 my.subdomain2.com
wheresjim - 26 Feb 2008 00:33 GMT
That's great! I am not using this for SSL, but rather I want a second
webapp folder for staging and want to use the same named URL but with
different IP adresses and choose which webapps folder to use based on
IP, regardless of name.
So just as you said, I added useIPVHosts="true" to my connector such
that:
<Connector port="80" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25"
maxSpareThreads="75"
redirectPort="443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
useIPVHosts="true"/>
Then I added set the virtual hosts such that:
<Host name="deploy.mywebserver.com" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"> ... </Host>
<Host name="staging.mywebserver.com" appBase="webapps-staging"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"> ... </Host>
Then I made the following additions to my hosts file:
192.168.12.201 staging.mywebserver.com
[my outside ipaddress] deploy.mywebserver.com
Now whenever I test, I just set my client's hosts file to:
192.168.12.201 deploy.mywebserver.com
And I can test without disrupting my deployment server.
Thanks!
Jim
lifw555@gmail.com - 11 Mar 2008 10:49 GMT
my hosts like this:
www.domain1.com ----> ip1
www.domain2.com -----> ip2
jdk 1.6
tomcat 6.0.16
windows 2003(64bit)
2 ssl
when i type : https://www.domain1.com the ssl is for www.domain2.com .
can not Matching !
is there some things error ???
> > Is there a way to enable IP based hosting in tomcat directly
>
[quoted text clipped - 18 lines]
>
> 10.0.1.201 my.subdomain2.com