This archive contains the latest NCSA HTTPD 1.4.1 that has been patched 
to allow multiple domains on a single HTTPD server. It allows the HTTPD 
to specify different root directories for unique IP addresses or 
Hostnames. It requires the compilation of the dummy device driver as a
module, and the latest 'modules' package for your kernel to install and
manipulate the modules.

Example:

http://www.multispam.org
http://www.fnirc.org

Can all reside on the same machine and use the same server, but would 
point to different home pages when accessed.

This package is working just fine with Linux 1.2.11, and I expect that it 
will work with ANY kernal that can install the dummy device as a module. 
I'm running it here to serve 6 different domains off of a single HTTP 
server.

Quick Install
-------------
1. Untar this archive (/usr/src is a good place) and cd into the directory
   it creates. 'cd /usr/src/httpd_1.4.1'

2. type 'make linux' to create the binary httpd file.

3. There aren't any installation instructions with the archive, so you'll 
   need to look at them with a Web Browser at...

   http://hoohoo.ncsa.uiuc.edu/docs/setup/Install.html

   Why NCSA chose to do it this way is beyond me. Hopefully, you can get 
   the server installed and working without too much trouble. Once you have 
   done that, then proceed onward..

4. Now, 'cd /usr/src/linux' and do 'make config'. When it asks you wether 
   you want to include the dummy driver answer 'n'

*
* Network device support
*
Network device support? (CONFIG_NETDEVICES) [y]
Dummy net driver support (CONFIG_DUMMY) [n]

5. After your done, do the following which will re-compile your kernel 
   and make all the devices that you DIDN'T select installable as modules.

bab5% make dep
bab5% make clean
bab5% make zImage (or make zlilo if you boot from a hard drive)
bab5% make modules
bab5% make modules_install

   This will copy all newly made modules into subdirectories under
   "/lib/modules/kernel_release/", where "kernel_release" is something
   like 1.1.83, or whatever the current kernel version is.
 
   (P.S. for a MUCH more in-depth explanation of modules, read 
   /usr/src/linux/README.modules, which is where I managed to grab this 
   info from.)

6. Ensure that you have the latest version of the 'modules' package 
   installed. At the time of this writing the latest modules package is 
   called..

   modules-1.2.8.tar.gz

   This is usually found where you grab your latest kernel release. 
   Sunsite, funet and all the mirrors should have this where they keep their 
   kernel source code. It should be located in the same directory as the 
   actual linux-1.2.xx.tgz archives.

7. Now that you have your new kernel, it might be a good time to 
   re-boot.

8. Install as many dummy device drivers as you need.

  /sbin/insmod -o dummy0 /lib/modules/1.2.11/net/dummy.o
  /sbin/insmod -o dummy1 /lib/modules/1.2.11/net/dummy.o

9. Configure them as interfaces and assign them an IP address.

  /sbin/ifconfig dummy0 www.multispam.org up
  /sbin/ifconfig dummy1 www.fnirc.org up

10. Now correctly assign routes to the interfaces..

  /sbin/route add www.multispam.org dummy0
  /sbin/route add www.fnirc.org dummy1

11. Find out what the hardware address of your Ethernet Card or SLIP 
    interface by using the following command.

  bab5% ifconfig | grep eth  (or grep sl)
  eth0      Link encap:10Mbps Ethernet  HWaddr 00:20:AF:A2:78:B6
                                               ^^^^^^^^^^^^^^^^^ HERE!

12. Now here is the kicker. Assign the hardware address of your Ethernet 
    Interface to the new dummy interfaces, but do it a few times in a 
    row because for some strange reason, it doesn't always assign right.

  /sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub
  /sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub
  /sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub
  /sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub

  /sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
  /sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
  /sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
  /sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub

13. If all that goes well, then you can double check your routing tables 
    to make sure that they have been correctly assigned and installed. In 
    my case, my routing table kinda looks like this.

bab5% route
Kernel routing table
Destination     Gateway       Genmask         Flags MSS    Window Use Iface
www.cia.net     *             255.255.255.255 UH    1436   0        0 dummy0
www.wcsb.org    *             255.255.255.255 UH    1436   0        0 dummy2
www.blackwolf.c *             255.255.255.255 UH    1436   0        0 dummy3
www.cyberdyne.o *             255.255.255.255 UH    1436   0        0 dummy4
www.multispam.o *             255.255.255.255 UH    1436   0        0 dummy5
www.fnirc.org   *             255.255.255.255 UH    1436   0        0 dummy6
199.18.254.2    *             255.255.255.255 UH    1436   0        0 eth0
ocpm.edu        *             255.255.255.255 UH    1436   0    14254 sl0
morocco.cia.net *             255.255.255.255 UH    1436   0     5241 sl1
198.30.235.72   *             255.255.255.248 U     1436   0   193727 eth0
199.18.255.0    ocpm.edu      255.255.255.0   UG    1436   0     4210 sl0
loopback        *             255.0.0.0       U     1936   0    69472 lo
default         pm1.nacs.net  *               UG    1436   0   567774 eth0

14. Now, comes the easy part which is setting up the 'srm.conf' file of 
    the HTTP server so that these different domains all point to a seperate 
    root directory, with their own home pages.
    Edit conf/srm.conf and add for each domain:

    SubDocumentRoot <domain or IP> <path to domain documentroot>

    ie:
    SubDocumentRoot www.multispam.org /usr/local/etc/httpd/htdocs/multispam

    The accesses to this domain will be logged to

    logs/access_log.multispam.org

15. Create the directories for your domains and place seperate index.html
    files in each of them.

