OpenLiteSpeed Web Server Users' Manual

Version 1.4 Rev. 1

Server General

General settings for the whole server. When path information is required in a setting, it can be either absolute or relative to $SERVER_ROOT. $SERVER_ROOT is the location where LiteSpeed web server has been installed (your_home_dir/lsws or /opt/lsws, for example). The server executable is under $SERVER_ROOT/bin.

Table of Contents

Server Process

Server Name | Number of Workers | Running As | Priority | Max I/O Buffer Size | Swapping Directory | Auto Fix 503 Error | Enable HTTP/2 Over Cleartext TCP | Graceful Restart Timeout (secs) | 

General Settings

MIME Settings | Suffixes | MIME Type | Disable Initial Log Rotation | Server Signature | Enable IP Geolocation | Use Client IP in Header | Administrator Email | 

Index Files

Index Files | Auto Index | Auto Index URI | 

Expires Settings

Enable Expires | Expires Default | Expires By Type | 

File Upload

Temporary File Path | Temporary File Permissions | Pass Upload Data by File Path | 

IP to Geolocation DB

DB File Path | DB Cache Type | 

Server NameGo to top
Description: A unique name for this server. You can use $HOSTNAME as value.
Number of WorkersGo to top
Description: Specifies the number of httpd workers.
Syntax: Integer value between 1 and 16.
Tips: [Performance] Set an appropriate number to suit your needs. Adding more workers may not necessarily mean better performance.
Running AsGo to top
Description: Specifies the user/group that the server process runs as. This is set using the parameters "--with-user" and "--with-group" when running the configure command before installation. To reset these values, you must rerun the configure command and reinstall.
Apply: Reinstall required.
Tips: [Security] Server should not run as a privileged user such as "root". It is critical that the server is configured to run with a un-privileged user/group combination that does not have login/shell access. A user/group of nobody is generally a good choice.
PriorityGo to top
Description: Specifies priority of the server processes. Value ranges from -20 to 20. A lower number means higher priority.
Syntax: Integer number
Tips: [Performance] Usually a higher priority leads to slightly higher web performance on a busy server. Do not set priority higher than that of database processes.
See Also: External App Priority, CGI Priority
Max I/O Buffer SizeGo to top
Description: Specifies the maximum buffer size that is used to store a request body and its dynamically generated response. When this limit is reached, the server will start to create temporary swapping files under Swapping Directory.
Syntax: Integer number
Tips: [Performance] Set the buffer size large enough to accommodate all concurrent requests/replies to avoid memory to disk swapping. If there is frequent I/O activity to the swap directoy, by default /tmp/lshttpd/swap/, this buffer size is too low and LiteSpeed is swapping to disk.
See Also: Swapping Directory
Swapping DirectoryGo to top
Description: Specifies the directory where the swapping files should be placed. When the server is started in chroot mode, this directory is relative to the new root directory, otherwise it is relative to the real root directory.
The server uses its own virtual memory to reduce system memory usage. Virtual memory and disk swapping are used to store large request bodies and dynamically generated responses. The swapping directory should be placed on a disk with enough space.
Syntax: Absolute path.
Tips: [Performance] Place the swapping directory on a separate disk or increase Max I/O Buffer Size to eliminate swapping.
See Also: Max I/O Buffer Size
Auto Fix 503 ErrorGo to top
Description: Specifies whether to try to fix the "503 Service Unavailable" error by restarting the server gracefully. A "503" error is usually caused by malfunctioning external applications and a web server restart can often fix the error temporarily. If enabled, the server will restart automatically whenever there are more than 30 "503" errors within a 30 seconds span. This feature is enabled by default.
Syntax: Select from radio box
Enable HTTP/2 Over Cleartext TCPGo to top
Description: Specifies whether to enable HTTP/2 over non-encrypted TCP connections. Default is disabled.
Syntax: Select from radio box
Graceful Restart Timeout (secs)Go to top
Description: During a graceful restart, even after the new server instance is up, the old instance will continue to handle existing requests. This timeout defines how long the previous instance shall wait before exit. Default value is 300 seconds. -1 means wait forever. 0 means no wait and abort immediately.
Syntax: int
MIME SettingsGo to top
Description: Specifies the file that contains the MIME settings for this server. It is always relative to the real root when an absolute path is given in chroot mode. Click on the file name to view/edit the detailed MIME entries.
Syntax: File name which can be an absolute path or relative to $SERVER_ROOT.
Tips: Click the file name to edit the MIME settings.
SuffixesGo to top
Description: You can list multiple suffixes for the same MIME type, using comma to separate.
MIME TypeGo to top
Description: A MIME type consists of a type and subtype in the format of "type/subtype".
Disable Initial Log RotationGo to top
Description: Specifies whether to enable/disable rotation of server error log file at startup. Initial log rotation is enabled by default when using value "Not Set".
Syntax: Select from radio box
Server SignatureGo to top
Description: Specifies whether to show the server signature and version number in the response header's "Server" value. There are three options: when set to Hide Version, only LiteSpeed is shown. When set to Show Version, LiteSpeed and the version number are shown. When set to Hide Full Header, the entire Server header will not be shown in the response header.
Syntax: Select from drop down list
Tips: [Security] Set to Hide Version if you do not wish to expose the server version number.
Enable IP GeolocationGo to top
Description: Specifies whether to enable/disable IP Geolocation lookup. It 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
Use Client IP in HeaderGo to top
Description: Specifies whether to use the IP address listed in the "X-Forwarded-For" HTTP request header for all IP address-related features, including connection/bandwidth throttling, access control, and IP geolocation.

