Network Appliance(TM)

Manual Pages


Table of Contents

NAME

httpd.hostprefixes - configuration of HTTP root directories for virtual hosts

SYNOPSIS

/etc/httpd.hostprefixes

DESCRIPTION

The httpd.hostprefixes is used to map virtual hosts used in HTTP to corresponding root directories. The same configuration file is used for both IP virtual hosts (discriminated by the IP address used when connecting to the server) and HTTP virtual hosts (discriminated by the Host: header used in HTTP requests).

Each virtual host has a subdirectory of the directory specified in the option httpd.rootdir, containing the files available to clients (browsers) connecting to that host. No file outside that directory is accessible to clients of that virtual.

Each line of the file consists of a virtual host root directory followed by the names and IP addresses of the virtual host associated with that directory. If the entry is an IP address, the named directory is associated with the given virtual host, for IP-level virtual hosting. If the entry is a name, the directory is used for the virtual host with that name, using HTTP-level virtual hosts; further, that host name is looked up and, if it resolves to an IP address used for an IP-level host alias (see the alias option in na_ifconfig(1)), that IP address is used, as if the IP address had been listed.

If the file /etc/httpd.hostprefixes is edited, it is read again by the HTTP server after the changes are saved.

EXAMPLE

This example maps requests sent to www.customer1.com to the customer1 subdirectory of httpd.rootdir and requests directed at a host with IP address 207.68.156.58 to the subdirectory customer2.

  /customer1 www.customer1.com
  /customer2 207.68.156.58

If the command

  toaster> ifconfig vh alias www.customer1.com

had been issued before the configuration file was read, requests destined for the IP address of www.customer1.com would also be mapped to the /customer1 subdirectory, regardless any the Host: header they included.

SEE ALSO

na_ifconfig(1), na_options(1)


Table of Contents