Last update at :2024-06-17,Edit by888u
OpenLiteSpeed is the open source version of LiteSpeed, a high-performance, lightweight web server application. Earlier, Snail had only started to come into contact with VPS and Linux Web environments, and he preferred to use LiteSpeed to configure the website environment. I just happened to see OpenLiteSpeed installing and configuring PHP7 in its environment while browsing the web. I will record it here to see if it can be successful.
In the past, many Linux VPS hosts had relatively small memory, so we would consider installing lightweight WEB applications. But now, most VPSs start at 512MB and the cost is low, so we now consider more ease of use. In terms of performance and scalability, resources may not be considered much.
In this article, Snail prepares to use CentOS7 system to install OpenLiteSpeed and PHP7. Try it and see if it works.
First, update the system
yum install epel-release -yyum clean all && yum update -y && shutdown -r now
After updating and upgrading the system, the server will be restarted. After restarting we log in to SSH again.
Second, quickly install OpenLiteSpeed
rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpmyum install openlitespeed -y
Currently we are using the CentOS7 version, and the latest officially provided version of OpenLiteSpeed is 1.4.24.
Third, install PHP7
Before installing PHP7, let's see if there is a PHP7 version in the current PHP package.
yum list lsphp*
You can see that both PHP7.0 and PHP7.1 are available. Here snail comes to install the latter.
yum install lsphp71 lsphp71-mysqlnd lsphp71-common lsphp71-gd lsphp71-pdo lsphp71-process lsphp71-mbstring lsphp71-mcrypt lsphp71-opcache lsphp71-bcmath lsphp71-xml -y
Just throw it into the above script to install PHP7.1 and the required component packages.
Fourth, set OpenLiteSpeed administrator information
/usr/local/lsws/admin/misc/admpass.sh
Execute the above script, and then you can see a wizard for setting administrator information.
Set the administrator username and password according to the prompts (repeat twice).
Fifth, open port 7080
firewall-cmd –zone=public –permanent –add-port=7080/tcpfirewall-cmd –reload
If you have used LiteSpeed, you should know that the default port is 7080. Here we need to set the firewall to open port 7080. After the settings are completed, in fact, if we use http://server IP address:7080 at this time, we can open and see the OpenLiteSpeed login interface. Because SSL is required by default, we need to skip the secure link before logging in.
We log in using the administrator username and password we set previously, because we will need to set parameters later.
Sixth, set OpenLiteSpeed parameter information
It seems that the progress is pretty good. However, by default OpenLiteSpeed 1.4.24 is currently installed in the PHP5.x version and does not start to the PHP7.1 we installed. Here we need to set the default parameters.
1. View current configuration
After we log in to the panel, in Server Configuration – External app, we can see that it is currently php5.x. Here we need to modify, click edit to edit.
2. Modify configuration
Other parameters are temporarily defaulted, we need to modify them here:
Name: lsphp71
Command: $SERVER_ROOT/lsphp71/bin/lsphp
Other parameters are currently defaulted. Save after modification is completed.
3. Modify Script handler
Similarly in the current interface, use the Script handler tag to confirm and modify parameters.
Suffixes: phpHandler Type: LiteSpeed SAPIHandler Name: lsphp71
Confirm that there are no problems and save.
4. Modify Listeners options
In the left menu\\"Listeners\\", then check the parameters, change 8088 to 80, and other parameters.
Listener Name: DefaultIP Address: ANYPort: 80
5. After saving, click \\"Graceful Restart\\" to restart the settings to take effect.
Seventh, confirm OpenLiteSpeed settings
1. Open port
firewall-cmd –zone=public –permanent –add-service=httpfirewall-cmd –reload
Modify the firewall to allow port 80.
2. Checking takes effect
Enter the IP address directly into the browser. If we can see the welcome interface, it means there is no problem.
It seems that I was lucky and succeeded in the first attempt. Let's see if PHP7.1 is successfully installed.
Enter http://IP address/phpinfo.php
The default system comes with a phpinfo file. We can see that the probe is version 7.1.
To summarize, this article is quite successful in installing the OpenLiteSpeed WEB engine and configuring PHP7.1 in the CentOS7 system. You can follow this configuration, install the database, and build a website.
Recommended site search: domain name price, mainland China agent IP, how to cancel domain name registration, domain name and space, cloud server rental, rent server, apply for free space and domain name, registration system, cc domain name, Ministry of Industry and Information Technology website registration System,
发表评论