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.

> >
> > >  This causes way
> > > too many threads on startup and slows the system down.
> > >
> >
> > Unless you are starting threads in your own servlets, the number of host
> > elements and webapps has neglible impact on the number of threads that
> > Tomcat starts.  That is driven primarily by how you configure your
> > <Connector> elements; and the connector threads that process requests are
> > shared across all the hosts and webapps.
>
> Good to know!  We are upgrading from 3.2.4 and it seems like the number of
> processes started up with that was around 300, roughly equal to the number
> of contexts we had declared, 150 hosts with two contexts each, which is why
> I thought they were related.
>

That's a pretty intriguing coincidence.

> >
> > > Any ideas?  We are using tomcat 4.1.12 and apache 1.3.26.
> >
> > The above info is about the Tomcat side of things -- you'll need to ask
> > someone else about the Apache connector configuration for this to work.
>
> One last question, I am going to continue to use our old compiled mod_jk
> connector from tomcat 3.2.4.  We are using the Coyote/jk2 AJP 1.3 connector
> in server.xml.  Is there anything wrong with this, or should I just take the
> time to try to compile a new connector too?
>

I'm not a guru on the web connectors, but it sounds like you can do this.
However, grabbing the most recent connector will probably have some
performance benefits (as well as bug fixes), so you might want to grab it
anyway.

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to