From owner-freebsd-questions Sat Mar 15 14:49:18 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C300837B404 for ; Sat, 15 Mar 2003 14:49:15 -0800 (PST) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2482243FA3 for ; Sat, 15 Mar 2003 14:49:14 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) by smtp.infracaninophile.co.uk (8.12.8/8.12.8) with ESMTP id h2FMnCe9018055 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 15 Mar 2003 22:49:12 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.8/8.12.8/Submit) id h2FMnCoa018054 for freebsd-questions@FreeBSD.ORG; Sat, 15 Mar 2003 22:49:12 GMT Date: Sat, 15 Mar 2003 22:49:12 +0000 From: Matthew Seaman To: freebsd-questions@FreeBSD.ORG Subject: Re: Apache problems Message-ID: <20030315224912.GB17725@happy-idiot-talk.infracaninophi> Mail-Followup-To: Matthew Seaman , freebsd-questions@FreeBSD.ORG References: <000001c2eb2f$4ca817b0$2f811581@garfield> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001c2eb2f$4ca817b0$2f811581@garfield> User-Agent: Mutt/1.5.3i X-Spam-Status: No, hits=-32.5 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT version=2.50 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Mar 15, 2003 at 03:13:09PM -0500, Brian McCann wrote: > Hey all. I'm having some (hopefully) simple problems with > Apache 1.3. I'm going to be hosting several sites on an private server, > domain is "toontown.local". My problem is when I add the virtual host > entry in for, say, phpmyadmin.toontown.local, no matter how I access > that server, it will always go to that site. In DNS I have 2 a records: > www.toontown.local and phpmyadmin.toontown.local, both have forward and > reverse entries. Here's what I'm sticking in the httpd.conf file: > > > DocumentRoot "/webs/www.toontown.local" > ServerName LocalWWW > > > > DocumentRoot /webs/phpMyAdmin > ServerName phpMyAdmin > > > Can anyone offer any insight? I've done this before on other servers > that host 10+ sites, but for some reason, I can't figure this out. Two things you might try: -- You need a 'NameVirtualHost' directive somewhere if you're going to be doing name based virtual hosting. http://httpd.apache.org/docs/mod/core.html#namevirtualhost -- The directive contains a list of IP numbers where those domains will be served from. Typically this will be '*' in all cases, to serve the data from all available interfaces. http://httpd.apache.org/docs/mod/core.html#virtualhost http://httpd.apache.org/docs/vhosts/name-based.html It's the ServerName and ServerAlias directives within the VirtualHost definition that determine which server will respond to a request. You should probably put the fully qualified domain name in as the ServerName and add the shortened version as a ServerAlias: NameVirtualHost * # First v-host is the default ServerName localwww.toontown.local ServerAlias localwww *.toontown.local DocumentRoot "/webs/www.toontown.local" ServerName phpmyadmin.toontown.local ServerAlias phpmyadmin DocumentRoot "/webs/phpMyAdmin" Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message