|
|
IP Based Virtual Hosting / Tomcat
Hi,I use Tomcat 6.0.10 as a stand-alone web application server (notsitting behind Apache httpd). I host several domains on a singlephysical host using name-based virtual hosting set up in server.xml.I need to enable ssl for one of the domains. I understand I can nolonger use name-based hosting with ssl.Is there a way to enable IP based hosting in tomcat directly or do Inow have to run tomcat behind apache for ip hosting / ssl.?Thanks
|
|
0
|
|
|
|
Reply
|
skijor (4)
|
2/10/2008 6:50:46 PM |
|
> Is there a way to enable IP based hosting in tomcat directlyyes. Minimally add a DNS entry to your hosts file:10.0.1.200 my.subdomain.comthen, add useIPVHosts="true" to your SSL HTTP/1.1 connectorkeep 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, youwill need to create another ethernet device witha new LAN IP (for unix, google the 'ifconfig' command). Then add thenew ip/domain name mapping to the host file:10.0.1.201 my.subdomain2.com
|
|
0
|
|
|
|
Reply
|
skijor
|
2/10/2008 8:26:12 PM
|
|
That's great! I am not using this for SSL, but rather I want a secondwebapp folder for staging and want to use the same named URL but withdifferent IP adresses and choose which webapps folder to use based onIP, regardless of name.So just as you said, I added useIPVHosts="true" to my connector suchthat: <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.comNow whenever I test, I just set my client's hosts file to:192.168.12.201 deploy.mywebserver.comAnd I can test without disrupting my deployment server.Thanks!Jim
|
|
0
|
|
|
|
Reply
|
wheresjim
|
2/26/2008 12:33:41 AM
|
|
my hosts like this=A3=BA
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 ???
On 2=D4=C211=C8=D5, =C9=CF=CE=E74=CA=B126=B7=D6, skijor <ski...@gmail.com> w=
rote:
> > 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=3D"true" to your SSL HTTP/1.1 connector
>
> keep the Named Based Virtual Host the same:
>
> <Host name=3D"my.subdomain.com" appBase=3D"webapps/myApp-1.0.0"
> unpackWARs=3D"true" autoDeploy=3D"true"
> xmlValidation=3D"false" xmlNamespaceAware=3D"false">
> <Context path=3D"" docBase=3D"." debug=3D"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
|
|
0
|
|
|
|
Reply
|
lifw555
|
3/11/2008 9:49:34 AM
|
|
|
3 Replies
103 Views
(page loaded in 0.073 seconds)
|
|
|
|
|
|
|
|
|