> -----Original Message----- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 17, 2002 8:42 PM > To: Tomcat Users List > Subject: Re: Can all vhosts share one Webapp? > > > > > On Sun, 17 Nov 2002, Brandon Cruz wrote: > > > Date: Sun, 17 Nov 2002 16:46:44 -0600 > > From: Brandon Cruz <[EMAIL PROTECTED]> > > Reply-To: Tomcat Users List <[EMAIL PROTECTED]> > > To: Tomcat Users List <[EMAIL PROTECTED]> > > Subject: Re: Can all vhosts share one Webapp? > > > > > > Can I have all my virtual hosts share one webapp? I > would like to avoid > > > > having to declare a context for every single virtual host. > > > > > > You can do this by taking advantage of the "defaultHost" > attribute on the > > > <Engine> element. If a request comes into Tomcat with an > unrecognized > > > host name, it is assigned automatically to the <Host> > element that is > > > speicified by defaultHost. > > > > > > The out-of-the-box configuration uses this technique to assign all > > > requests for all virtual hosts to the <Host> named > "localhost", which is > > > the single set of webapps nested inside that host. > > > > In simple terms, does this mean that if I have a context > called "/context1", > > and want all vhosts to be able to access and use it, I can > just specify the > > context one time in the default host and not have to worry > about specifying > > it for any other host in server.xml? > > > > Yes.
I don't think you can share one context like this if you have a <host> defined for the virtual host that contains other contexts,logger,etc specific to that host. I think Craig is saying that it works if all requests for your virtual host go to the default host. If you want to share a context between multiple <host> elements, you can set the appBase to the same directory and let tomcat autoload the context from there. Then each context specific to each webapp can have an absolute path to the context. Charlie -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
