LiteSpeed Web Server Users' Manual

Version 5.1 Rev. 3

Fast CGI Context

Table of Contents

FastCGI Context

URI | FastCGI App | Extra Headers | Allow Override | Realm | Authentication Name | Require (Authorized Users/Groups) | Access Allowed | Access Denied | Authorizer | Add Default Charset | Customized Default Charset | Enable Public Cache | Cache Expire Time (seconds) | Cache Stale Age (seconds) | Cache Request with Query String | Cache Request with Cookie | Cache Response with Cookie | Ignore Request Cache-Control | Ignore Response Cache-Control | Enable Private Cache | Private Cache Expire Time (seconds) | Enable IP Geolocation | 

FastCGI ContextGo to top
Description: FastCGI applications cannot be used directly. A FastCGI application must be either configured as a script handler or mapped to a URL through FastCGI context. A FastCGI context will associate a URI with a FastCGI application.
URIGo to top
Description: Specifies the URI for this context.
Syntax: The URI can be a plain URI (starting with "/") or a Perl compatible regular expression URI (starting with "exp:"). If a plain URI ends with a "/", then this context will include all sub-URIs under this URI. If the context maps to a directory on the file system, a trailing "/" must be added.
See Also: Location
FastCGI AppGo to top
Description: Specifies the name of the FastCGI application. This application must be defined in the External Application section at the server or virtual host level.
Syntax: Select from drop down list
Extra HeadersGo to top
Description: Specifies extra response headers to be added. Multiple headers can be added, one header per line. Put "NONE" to disable headers inherited from parent content.
Syntax: "[HeaderName]: [HeaderValue]" in each line.
Example: Cache-control: no-cache, no-store
My-header: Custom header value
Allow OverrideGo to top
Description: Specifies what directives in an access control file are allowed. An access control file can be placed in a directory to control the accessibility of files under that directory.
  • When nothing is checked, inherited default settings will be used.
  • When None is checked, access control files will be ignored.
  • When Limit is checked, directives "Order", "Allow from" and "Deny from" are allowed.
  • When Auth is checked, directives "AuthGroupFile", "AuthName", "AuthType", "AuthUserFile", and "Require" are allowed.
  • When FileInfo is checked, directives "Satisfy", "AddDefaultCharset", "AddType", "DefaultType", "ForceType", "ExpiresActive", "ExpiresDefault", "ExpiresByType", "Redirect", "RedirectTemp", "RedirectPermanent", "RewriteEngine", "RewriteOptions", "RewriteBase", "RewriteCond" and "RewriteRule" are allowed
  • When Indexes is checked, directive "DirectoryIndex" is allowed
  • When Options is checked, directive "Options" is allowed

Allow Override configuration is available at three levels: server, virtual host and context. If a configuration is not checked at the server level, the controlled directives will be disabled for the whole server whether or not it is enabled at lower levels. If something is enabled at the server level, virtual hosts will inherit same settings by default. Similarly context level settings will be inherited from virtual host settings. Lower levels can disable a setting that is enabled at an upper level, but cannot enable a setting that is disabled at an upper level.
Syntax: Select from checkbox
Tips: [Performance] If there is no need for directory level configuration customization, check None.
RealmGo to top
Description: Specifies the authorization realm for this context. When specified, a valid username and password must be provided in order to access this context. Authorization Realms are set up in the Virtual Host Security section. This setting uses each realm's Realm Name.
Syntax: Select from drop down list
Authentication NameGo to top
Description: Specifies an alternative name for the authorization realm for the current context. If not specified, the original realm name will be used. The authentication name is displayed on the browser's login pop-up.
Require (Authorized Users/Groups)Go to top
Description: Specifies which user/group can access this context. This allows you to use one user/group database (specified in Realm) across a number of contexts, but only allow certain users/groups from that database to access this context.
Syntax: Syntax is compatible with Apache's Require directive. For example:
  • user username [username ...]
    Only listed users can access this context.
  • group groupid [groupid ...]
    Only users belonging to the listed groups can access this context.
