Not really needed. Just assign different IP addresses to the different
names and have the server discriminate on that. I already do this.
Here is a copy of a message I posted recently to the plexus-dev list:
Date: Tue, 31 May 1994 19:28:34 CDT
From: Tony Sanders <[email protected]>
Organization: Berkeley Software Design, Inc.
To: [email protected]
Subject: HOWTO -- multi-servers
Several people have expressed an interest in having multiple servers
running on the same machine serving different information for different
hostnames. The following information explains (a little bit anyway)
what you need to do to set that up.
Say I want WWW.BSDI.COM and WWW.JOE.NET to be WWW servers running on the
*same* machine but I want them to export totally different sets of
information. Now, you could just put all the data in one place and use
simple path names to differentiate between them:
http://www.bsdi.com/bsdi/index.html
http://www.joe.net/joe/index.html
But this is unpleasent and we can't have that. We want to be able to say:
http://www.bsdi.com/
and get the "right" server.
A solution:
Since the protocol cannot differentiate on the name at this point in the
game you will need to be able to assign multiple IP addresses to the
machine to get this to work (if you have multiple interfaces on the machine
you are all set). On late-model BSD systems (including BSD/386, plug plug
:-) you can use the alias feature of ifconfig to add another IP address
to an existing interface:
ifconfig ef0 inet 192.124.139.2 # configure interface
ifconfig ef0 192.124.139.100 alias # add an alias
First, make a server directory for the new system.
Then, edit server/plexus and go down to the bind_port routine and
change the "\0\0\0\0" string like so:
# 192.124.139.100
$this = pack($sockaddr, &AF_INET, $port, "\300\174\213\144");
That's it! Now you have a different server running on that IP address.
And you can still leave the main server running to catch requests to all
other addresses (amazing, isn't it).
Ok, so it's hard coded. You're smart right, figure out how to add
a command line argument to plexus. While working on plexus I'll
keep an eye on this feature and see if I can't make it nicer for you
(I have a bunch of ideas, including being able to setup this up in
a single server process using local.conf).
'Til then -- keep on hacking,
--sanders