Virtual hosting enables a filer to respond to requests directed to more than one IP address through a single physical interface. This means that a filer with only one physical interface can host several IP addresses.
Virtual hosting enables, for example, an Internet provider to host several Web sites but have only one physical interface. An HTTP server can use the destination IP address of an incoming HTTP request to find the directory that contains the HTTP pages belonging to the virtual host.
To enable virtual hosting, you
To direct HTTP requests, use the following format in the /etc/httpd.hostprefixes file:
prefix [host-name-or-address ... ]
For example, the line
/customer www.customer.com 192.225.37.102
means that an HTTP request that comes for the interface with address 192.225.37.102, or with an HTTP 1.1 Host: header specifying www.customer.com, is directed to /customer, and the requestor cannot get a file outside the /customer directory.
If the HTTP server receives an HTTP request that is destined for one of its virtual host IP addresses, in this example 192.225.37.102, the destination IP address is used to select the virtual host root directory from the /etc/httpd.hostprefixes file.
To map virtual host addresses to the virtual host interface, use the ifconfig command, as follows:
ifconfig vh alias address
where address is an IP address.
The use of the vh interface indicates to the system that you are adding a virtual host address rather than adding an IP alias address to a network interface.
ifconfig vh -alias address
Note: If you need to create a virtual subnet with many contiguous addresses, the IP address can be a subnet address.
Copyright © 1999, Network Appliance, Inc. All rights reserved.
Part No. 210-02334
File: http4.htm
Last updated: 02/24/99 12:16:45