Start OpenLiteSpeed:
Browse / OpenLiteSpeed Web Server Cheatsheet
OpenLiteSpeed Web Server Cheatsheet
A quick reference guide for OpenLiteSpeed web server, covering essential configurations, commands, and best practices for efficient web hosting.
Basic Configuration & Management
Server Startup & Shutdown
|
|
Typically starts automatically on system boot. Check systemd or init.d scripts. |
|
Stop OpenLiteSpeed: |
Use the command: |
|
Restart OpenLiteSpeed: |
Use the command: |
|
Check Status: |
Use the command: |
|
Graceful Restart: |
In the WebAdmin console, this allows minimal downtime. |
|
Configuration File Location: |
|
WebAdmin Console Access
|
Access the WebAdmin console via a web browser using the server’s IP address or domain name, followed by port Example: |
|
Default username is |
|
Initial password is the server’s serial number, found in |
|
It is highly recommended to change the default password immediately after logging in. |
Basic WebAdmin Tasks
|
Adding a Virtual Host: |
Navigate to |
|
Setting Document Root: |
Within a virtual host’s settings, configure the |
|
Configuring Listeners: |
Set up listeners to define which IP addresses and ports OpenLiteSpeed should listen on for incoming connections. |
|
Enabling SSL: |
Configure SSL certificates and enable HTTPS for secure connections under the virtual host settings. |
|
Deploying a WordPress Site: |
Use the built-in one-click WordPress installer for simplified setup. |
Virtual Host Configuration
Virtual Host Basics
|
Virtual hosts allow you to host multiple websites on a single server. Each virtual host has its own configuration, document root, and settings. |
|
Virtual host configuration files are located in |
|
Each virtual host directory contains a |
Key Virtual Host Directives
|
|
Specifies the directory where the website’s files are located. Example: |
|
|
Defines the domain names that this virtual host will respond to. Supports wildcards. Example: |
|
|
Enables or disables WebDAV support for the virtual host. Example: |
|
|
Specifies email addresses for administrators who will receive error notifications. Example: |
|
|
Path to the error log file. Example: |
|
|
Path to the access log file. Example: |
Context Configuration
|
Contexts define how OpenLiteSpeed handles requests for specific URLs or file types within a virtual host. |
|
Common context types include:
|
|
Contexts are defined within the |
Security & Optimization
Basic Security Measures
|
Keep OpenLiteSpeed up-to-date with the latest security patches. |
|
Use a strong password for the WebAdmin console and change it regularly. |
|
Enable ModSecurity for enhanced web application firewall protection. |
|
Configure access control lists (ACLs) to restrict access to sensitive files and directories. |
|
Disable unnecessary modules to reduce the attack surface. |
|
Use SSL/TLS encryption to protect data in transit. |
Performance Optimization
|
Enable Static File Cache: |
Configure caching for static files (CSS, JavaScript, images) to reduce server load and improve page load times. |
|
Enable Gzip Compression: |
Compress responses to reduce bandwidth usage and improve page load times. |
|
Use a Content Delivery Network (CDN): |
Distribute static content across multiple servers to improve performance for users in different geographic locations. |
|
Optimize Database Queries: |
Ensure that database queries are efficient to reduce database load and improve application performance. |
|
Tune PHP Settings: |
Adjust PHP settings (e.g., memory_limit, max_execution_time) to optimize performance for PHP-based applications. |
|
Use LiteSpeed Cache: |
Leverage the LiteSpeed Cache plugin (for WordPress and other platforms) for advanced caching features. |
Rate Limiting
|
Implement rate limiting to protect against denial-of-service (DoS) attacks and brute-force attacks. |
|
Configure rate limiting rules based on IP address, URL, or other criteria. |
|
Use the WebAdmin console to define rate limiting settings under the Security section. |
Troubleshooting & Logging
Common Issues
|
500 Internal Server Error: Check server error logs for detailed information about the cause of the error. |
|
403 Forbidden Error: Verify file permissions and access control settings. |
|
404 Not Found Error: Ensure that the requested file or directory exists and that the document root is configured correctly. |
|
Website Not Accessible: Check DNS settings, firewall rules, and listener configurations. |
|
Slow Performance: Analyze server resource usage, optimize caching, and tune PHP settings. |
Log File Locations
|
Server Error Log: |
|
|
Virtual Host Error Log: |
|
|
Virtual Host Access Log: |
|
|
WebAdmin Console Log: |
|
Debugging Tools
|
Use the |
|
The WebAdmin console provides various tools for monitoring server performance and troubleshooting issues. |
|
Enable PHP error reporting to display errors in the browser or log them to a file. |
|
Use debugging tools like Xdebug for advanced debugging of PHP applications. |