Home arrow static arrow Java Programming [Archive] - a second virtual host is deaf
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - a second virtual host is deaf
This topic has 9 replies on 1 page.

Posts:4
Registered: 2/8/03
a second virtual host is deaf  
Feb 8, 2003 10:42 PM



 
Apache 2 and Tomcat 4.0 work together here on an NT as long as httpd.conf sees the Tomcat contexts denoted as a virtual host with the same name as the host : "host1".

So, I am trying now to use a second virtual host "host2" on my machine "host1".

I can still reach the contexts on host1 with http://host1/things
but should this also work? : http://host2/otherthings

must I give my system 2 (two) ip addresses in order to have a second virtual host? Seems strange.
 

Posts:991
Registered: 7/13/01
Re: a second virtual host is deaf  
Feb 9, 2003 12:45 AM (reply 1 of 9)



 
have a look at
http://httpd.apache.org/docs/vhosts/name-based.html
how to set virtual hosts on apache
not sure about using tomcat as well though
 
Guest
Re: a second virtual host is deaf  
Feb 9, 2003 5:56 AM (reply 2 of 9)



 

must I give my system 2 (two) ip addresses in order to
have a second virtual host?

no... this is the point of virtual hosting. having more than one host on the same ip.

but you can't just invent hostnames and hope they work. the client/browser has to resolve them into an ip.
 

Posts:991
Registered: 7/13/01
Re: a second virtual host is deaf  
Feb 9, 2003 5:58 AM (reply 3 of 9)



 
yeah, true, no point having a server is the network cant find it
 
Guest
Re: a second virtual host is deaf  
Feb 9, 2003 6:24 AM (reply 4 of 9)



 
yes and the link you posted before does actually mention this fairly important issue

Of course, you can't just make up names and place them in ServerName or ServerAlias. You must first have your DNS server properly configured to map those names to an IP address associated with your server.


i suspect that is you want to test on win network if you don't want to mess about with dns you might be able to do some bejiggery in the LMHOSTS file that would have the same effect.

if you want to just test virtual hosts in general. one thing that also might work is using machine name(s) as well as the ip's

for example if the machine is called host1 and has an address of 192.168.100.10 then i think you could set up three sites.

the "real" (default) site.

192.168.100.10
127.0.0.1

virtual host 1

host1

virtual host 2

localhost

i think these would work although the last one would only work from the server itself. see virtual hosting uses the host header passed in HTTP so as long as you can have different ones that end up going to the same place you can invent some virtual hosts for testing.
 

Posts:4
Registered: 2/8/03
Re: a second virtual host is deaf  
Feb 10, 2003 2:33 AM (reply 5 of 9)



 
So I must do something to my Host1 system to enable multiple virtual hosting? What exactly? Yes it is a WinNT in a LAN where all this is taking place.
I do the virtual host instructions 'perfectly' but the one line in
the workers.properties :
worker.ajpworker2.host = host2
this causes it all to die.
Just mentioning host2 is fatal. I have it mentioned in a 'hosts' file in
WinNT, but that 'lmhosts', no, not yet.
what do you mean by

using machine name(s) as well as the ip's

I don't use ips anywhere so I must be using machine names.
And you're right, no DNS in this mess.

what is this? a unix type file in WinNT\System?
the "real" (default) site.

192.168.100.10
127.0.0.1
virtual host 1
host1
virtual host 2
localhost
 

Posts:4
Registered: 2/8/03
Re: a second virtual host is deaf  
Feb 10, 2003 2:36 AM (reply 6 of 9)



 
if I don't give the machine a second ip number for host2
then calling http://host2/ will not work
and so virtual hosting will not work
 

Posts:4
Registered: 2/8/03
Re: a second virtual host is deaf  
Feb 10, 2003 2:41 AM (reply 7 of 9)



 
the who virtual source ruckus appears only when using
apache with tomcat

Bravo, that's a good source
 

Posts:6
Registered: 3/12/03
Re: a second virtual host is deaf  
Aug 3, 2004 11:53 PM (reply 8 of 9)



 
hi,

can anyone tell me how to use sun one application server 8 to serve differet virtual host?

for example:
theres two domain like aaa.test.com and bbb.test.com, so if a user browse to aaa.test.com he/she should get the content of aaa.test.com . But since both of them points to the same IP, how does sun one app server differentiate it and forward it to the right place?

Kien
 

Posts:6
Registered: 3/12/03
Re: a second virtual host is deaf  
Aug 3, 2004 11:54 PM (reply 9 of 9)



 
thanks in advance
 
This topic has 9 replies on 1 page.