Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments

Using virtual hosting

About virtual hosting  Top

Virtual hosting enables you to configure your filer to host several IP addresses using only one physical interface. Virtual hosting is useful if, for example, an Internet provider wants to host several Web sites but has only one physical interface.

When virtual hosting is enabled, an HTTP server uses the IP address pointed to by an incoming HTTP request to find the directory that contains the HTTP pages belonging to the virtual host.

How to enable virtual hosting  Top

To enable virtual hosting, you

Setting up virtual hosting  Top

You set up virtual hosting by putting subdirectory and host or address entries in the /etc/httpd.hostprefixes file. Data ONTAP redirects HTTP requests to the subdirectory and host or address listed in the /etc/httpd.hostprefixes file.

To set up virtual hosting, complete the following steps.

Step

Action

1

Open the /etc/httpd.hostprefixes file for editing.

2

Enter subdirectory and host or address entries in the following format:

prefix [host_name_or_address ... ]

prefix is a subdirectory in the HTTP root directory, which is defined by the options httpd.rootdir command.

host_name_or_address is an HTTP host name or an IP address. You can have more than one of each.

3

Save the edits.

Example of virtual hosting  Top

Assume that you added the following entry in the /etc/httpd.hostprefixes file:

/customer 192.225.37.102
/customer www.customer.com 

If the HTTP server receives an HTTP request destined for one of its virtual host IP addresses, 192.225.37.102, the IP address is used to select the virtual host root directory, the /customer directory, from the /etc/httpd.hostprefixes file. An HTTP request with an HTTP 1.1 Host: header specifying www.customer.com is directed to the /customer directory. In either case, the requestor cannot get a file outside the /customer directory.

Mapping virtual host addresses  Top

You must map virtual host addresses to the vh interface to support virtual hosting. To map virtual host addresses to the vh interface, complete the following step.

Step

Action

1

Enter the following command to add a new IP virtual host address mapping:

ifconfig vh -wins [alias | -alias] address 

Use alias to map a virtual host address.

Use -alias to remove a virtual host address map.

address is the IP address you want to add or remove.

Note
If you need to create a virtual subnet with many contiguous addresses, the IP address can be a subnet address.

The vh interface indicates that you are adding a virtual host address rather than adding an IP alias address to a network interface.

Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments