Received: by taz.hyperreal.com (8.7.5/V2.0) id GAA15731; Mon, 30 Sep 1996 06:38:17 -0700 (PDT) Received: from sierra.zyzzyva.com by taz.hyperreal.com (8.7.5/V2.0) with ESMTP id GAA15720; Mon, 30 Sep 1996 06:38:11 -0700 (PDT) Received: from sierra.zyzzyva.com (localhost [127.0.0.1]) by sierra.zyzzyva.com (8.7.5/8.7.3) with ESMTP id IAA04920 for ; Mon, 30 Sep 1996 08:38:07 -0500 (CDT) Message-Id: <199609301338.IAA04920@sierra.zyzzyva.com> To: new-httpd@hyperreal.com Subject: Re: more problems with Host:'s In-reply-to: brian's message of Sun, 29 Sep 1996 22:55:05 -0700. X-uri: http://www.zyzzyva.com/ Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 30 Sep 1996 08:38:06 -0500 From: Randy Terbush Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com An interest addition to these findings... The patch I supplied fixed my problem completely. However, I use NO named hosts. Only IP addresses. > > Randy's patch (r->server->next ==> r->server) didn't change a thing. to "fix > it" I had to place the vhost segment for what I was calling the "default" > server at the end. > > Here's the relevant sections from my httpd.conf file. Hyperreal's primary > address is 204.152.144.36. > > Port 8O > ServerName www.hyperreal.com > DocumentRoot /export/pub > > < 204.152.144.36 came without a Host: header!!>> > > > ServerName www.grooveneedle.com > ..... > > > > ServerName dev.apache.org > ... > > > > ServerName www.hyperreal.com > Redirect /axiom http://www.hyperreal.com/music/labels/axiom > ...(lots of stuff I want to ONLY apply to www.hyperreal.com)... > > > > ServerName www.apache.org > .... > > > etc... > > In order for www.hyperreal.com to come up as the host for requests without a > Host: header, it must be the *last* of the 204.152.144.36 vhosts. Previously I > had it as the *first*, and accesses were defaulting to dev.apache.org's vhost > section. This is a change that happened recently, as in the last few weeks at > the most. > > Now, THIS is where it gets interesting, and what is a real BUG compared to > just being a confusing aspect of the current config situation. Let's say I > move the vhost segment for www.apache.org in between www.grooveneedle.com and > dev.apache.org. When I do that, EVERY request for dev.apache.org and > www.hyperreal.com get shunted to www.grooveneedle.com. If I move the vhost > segment for www.apache.org in between dev.apache.org and www.hyperreal.com, the > www.grooveneedle.com and dev.apache.org work fine, but www.hyperreal.com gets > shunted to dev.apache.org. It appears that only name-vhost segments before the > first IP-vhost segment are matched! > > It looks like the ONLY acceptible config file format is > > VirtualHost name-vhost1 > VH name-vhost2 > .... > VH default-server > VH IP-vhost1 > VH IP-vhost2 > > Etc. Anyone have evidence to the contrary? Does someone know the code well > enough in this area to find the cause? > > On 29 Sep 1996, Dean Gaudet wrote: > > It doesn't seem screwy to me (mind you, I'm looking at 1.1.1 code): > > > > www.hyperreal.com IN A 204.152.144.36 > > www.grooveneedle.com IN A 204.152.144.36 > > > > s are stacked, so the last in the file is the first > > match found. Unless the request has something to differentiate it -- > > which "GET / HTTP/1.0" doesn't -- you get the first match found in > > find_virtual_server. > > Okay, this is the crux of my misunderstanding/problem statement. I guess > nowhere is the logic "if there's no Host header, default to the 'main' server > on that IP number", and if that's the server's main IP number ("Port", outside > of segments), then it should bind to the same DocumentRoot which sits > outside the segments as well. In fact the logic should check that the > vhost segment with ServerName set to the same as ServerName set outside any > segment is the "default" server; presumably that was put there (as I > did, and I know lots others do) to allow for certain configs to be scoped > locally to the main server, not globally to all servers. > > > Anyhow, since check_serverpath() searches from last to first, > > if you put "ServerPath /" into hyperreal's section it will > > become the default. > > Or rearrange the order, as I did do. Neither this or the above suggestion are > intuitive, nor were they required before sometime in the last two weeks. > > Brian > > --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-- > brian@organic.com www.apache.org hyperreal.com http://www.organic.com/JOBS