From owner-freebsd-questions Sun Feb 11 12: 2:25 2001 Delivered-To: freebsd-questions@freebsd.org Received: from the.outroad.org (the.outroad.org [206.152.117.186]) by hub.freebsd.org (Postfix) with ESMTP id B5CDC37B491 for ; Sun, 11 Feb 2001 12:02:18 -0800 (PST) Received: (from bweaver@localhost) by the.outroad.org (8.11.1/8.11.1) id f1BK5Em00389; Sun, 11 Feb 2001 14:05:14 -0600 (CST) (envelope-from bweaver) Date: Sun, 11 Feb 2001 14:05:14 -0600 From: Ben Weaver To: Arthur Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Virtual Server Message-ID: <20010211140514.C167@tranquility.net> References: <003a01c0940f$1ca57680$86391ecb@argay.com.au> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="s9fJI615cBHmzTOP" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <003a01c0940f$1ca57680$86391ecb@argay.com.au>; from arthur@argay.com.au on Sun, Feb 11, 2001 at 08:43:39PM +1100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --s9fJI615cBHmzTOP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The named configuration will be the same as before, you will just use the s= ame IP address when making A records in different zones. For instance ig y= ou host the vhost1.com and vhost2.com domains and you want both of them to = use IP address 192.168.1.20, you would put this line into the zone files fo= r each zone: www IN A 192.168.1.20 Now, it's up to apache to figure out what website a request on that IP addr= ess is for. It does this using the HTTP header information, so you will ne= ed to set up your virtual hosts like this: Servername www.vhost1.com DocumentRoot /path/to/document/root # Put Logfile and other config options you want here Now, apache will know to direct requests for www.vhost1.com to the right pl= ace. Make a similar entry for www.vhost2.com and you'll be all set. The o= ne drawback to hosting in this way is if I were to go to http://vhost1.com = in my browser (assuming you've set the DNS to resolve vhost1.com to 192.168= .1.20), apache will not know what website I want. You will have to tell ap= ache that request for both vhost1.com and www.vhost1.com need to go to the = same VirtualHost. You can do this by adding this line to your VirtualHost = statement: ServerAlias vhost1.com or ServerAlias *.vhost1.com The last will intercept all requests for anything.vhost1.com and bring up t= he correct site. To do this last entry, howeverm be sure to do: ServerName vhost1.com instead of ServerName www.vhost1.com This is because *.vhost1.com in the ServerAlias statement will not match vh= ost1.com. Hope this helps, -Ben=20 On Sun, Feb 11, 2001 at 08:43:39PM +1100, Arthur wrote: > HI >=20 > I am running FBSD 2.2.6 and am intending to upgrade to the 4 series, but > time is the problem. >=20 > In the meantime I have virtual servers (Hosts) configures using individual > IP addresses and the DNS configured accordingly for each zone file for ea= ch > server. >=20 > I now wish to configure virtual servers using the one IP address. >=20 > How do I go about this in the httpd.conf file and the named set-up. >=20 > Thanks in advance. >=20 > Arthur >=20 >=20 >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message --s9fJI615cBHmzTOP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE6hvB6lLyqskZtc9ERAu+ZAJ9rmUjOmA3JRwJTmIMgbTWKaDtAKwCfSumO /iYpr5pehTz0bBSYtyEz464= =R1Mo -----END PGP SIGNATURE----- --s9fJI615cBHmzTOP-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message