You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tony Finch <fa...@demon.net> on 1999/05/20 20:16:07 UTC

[PATCH] more mass virtual hosting support

I have finlly got permission to release some modifications that I
developed for Demon Internet to provide better support for mass
dynamic virtual hosting, especially IP-based virtual hosts. It is in
two parts: (1) a new module, mod_vhost_alias, and (2) a patch to the
existing code. We are using this on web servers that have thousands of
IP-based virtual hosts.

The first two attachments to this message are the source code and
documentation for mod_vhost_alias. This module provides simplified and
streamlined support for dynamic mass virtual hosting as compared to
using mod_rewrite. In addition it allows you to vary the DocumentRoot
or a standard ScriptAlias based on the IP address of the server, which
isn't possible with mod_rewrite (but see below).

The third attachment is a patch which does a number of things:

(1) Add a local_ip and local_host fields to conn_rec, analogous to the
remote_ip and remote_host fields. The first of these is used by
mod_vhost_alias and the modified mod_log_config; the second is
required for UseCanonicalName DNS.

(2) (The bulk of the change.) Add a third option to UseCanonicalName,
"DNS". The reson for this is to support ancient browsers that do not
provide a Host: header when we are doing IP-based dynamic virtual
hosting and need to create a self-referential URL, etc. This could
probably be generalised to using DB files etc.

(3) Change mod_log_config to add %A for logging the server address.
The motivation for this is to reduce the number of reverse DNS lookups
required when using UseCanonicalName DNS compared to logging %V.

The fourth attachment is a trivial patch that adds a SERVER_ADDR
environment variable for CGIs and mod_rewrite, partly because it's
easy and adds consistency, and partly because it allows mod_rewrite to
catch up with mod_vhost_alias's functionality :-) We don't use it at
Demon because it isn't standard and we don't need it.

Tony.
-- 
f.a.n.finch   dot@dotat.at   fanf@demon.net   black dog


SSL mass-vhosting

Posted by David Harris <dh...@drh.net>.
On Friday, May 21, 1999 3:09 AM, Tony Finch wrote:
> BTW, something I have been thinking about but haven't investigated yet
> is mass SSL vhosting. Demon uses IP vhosting for historical reasons
> but other than that the main reason to do things that way is SSL. It
> would be cool to get mod_ssl to magically find a vhost's certificate
> on the fly in a similar manner to mod_vhost_alias and the document
> root. I haven't got my head round SSLeay yet so this idea probably
> won't happen until Demon decide they want to do SSL vhosting, unless
> anyone else wants to do it...

I think all the certificate and private key files are loaded in the server
init phase and then stored by mod_ssl. So, it seems that getting mass SSL
vhosting to work would be more of a trick than just dynamically creating the
crt/key path from each request... but more of making the crt/key cache
dynamic.

Ralf, can you offer any guidance?

 - David Harris
   Principal Engineer, DRH Internet Services




Re: [PATCH] more mass virtual hosting support

Posted by Tony Finch <do...@dotat.at>.
Jim Jagielski <ji...@devsys.jaguNET.com> wrote:
>Tony Finch wrote:
>> 
>> The first two attachments to this message are the source code and
>> documentation for mod_vhost_alias. This module provides simplified and
>> streamlined support for dynamic mass virtual hosting as compared to
>> using mod_rewrite. In addition it allows you to vary the DocumentRoot
>> or a standard ScriptAlias based on the IP address of the server, which
>> isn't possible with mod_rewrite (but see below).
>
>wow... I'm gonna try this out on one of my spares.
>This is cool function.

Glad you think so :-)

BTW, something I have been thinking about but haven't investigated yet
is mass SSL vhosting. Demon uses IP vhosting for historical reasons
but other than that the main reason to do things that way is SSL. It
would be cool to get mod_ssl to magically find a vhost's certificate
on the fly in a similar manner to mod_vhost_alias and the document
root. I haven't got my head round SSLeay yet so this idea probably
won't happen until Demon decide they want to do SSL vhosting, unless
anyone else wants to do it...

Tony.
-- 
f.a.n.finch   dot@dotat.at   fanf@demon.net   black dog

Re: [PATCH] more mass virtual hosting support

Posted by Dean Gaudet <dg...@arctic.org>.
+1 for inclusion in 1.3.7. 

Dean

p.s. thanks Tony, glad to see you finally cut through the red tape so you
could release this :) 

On Thu, 20 May 1999, Tony Finch wrote:

> I have finlly got permission to release some modifications that I
> developed for Demon Internet to provide better support for mass
> dynamic virtual hosting, especially IP-based virtual hosts. It is in
> two parts: (1) a new module, mod_vhost_alias, and (2) a patch to the
> existing code. We are using this on web servers that have thousands of
> IP-based virtual hosts.
> 
> The first two attachments to this message are the source code and
> documentation for mod_vhost_alias. This module provides simplified and
> streamlined support for dynamic mass virtual hosting as compared to
> using mod_rewrite. In addition it allows you to vary the DocumentRoot
> or a standard ScriptAlias based on the IP address of the server, which
> isn't possible with mod_rewrite (but see below).
> 
> The third attachment is a patch which does a number of things:
> 
> (1) Add a local_ip and local_host fields to conn_rec, analogous to the
> remote_ip and remote_host fields. The first of these is used by
> mod_vhost_alias and the modified mod_log_config; the second is
> required for UseCanonicalName DNS.
> 
> (2) (The bulk of the change.) Add a third option to UseCanonicalName,
> "DNS". The reson for this is to support ancient browsers that do not
> provide a Host: header when we are doing IP-based dynamic virtual
> hosting and need to create a self-referential URL, etc. This could
> probably be generalised to using DB files etc.
> 
> (3) Change mod_log_config to add %A for logging the server address.
> The motivation for this is to reduce the number of reverse DNS lookups
> required when using UseCanonicalName DNS compared to logging %V.
> 
> The fourth attachment is a trivial patch that adds a SERVER_ADDR
> environment variable for CGIs and mod_rewrite, partly because it's
> easy and adds consistency, and partly because it allows mod_rewrite to
> catch up with mod_vhost_alias's functionality :-) We don't use it at
> Demon because it isn't standard and we don't need it.
> 
> Tony.
> -- 
> f.a.n.finch   dot@dotat.at   fanf@demon.net   black dog
> 
>