When using a shared host, I am very impressed with hosting services using LiteSpeed web servers such as HawkHost , AZDigi .
Websites hosted on it using LiteSpeed Cache plugin are very fast. Even many readers have found LiteSpeed Cache to be better than the paid plugin WP Rocket.
So when researching VPS, I am very excited to experience LiteSpeed Web Server. Fortunately, LiteSpeed has an open source version for its website.
It’s called OpenLiteSpeed . This is a very good performing HTTP server. It can handle a large number of concurrent connections with very few resources.
It supports both SPDY/3.1 and HTTP/2 protocols. Installing and configuring the Lets Encrypt certificate in OpenLiteSpeed is very simple.
Experience OpenLiteSpeed + LiteSpeedCache after installing a WordPress website using the MyThemeShop theme for great speed.
That’s why I started to create this OpenLiteSpeed series.
So you can add a choice next to two popular web servers, Apache and Nginx.
Contents
Outstanding Features of OpenLiteSpeed
- High performance, event driven architecture
- Very light, consumes less RAM and CPU
- Apache-compatible rewrite rules
- There is WebAdmin using the user interface. So many server configuration tasks are simple and intuitive. This is much less tiring than Nginx.
- Supports many different PHP versions. In this article, I will guide you to install the latest version of PHP 7.1.
Prepare
You need to prepare the following:
- A brand new VPS server has just installed CentOS 7. If you don’t know which VPS provider to choose, check out the quality cheap VPS services here.
- Log in as user root using an SSH Client like MobaXTerm .
Step 1: Update the system
First you need to update the operating system with the following commands:
|
1
2
|
yum install epel–release –y
yum clean all && yum update –y && shutdown –r now
|
Step 2: Install OpenLiteSpeed
We will be installing OpenLiteSpeed version 1.4.27 (at the time of this article) from OpenLiteSpeed Repositories using the following commands:
|
1
2
|
rpm –ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm
yum install openlitespeed –y
|
A few useful commands you need to know:
To start OpenLiteSpeed you use the following command:
|
1
|
/usr/local/lsws/bin/lswsctrl start
|
Stop OpenLiteSpeed you use the following command:
|
1
|
/usr/local/lsws/bin/lswsctrl stop
|
Restart OpenLiteSpeed you use the following command:
|
1
|
/usr/local/lsws/bin/lswsctrl restart
|
Check if OpenLiteSpeed is running:
|
1
|
/usr/local/lsws/bin/lswsctrl status
|
Step 3: Install PHP 7.1
You use the following command to install PHP 7.1 and the necessary modules:
|
1
|
yum install lsphp71 lsphp71–mysqlnd lsphp71–common lsphp71–gd lsphp71–pdo lsphp71–process lsphp71–mbstring lsphp71–mcrypt lsphp71–opcache lsphp71–bcmath lsphp71–xml –y
|
If you need to install any more modules, just get the module name starting with lsphp. Use the following command to view the entire module:
|
1
|
yum list lsphp*
|
Step 4: Set up an Admin account for OpenLiteSpeed WebAdmin GUI
The good thing about OpenLiteSpeed that I say:
It provides you with a management tool in the form of a GUI called WebAdmin. All server administration operations such as adding a website will use an interface that no longer has to manipulate the command line or edit the configuration file manually.
This tool is accessed with the address: http://your_ip_address:7080. If you are using a firewall, remember to add a rule to allow access through this port.
Default account admin/12356.
You can safely edit this account by running the following command:
|
1
|
/usr/local/lsws/admin/misc/admpass.sh
|
Enter the user and password you want:

Ignore SSL Security warning when accessing WebAdmin. After logging in you will see the interface as below

Step 5: Install MariaDB
About installing MariaDB, you can refer to the installation instructions in this article . Since the database is independent of the webserver, it makes no difference when you use OpenLiteSpeed.
Step 6: Configure OpenLiteSpeed in WebAdmin GUI
By default OpenLiteSpeed will use PHP 5.6. Now we configure OpenLiteSpeed to use PHP 7.1.
Go to WebAdmin: http://your_ip_address:7080/
Go to Server Configuration -> External App -> Add :

You select LiteSpeed SAPI APP in the Type field. Click the Next button

Add config like below:
- Name:
lsphp71 - Address:
uds://tmp/lshttpd/lsphp.sock - Max Connections:
35 - Environment:
PHP_LSAPI_MAX_REQUESTS=500PHP_LSAPI_CHILDREN=35
- Initial Request Timeout (secs):
60 - Retry Timeout :
0 - Response Buffering:
no - Auto Start:
yes - Command:
$SERVER_ROOT/lsphp71/bin/lsphp - Back Log:
100 - Instances:
1 - Memory Soft Limit (bytes):
2047M - Memory Hard Limit (bytes):
2047M - Process Soft Limit:
400 - Process Hard Limit:
500
Click the Save icon in the right corner to save the configuration.
Next we change the script handle to switch to PHP 7.1
Go to Server Configuration -> Script Handler . Click the Edit button .

In Handler Type you choose lsphp71 . Click the Save icon to save it.

Configure OpenLiteSpeed to use 80 . port
By default OpenLiteSpeed listens on port 8088. We will configure it to listen on port 80.
Go to Listeners and click the View button .

Click the Edit button . Port part you switch from 8088 to 80. Click the Save icon to save.

Click the blue Graceful Restart button in the upper right corner to apply all of the above configurations.

Check if OpenLiteSpeed is working or not
Now just type the following address on the server: http://your_ip_address
If you see the following screen, OpenLiteSpeed has run successfully:

Scroll down and click on PHP test

You should see OpenLiteSpeed using PHP 7.1

Some configuration file locations you need to know:
Here I note the location of some configuration files
Everything about OpenLiteSpeed is located in /usr/local/lsws . It is represented in WebAdmin by the $SERVER_ROOT variable .
php.ini configuration file:
| /usr/local/lsws/lsphp71/etc/php.ini |
So you have completed the installation of OpenLiteSpeed, PHP 7.1 and Maria DB. We already have enough components to install a WordPress website.

