How To Install OpenLiteSpeed on Fedora 42
OpenLiteSpeed represents a remarkable achievement in web server technology, offering exceptional performance while maintaining an accessible open-source framework. For system administrators and web developers looking to maximize server efficiency on Fedora 42, OpenLiteSpeed provides a compelling alternative to traditional web server solutions. This comprehensive guide walks you through the complete installation and configuration process, ensuring you can harness OpenLiteSpeed’s full potential on your Fedora 42 system.
Introduction
OpenLiteSpeed has emerged as a formidable competitor in the web server market, particularly for those seeking high-performance alternatives to Apache and Nginx. As an open-source version of the commercial LiteSpeed Enterprise server, it delivers impressive speed advantages while consuming fewer system resources. The platform has gained significant traction due to its built-in cache capabilities, Apache rewrite rule compatibility, and user-friendly GUI administration panel, making server management more accessible even for those with limited command-line experience.
Fedora 42, with its cutting-edge features and robust package management, provides an excellent foundation for OpenLiteSpeed deployment. Whether you’re setting up a development environment, hosting multiple websites, or building a high-traffic production server, this combination offers exceptional stability and performance. This tutorial caters to both beginners seeking their first web server installation and experienced administrators looking to optimize their infrastructure.
Understanding OpenLiteSpeed
OpenLiteSpeed represents the community edition of LiteSpeed Technologies’ enterprise web server solution. This relationship ensures regular updates and security patches while maintaining the advantages of open-source development. The server’s event-driven architecture enables it to handle more concurrent connections with significantly less memory consumption than traditional servers like Apache.
From a technical perspective, OpenLiteSpeed outperforms many competitors through its efficient event-driven processing model. Rather than creating new threads or processes for each connection, it uses an asynchronous approach that substantially reduces memory overhead. This architecture translates to measurable performance benefits: faster page load times, higher request throughput, and better resource utilization under heavy loads.
When compared to Apache, OpenLiteSpeed demonstrates superior performance metrics while maintaining compatibility with common Apache features like .htaccess and mod_rewrite rules. Against Nginx, it offers comparable speed but with added features like the built-in administration interface. For high-traffic websites, content delivery networks, or resource-constrained environments, these advantages make OpenLiteSpeed particularly attractive.
The latest versions continue to introduce performance optimizations, security enhancements, and expanded plugin support, making it increasingly versatile for different deployment scenarios.
Prerequisites
Before beginning the OpenLiteSpeed installation on Fedora 42, ensure your system meets the following requirements:
- A Fedora 42 system with at least 1GB RAM (2GB or more recommended for production environments)
- Minimum 20GB disk space (more for websites with significant content)
- Root or sudo access to execute system-level commands
- Basic familiarity with terminal commands and text editors
- Active internet connection for downloading packages
While OpenLiteSpeed can run on minimal hardware, its performance scales effectively with additional resources. For production deployments, consider allocating additional RAM and CPU cores to handle increased traffic loads. Before proceeding with installation, it’s also prudent to create system backups, especially if you’re migrating from another web server solution.
Preparing Your Fedora 42 System
The first step toward a successful OpenLiteSpeed installation involves preparing your Fedora 42 system. Begin by ensuring all system packages are updated to their latest versions. This minimizes potential compatibility issues and secures your server against known vulnerabilities.
Open your terminal and execute the following command to perform a complete system update:
sudo dnf update
After the update completes, install the libnsl package, which provides essential network service libraries required by OpenLiteSpeed:
sudo dnf install libnsl -y
Before proceeding, verify your system has sufficient free disk space by running:
df -h
This command displays available disk space on all mounted filesystems. Ensure your primary partition has at least 10GB free for the installation and subsequent website files.
If you’re upgrading from another web server like Apache or Nginx, check for any running services that might conflict with OpenLiteSpeed’s port usage:
sudo systemctl status httpd
sudo systemctl status nginx
If active, consider either stopping these services or configuring OpenLiteSpeed to use different ports. For existing web servers, create backups of your sites and configuration files before proceeding.
Configuring the Firewall
Properly configuring the firewall is crucial for securing your OpenLiteSpeed installation while ensuring necessary services remain accessible. Fedora 42 uses firewalld as its default firewall management tool. Begin by ensuring the firewall service is active and enabled at boot:
sudo systemctl start firewalld
sudo systemctl enable firewalld
OpenLiteSpeed requires several ports to be accessible for proper functionality. Configure your firewall to allow these essential services:
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
Additionally, OpenLiteSpeed uses specific ports that need to be explicitly allowed:
sudo firewall-cmd --permanent --add-port=7080/tcp # Admin panel
sudo firewall-cmd --permanent --add-port=8088/tcp # Default web server port
After adding all necessary ports and services, reload the firewall configuration to apply changes:
sudo firewall-cmd --reload
Verify your firewall configuration with:
sudo firewall-cmd --list-all
The output should display all services and ports you’ve configured. For enhanced security, consider restricting access to the admin panel port (7080) to trusted IP addresses only:
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="your-trusted-ip/32" port port="7080" protocol="tcp" accept'
sudo firewall-cmd --reload
This limits administrative access to connections originating from your specified IP address, significantly reducing potential attack vectors.
Installation Methods for OpenLiteSpeed
Two primary methods exist for installing OpenLiteSpeed on Fedora 42: repository-based installation and manual installation. Each approach offers distinct advantages depending on your specific requirements and comfort level with system administration.
The repository-based method simplifies installation and future updates by integrating with Fedora’s package management system. This approach handles dependencies automatically and streamlines maintenance through standard system update procedures. It’s recommended for most users, especially those new to server administration or seeking minimal maintenance overhead.
Manual installation offers greater control over the installation process and version selection. This method becomes particularly valuable when you need a specific version not yet available in repositories or require custom compilation options. However, it demands greater technical knowledge and manual management of updates and dependencies.
For most Fedora 42 deployments, the repository method provides the optimal balance of convenience and functionality. The following sections detail both approaches, allowing you to choose based on your specific requirements.
Repository Installation Method
Installing OpenLiteSpeed through repositories streamlines both initial setup and long-term maintenance. Begin by adding the official OpenLiteSpeed repository to your Fedora 42 system:
sudo rpm -Uvh https://rpms.litespeedtech.com/centos/litespeed-repo-1.3-1.el8.noarch.rpm
While this repository is designed for CentOS/RHEL, it’s compatible with Fedora 42 due to their shared RPM package management system. Next, install the EPEL (Extra Packages for Enterprise Linux) repository for additional dependencies:
sudo dnf install epel-release
Update your package lists to include these new repositories:
sudo dnf update
Now install OpenLiteSpeed and the PHP processor (using the latest available version):
sudo dnf install openlitespeed lsphp74
After installation completes, create a symbolic link to ensure OpenLiteSpeed uses the correct PHP processor:
sudo ln -sf /usr/local/lsws/lsphp74/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5
Verify the installation was successful by checking the OpenLiteSpeed status:
sudo /usr/local/lsws/bin/lswsctrl status
If the installation was completed properly, you should see a message indicating that OpenLiteSpeed is running. The repository installation automatically configures initial service settings, though you’ll still need to perform additional setup for administrative access and website configuration in subsequent sections.
Manual Installation Method
For scenarios requiring specific versions or custom configurations, manual installation provides greater flexibility. Begin by downloading the OpenLiteSpeed package directly from the official website:
wget https://openlitespeed.org/packages/openlitespeed-X.X.XX.tgz
Replace X.X.XX with the specific version you wish to install. Extract the archive:
tar -zxvf openlitespeed-X.X.XX.tgz
Before running the installation script, ensure you have the necessary development tools installed:
sudo dnf install gcc gcc-c++ make pcre-devel expat-devel openssl-devel geoip-devel zlib-devel
Navigate to the extracted directory and run the installation script:
cd openlitespeed
sudo ./install.sh
The installation script will guide you through several configuration options. For standard installations, the default options are typically sufficient. The script configures OpenLiteSpeed in the /usr/local/lsws/
directory with the following structure:
/usr/local/lsws/bin/
: Contains control binaries like lswsctrl/usr/local/lsws/conf/
: Configuration files including httpd_config.conf/usr/local/lsws/admin/
: Admin panel files and utilities/usr/local/lsws/Example/
: Default example website files
After installation completes, verify OpenLiteSpeed installed correctly:
sudo /usr/local/lsws/bin/lswsctrl status
The manual installation provides more control but requires additional configuration compared to the repository method. You’ll need to manually create service files for system integration and autostart capability, which the next sections will address.
Starting and Testing OpenLiteSpeed
Once installed, you need to ensure OpenLiteSpeed starts correctly and continues to run after system reboots. If OpenLiteSpeed isn’t already running, start it with:
sudo /usr/local/lsws/bin/lswsctrl start
To enable automatic startup when your system boots, create a systemd service file:
sudo nano /etc/systemd/system/openlitespeed.service
Add the following content to the file:
[Unit]
Description=OpenLiteSpeed HTTP Server
After=network.target
[Service]
Type=forking
PIDFile=/tmp/lshttpd/lshttpd.pid
ExecStart=/usr/local/lsws/bin/lswsctrl start
ExecStop=/usr/local/lsws/bin/lswsctrl stop
ExecReload=/usr/local/lsws/bin/lswsctrl reload
[Install]
WantedBy=multi-user.target
Save and close the file, then enable and start the service:
sudo systemctl enable openlitespeed
sudo systemctl start openlitespeed
Verify the service status to ensure it’s running correctly:
sudo systemctl status openlitespeed
Test your installation by accessing the default welcome page. Open a web browser and navigate to:
http://your-server-ip:8088
You should see the OpenLiteSpeed welcome page, confirming the web server is functioning correctly. If the page doesn’t load, check your firewall settings and ensure port 8088 is accessible. You can also examine the error logs at /usr/local/lsws/logs/error.log
for troubleshooting information.
Setting Up Admin Access
The OpenLiteSpeed admin panel provides a graphical interface for server configuration and management. To access this interface, you first need to create admin credentials:
sudo /usr/local/lsws/admin/misc/admpass.sh
When prompted, enter your desired username (or press Enter to use the default “admin”) and create a strong password. The script will confirm successful credential creation.
With credentials established, access the admin panel by navigating to:
https://your-server-ip:7080
Your browser may display a security warning due to the self-signed SSL certificate. This is expected for the initial setup. You can safely proceed to the admin panel and log in with your credentials.
For enhanced security, consider implementing these best practices for admin access:
- Change the default admin port from 7080 to a custom port
- Implement IP-based access restrictions in your firewall
- Set up session timeouts to automatically log out inactive sessions
- Regularly update your admin password
- Consider setting up SSL certificates for the admin interface
To change the admin port, navigate to WebAdmin Settings in the admin panel. Modify the address settings to use your preferred port, then restart the server to apply changes. Remember to update your firewall rules if you change the port number.
Installing PHP for OpenLiteSpeed
OpenLiteSpeed uses specially optimized PHP handlers for superior performance compared to standard PHP implementations. While we installed a basic PHP processor earlier, you may need additional modules or specific PHP versions depending on your application requirements.
To install additional PHP versions from Remi’s repository, first add the repository:
sudo dnf install dnf-utils http://rpms.remirepo.net/fedora/remi-release-42.rpm
View available PHP module streams:
sudo dnf module list php
Enable your preferred PHP version (for example, PHP 8.1):
sudo dnf module enable php:remi-8.1
Install the PHP extension for OpenLiteSpeed and common modules:
sudo dnf install lsphp81 lsphp81-common lsphp81-mysqlnd lsphp81-process lsphp81-xml lsphp81-mbstring lsphp81-opcache lsphp81-json lsphp81-zip
Create a symbolic link to the new PHP processor:
sudo ln -sf /usr/local/lsws/lsphp81/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5
To test PHP functionality, create a simple phpinfo file:
sudo nano /usr/local/lsws/Example/html/phpinfo.php
Add the following content:
<?php phpinfo(); ?>
Access this file through your browser at http://your-server-ip:8088/phpinfo.php
to verify PHP is working correctly. The page should display detailed PHP configuration information. Review this information to confirm all necessary modules are enabled for your applications.
Virtual Host Configuration
Virtual hosts allow you to host multiple websites on a single OpenLiteSpeed server. Each virtual host can have its own domain name, document root, and configuration settings. To create a virtual host through the admin panel:
- Log in to the OpenLiteSpeed admin panel
- Click on “Virtual Hosts” in the left navigation pane
- Click the “Add” button to create a new virtual host
- Enter a name for your virtual host (e.g., “example.com”)
- Specify the virtual host root directory (e.g., “/
usr/local/lsws/example.com/
“) - Enter the configuration file path, typically within the
conf/vhosts/
directory - Set both “Enable Scripts/ExtApps” and “Restrained” to “Yes”
- Click “Save”
If the configuration file doesn’t exist, OpenLiteSpeed will prompt you to create it. Click the “CREATE” button when prompted. After creating the virtual host, configure its general settings:
- Click on your new virtual host in the list
- Select “General” from the navigation menu
- Set the document root to the appropriate directory (e.g., “
/usr/local/lsws/example.com/html/
“) - Enter your domain name
- Enable compression for better performance
- Click “Save”
Next, configure index files:
- Navigate to “Virtual Hosts” → “[your virtual host]” → “General” → “Index Files”
- Add common index files like “index.php”, “index.html”, and “index.htm”
- Click “Save”
Finally, set up logging:
- Navigate to “Virtual Hosts” → “[your virtual host]” → “Log”
- Configure the virtual host log file location
- Configure access log settings
- Set appropriate access control permissions
- Click “Save”
After completing the configuration, create the necessary directories for your virtual host:
sudo mkdir -p /usr/local/lsws/example.com/html
sudo chown -R nobody:nobody /usr/local/lsws/example.com/html
Gracefully restart OpenLiteSpeed to apply the changes:
sudo /usr/local/lsws/bin/lswsctrl restart
Your virtual host should now be accessible through its domain name once DNS records are properly configured.
Setting Up SSL/HTTPS
Secure communication through SSL/TLS is essential for modern websites. OpenLiteSpeed supports various methods for implementing HTTPS, including free Let’s Encrypt certificates and commercial SSL certificates.
To obtain a free Let’s Encrypt certificate, first install Certbot:
sudo dnf install certbot
Generate certificates for your domain:
sudo certbot certonly --standalone -d yourdomain.com -d www.yourdomain.com
Follow the prompts to complete the certificate generation process. Certbot will save the certificates in /etc/letsencrypt/live/yourdomain.com/
.
To configure SSL in OpenLiteSpeed:
- Log in to the admin panel
- Navigate to “Listeners” and select the listener you want to secure
- Click the “SSL” tab
- Set “SSL Private Key File” to
/etc/letsencrypt/live/yourdomain.com/privkey.pem
- Set “SSL Certificate File” to
/etc/letsencrypt/live/yourdomain.com/fullchain.pem
- Set “Chained Certificate” to “Yes” for Let’s Encrypt certificates
- Click “Save”
To implement HTTP to HTTPS redirection:
- Navigate to “Virtual Hosts” → “[your virtual host]” → “Rewrite”
- Enable the rewrite engine
- Add a rewrite rule like:
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
- Click “Save”
After configuring SSL, gracefully restart OpenLiteSpeed:
sudo /usr/local/lsws/bin/lswsctrl restart
Test your SSL configuration using an online SSL checker or by accessing your site through HTTPS in a browser. For production environments, set up automatic certificate renewal:
sudo crontab -e
Add the following line to renew certificates and restart OpenLiteSpeed when necessary:
0 3 * * * certbot renew --quiet && /usr/local/lsws/bin/lswsctrl restart
This schedule attempts certificate renewal daily at 3 AM, but Certbot only performs the renewal when certificates are nearing expiration.
Performance Tuning
OpenLiteSpeed’s performance can be further optimized through careful tuning of various parameters. Access the server-level settings through the admin panel by clicking “Server Configuration” in the left navigation menu.
Key performance parameters to consider include:
- Worker Processes: Set this to match your server’s CPU core count for optimal resource utilization. For a system with 4 cores:
Number of Worker Processes: 4
- Connection Limits: Adjust based on available RAM and expected traffic:
Max Connections: 10000 Connection Timeout (secs): 300
- Memory Allocation: Configure based on available system resources:
Total Max RSS(KB): [50% of system RAM] Per Process Hard Limit(KB): [Total Max RSS / Number of Workers]
- Cache Configuration: Enable and configure caching for static content:
Cache Storage Path: /tmp/lscache Cache Storage Size(bytes): 1073741824 (1GB)
- PHP Settings: Optimize PHP performance in the PHP handler configuration:
Max Connections: [2 × Number of Workers] Initial Request Timeout (secs): 60 Retry Timeout (secs): 0
For accurate performance assessment, use benchmarking tools like ApacheBench (ab) or wrk to measure response times and throughput under various loads. Monitor server resource usage during testing to identify potential bottlenecks, and adjust configurations accordingly.
Remember that optimal settings vary based on your specific hardware, application requirements, and traffic patterns. Implement changes incrementally and test thoroughly between adjustments.
Advanced Configuration Options
OpenLiteSpeed offers numerous advanced configuration options for tailoring your server to specific requirements. Here are key areas for customization:
Rewrite Rules: OpenLiteSpeed supports Apache-compatible mod_rewrite rules, making it easy to implement URL manipulation for frameworks like WordPress or Laravel. Access rewrite settings through Virtual Hosts → [your host] → Rewrite and enable the rewrite engine.
Custom Error Pages: Create professional error responses by configuring custom error pages:
- Navigate to Virtual Hosts → [your host] → General
- Scroll to “Custom Error Pages” and click “Edit”
- Add entries for common error codes (404, 500, etc.)
- Specify the path to custom HTML error pages
Access Control: Implement IP-based access restrictions:
- Navigate to Virtual Hosts → [your host] → Security → Access Control
- Add allowed/denied IPs or networks
- Configure appropriate access levels
External Application Integration: OpenLiteSpeed can interface with various external applications through its External App configuration. This is particularly useful for running Node.js, Ruby, or Python applications alongside traditional PHP sites.
Log Rotation: Prevent log files from consuming excessive disk space:
- Navigate to Server → Log → Server Log
- Configure “Log Rolling” settings
- Set appropriate size limits and backup counts
Resource Limits: Prevent resource abuse by implementing throttling:
- Navigate to Virtual Hosts → [your host] → General → Resources
- Set connection and bandwidth limits
- Configure request throttling parameters
These advanced configurations allow you to create a highly customized web server environment optimized for your specific applications and traffic patterns.
Troubleshooting Common Issues
Even with careful installation and configuration, issues can arise with OpenLiteSpeed. Here are solutions to common problems:
Permission Problems: If you encounter 403 Forbidden errors or issues with file access:
- Check directory ownership and permissions:
sudo chown -R nobody:nobody /path/to/your/website sudo chmod -R 755 /path/to/your/website
- Ensure the OpenLiteSpeed process has access to necessary files
Connection Refused Errors: If you can’t connect to the admin panel or website:
- Verify the OpenLiteSpeed service is running:
sudo /usr/local/lsws/bin/lswsctrl status
- Check firewall settings:
sudo firewall-cmd --list-all
- Confirm port availability:
sudo ss -tulpn | grep -E '7080|8088'
SSL Certificate Issues: For HTTPS-related problems:
- Verify certificate and key paths in the listener configuration
- Ensure certificate files are readable by the OpenLiteSpeed process
- Check certificate validity and expiration:
openssl x509 -in /path/to/certificate.crt -text -noout
For deeper investigation, OpenLiteSpeed maintains detailed logs at:
/usr/local/lsws/logs/error.log
– Server-level errors/usr/local/lsws/logs/access.log
– Access logs/usr/local/lsws/logs/[virtualhost]
– Virtual host-specific logs
When issues persist, the OpenLiteSpeed community provides support through their official forums and documentation, which offer extensive troubleshooting resources.
Congratulations! You have successfully installed OpenLiteSpeed. Thanks for using this tutorial for installing the OpenLiteSpeed web server on your Fedora 42 Linux system. For additional help or useful information, we recommend you check the official OpenLiteSpeed website.