You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gregor Schneider <rc...@googlemail.com> on 2009/03/10 20:07:59 UTC
Lazy Virtual Hosting?
Hi guys,
just a quickone:
I'm having a server here running 4 different domains, luckily having a
bunch of IP-adresses on said host available.
On my test-server, I just had one IP-adress, thus I created one
HTTP-Connector (without the adress-param), below an Engine and inside
the Engine 4 different Host-Elements.
Working like charm.
None of those domains requires SSL.
Now me being lazy, I'm wondering:
Should I just run this configuration on our Prod-server? Although
DNS-entries for said domains all point to different IP-adresses,
Tomcat doesn't bother since it's just reading the headers and routing
to the correct host.
So what would you do? Be lazy? Set up the config perfectly? What's the
benfit setting up a HTTP-Connector for each IP-Adress?
Your input very welcome!
Rgds
Gregor
--
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Robert Koberg <ro...@koberg.com>.
On Mar 12, 2009, at 12:18 PM, Mark Thomas wrote:
> Gregor Schneider wrote:
>> Mark,
>>
>> I guess I didn't phrase properly since you seem to have
>> misunderstood me:
>>
>> I want a *separation* of the hosts. Alias, as I understand it, helps
>> to run multiple domains within the same IP-adress.
>
> I thought the issue was that you wanted to make sure the name and
> associated IP address were served by the same virtual host. Without an
> alias for the IP address any requests that use IP address rather than
> FQDN will be served by the default host.
Here is place where I have wanted external host files similar to
webapp configs, e.g.
$TC/conf/Catalina/_common_/shared-webapp.xml
$TC/conf/Catalina/_common_/shared-webapp2.xml
$TC/conf/Catalina/localhost/host-webapp.xml
$TC/conf/Catalina/my.domain.com/host-webapp2.xml
$TC/conf/Catalina/my.domain.com.xml
$TC/conf/Catalina/my.domain.com.xml
So, similar to how webapp loading, the hosts could be loaded based off
of existing configs.
Is this in the realm of possibilities?
-Rob
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Mark Thomas <ma...@apache.org>.
Gregor Schneider wrote:
> Mark,
>
> I guess I didn't phrase properly since you seem to have misunderstood me:
>
> I want a *separation* of the hosts. Alias, as I understand it, helps
> to run multiple domains within the same IP-adress.
I thought the issue was that you wanted to make sure the name and
associated IP address were served by the same virtual host. Without an
alias for the IP address any requests that use IP address rather than
FQDN will be served by the default host.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Gregor Schneider <rc...@googlemail.com>.
On Thu, Mar 12, 2009 at 5:29 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: Gregor Schneider [mailto:rc46fi@googlemail.com]
>> Subject: Re: Lazy Virtual Hosting?
>>
>> I want a *separation* of the hosts. Alias, as I understand it, helps
>> to run multiple domains within the same IP-adress.
>
> No, it can be used for different things. In this case, the <Alias> simply allows use of either the DNS name or the IP address. You would still have one <Host> element for each site, and each <Host> element would have an <Alias> of its IP address inside it.
>
>> Since I can't insert a Valve into a Server-Element, there's
>> no SSO-functionality between different Services
>
> Yup, that precludes the strict separation mechanism.
>
>> Therefore, I guess I stick with my current design having 1 Service, 1
>> Executor, in there 1 HTTP-Connector for each IP, and I should be on
>> the safe side.
>
> Yes, just add the appropriate <Alias> inside each <Host>.
>
I see. What I missed was, that I assumed (led by the example in the
docs) that Alias takes a hostname as argument. Never thought of the
option to place an IP-address.
Cheers
Gregor
--
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Lazy Virtual Hosting?
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Gregor Schneider [mailto:rc46fi@googlemail.com]
> Subject: Re: Lazy Virtual Hosting?
>
> I want a *separation* of the hosts. Alias, as I understand it, helps
> to run multiple domains within the same IP-adress.
No, it can be used for different things. In this case, the <Alias> simply allows use of either the DNS name or the IP address. You would still have one <Host> element for each site, and each <Host> element would have an <Alias> of its IP address inside it.
> Since I can't insert a Valve into a Server-Element, there's
> no SSO-functionality between different Services
Yup, that precludes the strict separation mechanism.
> Therefore, I guess I stick with my current design having 1 Service, 1
> Executor, in there 1 HTTP-Connector for each IP, and I should be on
> the safe side.
Yes, just add the appropriate <Alias> inside each <Host>.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Gregor Schneider <rc...@googlemail.com>.
Mark,
I guess I didn't phrase properly since you seem to have misunderstood me:
I want a *separation* of the hosts. Alias, as I understand it, helps
to run multiple domains within the same IP-adress.
Therefore, I'm using multiple host-elements (one for each
IP/domain-combination) to separate them - aka virtual hosting - esp.,
since they serve different content.
@Chuck:
> Caldarale, Charles R wrote:
>
> If you really want to have a separate <Connector> for each site with no potential for cross-talk, you'll actually need a separate
> <Service> element for each. Alternatively, a <Valve> at the <Engine> level would probably suffice to prevent mixing of IP
> addresses and site names.
Multiple Service-Elements for me, I guess, would be a show-stopper:
If I'm not mistaken, Tomcat's SSO-Valve only works within multiple
Engines (as toplevel-element). Since I can't insert a Valve into a
Server-Element, there's no SSO-functionality between different
Services - am I right with that?
Therefore, I guess I stick with my current design having 1 Service, 1
Executor, in there 1 HTTP-Connector for each IP, and I should be on
the safe side.
Any objections from the gurus?
Rgds
Gregor
--
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Mark Thomas <ma...@apache.org>.
Caldarale, Charles R wrote:
>> From: Gregor Schneider [mailto:rc46fi@googlemail.com]
>> Subject: Re: Lazy Virtual Hosting?
>>
>> However, since I'll have to use Authentication (see my other post),
>> thus needing SSL, I guess I have to setup a HTTP-Connector for each
>> of them.
>
> Depends on how much separation you want. If you're using a self-signed certificate, then the same one should suffice for all of your sites. If you want real certificates, then you'll need a separate <Connector> for each site, assigned to the IP address for that site. Clients won't be able to login with an IP address, but that's probably not a big deal.
>
> If you really want to have a separate <Connector> for each site with no potential for cross-talk, you'll actually need a separate <Service> element for each. Alternatively, a <Valve> at the <Engine> level would probably suffice to prevent mixing of IP addresses and site names.
The simplest way to achieve this would be to use an <Alias> element under each
<Host> element that specifies the IP address for that host.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Gregor Schneider <rc...@googlemail.com>.
Chris,
On Fri, Mar 13, 2009 at 3:18 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> Another potential reason for using separate <Connector>s is to
> (somewhat) guarantee availability of each of your webapps. If you have
> an <Executor> with 100 threads available, a single webapp('s users) can
> consume all the threads and (temporarily) starve the other webapps.
>
That's a very interesting thought - thanks for that one!
Rgds
Gregor
--
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chuck,
On 3/10/2009 9:27 PM, Caldarale, Charles R wrote:
>> From: Gregor Schneider [mailto:rc46fi@googlemail.com]
>> Subject: Re: Lazy Virtual Hosting?
>>
>> However, since I'll have to use Authentication (see my other post),
>> thus needing SSL, I guess I have to setup a HTTP-Connector for each
>> of them.
>
> If you really want to have a separate <Connector> for each site with
> no potential for cross-talk, you'll actually need a separate <Service>
> element for each. Alternatively, a <Valve> at the <Engine> level would
> probably suffice to prevent mixing of IP addresses and site names.
Another potential reason for using separate <Connector>s is to
(somewhat) guarantee availability of each of your webapps. If you have
an <Executor> with 100 threads available, a single webapp('s users) can
consume all the threads and (temporarily) starve the other webapps.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkm6aywACgkQ9CaO5/Lv0PCzAQCfQlwPKYXOn/uyrZW3WcWJZl0l
BZQAn3omVt3HGzeKxmd9m5sIOtWYfZja
=IIQw
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Lazy Virtual Hosting?
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Gregor Schneider [mailto:rc46fi@googlemail.com]
> Subject: Re: Lazy Virtual Hosting?
>
> However, since I'll have to use Authentication (see my other post),
> thus needing SSL, I guess I have to setup a HTTP-Connector for each
> of them.
Depends on how much separation you want. If you're using a self-signed certificate, then the same one should suffice for all of your sites. If you want real certificates, then you'll need a separate <Connector> for each site, assigned to the IP address for that site. Clients won't be able to login with an IP address, but that's probably not a big deal.
If you really want to have a separate <Connector> for each site with no potential for cross-talk, you'll actually need a separate <Service> element for each. Alternatively, a <Valve> at the <Engine> level would probably suffice to prevent mixing of IP addresses and site names.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Gregor Schneider <rc...@googlemail.com>.
On Tue, Mar 10, 2009 at 10:27 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: Gregor Schneider [mailto:rc46fi@googlemail.com]
>> Subject: Re: Lazy Virtual Hosting?
>>
>
> My only concern is if some client started using an IP address rather than the name associated with that address; such requests would all be handled by the default <Host>, regardless of target IP address. Do you care?
>
Well, that's a point, but ppl using our website hardly do know the
meaning of an IP-adress ;)
However, since I'll have to use Authentication (see my other post),
thus needing SSL, I guess I have to setup a HTTP-Connector for each of
them.
Cheers
Gregor
--
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Lazy Virtual Hosting?
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Gregor Schneider [mailto:rc46fi@googlemail.com]
> Subject: Re: Lazy Virtual Hosting?
>
> So it seems there are no catches if I'm setting up the
> server the lazy way - correct?
My only concern is if some client started using an IP address rather than the name associated with that address; such requests would all be handled by the default <Host>, regardless of target IP address. Do you care?
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by Gregor Schneider <rc...@googlemail.com>.
On Tue, Mar 10, 2009 at 9:09 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: André Warnier [mailto:aw@ice-sa.com]
>> Subject: Re: Lazy Virtual Hosting?
>>
>> So if you have 4 Connectors, you will be having 4 independent
>> number of min and max threads, and 4 independent settings for
>> the number of TCP connections to be queued up.
>
> On Tomcat 6, you can use an <Executor> as a common thread pool for all <Connector> elements.
>
Sorry, I fogot to mention that I do have an Executor specified:
<Service name="Catalina">
<Executor name="tomcatThreadPool"
namePrefix="catalina-exec-"
daemon="true"
maxThreads="150"
minSpareThreads="4"
maxIdleTime="60000"/>
<Connector port="80"
[ ... ]
<Engine name="Catalina" defaultHost="www.somehost.de">
<Host name="www.somehost.de"
</Host>
<Host name="www.someotherhost.com"
</Host>
<Host name="www.tele-underwriting.de"
</Host>
@André:
Not a Tomcat-specialist? Good joke ;)
@ all:
So it seems there are no catches if I'm setting up the server the lazy
way - correct?
Rgds
Gregor
--
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Lazy Virtual Hosting?
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: Re: Lazy Virtual Hosting?
>
> So if you have 4 Connectors, you will be having 4 independent
> number of min and max threads, and 4 independent settings for
> the number of TCP connections to be queued up.
On Tomcat 6, you can use an <Executor> as a common thread pool for all <Connector> elements.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Lazy Virtual Hosting?
Posted by André Warnier <aw...@ice-sa.com>.
Gregor Schneider wrote:
> Hi guys,
>
> just a quickone:
>
> I'm having a server here running 4 different domains, luckily having a
> bunch of IP-adresses on said host available.
>
> On my test-server, I just had one IP-adress, thus I created one
> HTTP-Connector (without the adress-param), below an Engine and inside
> the Engine 4 different Host-Elements.
> Working like charm.
>
> None of those domains requires SSL.
>
> Now me being lazy, I'm wondering:
>
> Should I just run this configuration on our Prod-server? Although
> DNS-entries for said domains all point to different IP-adresses,
> Tomcat doesn't bother since it's just reading the headers and routing
> to the correct host.
>
> So what would you do? Be lazy? Set up the config perfectly? What's the
> benfit setting up a HTTP-Connector for each IP-Adress?
>
> Your input very welcome!
>
From a non-Tomcat specialist, simply going by the docs and the little I
have learned here :
As I understand, when you use the standard HTTP Connector, the Connector
is the one who creates the threads that will handle requests. It is
also the one which keeps the TCP connection queue when there are more
requests pending than the maximum number of living threads can handle.
So if you have 4 Connectors, you will be having 4 independent number of
min and max threads, and 4 independent settings for the number of TCP
connections to be queued up.
Having 4 connectors would also allow you to set different other
Connector-specific settings, in case you need them.
Now whether all that would ultimately be an advantage or a disadvantage,
that is beyond my faculties of analysis.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org