OpenLiteSpeed is a powerful, lightweight, and open-source HTTP web server. Install of OpenLiteSpeed in Centos involves a series of steps that include adding repositories and taking steps to ensure security.
As a part of our Server Management Services, we help our Customers with software installations regularly.
Let us today discuss the steps to install OpenLiteSpeed in Centos.
How to install OpenLiteSpeed Web Server on CentOS 8?
Install of OpenLiteSpeed in Centos involves the steps below:
- Configure OpenLiteSpeed Repository
- Install PHP from OpenLiteSpeed Repositories
- Install & Secure MariaDB database server
- OpenLiteSpeed install with dnf command
- Change the default Administrator Password
- Accessing OpenLiteSpeed webserver
Configure OpenLiteSpeed Repository
The first step is to add the OpenLiteSpeed repository to the CentOS 8 or RHEL 8 instance. This will allow us to install the OpenLiteSpeed web server and associated packages and dependencies.
$ sudo rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm
Then update the package lists as shown:
$ sudo dnf update
Install PHP from OpenLiteSpeed Repositories
In this step, we are going to install PHP 7.4 using the OpenLiteSpeed repository colloquially referred to as LSPHP. But before that, ensure that we have added the EPEL repo using the command:
$ sudo dnf install -y epel-release
After installing the EPEL repo, install LSPHP as shown
$ sudo dnf install -y lsphp74 lsphp74-mysqlnd lsphp74-process lsphp74-mbstring lsphp74-mcrypt lsphp74-gd lsphp74-opcache lsphp74-bcmath lsphp74-pdo lsphp74-common lsphp74-xml
Once PHP packages have been installed successfully using the above dnf command, let us install the MariaDB database server.
Install & Secure MariaDB database server
To install the MariaDB database server, run:
$ sudo dnf install -y mariadb mariadb-server
Once installed, start the MariaDB database server by running:
$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb
Run following systemctl command to check the status of MariaDB service,
$ sudo systemctl status mariadb
To secure MariaDB and avoid security breaches, let us proceed with some additional steps:
$ sudo mysql_secure_installation
Begin by setting the root password if none was assigned.
For the remainder of the prompts. Simply press ‘Y’ for Yes to enforce best practice settings.
Install OpenLiteSpeed with dnf command
Now, we need to get OpenLiteSpeed installed on the CentOS 8 instance. To install the web server, simply invoke the following dnf command:
$ sudo dnf install -y openlitespeed
Once the installation is completed, we can check the status of the webserver using the command:
$ sudo systemctl status lsws
If the webserver is not active and running, we can start it by running the command:
$ sudo systemctl start lsws
The web server listens on two ports: 8088 and 7080. Port 8088 is for demo purposes while the port 7080 gives us access to the administrative UI.
We can confirm the ports that the webserver is listening on using the netstat command as shown:
$ sudo netstat -pnltu
Now, we need to open these ports in the firewall:
$ sudo firewall-cmd --zone=public --permanent --add-port=8088/tcp
$ sudo firewall-cmd --zone=public --permanent --add-port=7080/tcp
$ sudo firewall-cmd --reload
Change the default Administrator Password
By default, the Admin’s password is set to ‘123456’. For security reasons, we need to change it to a secure one. To achieve this run the script shown below:
$ sudo /usr/local/lsws/admin/misc/admpass.sh
Specify a different username and password.
Accessing OpenLiteSpeed webserver
To access the default page for the OpenLiteSpeed web server, browse the server’s address as shown:
http://server-ip:8088
This takes us to the demo page. To access the administrative section, browse the server’s IP with the port 7080 using the https protocol.
https://server-ip:7080
We can log in with the new username and password that we set in the step earlier.
This takes us to the OpenLiteSpeed dashboard.
From here, we can configure virtual hosts, change the default port from port 8088 to another port and so much more.
[Need any further assistance to install OpenLiteSpeed on Centos? – We’re available 24*7]
Conclusion
In short, install of OpenLiteSpeed in Centos involves the steps to add repositories and taking steps to ensure security. Today, we saw how our Support Engineers install OpenLiteSpeed on Centos.
0 Comments