Welcome to our comprehensive guide on installing OpenLiteSpeed on AlmaLinux 8! In this article, we will walk you through the step-by-step process of setting up OpenLiteSpeed, a free and open-source web server known for its lightning-fast speeds and user-friendly features. With OpenLiteSpeed, you can administer and serve websites with ease, enjoying powerful page speeds and reduced load times. So, let’s get started!
Prerequisites
Before we dive into the installation process, there are a few prerequisites you need to have in place:
- AlmaLinux 8 server: Ensure that you have a server with AlmaLinux 8 installed. If you need assistance with the installation, refer to our guide on how to install AlmaLinux 8.
- Non-root user with sudo privileges: It’s important to have a non-root user with sudo privileges to ensure the security and stability of your server.
Updating the System
The first step in installing OpenLiteSpeed is to update your system. To do this, log in to your AlmaLinux 8 server as the non-root user and run the following command:
sudo dnf update
This command will update the system and install any additional packages that are needed for the OpenLiteSpeed installation. Once the update is complete, you’re ready to move on to the next step.
Removing Apache HTTP Server
If you already have Apache HTTP Server installed on your server, it is recommended to remove it before installing OpenLiteSpeed. This will ensure a smooth installation process without any conflicts.
To remove Apache HTTP Server, run the following commands:
sudo dnf remove "httpd*" rm -rf /etc/httpd rm -rf /usr/lib64/httpd After running these commands, you can check whether Apache HTTP Server has been successfully removed by typing the following command:
sudo systemctl status httpd
If there are no active instances of Apache HTTP Server running, you’re ready to proceed with the installation of OpenLiteSpeed.
Installing the OpenLiteSpeed Server
Now that you have a clean system, it’s time to install the OpenLiteSpeed server. To do this, we first need to set up the LiteSpeed repository. Run the following command to add the repository:
sudo rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm
Once the repository is added, you can install OpenLiteSpeed by running the following commands:
sudo dnf update sudo dnf install openlitespeed lsphp74
When prompted for confirmation, type “Y” and press Enter. The installation process may take a few moments to complete.
After the installation is finished, you can check whether OpenLiteSpeed is working as expected by running the following command:
sudo systemctl status lsws
If everything is working properly, you should see an output indicating that OpenLiteSpeed is active.
Configuring the Firewall
OpenLiteSpeed is designed to be a lightweight web server that can run on non-standard ports. To ensure that incoming traffic can access your server, you need to configure the firewall to allow access to the necessary ports.
Run the following commands to allow incoming traffic on ports 8088 and 7080:
firewall-cmd --zone=public --permanent --add-port=8088/tcp firewall-cmd --zone=public --permanent --add-port=7080/tcp
Once the commands are executed, reload the firewall to apply the changes:
sudo firewall-cmd --reload
Your firewall is now configured to allow access to OpenLiteSpeed through the specified ports.
Testing the OpenLiteSpeed Installation
Now that you have completed the installation and configuration of OpenLiteSpeed, it’s time to test whether it is working as expected. To do this, open a web browser of your choice and enter the following URL:
http://your_server_ip:8088/
Replace “yourserverip” with the actual IP address of your AlmaLinux 8 server. If everything is set up correctly, you should see the default OpenLiteSpeed web page.
To access the administration interface, navigate to your server’s domain or IP address using HTTPS and port number 7080:
https://your_server_ip:7080
Please note that you may encounter a “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 and then clicking on the “Proceed to … (unsafe)” link.
You will be taken to the OpenLiteSpeed administration interface. Enter the administrative username and password that you set up earlier using the admpass.sh script. Once authenticated, you will have access to the administrative interface, where you can add additional domains and configure various settings.
Conclusion
Congratulations! You have successfully installed OpenLiteSpeed on your AlmaLinux 8 server, replacing the default Apache HTTP Server. OpenLiteSpeed offers a wide range of features and benefits, including lightning-fast speeds, streamlined PHP processing, and a user-friendly administrative interface.
While this guide has covered the installation and basic configuration of OpenLiteSpeed, there is much more to explore and learn about this powerful web server. For more information and in-depth documentation, be sure to check out the official OpenLiteSpeed documentation.
At Shape.host, we are dedicated to providing reliable and scalable cloud hosting solutions. Our Linux SSD VPS options are ideal for running OpenLiteSpeed and other web applications. If you’re looking for a hosting provider that combines performance, security, and excellent customer support, look no further than Shape.host.