Install and Configure OpenLiteSpeed on AlmaLinux 8

In this article, we want to teach you How To Install and Configure OpenLiteSpeed on AlmaLinux 8.

OpenLiteSpeed is a high-performance, lightweight, open-source HTTP server that helps your site load faster than ever.

How To Install and Configure OpenLiteSpeed on AlmaLinux 8

Before you start to install OpenLiteSpeed on AlmaLinux 8, you need to log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our article the Initial Server Setup with AlmaLinux 8.

Now follow the steps below to install OpenLiteSpeed on AlmaLinux 8.

Set up OpenLiteSpeed on AlmaLinux 8

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

sudo dnf update -y

Then, you need to install the Epel repository on AlmaLinux 8:

sudo dnf install epel-release

Next, you need to add the OpenLiteSpeed repository on your server with the command below:

sudo rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm

Now you can use the following command to install OpenLiteSpeed:

sudo dnf install openlitespeed

OpenLieSpeed will start automatically during your installation.

Verify that your OpenLiteSpeed web server is active and running on AlmaLinux 8 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; vendor pre>
Active: active (running) since Thu 2022-01-27 07:53:28 EST; 2min 18s ago
Process: 119889 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, st>
Main PID: 119911 (litespeed)
CGroup: /system.slice/lshttpd.service
├─119911 openlitespeed (lshttpd - main)
├─119918 openlitespeed (lscgid)
├─119931 openlitespeed (lshttpd - #01)
└─119932 openlitespeed (lshttpd - #02)

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

/usr/local/lsws/bin/lswsctrl start.

Install PHP on ALmaLinux 8

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

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

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

Install MySQL on AlmaLinux 8

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

sudo dnf install mysql mysql-server

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.

Configure OpenLiteSpeed on AlmaLinux 8

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:

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

Here we assumed that you have enabled the firewalld. Now run the commands below to open the OpenLiteSpeed ports through the AlmaLinux 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

Access OpenLiteSpeed Admin Web Interface

At this point, you can access your OpenLiteSpeed Admin panel on AlmaLinux 8 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 login screen

 

Then, you will see your OpenLiteSpeed Admin dashboard:

OpenLiteSpeed Admin dashboard

Conclusion

At this point, you learn to set up OpenLiteSpeed on AlmaLinux 8. Also, you learn to access your OpenLiteSpeed admin dashboard. From there you can easily manage your server.

Hope you enjoy it.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular