### LiteSpeed Web Server Users' Manual

##### Version 5.0 Rev. 1

- License Std / Ent
- Introduction
- Installation
- Administration
  - Service Manager
- Security
- Configuration
  - Server General
  - Server Tuning
  - Server Security
  - Request Filter
  - Page Cache
  - External Apps
  - Fast CGI App
  - Fast CGI Authorizer
  - LSAPI App
  - Servlet Engine
  - Web Server
  - Pipped logger
  - Load Balancer
  - Script Handler
  - Rack/Rails Settings
  - Listeners
  - Templates
  - Virtual Host Basic
  - Virtual Host General
  - Virtual Host Security
  - Rewrite
  - Context
  - Static Context
  - Java Web App Context
  - Servlet Context
  - Fast CGI Context
  - LSAPI Context
  - Proxy Context
  - CGI Context
  - Load Balancer Context
  - Redirect Context
  - Rack/Rails Context
  - Web Socket Proxy
  - Add-ons
  - Admin Server
  - Admin Listeners

# Virtual Host Templates

Virtual host templates make it easy to create many new virtual hosts with similar configurations. Each template contains a template configuration file, a list of mapped listeners, and a list of member virtual hosts. To add a template-based virtual host, the administrator only needs to add a member with a unique virtual host name and a qualified domain name to the template member list. Listener-to-virtual host mapping will be added automatically for all listeners in the template's mapped listener list. Later on, if you need to customize the configuration for a particular virtual host, just "instantiate" that member virtual host and a standalone virtual host configuration will be created automatically. Even when setting up a customized virtual host, a template can still be a convenient starting point.

#### Table of Contents

Template Name
Description: A unique name for the template.

Template File
Description: Specifies the path to the configuration file of this template. File must locate within $SERVER_ROOT/conf/templates/ with a ".conf" file name. If the file you designate does not exist, after you try 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 stipulated in the member virtual hosts' individual configurations.
Syntax: comma-separated list

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: To match the hostname in the Host header when processing a request. To populate the domain name configurations for add-ons like FrontPage or AWstats. 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: To match the hostname in the Host header when processing a request. To populate domain name/alias configurations for add-ons like FrontPage or AWstats. 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

Instantiated VHost Config File
Description: Specifies the location of the config file generated when you instantiate a member virtual host. Variable $VH_NAME must appear in the path so each virtual host will have its own file. Suggested location is $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf. This config file will be created only after you move a member vhost out of the template through instantiation.
Syntax: String with $VH_NAME variable and .conf suffix

Document Root
Description: Specifies the unique path for each member virtual host's document root. Variable $VH_NAME or $VH_ROOT must appear in the path so each member virtual host will have its own document root.
Syntax: string with $VH_NAME or $VH_ROOT variable
Example: $VH_ROOT/public_html/ or $SERVER_ROOT/$VH_NAME/public_html.

File Name Used In Template
Description: Specifies a path for the file to be used for member virtual hosts. Variable $VH_NAME or $VH_ROOT must appear in the path so each member virtual host will have its own file.
Syntax: string