Re: Help figuring out Virtual Hosts
You can use multiple hosttags in the server.xml, each with their own context. As described here http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html "One or more Host elements are nested inside an Engine element. Inside the Host element, you can nest Context elements for the web applications associated with this virtual host. Exactly one of the Hosts associated with each Engine MUST have a name matching the defaultHost attribute of that Engine." You give each application its own host and it should work fine. You can also use alias tags inside a host tag if you want an application to be available for multiple hosts. Jilles Dola Woolfe wrote: Hi, I've certainly RTFM'd and had thoroughly read http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html#Host%20Name%20Aliases but I just can't figure out how to get virtual servers to work. Basically, assume that DNS is set up properly and that ServerA.com ServerB.com and Server.com resolve to the same IP. Now, I want ServerA.com to "go to" Server.com/MyAppA/index.jsp and ServerB.com to "go to" Server.com/MyAppB/index.jsp. This, in my mind is sort of like how Apache lets you do it, where of course it takes advantage of the convention of index.html being the default destination. OK, how do I achieve this with Tomcat? Could anyone please provide a specific example? Many thanks, Dola __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help figuring out Virtual Hosts
Dola, I believe in order to serve static content you'll need to create a context XML file. I just posted an email outlining how I was able to get virtual hosting working. An additional step in your case would be to create a file [TOMCAT]/conf/Catalina/servera.com/ROOT.xml and include a definition. The your content would reside in the [TOMCAT]/webapps-servera.com directory. Bernie > -Original Message- > From: Dola Woolfe [mailto:[EMAIL PROTECTED] > Sent: Friday, September 16, 2005 2:44 PM > To: Tom Cat > Subject: Help figuring out Virtual Hosts > > > Hi, > > I've certainly RTFM'd and had thoroughly read > > http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.ht ml#Host%20Name%20Aliases > > but I just can't figure out how to get virtual servers > to work. > > Basically, assume that DNS is set up properly and that > ServerA.com ServerB.com and Server.com resolve to the same > IP. Now, I want ServerA.com to "go to" > Server.com/MyAppA/index.jsp and ServerB.com to "go to" > Server.com/MyAppB/index.jsp. This, in my mind is sort of like > how Apache lets you do it, where of course it takes advantage > of the convention of index.html being the default destination. > > OK, how do I achieve this with Tomcat? Could anyone > please provide a specific example? > > Many thanks, > > Dola > > > > __ > Yahoo! Mail - PC Magazine Editors' Choice 2005 > http://mail.yahoo.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]