You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Łukasz Łapiński <l....@wp.pl> on 2007/07/28 20:18:57 UTC

Subdomains/ Virtual Hosts+ Tomcat 5.5/6.0

Hello,

I am not really sure where to start. Whether it should be a dns
modification or virtual hosts in tomcat?

I am doing a web portal that a user after registration would have its own
domain, such as:

max.foo.com
jarek.foo.com

at my server foo.com.

How to add programmatically, without restarting the server such domains.

I have been reading around but no good solution have I found. Could you
recommend me some libraries, tools or techniques?

Would it be more difficult when I start to use load balancing
functionality of Tomcat?


-- 
Kind regards,
Łukasz Łapiński

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


Re: Subdomains/ Virtual Hosts+ Tomcat 5.5/6.0

Posted by Bill Barker <wb...@wilshire.com>.
"�ukasz �api�ski" <l....@wp.pl> wrote in message 
news:op.tv6s5vhaxdblfq@jarod...
> Hello,
>
> I am not really sure where to start. Whether it should be a dns
> modification or virtual hosts in tomcat?
>
> I am doing a web portal that a user after registration would have its own
> domain, such as:
>
> max.foo.com
> jarek.foo.com
>
> at my server foo.com.
>
> How to add programmatically, without restarting the server such domains.
>

Obviously DNS has to be handled no matter what you do.  The rest depends on 
how you are deploying the resulting sites.  If they can be deployed all 
under one (the Engine's default) <Host />, then you can probably get away 
with a Filter that plays traffic cop and forwards requests to the correct 
web-app based on the Host header.  Otherwise, you would probably need to use 
JMX to dynamically add a new <Host /> and persist it to server.xml (with 
appropriate syncs).  In the second case, it may even be worth looking into 
an Embedded TC, so you don't have to store the <Host /> info in server.xml.

> I have been reading around but no good solution have I found. Could you
> recommend me some libraries, tools or techniques?
>
> Would it be more difficult when I start to use load balancing
> functionality of Tomcat?
>

Short answer: likely.  You need some form of file-replecation whatever you 
do.  If you can use the defaultHost method, then the Filter needs some way 
to update it's list of installed hosts.  If you go the JMX route, then you 
need a notification method (for a small cluster, raw JMX might work, for a 
large cluster, you probably need to write some kind of multi-castor 
notification).

>
> -- 
> Kind regards,
> �ukasz �api�ski
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 




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


Re: Subdomains/ Virtual Hosts+ Tomcat 5.5/6.0

Posted by Lucas Galfaso <lg...@gmail.com>.
.) I think the original question is not for this newsgroup.
.) You can use domain identifiers with wildcards, like *.foo.com
.) Tomcat load balancing should have no issues with this if the web
app does not have an issue with it.


On 7/28/07, Łukasz Łapiński <l....@wp.pl> wrote:
> Hello,
>
> I am not really sure where to start. Whether it should be a dns
> modification or virtual hosts in tomcat?
>
> I am doing a web portal that a user after registration would have its own
> domain, such as:
>
> max.foo.com
> jarek.foo.com
>
> at my server foo.com.
>
> How to add programmatically, without restarting the server such domains.
>
> I have been reading around but no good solution have I found. Could you
> recommend me some libraries, tools or techniques?
>
> Would it be more difficult when I start to use load balancing
> functionality of Tomcat?
>
>
> --
> Kind regards,
> Łukasz Łapiński
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>