Installation OpenLiteSpeed and php 7.4 on Centos 8
The following tutorial describes how to install OpenLiteSpeed with PHP 7.4 on a server running Centos 8.
This is done using a few simple steps.
Some time ago, we described how to install OpenLiteSpeed on a server with a panel DirectAdmin today we'll do it on the open system.
First, we install the repository command:
1 | rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm |
And we check to see if it is visible in the system:
1 | dnf repolist |
Then install OpenliteSpeed
1 | sudo dnf install openlitespeed |
Run it on your system:
1 2 | systemctl start lsws systemctl enable lsws |
We also check its status:
1 | systemctl status lsws |
PHP Installation 7.4
For starters, add repositories EPEL
1 | sudo dnf install epel-release |
Then install the packages php
1 | sudo dnf install lsphp74 lsphp74-mysqlnd lsphp74-process lsphp74-mbstring lsphp74-mcrypt lsphp74-gd lsphp74-opcache lsphp74-bcmath lsphp74-pdo lsphp74-common lsphp74-xml |
We can also check if lsphp listening correctly:
1 | netstat -pl | grep lsphp |
Installing MariaDB
1 | sudo dnf install mariadb mariadb-server |
Run it on your system
1 2 | systecmtl start mariadb systemctl enable mariadb |
We issue the command to carry out the basic configuration of the server and the MySQL root password giving
1 | mysql_secure_installation |
I answer questions:
1 2 3 4 | Set a root password? [Y/n] Y Remove anonymous users? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y |
Now login to the shell using the MySQL root user
1 2 | mysql -u root -p Type Your Root Password: |
I enter the password.
The next step is configuration management panel OpenliteSpeed listening on port 7080 it unlocks the firewall
1 2 | firewall-cmd --add-port=7080/tcp --permanent firewall-cmd --reload |
Password panel can generate by going to the directory:
1 | cd /usr/local/lsws/admin/misc |
And by typing:
1 | sh admpass.sh |
Configuration OpenliteSpeed with PHP 7.4
Log in to the admin panel and go to openlitespeed Server Configuration 'External App
Then add LiteSpeed SAPI App with the following parameters:
1 2 3 4 5 6 7 | Name: lsphp74 Address: uds://tmp/lshttpd/lsphp.sock Notes: lsphp74 for OpenLiteSpeed Max Connections: 35 Initial Request Timeout (secs): 60 Retry Timeout (secs): 0 Command: $SERVER_ROOT/lsphp74/bin/lsphp |
Then we change the default PHP for the PHP version OpenLiteSpeed 7.4.
In the "Server Configuration", click the "Scripting".
In the "Name service module" select "lsphp74", which just added and click "Save".
The whole should look like
Add http and https to the firewall:
1 2 3 | firewall-cmd --add-service=http --permanent firewall-cmd --add-service=https --permanent firewall-cmd --reload |
The last step is to change the port the port Opellitespped 80
Go to the tab Listener
In the "Default", click "View".
In the "Address Settings", click "edit" to the right.
And change the port 8080 na 80
We save and reload lsphp
If everything is done correctly by using the browser on our server IP address we should see the home page OpenLiteSpeed