Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 21692 invoked by uid 6000); 3 Jan 1998 07:18:14 -0000 Received: (qmail 21680 invoked from network); 3 Jan 1998 07:18:12 -0000 Received: from camel8.mindspring.com (207.69.200.58) by taz.hyperreal.org with SMTP; 3 Jan 1998 07:18:12 -0000 Received: from posthuman.com (user-38lcp4a.dialup.mindspring.com [209.86.100.138]) by camel8.mindspring.com (8.8.5/8.8.5) with ESMTP id CAA08208 for ; Sat, 3 Jan 1998 02:18:07 -0500 (EST) Message-ID: <34ADE5C2.A9F57CEA@posthuman.com> Date: Sat, 03 Jan 1998 02:16:18 -0500 From: Brian Atkins X-Mailer: Mozilla 4.04 [en] (Win95; I) MIME-Version: 1.0 To: new-httpd@apache.org Subject: Re: r->hostname vs. s->server->server_hostname References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Hi, we were the ones who posted about this to the newsgroup... Before I dive into the code to try and hack it myself, I'd like to know if anyone out there is working on this or plans to work on it (you mention some patches in progress below...) ? Thanks, and any tips as to what lines to look at in the code would be most helpful! Dean Gaudet wrote: > > There's like a half-dozen PRs mentioning the related issue of how the port > number is chosen for generating these "canonical" URLs. My opinion on > this topic is that web servers have a single canonical name, and catering > to "http://www/" is not worth any effort in core code. I'd rather just > advocate a mod_rewrite rule that sends a redirect to correct broken URLs. > Apache right now dictates that a server has a single canonical name. > > That doesn't mean I'd veto a change that gets rid of the concept of a > canonical name, and generates URLs using (r->hostname ? r->hostname : > r->server->server_hostname) and ntohs(r->connection->local_addr.sin_port). > > If we go that way, the Port directive should be disallowed inside vhosts, > and Port should be documented as only there for legacy compatibility with > NCSA, in the main server only. > > Some of this is related to Martin's URL parsing patches that are in > progress still. > > Dean > > On Thu, 1 Jan 1998, Marc Slemko wrote: > > > background: say you want to use mod_rewrite to implement large numbers of > > pseudo vhosts (without using real vhosts with their overhead), eg. one for > > each user. It appears like this _almost_ works. You need to make a custom > > log using {Host}i to get the server name logged right, but that isn't a > > big deal. > > > > The problem comes with when Apache has to generate the servername. This > > happens in several places, but one most visable externally is in the > > creation of redirects; they get redirected to the ServerName name instead > > of the pseudo-vhost name. > > > > Why not use r->hostname instead of s->server_hostname for generating the > > redirect URL (and possibly other things... but you have to be very careful > > there...) if it is set? This has the added advantages of eliminating all > > the double auth problems when someone gets a redirect from http://site/foo > > to http://site.domain.com/foo/ in addition to fixing the redirect problem > > here. > > > > The problem is that construct_url doesn't take the request_rec but only > > the server_rec. A new function could be added easily enough that took the > > request_rec instead and did this, since all construct_url does is: > > > > API_EXPORT(char *) construct_url(pool *p, const char *uri, const > > server_rec *s) > > { > > return pstrcat(p, "http://", > > construct_server(p, s->server_hostname, s->port), > > uri, NULL); > > } > > > > The disadvantage of this idea is that it doesn't discourage URL-variance, > > however it isn't encouraging it; just lessening the effect of it changing > > in midstream. This would eliminate a lot of user problems since most > > clients send the Host: header. > > > > Comments? > > > > -- The future has arrived; it's just not evenly distributed. -William Gibson ______________________________________________________________________ Visit Hypermart at http://www.hypermart.net for free business hosting!