Date: Sun, 11 Feb 2001 14:05:14 -0600 From: Ben Weaver <bweaver@tranquility.net> To: Arthur <arthur@argay.com.au> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Virtual Server Message-ID: <20010211140514.C167@tranquility.net> In-Reply-To: <003a01c0940f$1ca57680$86391ecb@argay.com.au>; from arthur@argay.com.au on Sun, Feb 11, 2001 at 08:43:39PM %2B1100 References: <003a01c0940f$1ca57680$86391ecb@argay.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] The named configuration will be the same as before, you will just use the same IP address when making A records in different zones. For instance ig you 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 for 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 address is for. It does this using the HTTP header information, so you will need to set up your virtual hosts like this: <VirtualHost 192.168.1.20:80> Servername www.vhost1.com DocumentRoot /path/to/document/root # Put Logfile and other config options you want here </VirtualHost> Now, apache will know to direct requests for www.vhost1.com to the right place. Make a similar entry for www.vhost2.com and you'll be all set. The one 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 apache 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 the 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 vhost1.com. Hope this helps, -Ben On Sun, Feb 11, 2001 at 08:43:39PM +1100, Arthur wrote: > HI > > I am running FBSD 2.2.6 and am intending to upgrade to the 4 series, but > time is the problem. > > In the meantime I have virtual servers (Hosts) configures using individual > IP addresses and the DNS configured accordingly for each zone file for each > server. > > I now wish to configure virtual servers using the one IP address. > > How do I go about this in the httpd.conf file and the named set-up. > > Thanks in advance. > > Arthur > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE6hvB6lLyqskZtc9ERAu+ZAJ9rmUjOmA3JRwJTmIMgbTWKaDtAKwCfSumO /iYpr5pehTz0bBSYtyEz464= =R1Mo -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010211140514.C167>