16. Restart the server (killall httpd;httpd) and you'll be ready to rock. 


I didn't write the patch but I managed to patch it into the latest 1.4.1 
server for Linux and get it to work, so I thought I'd put it up. Below is
the letter that I received from the patches original author that details
how to use the added features.

The patch file that he mentions in the letter is the same one that I have 
included, only I have modified it slightly to reflect a more "sane" 
directory structure. If you want to look at the patch, then please feel 
free... It is located in 

subdocroot.patch

To get this patch to work, I had to move it to the same directory that 
httpd_1.4.1 was located in and then use.

patch -p < subdocroot.patch

Sincerely,
damin@nacs.net (Greg Boehnlein)
New Age Consulting Service (http://www.nacs.net)

Tips and Tricks
---------------
I've created a script file that runs at boot time that installs the 
modules, configures the interfaces and so on. Here's a copy of mine. 
PLEASE make sure that you substitute the correct Hostnames and hardware 
interfaces for your system, otherwise you could be responsible for 
global-thermonuclear meltdown.

#! /bin/sh
# /me goes "Dauuhhhh.... " like an idiot!
# Starting up our multi-homed routing AFTER the name-server is usually
# a good idea, otherwise the system takes 3 hours to reboot!

echo "7/6/95  - Adding dummy routes for Multi Homed HTTPD"

/sbin/insmod -o dummy0 /lib/modules/1.2.11/net/dummy.o
/sbin/insmod -o dummy1 /lib/modules/1.2.11/net/dummy.o
/sbin/insmod -o dummy2 /lib/modules/1.2.11/net/dummy.o
/sbin/insmod -o dummy3 /lib/modules/1.2.11/net/dummy.o
/sbin/insmod -o dummy4 /lib/modules/1.2.11/net/dummy.o
/sbin/insmod -o dummy5 /lib/modules/1.2.11/net/dummy.o
/sbin/insmod -o dummy6 /lib/modules/1.2.11/net/dummy.o

# Now, add the interface parms, routes and arp address
/sbin/ifconfig dummy0 www.cia.net up
/sbin/route add www.cia.net dummy0
/sbin/arp -s www.cia.net 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.cia.net 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.cia.net 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.cia.net 00:20:AF:A2:78:B6 pub

/sbin/ifconfig dummy1 www.fnirc.org up
/sbin/route add www.fnirc.org dummy1
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub

/sbin/ifconfig dummy2 www.wcsb.org up
/sbin/route add www.wcsb.org dummy2
/sbin/arp -s www.wcsb.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.wcsb.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.wcsb.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.wcsb.org 00:20:AF:A2:78:B6 pub

/sbin/ifconfig dummy3 www.blackwolf.com up
/sbin/route add www.blackwolf.com dummy3
/sbin/arp -s www.blackwolf.com 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.blackwolf.com 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.blackwolf.com 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.blackwolf.com 00:20:AF:A2:78:B6 pub

/sbin/ifconfig dummy4 www.cyberdyne.org up
/sbin/route add www.cyberdyne.org dummy4
/sbin/arp -s www.cyberdyne.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.cyberdyne.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.cyberdyne.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.cyberdyne.org 00:20:AF:A2:78:B6 pub

/sbin/ifconfig dummy5 www.multispam.org up
/sbin/route add www.multispam.org dummy5
/sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.multispam.org 00:20:AF:A2:78:B6 pub

/sbin/ifconfig dummy6 www.fnirc.org up
/sbin/route add www.fnirc.org dummy6
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub
/sbin/arp -s www.fnirc.org 00:20:AF:A2:78:B6 pub

# Done!

Letter from Author
------------------

From bbaydar@ra.isisnet.com Sat Jun 17 17:00:14 1995
Received: from ra.isisnet.com (ra.isisnet.com [199.45.83.5]) by bab5.nacs.net (8.6.12/8.6.12) with ESMTP id RAA20664 for <damin@bab5.nacs.net>; Sat, 17 Jun 1995 17:00:11 -0400
Received: by ra.isisnet.com (8.6.9/SMI-SVR4)
	id SAA05620; Sat, 17 Jun 1995 18:10:04 -0300
From: bbaydar@ra.isisnet.com (Baha Baydar)
Message-Id: <199506172110.SAA05620@ra.isisnet.com>
Subject: Re: WWW Hosting Charges
To: damin@bab5.nacs.net (Greg Boehnlein)
Date: Sat, 17 Jun 1995 18:10:03 -0300 (ADT)
In-Reply-To: <Pine.LNX.3.91.950616204636.29852C-100000@bab5.nacs.net> from "Greg Boehnlein" at Jun 16, 95 08:46:54 pm
X-Mailer: ELM [version 2.4 PL24alpha3]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 1743      
Status: RO
X-Status: 

I have a patch for the NCSA httpd 1.4.1 server that will do this.
To set this up, grap the ncsa httpd 1.4.1 server,
and then get the patch from:

ftp://ftp.semaphore.com/pub/web/ncsa_httpd/subdocroot.patch

Apply the patch
(put the patch file in the directory where you have installed the
ncsa server (ie: the directory with the httpd_1.4.1 directory in it)
and type: patch -p < subdocroot.patch)

Compile the server.
Edit conf/srm.conf and add for each domain:

SubDocumentRoot <domain or IP> <path to domain documentroot>

ie:
SubDocumentRoot foobar.com /usr/local/etc/httpd/htdocs/foobar

The accesses to this domain will be logged to

logs/access_log.foobar.com

-- 
Baha Baydar				     Sales and Support
	  internet service and information systems
bbaydar@ra.isisnet.com				(902) 429-isis
