Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 53865 invoked by uid 500); 22 Jun 2000 02:30:35 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 53851 invoked from network); 22 Jun 2000 02:30:32 -0000 From: "William A. Rowe, Jr." To: , Subject: RE: confused about new ServerName logic Date: Wed, 21 Jun 2000 21:29:06 -0500 Message-ID: <002801bfdbf1$d6b6f8e0$345985d0@corecomm.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <200006220216.WAA03924@k5.localdomain> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N I don't disagree, but let's tear apart the code in 1.3.13... #ifdef BEOS /* BeOS returns zero as an error for gethostname */ if (gethostname(str, sizeof(str) - 1) == 0) { #else if (gethostname(str, sizeof(str) - 1) != 0) { #endif /* BeOS */ ap_log_error(APLOG_MARK, APLOG_WARNING, NULL, "%s: gethostname() failed to detemine ServerName\n", ap_server_argv0); server_hostname = ap_pstrdup(a, "127.0.0.1"); } else { str[sizeof(str) - 1] = '\0'; if ((!(p = gethostbyname(str))) || (!(server_hostname = find_fqdn(a, p)))) { /* Recovery - return the default servername by IP: */ // Right here we gracefully recover if there isn't a single 'undotted' // name to be found. I would be equally happy accepting an 'undotted' // name if we have one, but failing that... here's our 'real' IP string: if (!str && p->h_addr_list[0]) { ap_snprintf(str, sizeof(str), "%pA", p->h_addr_list[0]); server_hostname = ap_pstrdup(a, str); } } } // Massive bummer... gethostname+gethostbyname got us nowhere at all. // But this way we don't fail to start the server... if (!server_hostname) server_hostname = ap_pstrdup(a, "127.0.0.1"); // Here's the error... now we need the server_rec as an argument if anything // is going to land in the log: ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, NULL, "%s: Missing ServerName directive, assumed host name %s\n", ap_server_argv0, server_hostname); Somehow, some way they get a ServerName. Best if it's fully qualified. Somewhat acceptable if we have an ip string. I suppose even a local, undotted name would be preferable to a private ip address. But failing all that, they get 127.0.0.1 - so... On the logic level, what do you want to change? Add the server_rec and log it in the right place? Forewarned... this happens pretty early, and there may be no logs yet. There will be logs once (at least under Win32) the conf is reparsed �n the child. Since it died before, rather than continuing, Win32 showed no log entries and the service wouldn't start. Bill > -----Original Message----- > From: Jeff Trawick [mailto:trawick@ibm.net] > Sent: Wednesday, June 21, 2000 9:17 PM > To: new-httpd@apache.org > Subject: Re: confused about new ServerName logic > > > > From: "William A. Rowe, Jr." > > Date: Wed, 21 Jun 2000 14:50:54 -0500 > > > > Accepted... > > Actually, I'm not happy with the original patch I posted. I don't > like the way the code is in CVS now, but you convinced me to shift > some towards your view. > > What I really don't like: > > error message on terminal for what I would consider a reasonable > configuration (no ServerName, but gethostname(), gethostbyname(), > and find_fqdn() all succeed) > > My current thought... > > I think it is fine to write a log message whenever we determine the > server name. It should be informational (and only to the log) if > for all we know it is a reasonable configuration; it should be an > alert or error message (and to the terminal) if we use 127.0.0.1. > > > Recognize that the patch does not report the assumption of any > > other numeric IP as the ServerName, which was the the original > > reason my original patch was voted down. > > In what case do we assume a numeric IP other than 127.0.0.1? > > Thanks, > > Jeff > > -- > Jeff Trawick | trawick@ibm.net | PGP public key at web site: > http://www.geocities.com/SiliconValley/Park/9289/ > Born in Roswell... married an alien... >