From owner-freebsd-questions Wed Mar 15 23:22: 6 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dt051n0b.san.rr.com (dt051n0b.san.rr.com [204.210.32.11]) by hub.freebsd.org (Postfix) with ESMTP id 2B5A637BA56 for ; Wed, 15 Mar 2000 23:22:00 -0800 (PST) (envelope-from Doug@gorean.org) Received: from gorean.org (doug@master [10.0.0.2]) by dt051n0b.san.rr.com (8.9.3/8.9.3) with ESMTP id XAA07509; Wed, 15 Mar 2000 23:21:52 -0800 (PST) (envelope-from Doug@gorean.org) Message-ID: <38D08B90.64B137BA@gorean.org> Date: Wed, 15 Mar 2000 23:21:52 -0800 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (X11; U; FreeBSD 5.0-CURRENT-0313 i386) X-Accept-Language: en MIME-Version: 1.0 To: Jim Flowers Cc: freebsd-questions@freebsd.org Subject: Re: Apache Virtual Host Setup Confusion References: <004f01bf8ec0$96d4d9a0$81d396ce@ezo.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jim Flowers wrote: > > In trying to understand the Apache documentation on virtual host setup I > have become confused Easy to do with apache. :) > (FreeBSD 3.4-STABLE, apache+php-1.3.12+3.0.15). It > seemed to be straightforward enough to set up a main server, a virtual host > server and a default server. First I set up the main server with: > > DNS set up for: > ---------------------- > host.domain.tld. IN A 222.222.222.222 Assuming that your DNS is correct and all of the names ultimately resolve to your IP, this is irrelevant. BTW, you don't have much to fear using real info, and it makes debugging easier, but it's up to you. > apache.conf includes main references (outside any container> > ---------------------------------------------------------------------------- > ServerName host.domain.tld > DocumentationRoot /www/domain > > Browser references to host.domain.tld, www.domain.tld and 222.222.222.222 > all display the index.html document in /www/domain. Hooray. > > Continuing,I add a virtual host for www.domain1.tld Here is where you run into trouble. You missed the bit of the docs where it says that if you define a vhost on the same IP as the "main" server, apache won't respond to anything other than the vhosts. > NameVirtualHost 222.222.222.222 Add: ServerName host.domain.tld ServerAlias www.domain.tld DocumentRoot /www/domain > > ServerName www.domain1.tld > DocumentRoot /www/domain1 > [snip] > You can't configure a default > server to trap unmatched virtual host servers? Take a look at the sample httpd.conf file. The entry you want is Good luck, Doug -- "While the future's there for anyone to change, still you know it seems, it would be easier sometimes to change the past" - Jackson Browne, "Fountain of Sorrow" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message