If this setting is not specified, all valid users will be allowed to access this resource.
Access AllowedGo to top
Description: Specifies which IPs or sub-networks are allowed to access resources under this context. Together with Access Denied and server/virtual host level access control, accessibility is determined by the smallest scope that a client's IP address falls into.
Syntax: Comma-delimited list of IPs/sub-networks.
Example: Sub-networks can be written as 192.168.1.0/255.255.255.0, 192.168.1, or 192.168.1.*.
Access DeniedGo to top
Description: Specifies which IPs or sub-networks are NOT allowed to access resources under this context. Together with Access Allowed and server/virtual host-level access control, accessibility is determined by the smallest scope that a client's IP address falls into.
Syntax: Comma-delimited list of IPs/sub-networks.
Example: Sub-networks can be written as 192.168.1.0/255.255.255.0, 192.168.1, or 192.168.1.*.
AuthorizerGo to top
Description: Specifies an external application that can be used to generate authorized/unauthorized decisions. Currently, only the FastCGI Authorizer is available. For more details about the FastCGI Authorizer role, please visit http://www.fastcgi.com.
Syntax: Select from drop down list
Add Default CharsetGo to top
Description: Specifies whether to add a character set tag to the "Content-Type" response header, when content type is either "text/html" or "text/plain" without any parameters. When set to Off, this function is disabled. When set to On, either the character set specified by Customized Default Charset or the default "iso-8859-1" will be added.
Syntax: Select from radio box
Customized Default CharsetGo to top
Description: Specifies a character set to be used when Add Default Charset is On. This is optional. The default value is iso-8859-1. This entry has no effect when Add Default Charset is Off.
Syntax: Name of a character set.
Example: utf-8
Enable Public CacheGo to top
Description: Specifies whether to turn on public cache for the current context, either at the server, virtual host, or context level.

Virtual hosts configured through Apache's httpd.conf can use the "CacheEnable" and "CacheDisable" directives at the server, virtual host, context, file, and location level or in .htaccess. "CacheEnable" and "CacheDisable" directives are compatible with Apache mod_cache directives. However, when used at the context, file, or location level, or in .htaccess, "CacheEnable" and "CacheDisable" will only be applied to directories below the current level. URL parameters will be ignored.
Syntax: Select from radio box
Tips: [Performance] It is not recommended to store large objects with low hit rates in cache. Doing so may result in high I/O wait and reduced overall server performance.
Cache Expire Time (seconds)Go to top
Description: Specifies how long an object will be cached. The default is "86400" seconds (one day).
Syntax: Integer number
Cache Stale Age (seconds)Go to top
Description: Specifies how long an object will continue to be served from cache after it has expired but before a new cached copy is available. The default is "10" seconds.
Syntax: Integer number
Cache Request with Query StringGo to top
Description: Specifies whether to cache a request with a query string in the URL. The default is "Yes". When a URL rewrite is involved, the server will check against the rewritten URL.
Syntax: Select from radio box
Cache Request with CookieGo to top
Description: Specifies whether to cache a request containing cookies. The default is "Yes".
Syntax: Select from radio box
Cache Response with CookieGo to top
Description: Specifies whether to cache a response containing cookies. The default is "Yes".
Syntax: Select from radio box
Ignore Request Cache-ControlGo to top
Description: Specifies whether to ignore Cache-Control request headers. The default is "No". If set to "Yes", the server may serve a cached object when "no-cache" has been set in Cache-Control.
Syntax: Select from radio box
Ignore Response Cache-ControlGo to top
Description: Specifies whether to ignore Cache-Control response headers. The default is "No". If set to "Yes", the response can be cached by the server even when "no-store" or "private" has been set in a Cache-Control header.
Syntax: Select from radio box
Enable Private CacheGo to top
Description: Specifies whether to turn on private cache for the current context, either at the server, virtual host, or directory level.

Private cache will cache a copy per user based on IP and cookies.
Virtual hosts configured through Apache's httpd.conf can use the "CacheEnable private /url" and "CacheDisable private /url" directives at server, virtual host, directory, file, and location levels or in a .htaccess file. "CacheEnable private" and "CacheDisable private" are compatible with Apache's mod_cache directives and will be applied to all directories below the current level. However, when used at the directory, file, or location level, or in a .htaccess file, "CacheEnable private" and "CacheDisable private" will only be applied to directories below the current level. URL parameters will be ignored.
Syntax: Select from radio box
Tips: [Performance] It is not recommended to store large objects with low hit rates in cache. Doing so may result in high I/O wait and reduced overall server performance.
Private Cache Expire Time (seconds)Go to top
Description: Specifies how long an object will be cached in private cache. The default is "60" seconds.
Syntax: Integer number
Enable IP GeolocationGo to top
Description: Enterprise Edition Only Specifies whether to enable/disable IP Geolocation lookup. Can be set at server, virtual host, or context level. IP Geolocation is disabled by default when using value "Not Set".
Syntax: Select from radio box
See Also: Use Client IP in Header, DB File Path, DB Cache Type