Server Configuration
This module explains how OpenLiteSpeed receives traffic, maps requests to sites, and applies server-wide controls.
Listener Configuration
Listeners are the front doors of the server. They accept traffic on specific ports and optionally terminate TLS.
Port Binding
Bind listeners to ports such as 80 for HTTP and 443 for HTTPS.
IP Binding
Bind to a specific IP when the server hosts multiple public addresses or when you want to limit exposure to one interface.
SSL Listener
An SSL listener is usually configured on port 443 and points to a certificate, private key, and protocol settings.
Virtual Hosts
Virtual hosts define how individual websites behave.
Virtual Host Setup
Each virtual host has a root directory, config file, domain mapping, and optional rewrite or context rules.
Document Root
The document root points to the public web files for the site, such as /var/www/example.com/public.
Domain Mapping
Map one or more domains to the virtual host so the listener knows where to route requests.
Contexts
Contexts are path-based rules. Common uses include:
- Static content contexts
- PHP or script execution contexts
- Proxy contexts for upstream apps
- Redirect or restricted path handling
Server Configuration
Server-wide settings shape how the engine behaves under load.
Server Process Settings
Tune worker processes, user and group ownership, and restart behavior.
Connection Settings
Control connection timeouts, keep-alive policy, and maximum concurrent usage.
Security Settings
Configure request filtering, forbidden path protections, and administrative exposure.
Log Settings
Define access logs, error logs, rotation strategy, and desired verbosity.
Configuration Files
httpd_config.conf
This is the main server-level configuration file and the central reference for listeners, includes, and top-level settings.
vhconf.conf
This per-virtual-host file stores site-specific directives such as roots, rewrites, and external app mappings.
.htaccess support
OpenLiteSpeed supports Apache-style .htaccess behavior for many use cases, but native OpenLiteSpeed configuration is usually easier to audit and performs better when rules are centralized.
Recommended Workflow
- Create the listener.
- Create the virtual host.
- Map domains from listener to virtual host.
- Set the document root and index files.
- Add PHP handlers, rewrite rules, or SSL.
- Gracefully reload and test.
Validation Checklist
- Listener exists on the expected IP and port
- Domain resolves to the correct server
- Virtual host root and document root are correct
- Config files are readable by the web server user
- A graceful restart applies changes without errors