Basic Configuration
OpenLiteSpeed uses a plain-text configuration file at /usr/local/lsws/conf/httpd_config.conf. Most settings can also be managed through the WebAdmin GUI at https://your-server-ip:7080.
Configuration File Structure
Section titled “Configuration File Structure”The main config file is organized into several blocks:
httpd_config.conf serverName user / group tuning { } accessControl { } listener(s) { } vhostMap { } module(s) { }Key Server Settings
Section titled “Key Server Settings”Server Identity
Section titled “Server Identity”serverName your-hostname.example.comuser nobodygroup nobodyThe user and group determine the OS user under which worker processes run. Use a non-root, unprivileged user.
Tuning
Section titled “Tuning”tuning { maxConnections 10000 maxSSLConnections 10000 connTimeout 300 maxKeepAliveReq 10000 keepAliveTimeout 5 sndBufSize 0 rcvBufSize 0 maxReqURLLen 32768 maxReqHeaderSize 65536 maxReqBodySize 2047M maxDynRespHeaderSize 32768 maxDynRespSize 2047M maxCachedFileSize 4096 totalInMemCacheSize 20M maxMMapFileSize 256K totalMMapCacheSize 40M useSendfile 1 fileETag 28 SSLCryptoDevice null}Important tuning parameters:
- maxConnections — Maximum concurrent connections.
- connTimeout — Idle connection timeout in seconds.
- maxKeepAliveReq — Requests allowed per keep-alive connection.
- keepAliveTimeout — How long to wait for the next request on a keep-alive connection.
- maxReqBodySize — Maximum upload size. Increase for large file uploads.
Access Control
Section titled “Access Control”accessControl { allow ALL}This controls server-level IP access. Use allow and deny with IP addresses or CIDR ranges.
Listeners
Section titled “Listeners”Listeners define which addresses and ports the server binds to. They are covered in detail in Listeners.
listener Default { address *:8088 secure 0}Virtual Host Mapping
Section titled “Virtual Host Mapping”Virtual hosts are mapped to listeners:
vhostMap Default { vhost Example domain *}See Virtual Hosts for full vhost configuration.
Module Configuration
Section titled “Module Configuration”Modules are loaded in the module block:
module cache { ls_enabled 1 checkPrivateCache 1 checkPublicCache 1 maxCacheObjSize 10000000 maxStaleAge 200 qsCache 1 reqCookieCache 1 respCookieCache 1}To load the LiteHTTPD module for .htaccess support:
module ols_htaccess { ls_enabled 1}WebAdmin GUI
Section titled “WebAdmin GUI”The WebAdmin interface at port 7080 provides a graphical way to manage all these settings. Changes made through WebAdmin are written back to the config files.
To restart the server after manual config file edits:
/usr/local/lsws/bin/lswsctrl restartOr perform a graceful restart (zero-downtime):
kill -USR1 $(cat /tmp/lshttpd/lshttpd.pid)Configuration Validation
Section titled “Configuration Validation”Before restarting, test your configuration:
/usr/local/lsws/bin/lshttpd -tThis checks for syntax errors without restarting the server.
Next Steps
Section titled “Next Steps”- Virtual Hosts — configure individual sites.
- Listeners — set up address and port bindings.
- SSL / TLS — enable HTTPS on listeners.
- Logs — configure logging.