httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: IP v. Host based virtualhosts
Date Sun, 09 Feb 1997 07:09:36 GMT
On Sat, 8 Feb 1997, Dean Gaudet wrote:

> Oh my, I certainly wasn't paying attention back then (way too busy at
> work).  I would have fought hard for <HostAlias>.  See some of my rants in
> early 96 (subject includes "security").

I think you were on vacation at the time.

> The problems going on now are mostly user error, but compounded by the
> following facts (I think we went through all this when Brian had a problem
> with hyperreal's config).  I'm pretty sure the following are all still
> true:
> - <VirtualHost> sections are scanned LAST to FIRST (i.e. last in the file
>     is the first on the linked list of servers)

> - the last vhost to name-match (i.e. the closest to the top of the file)
>     is the one that will be served

Although combined with the scanning order, this makes it somewhat

> - it is possible to name-match a server which doesn't ip-match (and possibly
>     not even port-match, I seem to recall ports being ignored during
>     name-matching).  To be fair, we document this behaviour.

We fixed the port-matching, I think, though it took a couple tries.

> - if you have a virtualhost for the server's "main ip address" then it
>     immediately gets treated as a name-vhost (despite the presence/lack of
>     other name-vhosts).  I run into this because I don't like the "main
>     server" having loads of stuff which is "inherited" into all vhosts.
>     I typically have to work around it by using a vhost with ip

Yes. The reason for this is I needed a way to make it intuitive for
the user - otherwise, when they set up a name-vhost, it would suddenly
override the main server, since it would have the same IP
address. Perhaps a better way would be to make the main server bind to
its IP address by default (I don't think it does that now unless you
use Listen or BindAddress), and then have each virtual host try and
bind (as they do now if the IP addies don't match). If you get an
error on binding, treat it as a name-vhost.

But that would make it harder to find errors if you really did want an
ip-vhost, since Apache would just keep on humming.

Alexei Kosut <>      The Apache HTTP Server

View raw message