Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Aug 1996 02:37:47 -0600
From:      zeeb@digitaladvantage.net (Russ Panula)
To:        questions@FreeBSD.ORG
Cc:        Eric Chan <Eric.Chan@nswcc.org.au>
Subject:   Re: WWW on FreeBSD v2.0
Message-ID:  <32103aa7.17120930@mail.digitaladvantage.net>
In-Reply-To: <320FF406.1562@ime.net>
References:  <199608130214.MAA00420@moredun.nswcc.org.au> <320FF406.1562@ime.net>

next in thread | previous in thread | raw e-mail | index | archive | help

>Eric Chan wrote:
>> 
>>         Hi, I am stuck on setting up 2 CERN Httpd v3.0 Web servers on a
>> single machine running FreeBSD v2.0.  I was told to set up an IP alias on
>> the server, so that one of  Httpd servers will point to a IP alias. (But I
>> don't know how to get it done, Httpd only listens to the port 80 on the
>> machine, but not relate to IP address.  Could the 2 Httpd Servers listening
>> on the same port 80?)
>> 
>>         What my company wants is to have 2 separate WWW servers running on a
>> single machine with different URL name, such as www.nbcc.org.au (this one
>> exists already) and www.nswcc.org.au(need to be implemented).
>> 
>>         Have you ever encountered this kind of set up?  If you do, could you
>> please give me any clues/info on it?
>> 
>> Many thanks
>> 
>> Eric
>
>I've done this by adding a second entry in the DNS pointing
>to the same IP..
>ie:
>	domain1       IN  A   a.b.c.d
>	domain2       IN  A   a.b.c.d
>
>a.b.c.d are both the same IP..
>
>Don't know if this is right, Works for me.
>
>-Enjoy
>Gary
>~~~~~~~~~~~~~~~~
>Improve America's Knowledge... Share yours
>The Borg... Where minds meet
>(207) 929-3848
>

You need to add alias IP addresses to your web server also.  You can
do this by doing:

ifconfig ep0 alias xxx.xxx.xxx.xxx netmask 0xffffffff

The netmask is important, it won't work without all the bits set.

To automate this so the addresses are assigned at boot time, create a
file named /etc/start_if.ep0 containing something similar to this:

# Configure further virtual interfaces
ifconfig ep0 alias 192.1.1.2 netmask 0xffffffff
ifconfig ep0 alias 192.1.1.3 netmask 0xffffffff
ifconfig ep0 alias 192.1.1.4 netmask 0xffffffff
[etc..etc]

And make sure the ifconfig_ep0 line in sysconfig reads something like
this:

ifconfig_ep0="inet 192.1.1.1 netmask 0xffffff00"

Notice the netmask, this is where you specify the actual netmask.

Now reboot, and the changes should take place.

Of course, if you aren't using an ep0 card replace ep0 with your NIC.

Your web server will probably need further configuration once this is
completed.  I'm not sure how CERN handles virtual hosts, but in Apache
you can add something like this to httpd.conf:

## xyz's virtual host
<VirtualHost xyz.somewhere.out.there>
ServerName xyz.somewhere.out.there
</VirtualHost>

This assumes xyz.somewhere.out.there is can be resolved to one of the
virtual interface ip addresses.

Any corrections are welcome.. I've been up far too long.

Russ



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32103aa7.17120930>