Hi,

and what about to write a servlet filter?

I have my test domain with several virtual hosts IN CNAME to localhost
(or any other IP where is Tomcat listening) in my DNS. I wrote an
simple filter which parses virtual host name (request.getLocalName()
-- always contains full computer name from requested URL) and forwards
request to specified servlet (according to configuration) using
RequestDispatcher... Note that I'm not using JSP, I'm using servlets
only because I have my own CMS which is vhost, domain, context-path,
servlet-path independed and must support various output formats.

This is working for me. Sessions are OK, because I don't need
cross-vhost navigation...

PETR


On 3/13/06, Per Johnsson <[EMAIL PROTECTED]> wrote:
> Hi!
>
> We have managed to do that but with a side effect that Tomcat loads each
> webapp several times. This is an example config.
>
> <Host name="www.aaa.com" appBase="webapps" unpackWARs="true"
> autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
>   <Context path="" docBase="aaa" debug="0" crossContext="true"/>
> </Host>
> <Host name="www.bbb.com" appBase="webapps" unpackWARs="true"
> autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
>   <Context path="" docBase="bbb" debug="0" crossContext="true"/>
> </Host>
>
>
> I think by setting the webapps folder to a empty dummy folder you could
> get rid of the autoloaded webapps
> and only get those you want. I have not tried it out much. I'm looking for
> a nicer solution
>
> <Host name="www.aaa.com" appBase="webappsDummy" unpackWARs="true"
> autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
>   <Context path="" docBase="webapps/aaa" debug="0" crossContext="false"/>
> </Host>
> <Host name="www.bbb.com" appBase="webappsDummy" unpackWARs="true"
> autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
>   <Context path="" docBase="webapps/bbb" debug="0" crossContext="false"/>
> </Host>
>
>
> So if someone knows another way of only load the defined context I'm more
> than glad to hear about it.
>
> Regards Per Jonsson
>
>
>
> Tim Diggins <[EMAIL PROTECTED]> wrote on 2006-03-13 12:38:59:
>
> > If you are planning to use apache anyway, then you could use mod_rewrite
>
> > for this (see apache docs on mod_rewrite - but basically rewrite
> > (internally) the "a.abc.com" to "abc.com/a" and connect "abc.com/a" via
> > mod_jk to tomcat "/a" and then tomcat doesn't need to know about the
> > rewrite).
> >
> > don't __think__ there is a tomcat way to distribute a webapp across
> > urls, but you __might__ get the same effect by having virtual hosts in
> > tomcat, each with a ROOT webapp, and enabling single-sign-on (to enable
> > the same session across the webapps).
> >
> > I've never used single-sign-on, but that's the first thing I'd check, if
>
> > you want a tomcat-only solution.
> >
> > hth Tim
> >
> >
> >
> > Kumar Limbu wrote:
> > > Hi Guys,
> > >
> > >
> > >
> > > Hi everyone. I am new to this mailing list and I have a configuration
> > > problem.
> > >
> > >
> > >
> > > I searched through the web and googled around but I couldn't get a
> > > satisfactory reply. I also went through the mailing list, but I
> couldn't
> > > come across anything specific to my need.
> > >
> > >
> > >
> > > We are about to deploy an application. What we are looking to do is to
> map
> > > each individual folder within the web application to a different urls.
> > >
> > > What I mean by this is,
> > >
> > > For example we have a web application called webapp and within webapp
> we
> > > have folders like a, b and c. What I would like to know is , how can I
> map
> > > these folder to urls like a.abc.com , b.abc.com and c.abc.com. Is
> there any
> > > way to do this? I haven't really been able to find a reasonable
> solution to
> > > this problem. So if anyone knows how to do it please drop a word.
> > >
> > >
> > >
> > > Thank You,
> > >
> > > Kumar
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ********************************************************************************
> This e-mail and the information it contains may be privileged and/or
> confidential.  It is for the intended addressee(s) only.
> The unauthorised use, disclosure or copying of this e-mail, or any 
> information it contains, is prohibited.
> If you are not an intended recipient, please contact the sender and delete 
> the material from your computer.
> ********************************************************************************
>
>
>

Reply via email to