*BSD News Article 67413


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!newsfeed.internetmci.com!news.kei.com!news.texas.net!newshost.comco.com!news.prismnet.com!smokey.prismnet.com!greg
From: greg@smokey.prismnet.com (Greg Stringfellow)
Newsgroups: comp.protocols.tcp-ip,comp.unix.bsd.freebsd.misc,comp.infosystems.www.servers.unix
Subject: Re: Virtual Hosts for Apache under FreeBSD
Followup-To: comp.protocols.tcp-ip,comp.unix.bsd.freebsd.misc,comp.infosystems.www.servers.unix
Date: 2 May 1996 02:34:48 GMT
Organization: PrismNet - (512)-418-1568
Lines: 44
Message-ID: <4m9708$3sb@ferengi.prismnet.com>
References: <4m57lg$374@news.cityscape.co.uk>
NNTP-Posting-Host: smokey.prismnet.com
X-Newsreader: TIN [version 1.2 PL2]
Xref: euryale.cc.adfa.oz.au comp.protocols.tcp-ip:44226 comp.unix.bsd.freebsd.misc:18507 comp.infosystems.www.servers.unix:13405

Douglas Reay (Douglas@Beyond2000.co.uk) wrote:
: Under FreeBSD I have no idea.  The FAQs didn't seem to help and 
: nor does the Apache web site.

: So ... does anybody have a FreeBSD port of the VIF patch, or otherwise
: know how to set FreeBSD up to listen on multiple ip numbers? 

Virtual sites under FreeBSD is fairly easy to do, and doesn't require any
patches (unless you are running an extremely old version of Apache).

First, you will need to bind a virtual IP address to your network 
interface. To do this you would type:

ifconfig de0 alias xxx.xxx.xxx.xxx netmask 0xffffffff

Replacing the xxx's with the IP address assigned to the virtual web site.
And replace the "de0" with the device name of your ethernet card.

Then add something like this to your httpd.conf at the end usually.

<VirtualHost www.foo.com>
ServerAdmin webmaster@foo.com
DocumentRoot /usr/local/www/host.foo.com/data
ServerName www.foo.com
ErrorLog logs/www.foo.com-error_log
TransferLog logs/www.foo.com-access_log
</VirtualHost>

To use the above example, replace www.foo.com with whatever you want 
to call your virtual web site. Also, make sure that the root path is
where you want it.

Then restart httpd (or you can reboot your system if you don't know how
to do that).

Do this for every virtual web site you want to add and I think you will be
on your way.

Greg

--
    Greg Stringfellow	     	           PrismNet, Inc.	
  Network Administration	WWW Pages, ISDN, Telnet, Dialup Accounts	 
					Phone: (512)-418-1568