Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

virtual host in tomcat

 
Ranch Hand
Posts: 603
  • 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 ?
 
Marshal
Posts: 67362
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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: 603
  • 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: 603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the error im geting :
 
Author and all-around good cowpoke
Posts: 13078
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: 603
  • 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 ...
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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
Posts: 13078
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: 603
  • 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
Posts: 13078
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: 603
  • 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
Posts: 13078
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: 603
  • 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: 603
  • 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?
 
Quick! Before anybody notices! Cover it up with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!