Install and Configure OpenLiteSpeed on Rocky Linux 8

In this article, we want to teach you to Install and Configure OpenLiteSpeed on Rocky Linux 8.

OpenLiteSpeed is a high-performance, lightweight, open-source HTTP server that helps your site load faster than ever. Because it’s developed and maintained by the same team responsible for LiteSpeed Web Server Enterprise, it contains all of the essential features of the enterprise version and the same high-quality coding standard.

Install and Configure OpenLiteSpeed on Rocky Linux 8

To install OpenLiteSpeed, you must 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 guide the Initial Server Setup with Rocky Linux 8.

Installing OpenLitespeed on Rocky Linux 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 your server:

sudo dnf install epel-release

Next, you need to add the OpenLiteSpeed repository to 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 Rocky Linux 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 Wed 2022-08-10 08:51:56 EDT; 5s ago
Process: 88852 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, sta>
Main PID: 88874 (litespeed)
CGroup: /system.slice/lshttpd.service
├─88874 openlitespeed (lshttpd - main)
├─88881 openlitespeed (lscgid)
├─88894 openlitespeed (lshttpd - #01)
├─88895 openlitespeed (lshttpd - #02)
└─88896 lsphp

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 Rocky Linux 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 Rocky Linux 8

You can easily run the following command to install MySQL on your server:

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 Rocky Linux 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 Rocky Linux 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 Rocky Linux 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:

OpenLiteSpeen Admin dashboard

Conclusion

At this point, you learn to Install and Configure OpenLiteSpeed on Rocky Linux 8.

Hope you enjoy it.

You may be interested in these articles:

Install and Secure Wekan Server on Rocky Linux 8

Install and Use HomeBrew on Rocky Linux 8

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!