OpenLiteSpeed is a free, open-source, lightweight and high-performance web server developed by LiteSpeed Technologies. Compared to other web servers, it consumes low resources and handles thousand of concurrent connections. It comes with a user-friendly web UI, supports Apache rewrite and other third-party modules. It supports many operating systems such as Linux, Mac OS and FreeBSD.
In this tutorial, we'll show you how to install OpenLiteSpeed with PHP 7.4 support on Debian 10.
Prerequisites
- A Debian 10 server installed in your system.
- A root user or user with sudo privileges configured in your server.
- Open the TCP ports for the web expample (8088) and the WebAdmin console (7080) in he profile server in Clouding's control panel.
Install OpenLiteSpeed
By default, the OpenLiteSpeed package is not included in the Debian 10 default repository. So you'll need to add the OpenLiteSpeed repository to your system.
First, add the OpenLiteSpeed repository with the following command:
# wget -c http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh
# bash enable_lst_debain_repo.sh
Once the repository is added, install OpenLiteSpeed with the following command:
# apt-get install openlitespeed -y
Once OpenLiteSpeed is installed, verify the installed version of OpenLiteSpeed with the following command:
# /usr/local/lsws/bin/lshttpd -v
You should get the following output:
LiteSpeed/1.6.21 Open
module versions:
modgzip 1.1
cache 1.62
modinspector 1.1
uploadprogress 1.1
mod_security 1.4
(built: Tue Apr 6 13:20:57 UTC 2021)
module versions:
modgzip 1.1
cache 1.62
modinspector 1.1
uploadprogress 1.1
mod_security 1.4
By default, OpenLiteSpeed listens on port 8088. You can check it with the following command:
# ss -antpl | grep 8088
You should get the following output:
LISTEN 0 128 0.0.0.0:8088 0.0.0.0:* users:(("litespeed",pid=4323,fd=22),("litespeed",pid=4285,fd=22))
You can also check the status of the OpenLiteSpeed service using the following command:
# systemctl status lsws
You should get the following output:
● lsws.service - LSB: lshttpd
Loaded: loaded (/etc/init.d/lsws; generated)
Active: active (running) since Thu 2021-04-15 05:05:58 UTC; 2min 24s ago
Docs: man:systemd-sysv-generator(8)
Process: 4257 ExecStart=/etc/init.d/lsws start (code=exited, status=0/SUCCESS)
Tasks: 3 (limit: 2359)
Memory: 6.6M
CGroup: /system.slice/lsws.service
├─4285 openlitespeed (lshttpd - main)
├─4294 openlitespeed (lscgid)
└─4323 openlitespeed (lshttpd - #01)
Apr 15 05:05:55 debian systemd[1]: Starting LSB: lshttpd...
Apr 15 05:05:58 debian systemd[1]: Started LSB: lshttpd.
Now, open your web browser and access the OpenLiteSpeed web page using the URL http://your-server-ip:8088. You should see the following page:
Install PHP7.4 for OpenLiteSpeed
Next, you'll need to install PHP7.4 for OpenLiteSpeed. You can install it with the following command:
# apt-get install lsphp74 lsphp74-common lsphp74-mysql lsphp74-dev lsphp74-curl lsphp74-dbg -y
Once all the packages are installed, you can proceed to the next step.
Setup OpenLiteSpeed Admin Password
OpenLiteSpeed provides a web console that listens on port 7080. You'll need to set an admin password to access it.
Run the following command to set an admin password for OpenLiteSpeed.
# /usr/local/lsws/admin/misc/admpass.sh
You'll be asked to provide admin username and password as shown below:
Please specify the user name of administrator.
This is the user name required to login the administration Web interface.
User name [admin]: admin
Please specify the administrator's password.
This is the password required to login the administration Web interface.
Password:
Retype password:
Administrator's username/password is updated successfully!
Configure OpenLiteSpeed for PHP 7.4 Support
By default, OpenLiteSpeed is configured with PHP5 support. So you'll need to configure OpenLiteSpeed to use PHP7.4 as a default version.
First, access the OpenLiteSpeed web admin console using the URL https://your-server-ip:7080. You should see the OpenLiteSpeed login page:
To go on, provide your admin username and password and click on the "Login" button. You should see the OpenLiteSpeed dashboard in the following page:
Next, click on the "Server Configuration" on the left panel and click the 'External App' tab. You should see the following page:
Next, click on the "+" icon to add the PHP 7.4 configuration. You should see the following page:
The next step is to select "LiteSpeed SAPI App" and click on the "Next" button. You should see the following page:
Provide the following information:
Name: lsphp74
Address: uds://tmp/lshttpd/lsphp.sock
Notes: lsphp74 for OpenLiteSpeed
Max Connections: 50
Initial Request Timeout (secs): 60
Retry Timeout (secs): 0
Command: $SERVER_ROOT/lsphp74/bin/lsphp
Next, click on the "Save" button to save the configuration. You should see the following page:
Click on the "restart" button to apply the changes.
Next, you'll have to change the default PHP for OpenLiteSpeed to the PHP 7.4 version.
To do so, click on the "Script Handler" tab in the Server Configuration. You should see the following page:
Click on the "edit" button. You should see the following page:
Select "lsphp74" in the Handler Name and click on the "Save" button. You should see the following page:
Click on the "restart" button to apply the changes.
Conclusion
Congratulations! You have successfully installed OpenLiteSpeed with PHP 7.4 support on Debian 10 server.
You can now host your application easily with OpenLiteSpeed web server.
Any question about this tutorial? You can contact us on support@clouding.io. We'll be glad to help you out!