tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Dynamic Aliases and db connections?
Date Mon, 27 Apr 2009 06:58:04 GMT
Hi.

There are two parts to your question, only one of which I can maybe 
contribute to.

Regarding hostnames and aliases :

First, to have requests to "sub1.domain.com" even reach your Tomcat 
server, it would have to be so of course that the DNS system recognises 
"sub1.domain.com" and translates it to the IP address of your server.
That part does not happen automatically, you have to make it happen, first.

Then regarding hosts and aliases recognised by Tomcat :
As long as a request for, say, "sub3.domain.com" reaches Tomcat (see DNS 
above), Tomcat will process the request.
Either it will find in its configuration a <Host> element with
a "name" attribute matching "sub3.domain.com", or a Host element 
containing a matching <Alias> tag, or else it will handle the request 
using its "default host" (the one named in the <Engine> tag).
Then, when it has selected the appropriate Host, it will process the 
request using the configuration of that <Host>, meaning essentially what 
it finds either between that Host's <Host> and </Host> tags, and 
anything defined at a higher level.

So now your problem is just moved down a notch, to the additional 
resources you seem to want to allocate per client.
Don't know if that really helps though.


Raymond Kleijngeld wrote:
> Hello,
> 
> I'm writing an application to support multiple clients using the same
> tomcat application. For security purposes I want each client to have
> there own database schema and subsequently their own subdomain i.e.
> sub1.domain.com, sub2.domain.com etc. 
> 
> I know I can update the server.xml file and add extra resource tags and
> extra alias tags for each new client but I don't want the tomcat server
> to be restarted because this would interupt the service/application to
> other clients.
> 
> So basically the question is how can I do this without having to stop
> and start the tomcat service?
> 
> Is there a <Alias> wildcard option like: <Alias>*.domain.com</Alias>
> that will automatically allow all subdomains to go through to this
> tomcat application? Maybe there should be something similar as the
> <Valve> option for RemoteHostValve and RemoteAddrValve?
> 
> I have been playing with the context.xml file in the
> conf/[engine]/[host]/ROOT.xml file and I have been able to add more db
> resources in there but the problem with this is that a client can also
> unsubscribe from my application which would mean I would remove the
> resource entry from the ROOT.xml file and then this is being undeployed
> deleting all content from the docBase folder which is of course not what
> I want.
> 
> Any help would be much appreciated.
> 
> Thanks
> 
> Ray
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


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


Mime
View raw message