Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9A5D7D7D for ; Thu, 1 Dec 2011 12:02:26 +0000 (UTC) Received: (qmail 97038 invoked by uid 500); 1 Dec 2011 12:02:25 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 96989 invoked by uid 500); 1 Dec 2011 12:02:25 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 96981 invoked by uid 99); 1 Dec 2011 12:02:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 12:02:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of i.galic@brainsware.org designates 188.40.115.121 as permitted sender) Received: from [188.40.115.121] (HELO mail.brainsware.org) (188.40.115.121) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 12:02:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.brainsware.org (Postfix) with ESMTP id 6CABA6C053 for ; Thu, 1 Dec 2011 12:02:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at brainsware.org Received: from mail.brainsware.org ([127.0.0.1]) by localhost (mail.brainsware.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ybDnZQ9UXTQL for ; Thu, 1 Dec 2011 12:01:56 +0000 (UTC) Received: from mail.brainsware.org (mail.brainsware.org [188.40.115.121]) by mail.brainsware.org (Postfix) with ESMTP id A06DA6C052 for ; Thu, 1 Dec 2011 12:01:56 +0000 (UTC) Date: Thu, 01 Dec 2011 12:01:56 -0000 (UTC) From: Igor =?utf-8?Q?Gali=C4=87?= To: dev@httpd.apache.org Subject: Re: Virtual host and DNS record Message-ID: <5396764f-f3a8-402c-ae17-2a72589ed38a@iris> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Originating-IP: [91.130.91.39] X-Mailer: Zimbra 7.0.0_GA_3077 (ZimbraWebClient - SAF3 (Linux)/7.0.0_GA_3077) ----- Original Message ----- > On Thu, Dec 1, 2011 at 9:34 AM, ipmanux wrote: > > > > Dear all, > > > > I am using RHEL with HTTPD+TOMCAT, I configured =C2=A04 VHOSTs on the > > same server > > > > =C2=A0 -3 VHOST (named-based) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01st =C2=A0vhost: www.abc.com > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A02nd vhost: www.def.com > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03rd =C2=A0vhost: www.ghi.com > > > > =C2=A0 -1 VHOST(IP-based) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0www.klm.com > > > > My DNS record are =C2=A0for the 3 VHOST (named-based) =C2=A0 pointing t= o > > 192.168.1.2 > > =C2=A0and =C2=A0 =C2=A0for =C2=A0the =C2=A0VHOST(IP-based) =C2=A0 =C2= =A0pointing to an alias > > =C2=A0192.168.1.3 > > > > In case someone create a DNS entry pointing to one of my 2 IP > > address for > > example: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 www.some= one.com =C2=A0 -> =C2=A0192.168.1.2 > > > > How to config Apache to not respond or redirect to a error page > > when an end > > user browse this URL:www.someone.com ? > > > > The first vhost for a particular vhost spec (eg, the first > or the first , depending > on > what you have for NameVirtualHost) is the default vhost. When a > request comes in for a domain name that is not served by any of your > vhosts, it will be served from the default vhost. > > Hence, if you want unknown domains to error, your first vhost should > handle this. Eg: > > > # The default/error vhost, no ServerName required > DocumentRoot /var/www/sites/error > > > > ServerName foo.com > users@ might have been a better place for this. > Cheers > > Tom > -- Igor Gali=C4=87 Tel: +43 (0) 664 886 22 883 Mail: i.galic@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE