Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 48233 invoked from network); 5 Dec 2003 08:49:45 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Dec 2003 08:49:45 -0000 Received: (qmail 18020 invoked by uid 500); 5 Dec 2003 08:49:10 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 17716 invoked by uid 500); 5 Dec 2003 08:49:08 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 17703 invoked from network); 5 Dec 2003 08:49:07 -0000 Received: from unknown (HELO laudlink.ru) (212.45.17.1) by daedalus.apache.org with SMTP; 5 Dec 2003 08:49:07 -0000 Received: from sysadmin (miksir.laudlink.ru [192.168.64.30]) by laudlink.ru (8.11.4/8.11.4) with ESMTP id hB58m9a49411; Fri, 5 Dec 2003 11:48:09 +0300 (MSK) Date: Fri, 5 Dec 2003 11:48:15 +0300 From: D Kelmi X-Mailer: The Bat! (v2.01) Reply-To: D Kelmi Organization: LaudLink X-Priority: 3 (Normal) Message-ID: <127248711718.20031205114815@laudlink.ru> To: "Boyle Owen" CC: users@httpd.apache.org In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: Re[4]: [users@httpd] NameVirtualHost * with X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello Boyle, Friday, December 5, 2003, 11:27:37 AM, you wrote: >> -----Original Message----- >> From: D Kelmi [mailto:miksir@laudlink.ru] >> >> > Try this (notice two NameVirtualHost directives): >> > NameVirtualHost empty.somedomain.com >> > NameVirtualHost www.somedomain.com BO> First, can we correct the advice posted earlier. NameVirtualHost should BO> take an IP address as an argument - not a fully-qualified domain name. BO> If you give it an FQDN, it will "work" but only because apache resolves BO> the name to its IP. If you have any DNS problems, apache could fail to BO> start. NameVirtualHost also can take * as argument for match all addresses. BO> To return to your misconfiguration problem; >>> NameVirtualHost * >>> >>> >>> DocumentRoot ... >>> ServerName empty.somedomain >>> >>> >>> >>> DocumentRoot ... >>> ServerName www.somedomain >>> >>> >>> But now for 1.2.3.4 run _ip-based_ virtual hosting. As result, for >>> requests to 1.2.3.4 always answer second virtualhost. BO> IP-based VHs supersede name-based VHs so the apache behaviour you see is BO> exactly correct. Not a bug. Why? I say in NameVirtualHost what my all IP addresses must support name-based virtual hosting. And now Apache must look all VHs with the same IP (same with request destination) and also look VHs with * (VHs which support any request destination). Right? >>> And more, if >>> i add third virtualhost this 1.2.3.4 IP, apache generate warning >>> about overlaps. BO> Of course it does. How is apache supposed to decide which VH to use if BO> they both have the same IP address? It is like you have two letter-boxes BO> with the same name on them. How can the postman decide which one to use? Again, I say, what 1.2.3.4 used for name-based hosting and apache must select VHs using Host: header and ServerName/ServerAlias directives in VH. >>> I think, that's wrong, because NameVirtualHost * say, what for >>> all IP run name-based virtual hosting. BO> You are assuming that NameVirtualHost will take priority and that the BO> IP-based VH will live inside it somehow. If you think about it, that is BO> impossible. BO> You do not tell us how many IP addresses you have on your server. If BO> only one, then I guess you are trying to achieve the following: BO> if hostname is set in request, do name-based VHing BO> else BO> use IP-VHing BO> The way to set that up is as follows: BO> NameVirtualHost 1.2.3.4 BO> BO> ServerName dummy BO> DocumentRoot /path/to/default/site BO> BO> BO> ServerName site_1 BO> DocumentRoot /path/to/site_1 BO> BO> BO> ServerName site_2 BO> DocumentRoot /path/to/site_2 BO> BO> etc. BO> If the request matches site_1 or site_2, it will be served from the BO> correct VH. If it doesn't match, or doesn't contain a hostname, apache BO> will fall-back to the *first* VH in the list, which is the "dummy" site. Ok. Now say, which VHs will be "dummy" in this example: NameVirtualHost 1.2.3.4 ServerName site1 ServerName site2 Which? site1 or site2? I think, what site1, because match 1.2.3.4 IP also. Apache think, what site2. -- Best regards, D Kelmi mailto:miksir@laudlink.ru --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org