*BSD News Article 78023


Return to BSD News archive

#! rnews 3050 bsd
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.vbc.net!samba.rahul.net!rahul.net!a2i!news.PBI.net!news.mathworks.com!newsfeed.internetmci.com!news.comm.net!usenet
From: "Richard Windmann" <root@bigeasy.com>
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: Help with virtual hosts
Date: 11 Sep 1996 04:50:40 GMT
Organization: Smartboat, Inc.
Lines: 69
Message-ID: <01bb9f9b$6560a380$1f02fbcc@ricky.bigeasy.com>
References: <506oup$pj5@news.cais.com>
NNTP-Posting-Host: ricky.bigeasy.com
X-Newsreader: Microsoft Internet News 4.70.1155



Shaleh <noone@nowhere.net> wrote in article <506oup$pj5@news.cais.com>...

> Please post instructions on how to set up virtual servers on a BSDI
> 2.1 machine.  We need .com resolution for web pages, ftp, and e-mail.
> Please be as verbose as possible.  Thank you.

Setup or instruct your name servers to point the virtual host names to the
virtual IP address.  Once the name servers are updated, do the following...

Add the following lines to the VERY END of /etc/netstart using vi if you
are a masochist, or pico if smart...

ifconfig lo0 alias 204.251.2.51
arp -s 204.251.2.51 00:c0:df:43:c0:0e pub

Where 204.251.2.51 is the virtual IP address, and 00:c0:df:43:c0:0e is the
hardware address of your NIC (network card).  You cannot simply make up a
NIC address, you must know what it is.  To find out, type...

arp -a

This will return...

yourhost.yourdomain.com (204.251.2.10) at 00:c0:df:43:c0:0e 

You might have several hosts in your arp table, so be sure to look for and
identify your computer.

As soon as you reboot your computer, your baby virtual domain will be born,
and you can spank it's butt by telnetting to another host (preferably
outside of your local network) and ping yourvirtual.domain.com. If it
cries, continue on - if not, contact or look at your name servers. 

For simple email handling, all you have to do is pull /etc/sendmail.cw into
vi or pico, and add...
 
yourvirtual.domain.com
ftp.yourvirtual.domain.com
mail.yourvirtual.domain.com
www.yourvirtual.domain.com

You probably only need yourvirtual.domain.com, but I'd throw the others in
for good measure.

WWW is next.  I wouldn't worry about FTP as that will happen on its own -
as long as you want to be generic (i.e.: not a lot of .message files, etc.)
 Again, using vi or pico, edit /var/www/conf/httpd.conf and add the
following to the VERY END of the file...

<VirtualHost www.yourvirtual.domain.com>
ServerAdmin webmaster@yourvirtual.domain.com
DocumentRoot /var/www/docs/yourvirtual
ServerName www.yourvirtual.domain.com
ErrorLog /var/log/httpd/www.yourvirtual.domain.com-error_log
TransferLog /var/log/httpd/www.yourvirtual.domain.com-access_log
</VirtualHost>

At this point, you're pretty much finished.  You must now kill sendmail and
httpd and restart them for these changes to take effect.  Because your
system is just getting online, and it only takes a few seconds, I'd type
reboot...

Richard Windmann
Big Easy Computing
504.821.0583 Voice
504.821.4337 Fax