• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

virtual host in tomcat

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all

for demo purpose i need to set up 2 virtual hosts in tomcat

now i tried like million times to fallow simple tutorials about setting up virtual host but with no success

for example i like to set virtual host that will point to tomcat : webapps\tomcat-docs\appdev\sample\web

now this is what i did :


but when i try to serf in IE with www.my.com

its not going noware .... what todo? or what im doing wrong here ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you own the domain my.com? If so, have you set up DNS servers appropriately?
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i dont , its closed network , not connected to the internet

i tried to do this :
http://forums.rimuhosting.com/forums/showthread.php?t=10

but it still dont work
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the error im geting :
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I set up virtual hosts in Tomcat 5.5.9 I use a Host entry that looks like:


Note that the appBase is an absolute directory address and there is no Context entry.

Bill
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it still does not work , do i need configure something else ?

maybe on the pc im working on?

help me im getting crazy ...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Did you verify that this directory exists?
Does it have a WEB-INF directory inside it?

If not, Tomcat will not recognize it as a valid web structure.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly does your <Host> entry look like now?
What exactly is the error that is reported?

Bill
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all and thanks for your help
it seams that defining virtual hosts based on one ip is working after i define it in the windows hosts file
BUT now i have new problem .
now i need to define 2 hosts based on 2 ips that is i defined 2 ip on my local pc then i configure in the server.xml
something like this :


and its working fine when i serf by this ip but how do i configure dns name to that ip?
thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect you can figure that out from this Tomcat documentation. (warning, I have not actually done this)

Bill
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry but i do not find it there ..
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isnt there something in those docs about defining multiple aliases for a host?

I found that the Host tag uses the exact name only it won't recognize a host name if what it has is the IP numbers.

Bill
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so i didn't understand it right i guess ..
the alias used to map the name to the host ip ?
is it right ?
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all
i have another question can i run on the same pc 2 instances of tomcat ? on port 80
but with different ip's?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic