How to install OpenLiteSpeed on Linux 9

Share on Social Media

In this Linux tutorial, you will learn how to install OpenLiteSpeed on Rocky Linux 9 or other Red Hat based Linux distributions. #centlinux #linux #openlitespeed

What is OpenLiteSpeed?:

OpenLiteSpeed is the open-source edition of LiteSpeed Web Server (LSWS). LiteSpeed Web Server is proprietary web server software. It is the 4th most popular web server, estimated to be used by 10% of websites as of July 2021. LSWS is developed by privately held LiteSpeed Technologies. The software uses the same configuration format as Apache HTTP Server and is compatible with most Apache features. An open-source variant is also available.

OpenLiteSpeed combines speed, security, scalability, optimization and simplicity in one friendly open-source package. (Source: Wikipedia)

Video to install OpenLiteSpeed on Linux:

YouTube player

Environment Specification:

We are using a minimal Rocky Linux 9 virtual machine with following specifications.

  • CPU – 3.4 Ghz (2 cores)
  • Memory – 2 GB
  • Storage – 20 GB
  • Operating System – Rocky Linux release 9.1 (Blue Onyx)
  • Hostname – web-01.centlinux-com.preview-domain.com
  • IP Address – 192.168.116.128/24

Prepare your Rocky Linux Server:

By using a ssh client, login to your Linux machine as root user. If you are a Linux newbie then we recommend that you should read Linux for Beginners (PAID LINK) by Ethem Mining before deep diving into Linux commandline.

Set a hostname (FQDN) and Local DNS resolution for your Linux Server. Or you can configure a DNS Server for your network.

# hostnamectl set-hostname web-01.centlinux-com.preview-domain.com
# echo "192.168.116.128 web-01 web-01.centlinux-com.preview-domain.com" >> /etc/hosts

It is a best practice to update software packages in your Linux operating system, before installation or configuration of a new software.

Therefore, execute dnf command to update your Linux operating system.

# dnf update -y

If your Linux Kernel is updated by the above command, then you should reboot your Linux server with the new Kernel.

# reboot

Note down the versions of Linux Kernel and Linux operating system.

# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.1 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.1"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.1 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.1"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.1"

# uname -r
5.14.0-162.23.1.el9_1.x86_64

Install Third Party Yum Repositories:

First of all, install wget command, because you will need it to download and install third party yum repositories.

# dnf install -y wget

Execute following Linux command to install LiteSpeed Official repository.

# wget -O - https://repo.litespeed.sh | sudo bash
--2023-04-18 16:47:24--  https://repo.litespeed.sh/
Resolving repo.litespeed.sh (repo.litespeed.sh)... 34.192.49.9
Connecting to repo.litespeed.sh (repo.litespeed.sh)|34.192.49.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4739 (4.6K) [application/octet-stream]
Saving to: ‘STDOUT’

-                   100%[===================>]   4.63K  --.-KB/s    in 0.04s

2023-04-18 16:47:27 (132 KB/s) - written to stdout [4739/4739]

/tmp ~
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1798  100  1798    0     0   1542      0  0:00:01  0:00:01 --:--:--  1540
~
LiteSpeed repository has been setup!

OpenLiteSpeed software requires some software packages from EPEL and REMI yum repositories. Therefore, install both of them by using following dnf commands.

# dnf install -y epel-release
# dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm

Build yum cache for newly installed yum repositories.

# dnf makecache
Extra Packages for Enterprise Linux 9 - x86_64  7.5 kB/s | 6.0 kB     00:00
LiteSpeed Tech Repository for CentOS 9 - x86_64 7.7 kB/s | 3.6 kB     00:00
LiteSpeed Tech Update Repository for CentOS 9 - 7.9 kB/s | 3.6 kB     00:00
Remi's Modular repository for Enterprise Linux  636  B/s | 833  B     00:01
Remi's Modular repository for Enterprise Linux  3.0 MB/s | 3.1 kB     00:00
Importing GPG key 0x478F8947:
 Userid     : "Remi's RPM repository (https://rpms.remirepo.net/) <remi@remirepo.net>"
 Fingerprint: B1AB F71E 14C9 D748 97E1 98A8 B195 27F1 478F 8947
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el9
Is this ok [y/N]: y
Remi's Modular repository for Enterprise Linux  426 kB/s | 882 kB     00:02
Safe Remi's RPM repository for Enterprise Linux 834  B/s | 833  B     00:00
Safe Remi's RPM repository for Enterprise Linux 3.0 MB/s | 3.1 kB     00:00
Importing GPG key 0x478F8947:
 Userid     : "Remi's RPM repository (https://rpms.remirepo.net/) <remi@remirepo.net>"
 Fingerprint: B1AB F71E 14C9 D748 97E1 98A8 B195 27F1 478F 8947
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el9
Is this ok [y/N]: y
Safe Remi's RPM repository for Enterprise Linux 492 kB/s | 910 kB     00:01
Rocky Linux 9 - BaseOS                          1.3 kB/s | 4.1 kB     00:03
Rocky Linux 9 - AppStream                       1.2 kB/s | 4.5 kB     00:03
Rocky Linux 9 - Extras                          1.2 kB/s | 2.9 kB     00:02
Metadata cache created.

Install OpenLiteSpeed Web Server:

Execute following command at Linux terminal to install OpenLiteSpeed and dependent software packages.

# dnf install -y openlitespeed

PHP 7.2 is already installed with OpenLiteSpeed software. However, if you want to install PHP 8.1 then you can use following Linux command.

# dnf install -y lsphp81 lsphp81-common lsphp81-mysqlnd lsphp81-gd lsphp81-process lsphp81-mbstring lsphp81-xml lsphp81-pdo lsphp81-imap lsphp81-soap lsphp81-bcmath

The OpenLiteSpeed web server has been installed successfully. Default installation directory is /usr/local/lsws.

OpenLiteSpeed installation process generates a random password for admin user. You can get this password by displaying the content of the file by using cat command.

# cat /usr/local/lsws/adminpasswd
Web Admin user/password is admin/MTUzN2Qw

Note down the admin password for future use.

Enable and start OpenLiteSpeed service.

# systemctl enable --now lsws

Configure Linux Firewall:

OpenLiteSpeed uses port 8088/tcp for websites and port 7080/tcp for its web admin console.

You need to allow both of these ports in Linux Firewall to enable network access.

# firewall-cmd --permanent --add-port={8088,7080}/tcp
success
# firewall-cmd --reload
success

Access OpenLiteSpeed Web Server:

Open URL http://web-01.centlinux-com.preview-domain.com:8088/ in web browser.

openlitespeed-welcome-page

You can also access the OpenLiteSpeed Web Admin Console at http://web-01.centlinux-com.preview-domain.com:7080/

openlitespeed-login

Login as admin user and auto-generated password.

openlitespeed-dashboard

You have reached at the Dashboard of OpenLiteSpeed Web Admin Console.

Conclusion – Install OpenLiteSpeed on Linux:

In this Linux tutorial, you have learned how to install OpenLiteSpeed on Linux 9 or other Red Hat based Linux distributions. To start hosting awesome websites with OpenLiteSpeed web server, we recommend that, you should attend online training LiteSpeed Fundamentals