Install OpenLiteSpeed on AlmaLinux 9

This tutorial intends to teach you to Install OpenLiteSpeed with PHP and MySQL on AlmaLinux 9 or you can use any RHEL 9 distro. As you know, OpenLiteSpeed is a high-performance, lightweight, open-source HTTP server that helps your site load faster than ever. Now follow the steps below to complete your OpenLiteSpeed installation and access your OpenLiteSpeed admin console.

Learn To Install OpenLiteSpeed on AlmaLinux 9

To complete this guide, you must have access to your as a non-root user with sudo privileges and set up a basic firewall. To do this, you can check our guide on Initial Server Setup with AlmaLinux 9.

Step 1 – Install Remi Enterprise Linux 9 Repository

First, you need to run the system update with the command below:

sudo dnf update -y

Then, use the commands below to install land enable Remi repository on AlmaLinux 9:

# sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
# sudo dnf config-manager --set-enabled remi

Next, use the command below to install the libxcrypt-compat package:

sudo dnf install libxcrypt-compat -y

Step 2 – Download and Install OpenLiteSpeed on AlmaLinux 9

At this point, you can use the following wget command to add the OpenLiteSpeed repository:

sudo wget -O - https://repo.litespeed.sh | sudo bash
Output
HTTP request sent, awaiting response... 200 OK
Length: 5592 (5.5K) [application/octet-stream]
Saving to: ‘STDOUT’

-                   100%[===================>]   5.46K  --.-KB/s    in 0.02s

2023-06-06 08:23:40 (340 KB/s) - written to stdout [5592/5592]

LiteSpeed repository already setup!

Next, use the command below to install OpenLitespeed:

sudo dnf install openlitespeed -y

OpenLieSpeed will start automatically during your installation.

Verify that your OpenLiteSpeed web server is active and running on AlmaLinux 9 with the following command:

sudo systemctl status lsws

In your output you will see:

Output
● lshttpd.service - OpenLiteSpeed HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/lshttpd.service; enabled; preset: disabled)
     Active: active (running) since Tue 2023-06-06 08:43:38 EDT; 1min 19s ago
    Process: 78537 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
   Main PID: 78550 (litespeed)
     CGroup: /system.slice/lshttpd.service
             ‣ 78550 "openlitespeed (lshttpd - main)"
...

Note: If your web server is not active on your server, you can start it with the command below:

sudo /usr/local/lsws/bin/lswsctrl start

Step 3 – Install PHP for OpenLitSeed

At this point, you need to install PHP for better security, stability, and handling of multiple connections.

You can install PHP 8.1 and its extensions with the following command:

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

Step 4 – Install MySQL on AlmaLinux 9

You can easily run the following command to install MySQL on AlmaLinux 9:

sudo dnf install mysql mysql-server -y

Then, start and enable your MySQL service with the commands below:

# sudo systemctl start mysqld 
# sudo systemctl enable mysqld

Now for more security, run the secure installation for MySQL:

sudo mysql_secure_installation

You will be asked some questions. Answer them as shown below:

Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: n
Please set the password for root here.
New password:
Re-enter new password:
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

When you are done, you can start to configure your OpenLiteSpeed Admin panel.

Step 5 – Configure OpenLiteSpeed on AlmaLinux 9

At this point, you need to change the default password of the Admin user to log in to the administration Web interface. To do this run the following command:

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

You will be asked to enter your admin username and set a password.

In your output you will see:

Output
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!

Step 6 – Configure Firewall For OpenLiteSpeed

Here we assumed that you have enabled the firewalld. Now run the commands below to open the OpenLiteSpeed ports through the AlmaLinux 9 firewall:

# sudo firewall-cmd --zone=public --permanent --add-port=8088/tcp
# sudo firewall-cmd --zone=public --permanent --add-port=7080/tcp

To apply the changes reload the firewall:

sudo firewall-cmd --reload

Step 7 – Access OpenLiteSpeed Admin Web Console

At this point, you can access your OpenLiteSpeed Admin panel on AlmaLinux 9 by typing your server’s IP address in your web browser followed by 7080:

http://Your_IP_address:7080

You will see the OpenLiteSpeed login screen, enter your credentials and click on the Login button:

Openlitespeed admin console login

Then, you will see your OpenLiteSpeed Admin dashboard:

OpenLiteSpeed Admin dashboard

From your dashboard, you can easily control as well as configure all OpenLiteSpeed Web Server settings. For more information, you can visit the official website.

Here are some of OpenLiteSpeed Admin Console features:

  • Virtual host management
  • Server-level configuration
  • Log management
  • Security features
  • Cache management

Conclusion

At this point, you have learned to Install OpenLiteSpeed on AlmaLinux 9 and Access your Admin Console. The admin console is a user-friendly interface that you can use to manage your OpenLiteSpeed web server.

Hope you enjoy it. You may be interested in these articles:

Installing OpenLiteSpeed on Debian 12 Bookworm

Change LiteSpeed WebAdmin Console Login

Install and Configure OpenLiteSpeed on Ubuntu 22.04

Install and Configure OpenLiteSpeed on Centos 7

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!