### 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 Hosts Basic

This page lists all defined virtual hosts. From here you can add/delete a virtual host or make changes to an existing one. Before you add a virtual host, make sure the virtual host root directory exists.

#### Table of Contents

Virtual Host Name
Description: A unique name for a virtual host. It is recommended to use the virtual host's domain name as the Virtual Host Name. Virtual Host Name can be referred to using the variable $VH_NAME.

Virtual Host Root
Description: Specifies the root directory of the virtual host. Note: This is NOT the document root. It is recommended to place all files related to the virtual host (like log files, html files, CGI scripts, etc.) under this directory. Virtual Host Root can be referred to using the variable $VH_ROOT.
Syntax: An absolute path or a relative path to $SERVER_ROOT.
Tips: [Performance] Place different virtual hosts on different hard drives.

Config File
Description: Specifies the configuration file name for this virtual host. The configuration file must be under the $SERVER_ROOT/conf/vhosts/ directory. $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf is recommended.
Syntax: File name which can be absolute, or relative to $SERVER_ROOT, or relative to $VH_ROOT.

Max Keep-Alive Requests
Description: Specifies the maximum requests that can be served through a keep-alive (persistent) connection. Connections will be closed once this limit is reached. You can specify a different limit for different virtual hosts. This number cannot exceed the server-level Max Keep-Alive Requests limit.
Syntax: Integer number
Tips: [Performance] Set to a reasonably high value. A value of "1" or less will disable keep-alive connections.
See Also: Max Keep-Alive Requests

Smart Keep-Alive
Description: Specifies whether to turn on Smart Keep-Alive for this virtual host. This option is effective only if the server-level Smart Keep-Alive is enabled and Max Keep-Alive Requests is greater than 1.
Syntax: Select from radio box
Tips: [Performance] Enable this for busy web sites.

Follow Symbolic Link
Description: Specifies whether to follow symbolic links in this virtual host. IF OWNER MATCH option will follow a symbolic link only if it has the same ownership. This setting overrides the default server-level setting.
Syntax: Select from drop down list
Tips: [Performance & security] For better security, disable this feature. For better performance, enable it.

Enable Script
Description: Specifies whether scripting (non-static pages) is allowed in this virtual host. If disabled, CGI, FastCGI, LSAPI, Servlet engines and other scripting languages will not be allowed in this virtual host. Therefore, if you want to use a script handler, you need to enable it here as well.
Syntax: Select from radio box

Restrained
Description: Specifies whether files beyond this virtual host root($VH_ROOT) can be accessed though this web site. If set to Yes, only files under $VH_ROOT can be accessed and access to symbolic links or context pointing to files or directories beyond $VH_ROOT will be denied. This, however, does not limit the accessibility of CGI scripts. This is useful in the shared hosting environment. Follow Symbolic Link can be set to Yes to allow users to use symbolic links under $VH_ROOT, but not anything beyond $VH_ROOT.
Syntax: Select from radio box
Tips: [Security] Turn it on in the shared hosting environment.

ExtApp Set UID Mode
Description: Specifies how user ID is set for an external application process. Three choices are available: Server UID: Set the user/group ID of external application processes to the same as the server's user/group ID. CGI File UID: Set the user/group ID of external CGI processes based on the user/group ID of the executable. This option only applies to CGI, not FastCGI or LSPHP. Doc Root UID: Set the user/group ID of external application processes based on the user/group ID of the document root of the current virtual host.
Syntax: Select from drop down list
Tips: [Security] In the shared hosting environment, it is recommended to use the CGI File UID or Doc Root UID modes to prevent files owned by one virtual host from being accessed by the external application scripts of another virtual host.

ExtApp Chroot Mode
Description: Enterprise Edition Only Specifies how the root directory is set for an external application process. In order to protect confidential system data files from being accessed by a vulnerable external application script, an alternative root path can be set for the external application process so that files beyond the new root directory become inaccessible. This is referred to as a "chroot jail". Three choices are available: Same as Server: External application processes will be run in the same jail as the server. Virtual Host Root: Set chroot jail to the root directory of the virtual host. The external application script will only be able to access files inside the virtual host root. Customized Chroot Path: Specify the chroot path ExtApp Chroot Path below.
Syntax: Select from drop down list
Tips: If used properly, chroot will greatly enhance the security of external application scripts, but you must make sure the external application script is functional in the limited chroot jail environment.

ExtApp Chroot Path
Description: Enterprise Edition Only Specifies a new root directory for the current host's external application scripts when ExtApp Chroot Mode is set to Customized Chroot Path.
Syntax: Absolute path.

Total Output Bandwidth (KB/sec)
Description: Sets a limit for the total output bandwidth in KB/s for this virtual host. Once this limit is reached throttling will occur.

Static Requests/Second
Description: Specifies the maximum number of requests to static content coming from a single IP address that can be processed in a single second regardless of the number of connections established. When this limit is reached, all future requests are tar-pitted until the next second. Request limits for dynamically generated content are independent of this limit. Per-client request limits can be set at server- or virtual host-level. Virtual host-level settings override server-level settings.
Syntax: Integer number
Tips: [Security] Trusted IPs or sub-networks are not affected.
See Also: Dynamic Requests/Second

Dynamic Requests/Second
Description: Specifies the maximum number of requests to dynamically generated content coming from a single IP address that can be processed in each second regardless of the number of connections established. When this limit is reached, all future requests to dynamic content are tar-pitted until the next second. The request limit for static content is independent of this limit. This per client request limit can be set at server or virtual host level. Virtual host-level settings override server-level settings.
Syntax: Integer number
Tips: [Security] Trusted IPs or sub-networks are not restrained by this limit.
See Also: Static Requests/Second

Outbound Bandwidth (bytes/sec)
Description: Specifies the maximum allowed outgoing throughput to a single IP address regardless of number of connections established. The real bandwidth may end up being slightly higher than this setting for efficiency reasons. Bandwidth is allocated in 4KB units. Set to 0 to disable throttling. Per-client bandwidth limits (bytes/sec) can be set at server- or virtual-host levels. Virtual host-level settings override server-level settings.
Syntax: Integer number
Tips: [Performance] Set the bandwidth in 8KB units for better performance. [Security] Trusted IPs or sub-networks are not affected.
See Also: Inbound Bandwidth (bytes/sec)

Inbound Bandwidth (bytes/sec)
Description: Specifies the maximum allowed incoming throughput from a single IP address regardless of number of connections established. The real bandwidth may end up being slightly higher than this setting for efficiency reasons. Bandwidth is allocated in 1KB units. Set to 0 to disable throttling. Per-client bandwidth limits (bytes/sec) can be set at server- or virtual-host levels. Virtual host-level settings override server-level settings.
Syntax: Integer number
Tips: [Security] Trusted IPs or sub-networks are not affected.
See Also: Outbound Bandwidth (bytes/sec)