This feature is useful if your web server is behind a load balancer or a proxy server. If you select "Trusted IP Only", then X-Forwarded-For IP will be used only when the request is coming from trusted IPs defined in the server-level Allowed List.
Syntax: Select from drop down list
Administrator EmailGo to top
Description: Specifies the server administrator's email address(es). If specified, administrators will be notified by email of important events (for example, when the LiteSpeed service is restarted automatically due to crash detection or when license is expiring).
Syntax: Comma delimited list of email address.
Tips: Email alert feature will only work if the server has an active MX server such as postfix, exim, or sendmail.
Index FilesGo to top
Description: Specifies names of index files that will be searched sequentially when a URL is mapped to a directory. You can customize it at the server, virtual host, and context level.
Syntax: Comma delimited list of index file names.
Tips: [Performance] Only set index files that you need.
Auto IndexGo to top
Description: Specifies whether to generate a directory index on the fly when index files listed in Index Files are not available in a directory. This option is customizable at the virtual host and context level, and is inherited along the directory tree until it is explicitly overridden. You can customize the generated index page. Please check online wiki How-tos.
Syntax: Select from radio box
Tips: [Security] It is recommended to turn off Auto Index wherever possible to prevent revealing confidential data.
See Also: Index Files, Auto Index URI
Auto Index URIGo to top
Description: Specifies the URI that will be used to generate the index page when index files listed in Index Files are not available in a directory. LiteSpeed web server uses an external script to generate the index page providing the maximum customization flexibility. The default script produces an index page with same look as Apache's. To customize the generated index page, please read online wiki How-tos. The directory to be indexed is passed to the script via an environment variable "LS_AI_PATH".
Syntax: URI
See Also: Index Files, Auto Index
Enable ExpiresGo to top
Description: Specifies whether to generate an Expires header for static files. If enabled, an Expires header will be generated based on Expires Default and Expires By Type.

This can be set at server, virtual host and context level. Lower level settings will override higher level ones, i.e. context settings will override virtual host settings and virtual host settings will override server settings.
Syntax: Select from radio box
Expires DefaultGo to top
Description: Specifies default settings for Expires header generation. This setting takes effect when Enable Expires is set to "Yes". It can be overridden by Expires By Type. Do not set this default at the server or virtual host level unless you have to, since it will generate Expires headers for all pages. Most of time this should be set at the context level for certain directories that do not change often. If there is no default setting, no Expires header will be generated for types not specified in Expires By Type.
Syntax: A|Mseconds
The file will expire after base time(A|M) plus specified seconds. Base time "A" sets the value to the client's access time and "M" to the file's last modified time.
Expires By TypeGo to top
Description: Specifies Expires header settings for individual MIME types.
Syntax: Comma delimited list of "MIME-type=A|Mseconds". The file will expire after base time (A|M) plus specified seconds.

Base time "A" sets the value to the client's access time and "M" to the file's last modified time. MIME-type accepts wildcard "*", like image/*.
File UploadGo to top
Description: Provides additional security functionality when uploading files by using a Request Body Parser to parse files to a server local directory where they can be easily scanned for malicious intent by third party modules. Request Body Parser is used when Pass Upload Data by File Path is enabled or a module calls LSIAPI’s set_parse_req_body in the LSI_HKPT_HTTP_BEGIN level. API examples provided in source package.
See Also: Hook::HTTP_BEGIN Priority
Temporary File PathGo to top
Description: Temporary directory where files being uploaded to server will be stored while request body parser is working. Default value is /tmp/lshttpd/.
Syntax: Absolute path or path starting with $SERVER_ROOT (for Server and VHost levels) or $VH_ROOT (for VHost levels).
Temporary File PermissionsGo to top
Description: Determines file permissions used for files stored in temporary directory. Server level setting is global, can be overridden at VHost level.
Syntax: 3 digits octet number. Default value is 666.
Pass Upload Data by File PathGo to top
Description: Specify whether or not to pass upload file data by path. If enabled, file path along with some other information is sent to backend handler instead of file itself when uploading. This saves on CPU resources and file transfer time but requires some updates to backend to implement. If disabled, file content will be transferred to backend handler, request body is still parsed to files.
Syntax: Select from radio box
Tips: [performance] Enable this to speed up file upload processing if backward compatibility is not an issue.
IP to Geolocation DBGo to top
Description: Multiple MaxMind geolocation databases can be specified here. MaxMind has the following type of DBs: Country, Region, City, Organization, ISP and Netspeed. If multiple databases of types "Country", "Region", and "City" are configured, the last one will be effective.
DB File PathGo to top
Description: Specifies the path to MaxMind GeoIP database.
Syntax: file path
DB Cache TypeGo to top
Description: Specifies what kind of cache mode should be used. Cache modes are: Standard, MemoryCache, CheckCache and IndexCache. MemoryCache is recommended and is the default.
Syntax: Select from drop down list