#### Virtual machine configuration #Bind Address (Address identifying this virtual host BindAddress * <VirtualHost> # #Server name returned to users connected to this host ServerName www.company.com # # #WebMaster for this host #IF YOU USE A VIRTUAL DOMAIN FOR MAIL, REMEMBER TO #CONFIGURE SENDMAIL TO ACCEPT THIS DOMAIN IN YOUR SENDMAIL.CF!!! # ServerAdmin webmaster@company.com # #The document root for this virtual host DocumentRoot /usr/local/etc/htdocs/company.htmld # #The location of the error log for the virtual host ErrorLog /usr/local/etc/apache/logs/company/error_log # #The location of the access log for the virtual host TransferLog /usr/local/etc/apache/logs/company/access_log ... </VirtualHost> #### End Virtual Machine configuration |
|
Operating System | Multiple IP Support |
AIX 4.1 | Built-in: ifconfig alias |
BSDI | Built-in: ifconfig alias |
Digital OSF/1 | Built-in: ifconfig alias |
Digital UNIX | Built-in: ifconfig alias |
FreeBSD | Built-in: ifconfig alias |
HPUX 10.x | Needs ifconfig alias patch |
HPUX 9.x | Needs virtual interface (VIF) patch |
IRIX 5.3 | Needs SGI's ifconfig alias patch |
Linux | Needs ifconfig alias patch |
NeXTSTEP 3.3 | Use PPP Interfaces to provide virtual interfaces |
Solaris 2.3 and better | Built-in: ifconfig logical units |
SunOS 4.x | Needs VIF patch |
SunOS 5.3 and better | Built-in: ifconfig logical units |
Ultrix | Needs VIF patch |
If your system is not listed in Table 4.1, you might want to try the PPP approach described later in this chapter. Alternatively, you can opt for Apache's 1.1 non-IP-intensive virtual hosts, which remove the need to create a multihomed server altogether.
You can specify multiple IP addresses to a single interface by using the following:
The alias option of ifconfig is the easiest way to implement a virtual host. The ifconfig command is used to set or display configuration values of a network interface. Not all vendors support the alias option.
You can make your Ethernet interface answer to an additional IP by issuing the following command:
ifconfig interface IP alias
Depending on your operating system, Interface can be en0 or le0, so you'll need to check your man pages for ifconfig to determine the appropriate name for your Ethernet interface. Set the IP parameter to a valid DNS address you assigned to the virtual host. That's it! The interface will now accept packets destined for the virtual site.
Some operating systems in the preceding list don't offer the alias option by default, but patches are available from the vendor or the Net. Each patch distribution includes information on how to apply it, as well as any other specifics on its use. I have included some of these patches on the CD, but you may want to check for updates on them at the following locations:
Each patch distribution will include information on how to apply it and any other specifics on its use. I have included some of these patches on the CD, but you may want to check for updates on them at the following locations:
Solaris supports virtual interfaces in the form of logical units. You can have up to 255 logical units per network interface. To add a new virtual host to the primary interface, just type the following:
ifconfig le0:logicalunit 204.95.222.200 up
Replace logicalunit with a number from 1 to 255. You can check currently used interfaces by issuing netstat -ia.
The VIF patch was one of the first solutions available on the Internet to enable a single interface to handle multiple IP addresses. The VIF patch was originally developed by John Ioannidis in 1991 as part of a project related to his Ph.D. thesis at Columbia University. The patch was pared down in 1994 to allow a single interface to handle multiple IP addresses under SunOS. The patch was further enhanced for SunOS 4.1.x by Chuck Smoko and Bob Baggerman. Two separate Ultrix 4.3a ports have been developed, one by John Hascall and the other by Phil Brandenberger .
The VIF patch creates a virtual interface that, to the networking software, looks like a hardware interface. The VIF interface allows you to assign an address as well as to configure network interface parameters with ifconfig.
After the virtual interface has been configured, you may have to add routing entries to the routing table using the route command. However, some implementations do the right thing without this step. For more information, refer to the instructions for your operating system. The VIF allows requests to any of the host's addresses, real or virtual, to be answered by the real interface. Packets leaving the host use the real or virtual IP assigned to match where they are coming from.
Detailed instructions on how to build the patch and incorporate it into the kernel, and how to use VIF for each specific architecture, are included in the source. You can obtain the latest version of the VIF patch from these repositories:
If your UNIX vendor didn't provide you with the sources to the kernel, then PPP software (used for establishing dial-up networking connections) may be your only viable alternative to create a multihomed host. NEXTSTEP, the operating system I use at accessLINK, doesn't come with the source to its Mach kernel, so I developed this workaround. The result is almost an equivalent to the VIF patch, and its effects are easily removed from a system. This solution should be very portable across various UNIX boxes.
PPP provides networking interfaces, which you can configure much in the same way as VIF interfaces, with these advantages:
If you need additional interfaces, you will have to obtain the source code to the basic PPP software plus the system-specific changes for your operating system. You will also have to edit one of the header files to add the additional interfaces.
You can find the latest release to the source code for the PPP software at ftp://dcssoft.anu.edu.au/pub/ppp and ftp://ftp.merit.edu/pub/ppp.
After you configure the software for your particular machine, modify the number of interfaces to match your needs. In the pppd.h file, found on the pppd distribution, find the line that contains the following definition:
#define NUM_PPP 2
The number to the right of NUM_PPP (in this case, 2)defines how many PPP interfaces are to be compiled into the software. Change this number to the number of interfaces you think you'll be needing plus a few more. I changed mine to add 25 interfaces.
In the NeXTSTEP-specific distribution of the PPP software, which is based on ppp-2.2, the defined NUM_PPP may be found on additional files. Do a grep to find them and change all instances to match the number of interfaces you want.
You should be able to build a customized version of your kernel or a kernel loader that adds supports for PPP. Read the installation instructions for your particular system. Once this is installed, you are ready to configure the interfaces.