*BSD News Article 55089


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!lll-winken.llnl.gov!enews.sgi.com!decwrl!pagesat.net!quack!quack.kfu.com!nsayer
From: nsayer@quack.kfu.com (Nick Sayer)
Subject: Re: multiple xxx.org on a same freebsd server
Message-ID: <m#bFKYt@quack.kfu.com>
Sender: news@quack.kfu.com (0000-News(0000))
Organization: The Duck Pond public unix, +1 408 249 9630, log in as guest.
References: <48i1s4$64l@s3.iway.fr>
Date: Tue, 21 Nov 1995 04:46:05 UTC
Lines: 42

In comp.unix.bsd.freebsd.misc chris@mail.cybernet.fr wrote:

>i heard that it was possible to let manage multiple domains names on the same
>machine ( for use with HTTPD ).
>if anybody knows how to get on with it, please help me! thanks

I believe you do it by...

1. Setting up the different domain names to different IP addresses on
the same subnet.

2. cloning the Ethernet interface and thus assigning multiple IP
addresses to it. See 'ifconfig alias'.

3. Modifying your http daemon to check the local side address and
'do the right thing' to go to different config files or what not
depending on which IP address is given.

Part 3 may be the tricky one. It would seem to me that the thing
to do (for NCSA httpd, for example) would be to fix the thing that
parses the -f argument on the command line to look for % in the
filename. If there is a %, then replace that with '%0X' and put
that into an sprintf() with the local side IP address. Thus,
for example,

httpd -d /usr/local/lib/http -f conf/%.conf

in inetd.conf would, when fielding a connection to
192.32.64.128 would use

C0204080.conf

as its config file.

This, of course, limits you to using the inetd method of firing off
httpd, but I think that's a feature, not a bug.

-- 
Nick Sayer <nsayer@quack.kfu.com>  | "When you have to shoot, shoot.
N6QQQ @ N0ARY.#NORCAL.CA.USA.NOAM  | Don't talk."
+1 408 249 9630, log in as 'guest' | 
URL: http://www.kfu.com/~nsayer/   |        -- Tuco