Table of ContentsLibraryView in Frames

Using virtual hosting

Virtual hosting enables you to configure your storage system 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.

Considerations

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.

To enable virtual hosting, perform the following tasks:

  • Set up virtual hosting by editing the /etc/httpd.hostprefixes file
  • Map virtual host addresses to the vh interface with the ifconfig command

Data ONTAP redirects HTTP requests to the subdirectory and host or address listed in the /etc/httpd.hostprefixes file.

For more information about the vh interface, see the ifconfig(1) man page.

Steps

  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 ...]

    Parameter Description
    prefix A subdirectory in the HTTP root directory, which is defined by the options httpd.rootdir command.
    host_name_or_address An HTTP host name or an IP address. You can have more than one of each.

  3. Save the edits.

Example of virtual hosting

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.