You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by David Robinson <dr...@ast.cam.ac.uk> on 1996/04/02 20:51:00 UTC

HostAlias (was Re: cvs commit: apache/src CHANGES http_config.c http_config.h http_core.c http_main.c http_protocol.c httpd.h util.c)

> akosut      96/03/27 23:59:37
> 
>  Modified:    src       CHANGES http_config.c http_config.h http_core.c
>                        http_main.c  http_protocol.c httpd.h util.c
>  Log:
>  Add new directive, <HostAlias>, very similar to <VirtualHost> in
>  function, but instead of binding the server to a new IP address, it
>  uses hostnames derived from the Host: header and/or full-URI
>  requests. (Requests that have neither will be served the documents as
>  given normally) The directive is of the form <HostAlias *.foo.com
>  foo.bar.net foo.com> (multiple entires seperated by spaces, with
>  wildcards).

Sorry I didn't spot this before, but the subject really wasn't very
informative.

I think that the invention of a completely new <HostAlias> section is
unnecessary and over-complicated. It is duplicating the entire functionality
of the VirtualHost directive. Apart from questions like can hostalias
and virtual host nest?, and can directives in virtual host sections be
allowed in host alias sections? -- there is the point that this could be
achivied simply by modifying the VirtualHost directive.

i.e. simply take the names in the virtual host directive as host aliases
as well interfaces.

Advantages: minimal changes to existing configuration files.

Implementation: each virtual host has an address property list and a hostname
property list.

<VirutalHost host1 host2 ... >
adds the IP adress for each host to the address list, and adds the hostname
itself to the hostname list.

The virtual host is matched by the request if the incoming address is
on the address list, and the Host: or URL host is on the hostname list.

Thus 

<VirtualHost host1.dom>
</VirtualHost>

<VirtualHost host2.dom>
</VirtualHost>

will 'work' for 1.1 queries even if host1.dom and host2.dom have the
same IP address.

 David.