How to Install OpenLiteSpeed Web Server on Debian 11

OpenLiteSpeed is an open-source HTTP server with a similar feature set to Apache but builds on more recent technologies.

OpenLiteSpeed is powered by the extremely fast LiteSpeed Web Server, which excels in both performance and stability – it’s up to 20 times faster than Apache when serving static files.

It also has built-in caching for dynamic content, load balancing, compression, and security features not found in most other web servers.

The LiteMage Cache & Accelerator Module supports cache digests (HTTP conditional GET/POST requests), bytecode caching, PHP accelerators, and SCGI cache support to further improve responsiveness for end-users.

OpenLiteSpeed is available under the GPLv3 open-source license, and commercial licenses are also available. LiteSpeed Technologies offers a variety of commercial licenses to best suit your needs, including Server & Cluster, Developer, OEM, and Reseller licenses. The company also offers a Free Edition for development or testing purposes.

OpenLiteSpeed is an excellent web server choice for any business or organization that wants the performance and stability of Apache but wants to use more recent technologies. It’s also a great choice for businesses that want to use an open-source license without having to give up features or support.

The OpenLiteSpeed server understands all the apache rewrite rules, so you don’t have to worry about reworking your website. If you are considering a switch to OpenLiteSpeed, you can try the software first with LiteSpeed’s product for free without any obligation, and no credit card is required.

We will show you how to install OpenLiteSpeed on Debian 11 in this tutorial. After completing the steps in this tutorial, you will have a fully-working OpenLiteSpeed web server on your Debian 11 system.

Prerequisites

In order to complete this tutorial, you will need:

  • A Debian 11 server with at least 1 GB of memory and 20 GB of disk space
  • Root access to the server
  • An internet connection

Updating the System

Before installing OpenLiteSpeed, it is recommended that you update your system to the latest stable version. You can do this by running the following command.

sudo apt update -y
sudo apt upgrade -y

Once the system is up-to-date, run the following commands to install the required packages.

sudo apt install build-essential libexpat1-dev libgeoip-dev -y
sudo apt install libudns-dev zlib1g-dev libssl-dev libxml2 libxml2-dev -y
sudo apt install libpcre3-dev libpcre3-dev libudns-dev zlib1g-dev -y
sudo apt install libssl-dev libxml2 libxml2-dev rcs libpng-dev libpng-dev openssl -y
sudo apt install rcs libpng-dev libpng-dev openssl autoconf g++ make -y
sudo apt install libxml2-dev openssl libssl-dev libcurl4-openssl-dev -y
sudo apt install libcurl4-openssl-dev pkg-config libsasl2-dev libzip-dev -y

Installing OpenLiteSpeed

Now that all of the prerequisites have been installed, you can install OpenLiteSpeed.

There are several ways to install OpenLiteSpeed. You can either use the LiteSpeed Repositories, or get the source code and build it yourself.

We will use the LiteSpeed Repositories in this tutorial.

First, add the LiteSpeed Repository to your system by running the following command.

wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | sudo bash

The command explained:

  • wget -O – downloads the enable_lst_debian_repo.sh script from the LiteSpeed website
  • http://rpms.litespeedtech.com/debian/ is the URL of the LiteSpeed Repository
  • enable_lst_debian_repo.sh is the name of the script
  • sudo bash runs the script as root, which enables the LiteSpeed Repository

Now that the repository has been enabled, update the package list and install OpenLiteSpeed by running the following command.

sudo apt update -y
sudo apt install openlitespeed -y

The installation process may take a few minutes, so be patient.

Once the installation is complete, you will need to configure the administrative password for OpenLiteSpeed. This password is required to access the OpenLiteSpeed web interface.

To set the administrative password, run the following command.

sudo /usr/local/lsws/admin/misc/admpass.sh
  • /usr/local/lsws/admin/misc/admpass.sh is a script that sets the administrative password.

The script will ask for the new username/password, and then ask you to confirm it. Type the new username/password and press Enter.

Run the following commands to start and enable OpenLiteSpeed.

sudo systemctl start lsws && sudo systemctl enable lsws

You can verify that OpenLiteSpeed is running by running the following command.

sudo systemctl status lsws

If you see the following output, then OpenLiteSpeed is up and running.

Start OpenLiteSpeed systemd service

Accessing the OpenLiteSpeed Web

Now that OpenLiteSpeed is installed, you can access the web interface. OpenLiteSpeed has a friendly web interface that was designed to make it easier for users to manage their configuration.

In order to access OpenLiteSpeed, you will need to know the boostrap URL. The bootstrap URL is the address of your server from a web browser’s viewpoint. For example, if your server has an IP address of 1.2.3.4, the boostrap URL would be http://1.2.3.4/7080

You will get a Your connection is not private error message if you try to access OpenLiteSpeed from a web browser that is not on the same network as the server. Because you have not configured an SSL certificate, the browser will not trust the connection.

Accept self-signed SSL certificate

To overcome this issue on Chrome, you can click on Advance > Proceed to 1.2.3.4 (unsafe). After doing that, you should be able to access the web interface from Chrome.

Continue to OpenLiteSpeed admin interface

You will be taken to the login screen. Provide the username and password that you set in the previous step, and then click on Log In.

You will now see the main OpenLiteSpeed web interface. From here, you can manage your server’s settings and performance.

OpenLiteSpeed dashboard

Next, you will need to compile PHP from the OpenLiteSpeed web UI.

Go to Tools > Compile PHP

Compile PHP

Select your desired PHP version and your desired PHP modules. Click on Next.

Compile PHP version

On the next screen, keep the default and click on Next.

Choose build options

Now, return back to your terminal and run the following script. This script will compile PHP with OpenLiteSpeed. This script can take a long time to complete, so be patient.

/usr/local/lsws/phpbuild/buildphp_manual_run.sh

Sample output:

Compile PHP

Conclusion

In this tutorial, you have learned how to install OpenLiteSpeed on Debian 11. You have also learned how to enable the LiteSpeed Repository and set the administrative password. Finally, you have learned how to compile PHP with OpenLiteSpeed.

You are now ready to start developing websites with PHP and OpenLiteSpeed.