How to Install OpenLiteSpeed on AlmaLinux 8
OpenLiteSpeed is a free, open-source web server that you can use for administering and serving websites. It offers many unique features to make your experience more seamless such as tailored PHP processing with streamlined instructions on how best to utilize it or administrative interfaces which will let you manage all aspects of the site's updates in one place without having dozens upon dozens of scripts scattered around at different places across town.
It is a cross-platform web server that works well with all operating systems, and it is well known for its lightning-fast speeds. You can use, modify or even redistribute OpenLiteSpeed under the terms of the LGPL license. On top of that, you can easily find support from other users on message boards because it has been around for more than ten years.
OpenLiteSpeed will be installed and configured on an AlmaLinux 8 server as part of this tutorial. After installing OpenLitesSpeed, it's ready for you to enjoy powerful page speeds with reduced load times.
In order to complete the steps in this tutorial, you will need:
- One server with AlmaLinux 8 installed. For installation instructions, see our guide
- A non-root with sudo privileges.
Updating the System
First, let’s start by updating the system.
sudo dnf update
This command will install additional packages that are needed for the OpenLiteSpeed installation.
sudo dnf install epel-release
Removing Apache HTTP Server
We will use OpenLiteSpeed as the primary webserver for this tutorial. If you already have Apache HTTP Server installed, it is recommended to remove it before installing OpenLiteSpeed.
sudo dnf remove "httpd*"
rm -rf /etc/httpd
rm -rf /usr/lib64/httpd
To check whether Apache HTTP Server has been removed from your system, type the following command:
sudo systemctl status httpd
Installing the OpenLiteSpeed Server
Now that we have a clean system let’s install the OpenLiteSpeed server.
To install OpenLiteSpeed on an AlmaLinux 8 server, we have to set up the lite speed repository. Add it with the rpm command.
sudo rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm
After that, we can install OpenLiteSpeed using the following command:
sudo dnf update
sudo dnf install openlitespeed lsphp74
Type Y and press Enter when it asks for confirmation.
After that, we can check whether OpenLiteSpeed is working as expected with the following command:
sudo systemctl status lsws
You should get an output like this:
OpenLiteSpeed's default administrative password has to be changed first. Because "123456" is the value, we need a new one for now and will want it as strong as possible so that only those who have access can get into the OpenLiteSpeed server.
Run the following command to set up the web interface username & password.
You can alternatively choose a username for the administrative account, or just press Enter to accept the default value “admin” as your default username. Afterward, you will have to provide and verify the password for the administrator.
Configuring the Firewall
OpenLiteSpeed is designed to be a lightweight web server that can be run from UNIX and utilizes non-standard ports. You must allow incoming traffic on these two ports in order for your client browser or other programming tool accessing the admin panel (port 8088) as well as viewing your default webpage at port 7080.
firewall-cmd --zone=public --permanent --add-port=8088/tcp
firewall-cmd --zone=public --permanent --add-port=7080/tcp
Reload the firewall to apply the changes.
sudo firewall-cmd --reload
Testing the OpenLiteSpeed Installation
Now that we have the webserver up and running, you can open a browser of your choice and type in http://your_server_ip:8088/ to get started with OpenLiteSpeed's user interface.
Where your_server_ip is the actual IP Address of your AlmaLinux 8 VPS.
If everything went well, you should be welcomed by the default OpenLiteSpeed’s web page.
To access the administration interface, you will need to navigate your server's domain or IP address using HTTPS and port number: 7080
You will likely encounter Your connection is not private error page since we haven’t generated and started using SSL certificates yet. You can choose to proceed by clicking on the Advanced button.
On the next page, click on Proceed to ... (unsafe) link at the bottom left.
You will be taken to the OpenLiteSpeed administration interface. Provide the administrative name and password that you set up with the admpass.sh script in the previous step, click on the login button.
OpenLiteSpeed's administrative interface will be shown after your authentication has been verified successfully. From there, you can add additional domains and configure other settings.
That’s It! You have successfully installed OpenLiteSpeed on an AlmaLinux 8 server. For more information regarding OpenLiteSpeed, you can check its official documentation.
To conclude, we have successfully installed OpenLiteSpeed on our AlmaLinux 8 server to replace the default Apache HTTP Server. Aside from installation and basic configuration, we haven't touched much about how this webserver works or what OpenLiteSpeed's features are. There are a lot of different concepts that we haven't covered in this tutorial, but you should already have a good idea of how OpenLiteSpeed works and what benefits it offers.