> -----Original Message-----
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, March 04, 2016 3:36 PM
> To: Tomcat Users List <users@tomcat.apache.org>
> Subject: Re: Multiple domian names one web site different content
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jose,
> 
> On 3/4/16 3:46 PM, Jose María Zaragoza wrote:
> > Maybe my question does't have to do with current thread ( an
> > probably doesn't have any sense at all) but :
> >
> > would be possible to define "VirtualHost" according the destination
> > port ? I know that VirtualHost diferent domain name, but i want to
> > keep the same domain name and to define 2 connectors , listening on
> > 8080 and 8081 Requests to 8080 go to /webapps-app1 and requests to
> > 8081 go to /webapps-app2
> >
> > is it possible in a only one Tomcat instance ? or  I need to
> > configure 2 tomcat instances ?
> 
> You would need to configure Tomcat to listen on two different
> interfaces (or two different ports as you have above), plus have those
> <Connectors> in separate <Service>s in Tomcat's configuration so their
> <Host>s wouldn't interfere.
> 
> More trouble than it's worth IMO.
> 
> - -chris

Chris's approach is correct.  That's the only way to separate <Connectors> by 
<Host>.
If you are stuck with that approach for some reason, it's what you'd need to 
do.  But might as well have two separate tomcat instances.  After all, that is 
what setting up multiple <Service> configs is really accomplishing.
The only advantage this gives you is if you are tight on memory and need to 
share the JVM's heap space between the webapp. (note: this only shares the 
memory, neither has access to the other's objects.)
Used to do this for some smallish webapps on Windows, primarily to give each 
webapp/host it's own connector set for 80/443 without having to do dances 
around that default host stuff.
Nowadays, I'm on linux with a load-balancing front-end that can properly serve 
the correct SSL certificate, so it's not so important.

Jeff

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

Reply via email to