tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Kam <moonblade.w...@gmail.com>
Subject Re: Map domain names to different paths of a single webapp ?
Date Wed, 13 Jun 2012 03:58:26 GMT
I have checked the tuckey urlRewriter, and it seems cool, but doesnt
seem to fit my needs.
Anyway, you warnings make a lot of sense to me, so thanks there !

On Wed, Jun 13, 2012 at 2:29 AM, André Warnier <aw@ice-sa.com> wrote:
> Albert Kam wrote:
>>
>> Dear Tomcat Users !
>>
>> Let's say that i have this simple webapp using Tomcat 7, and let's say
>> the context name is "albertzoo"
>> http://albertzoo.com
>
>
> "albertzoo" is not the context here, it's a <Host>.
> If you want that application to respond to the URL "http://albertzoo.com/"
> (thus the context "/"), you will have to use the ROOT webapp.
>
>
>>
>> And then, i would like a niche site for monkeys with it's own domain :
>> http://albertzoomonkeys.com
>
>
> "albertzoomonkeys.com" is the host. The context is "/".
>
>
>> which is actually the same as :
>> http://albertzoo.com/monkeys
>
>
> In this one (barring tricks), "monkeys" is the context.
>
>
>>
>> But if the user is accessing through albertzoomonkeys.com, i dont want
>> them to see the albertzoo.com/monkeys in their browser
>
>
> unless you do an external redirect, they should not see that.
>
>
>>
>> Is it possible to do with a single webapp context, or do i have to
>> have different contexts(virtual hosts) for these different domains ?
>>
>
> I think that technically, you could monkey around to achieve that.  But it
> is probably a lot more trouble than it's worth (risks of double deployment,
> a mess when you undeploy or want to manage your apps etc..).
>
> Probably much better to use two separate <Host>, each with its own appBase
> (/webapps) directory;
> in one of them, you deploy your application as the ROOT (default)
> application (see the FAQ for that); in the other, you deploy *a copy* of the
> same application as "monkeys" (and, supposedly, some other "animals"
> application as ROOT).
> The only inconvenient is that when you update the monkeys application,
> you'll have to copy it to both places.  But that will be much easier to
> manage, than to try some clever overlapping scheme which is going to come
> back and hit you somewhere..
>
> Alternatively, if you feel adventurous, you could try a single <Host> with
> an Alias, and play with the URLrewrite filter (see www.tuckey.org) and
> internal redirects, but... you have been warned.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>



-- 
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message