Read More

Virtual Host Templates

Virtual host template can be used to simplify the administration of virtual hosts with similar configuration, especially, for mass hosting environment. Once a template is configured properly, only minimum configuration is required when adding a new virtual host. Each template contains a template configuration file, a list of mapped listeners and a list of member virtual hosts. The template configuration file contains all configuration entries for a virtual host, with some fields requiring special values. To add a template-based virtual host, administrator only needs to add a member to the template member list with a unique virtual host name and a qualified domain name of that virtual host. Listener-to-virtual host mapping will be added automatically for all listeners in the mapped listener list. Later on, if you need to customize the configuration for a particular virtual host, just "instantiate" that member virtual host, a standalone virtual host configuration will be created automatically. Even when setting up a virtual host with different configuration, it is still convenient to use a template as a starting point, and then customize it after instantiation.

Table of Contents

Template Location

Template Name | Template File | Mapped Listeners

ZeroConf

Used by ZeroConf | Separate VHost Per Domain

Member Virtual Hosts

Virtual Host Name | Domain | Aliases | Member Virtual Host Root

Template Settings

Default Virtual Host Root | Config File

Template Name

Description

A unique name for the template.

Template File

Description

Specifies the path to the configuration file of this template. The file must be located within $SERVER_ROOT/conf/templates/ with a ".xml" filename. If the file you designate does not exist, after trying to save the template an error will appear with the link "CLICK TO CREATE". This link will generate a new empty template file. When you delete the template, the entry will be removed from your configurations, but the actual template config file will not be deleted.

Syntax

path

Mapped Listeners

Description

Specifies the names of all listeners that this template maps to. A listener-to-virtual host mapping for this template's member virtual hosts will be added to the listeners specified in this field. This mapping will map listeners to virtual hosts based on the domain names and aliases set in the member virtual hosts' individual configurations.

Syntax

comma-separated list

Used by ZeroConf

Description

Allow ZeroConf configurations to specify this template for use as a base for created VHosts.

Default value: Yes

Syntax

Select from radio box

Separate VHost Per Domain

Description

Create a VHost for each domain configured through ZeroConf. If set to "No", all domains that share the same list of backends will share a VHost.

The server level Separate VHost Per Domain setting is ignored for VHosts created with this template.

Warning: When set to "Yes", this could be very memory expensive if there are many domains.

Default value: No

Syntax

Select from radio box

Virtual Host Name

Description

A unique name for this virtual host. This name must be unique among all template member virtual hosts and standalone virtual hosts. Inside a directory path configuration, this name can be referenced by the variable $VH_NAME.

If a standalone virtual host with the same name is also configured, then the member virtual host configuration will be ignored.

Domain

Description

Specifies the main domain name for this member virtual host. If left blank, the virtual host name will be used. This should be a fully qualified domain name, but you can use an IP address as well. It is recommended to append : for web sites not on port 80. For configurations containing domain names, this domain can be referenced with variable $VH_DOMAIN.

This domain name will be used in the following situations:

  1. To match the hostname in the Host header when processing a request.
  2. To populate domain name configurations for add-ons like FrontPage or AWstats.
  3. To configure listener-to-virtual host mappings based on the virtual host template.

Syntax

domain name

Aliases

Description

Specifies alternate names for the virtual host. All possible hostnames and IP addresses should be added to this list. The wildcard characters * and ? are allowed in the name. Append : for web sites not on port 80.

Aliases will be used in the following situations:

  1. To match the hostname in the Host header when processing a request.
  2. To populate domain name/alias configurations for add-ons like FrontPage or AWstats.
  3. To configure listener-to-virtual host mappings based on the virtual host template.

Syntax

Comma-separated list of domain names.

Member Virtual Host Root

Description

Specifies the root directory of this virtual host. If left blank, the default virtual host root for this template will be used.

Note: This is NOT the document root. It is recommended to place all files related to the virtual host (like virtual host configuration, log files, html files, CGI scripts, etc.) under this directory. Virtual host root can be referred to as $VH_ROOT.

Syntax

path

Default Virtual Host Root

Description

Specifies the default root directory for member virtual hosts using this template. Variable $VH_NAME must appear in the path. This will allow each member template to be automatically assigned a separate root directory based on its name.

Syntax

path

Config File

Description

Specifies the unique path for each member virtual host's configuration file. Variable $VH_NAME or $VH_ROOT must appear in the path so each member virtual host will have its own configuration file.

Syntax

path with $VH_NAME or $VH_ROOT variable