First lets see why LiteSpeed is way better then Apache:
- Performance: LSWS is miles ahead of Apache in terms of performance and the implementation of HTTP/3. It also continues to improve HTTP/2 and optimize WordPress performance.
- Efficiency: LSWS is designed to be a drop-in replacement for Apache, but it is not based on Apache code. Instead, it shares similarities with Nginx under the hood.
- WebGUI: LSWS comes with a WebGUI-based administration panel, making management easier.
- Scalability: LSWS is highly scalable and can handle a large number of concurrent connections efficiently.
- LSCache: LSWS integrates seamlessly with LSCache, a powerful caching solution that significantly improves website speed.
Bellow you will find the step-by-step process of installing and configuring LiteSpeed Web Server (LSWS) on Debian 12.
Prerequisites
Before we begin, ensure you have the following:
- A server running Debian 12.
- A non-root user with sudo privileges.
- A fully qualified domain name (FQDN) pointing to your server (e.g., example.com).
Step 1: Configure Firewall
- Debian comes with ufw (Uncomplicated Firewall) by default. Check if it’s running:
sudo ufw status
- Allow SSH, HTTP, HTTPS, and the port related to OpenLiteSpeed:
sudo ufw allow OpenSSH
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 7080/tcp
sudo ufw enable
Step 2: Install OpenLiteSpeed
- Install OpenLiteSpeed from the LiteSpeed repositories:
sudo apt update
sudo apt install wget curl nano ufw software-properties-common dirmngr apt-transport-https gnupg2 ca-certificates lsb-release debian-archive-keyring unzip -y - Add the OpenLiteSpeed repository for Debian 12:
sudo wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | bash
- Install OpenLiteSpeed:
sudo apt update
sudo apt install openlitespeed
Step 3: Create the Administrator Password
- Access the OpenLiteSpeed WebGUI at http://your-server-ip:7080.
- Set an admin username and password.
Step 4: Install PHP
- Enable the LiteSpeed repository for PHP:
sudo wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_php_repo.sh | bash
- Install PHP:
sudo apt update
sudo apt install lsphp74
Step 5: Configure MariaDB
- Install MariaDB:
sudo apt install mariadb-server
- Secure MariaDB installation:
sudo mysql_secure_installation
Step 6: Configure OpenLiteSpeed
- Switch the HTTP port back to 80:
- In the WebGUI, navigate to Configuration > Listeners.
- Edit the Default listener and set the port to 80.
- Configure PHP:
- In the WebGUI, navigate to Configuration > Server > General.
- Set the External App for PHP to lsphp74.
- Restart PHP:
sudo systemctl restart lsws
Step 7: Create VirtualHost
- In the WebGUI, navigate to Virtual Hosts > Add a Virtual Host.
- Configure your website settings.
Step 8: Install SSL
- Obtain an SSL certificate (e.g., Let’s Encrypt).
- In the WebGUI, navigate to Virtual Hosts > your-virtual-host > SSL.
- Upload your SSL certificate files.
Step 9: Test Site
- Upload your website files to the configured VirtualHost directory.
- Access your site via the FQDN or IP address.
Congratulations! You’ve successfully installed and configured LiteSpeed Web Server on Debian 12. Enjoy the improved performance!