Date: Sat, 15 Mar 2003 22:49:12 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: freebsd-questions@FreeBSD.ORG Subject: Re: Apache problems Message-ID: <20030315224912.GB17725@happy-idiot-talk.infracaninophi> In-Reply-To: <000001c2eb2f$4ca817b0$2f811581@garfield> References: <000001c2eb2f$4ca817b0$2f811581@garfield>
next in thread | previous in thread | raw e-mail | index | archive | help
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: > > <VirtualHost *> > DocumentRoot "/webs/www.toontown.local" > ServerName LocalWWW > </VirtualHost> > > <VirtualHost phpmyadmin.toontown.local> > DocumentRoot /webs/phpMyAdmin > ServerName phpMyAdmin > </VirtualHost> > > 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 <VirtualHost ...> 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 <VirtualHost *> ServerName localwww.toontown.local ServerAlias localwww *.toontown.local DocumentRoot "/webs/www.toontown.local" </VirtualHost> <VirtualHost *> ServerName phpmyadmin.toontown.local ServerAlias phpmyadmin DocumentRoot "/webs/phpMyAdmin" </VirtualHost> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030315224912.GB17725>