Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

IP Based Virtual Hosting / Tomcat

Thread view: 
skijor - 10 Feb 2008 18:50 GMT
Hi,
I use Tomcat 6.0.10 as a stand-alone web application server (not
sitting behind Apache httpd).  I host several domains on a single
physical 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 no
longer use name-based hosting with ssl.

Is there a way to enable IP based hosting in tomcat directly or do I
now have to run tomcat behind apache for ip hosting / ssl.?

Thanks
skijor - 10 Feb 2008 20:26 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.