Install and Configure OpenLiteSpeed on Debian 11

In this guide, we intend to teach you to Install and Configure OpenLiteSpeed on Debian 11.

OpenLiteSpeed ​​combines speed, security, scalability, optimization, and simplicity in a friendly open-source package. It has rewriting rules compatible with Apache, a built-in web-based administration interface, and custom PHP processing, optimized for the server.

Install and Configure OpenLiteSpeed on Debian 11

To install OpenLiteSpeed, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide the Initial Server Setup with Debian 11.

Now Follow the steps below to complete this guide.

Installing OpenLiteSpeed on Debian 11

First, you need to update your local package index with the following command:

sudo apt update 

By default, OpenLiteSpeed is not available in the default Debian repository. So you need to add the OpenLiteSpeed repository to your server with the following command:

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

When you have added your OpenLiteSpeed repo, you can install it on Debian 11 by running the command below:

sudo apt install openlitespeed -y

Then, start and enable your service to start on boot with the following commands:

# sudo systemctl enable lsws
# sudo systemctl start lsws

Verify your service is active and running on your server:

sudo systemctl status lsws

In your output you will see:

Output
● lsws.service - LSB: lshttpd
Loaded: loaded (/etc/init.d/lsws; generated)
Active: active (running) since Sat 2022-08-13 03:39:06 EDT; 3min 14s ago
Docs: man:systemd-sysv-generator(8)
Tasks: 4 (limit: 2340)
Memory: 9.5M
CPU: 484ms
CGroup: /system.slice/lsws.service
├─4708 openlitespeed (lshttpd - main)
├─4718 openlitespeed (lscgid)
├─4747 openlitespeed (lshttpd - #01)
└─4748 openlitespeed (lshttpd - #02)

Also, you can check your OpenLiteSpeed version:

/usr/local/lsws/bin/openlitespeed -v
Output
LiteSpeed/1.7.16 Open (BUILD built: Fri May 13 19:00:23 UTC 2022)
module versions:
lsquic 3.0.4
modgzip 1.1
cache 1.64
mod_security 1.4

At this point, we want to install PHP 8.1 to work with OpenLiteSpeed.

Install PHP 8.1 on Debian 11

You can use the following command to install PHP 8.1 and the required packages:

sudo apt install lsphp81 lsphp81-mysql lsphp81-common lsphp81-opcache lsphp81-curl -y

When your installation is completed, you can verify it by checking its version:

/usr/local/lsws/lsphp81/bin/php8.1 -v
Output
PHP 8.1.6 (cli) (built: May 16 2022 00:07:36) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies
with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies

Now you need to configure your OpenLiteSpeed to work with PHP 8.1.

Configure OpenLiteSpeed to Work with PHP 8.1

You need to open your OpenLiteSpeed configuration file with your favorite text editor, here we use vi:

sudo vi /usr/local/lsws/conf/httpd_config.conf

Find the “Path” line and change it to:

  path                    lsphp81/bin/lsphp

When you are done, save and close the file.

Restart the OpenLiteSpeed service on Debian 11 to apply the changes:

sudo systemctl restart lsws

Create OpenLiteSpeed Admin User

At this point, you should create an admin user to access your OpenLiteSpeed admin interface.

To do this, run the following command:

sudo /usr/local/lsws/admin/misc/admpass.sh

You will see the following output, provide your admin user and password:

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.
User name [admin]: admin

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password:
Retype password:
Administrator's username/password is updated successfully!

When you are done, you can access your OpenLiteSpeed admin panel on your Debian 11.

Access OpenLiteSpeed WebAdmin Console

At this point, you can type your server’s IP address in your web browser followed by 7080/login.php to see your admin dashboard:

http://server-ip-address-or-domain-name:7080/login.php

You will see your login screen. Enter your admin user and password that you have set and click Login.

OpenLiteSpeed login screen
OpenLiteSpeed login screen

Now you will access your OpenLiteSpeed WebAdmin console:

OpenLiteSpeen Admin dashboard
LiteSpeed WebAdmin Console

That’s it, you are done.

For more information, you can visit the OpenLiteSpeed Official page.

Conclusion

At this point, you learn to Install and Configure OpenLiteSpeed on Debian 11.

Hope you enjoy it.

You may be interested in these articles:

Install and Use Siege Stress Tester on Debian 11

How To Install Brotli Compression on Debian 11

Install and Configure Zabbix 6.0 on Debian 11

Newsletter Updates

Enter your email address below and subscribe to our newsletter

2 Comments

  1. I’ve been browsing on-line more than three hours lately, but I by no means found any fascinating article like yours. It is pretty value sufficient for me. In my view, if all web owners and bloggers made excellent content as you did, the internet can be a lot more helpful than ever before.

Leave a Reply

Your email address will not be published. Required fields are marked *

Stay informed and not overwhelmed, subscribe now!