OpenLiteSpeed is an open source HTTP web server developed by LiteSpeed Technologies. OpenLiteSpeed is a high performance and lightweight web server. Some of its features are listed below.
- Event-driven architecture with extremely low resource (CPU and RAM) overhead.
- Handles hundreds of thousands of concurrent connections without load spikes.
- WebAdmin GUI with real-time statistics.
- Rewrite engine uses Apache mod_rewrite syntax.
- Worker processes for scalability. Ability to bind certain processes to particular workers.
- High-performance coding using kqueue (FreeBSD and OS X), epoll (Linux), /dev/poll (Solaris), and poll.
- High-performance page caching.
OpenLiteSpeed does not require any special kind of hardware for installation you'll only need a CentOS server and user with root privileges on it.
Updating the System
Before going through the installation process it is recommended to update the system to upgrade the available packages and to do so run following command.
yum -y update
First of all we have to add litespeed repository to continue further installation process so please add litespeed repository using this rpm command as shown below.
rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm
We have added the litespeed repository so now we will install openlitespeed 1.4. This is the latest stable release including features like Pagespeed, file upload, PHP 7 support, RCS integration and HTTP/2 support.
Now let's install openLiteSpeed 1.4 using following yum command as shown below:
yum -y install openlitespeed14.x86_64
It may take some time so we recommend you to wait untill the installation is finished.
Installing PHP 7
We will have to install Epel repository for PHP 7 so please install epel repository using this yum command.
yum -y install epel-release
We can download and install PHP 7 now for openlitespeed. Openlitespeed uses a different version of PHP so run below given command to install PHP 7 and required dependencies.
yum -y install lsphp70 lsphp70-mysqlnd lsphp70-process lsphp70-mbstring lsphp70-mcrypt lsphp70-gd lsphp70-opcache lsphp70-bcmath lsphp70-pdo lsphp70-common lsphp70-xml
You can always check list of all PHP extensions using this command.
yum search lsphp70
Configuration of OLSWS & PHP
We will configure OpenLiteSpeed web server(OLSWS) and PHP. Let's configure admin username and password for the management GUI, to do so run this command.
Please enter an admin username and password for your GUI management you should see like this on your screen.
[root@ip-172-31-10-82 ~]# /usr/local/lsws/admin/misc/admpass.sh
Please specify the user name of administrator. This is the user name required to login the administration Web interface.
User name [admin]: sajid
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! [root@ip-172-31-10-82 ~]#
Next open your favorite web browser and visit your server IP with port 7080 (http://yourserverIP:7080)
You'll see a web page like this now please enter admin username and password and finally click on Sign in button and then you'll see dashboard of OpenLiteSpeed as shown below.
Configure PHP 7
By default OpenLiteSpeed 1.4 uses PHP 5 version so we will have to change it to PHP 7 and as we know that we have already installed PHP 7 on our server so now we just need to add a new configuration.
Click on Server Configuration and then click on External App which is shown at the center of web page. You'll see lsphp5 with a socket address so we will have to add new version of PHP and to do so please click on Add button on the right side.
For the type use LiteSpeed SAPI App and then click on next on the right side.
Now add the configuration below.
Name: lsphp70 Address: uds://tmp/lshttpd/lsphp.sock Max Connections: 35 Environment: PHP_LSAPI_MAX_REQUESTS=500 PHP_LSAPI_CHILDREN=35 Initial Request Timeout (secs): 60 Retry Timeout : 0 Response Buffering: no Auto Start: yes Command: $SERVER_ROOT/lsphp70/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 on save icon to save the configuration.
Now click on the tab Script Handler and edit the lsphp5. Change below given configuration as shown.
Suffixes: php Handler Type: LiteSpeed SAPI Handler Name: lsphp70
Click on the save icon to save the configuration.
Configure Port 80
The default http port for OpenLiteSpeed is 8080 we will change it port 80.
On the left side of the web page click on Listeners then you'll see default port 8080 so click on view icon and then click on edit icon change the port 80 and save the configuration.
Now restart OpenLiteSpeed server by clicking on Graceful Restart button and click yes to confirm.
To start OpenLiteSpeed using command line terminal you can use this command.
In order to stop OpenLiteSpeed you can run this command as shown below.
You can even restart your OpenLiteSpeed web server from command line terminal by using this command as shown below.
You can find more information about OpenLiteSpeed web server on this OpenLiteSpeed Website.
In this tutorial we learned how to install OpenLiteSpeed web server on centos 7. OpenLiteSpeed is easy to configure trough its admin GUI so we can configure it from a browser. We hope now you have enough knowledge to work with OpenLiteSpeed.