How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Introduction

OpenLiteSpeed is an open source web server characterized by high-performance, light-weight event-driven architecture, and Apache compatible rewrite rules. After installation on a VPS or Dedicated Server, it requires further configuration on its WebAdmin in preparation for installation of CMS websites and web applications.

In addition, it requires the installation of required packages i.e. the latest php version (i.e. 7.2 at the time of publication of this tutorial) for processing of web server requests and MySQL 8.0 for CMS or website database.

In this tutorial, we illustrate how to configure OpenLiteSpeed for CMS or Application installation by installing PHP 7.2 and MySQL 8.0 and configuring them with the OpenLiteSpeed web server on Ubuntu 18.04.

Pre-requisites:

Installing and Configuring PHP 7.2 with LiteSpeed

Overview

Litespeed completely supports PHP without any further configuration. However, Litespeed by-default comes with php5.6binary (/usr/local/lsws/lsphp) which can only be used for development environments and NOT RECOMMENDED for production environments. This is because of its minimal build.

PHP Support in Litespeed comprises two parts as follows:

1. PHP External Application: Litespeed does not have PHP inbuilt into it but rather hands over execution tasks to external PHP applications/executables. This enables for greater stability, security and managing simultaneous connections. The two PHP external applications used are:

  • LSAPI (LiteSpeed SAPI – Server Application Programming Interface)
  • FCGI SAPI (FastCGI SAPI – Server Application Programming Interface)

LSAPI acts as an interface between LiteSpeed and PHP. It’s HIGHLY RECOMMENDED as it’s specially built for Litespeed while it’s designed for high performance, faster and has more features than FCGI SAPI. LSAPI also binds for Python and Ruby.

2. Script Handler: Enables Litespeed to determine how the files will be directed to specific applications by mapping suffixes.

Note: Both the external application and script handler must be configured in the WebAdmin Console as is illustrated in the section that follows – Installing PHP 7.2 for Litespeed.

Installing PHP 7.2 for Litespeed

Add the repository for Litespeed PHP 7.2 by running the commands

$ sudo bash
# wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh | bash

Then install PHP 7.2 for Litespeed by running the command.

$ sudo apt install lsphp72 lsphp72-common lsphp72-mysql lsphp72-dev lsphp72-curl lsphp72-dbg lsphp72-tidy lsphp72-recode lsphp72-opcache -y

Finally create symbolic link for php7.2

$ sudo ln -sf /usr/local/lsws/lsphp72/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp7

Configuring PHP 7.2 with LiteSpeed Web Server

At this stage, we change the PHP version being used by LiteSpeed from 5.6 to 7.2.

Log into LiteSpeed Web Server.

Go to Server Configuration > External App > Click Add button as shown in the figure below.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Then select the LiteSpeed SAPI App for the Type, then Click Next button as shown below.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Enter the following configurations as follows:

Name: lsphp72
Address: uds://tmp/lshttpd/lsphp.sock
Notes: lsphp72forOpenLiteSpeed
Max Connections: 35
InitialRequestTimeout(secs):60
RetryTimeout(secs):0
Command: $SERVER_ROOT/lsphp72/bin/lsphp

Then click the Save button in the right corner as shown below:

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Since there are now two PHP versions in the web server, we should configure the Litespeed to only use PHP7.2 as follows.

Go to Script Handler > Click Edit button as shown below.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

The select lsphp72 in the HandlerName and Click Save button as shown.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Click Graceful Restart button to apply the changes made as shown below.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Now Litespeed Web Server is using PHP7.2

Configure Port 80 on Litespeed Web Server

By-default the Litespeed web server is receiving HTTP requests on Port 8088. But of course, you wouldn’t want your website visitors to be including port 8088 on the browser whenever they visit your site. Hence you need to change this to port 80.

Go to Listeners > Click View button for the Default Listener as shown.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Click the Edit button to edit the port as shown below.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Change the Port value from 8088 to 80 and Click Save button.

How to Prepare/Configure OpenLiteSpeed for CMS or Application Installation

Click Graceful Restart button to apply the new changes.

Installing MySQL 8.0

MySQL is needed to provide the database infrastructure for your CMS or Web Application.

To install MySQL 8.0 in your Ubuntu 18.04 Server, follow our tutorial –How to Install MYSQL 8.0 and Create a Database on an Ubuntu 18.04 Linux VPS

Conclusion

Now that you’ve set up your setup and configured your Litespeed server environment, you can now install any CMS (e.g. WordPress, Drupal, Joomla), Web Application (e.g. Yii, Laravel), Ruby or Python Frameworks in the LiteSpeed Web Server.

The next steps are to learn the following:

How to Create VirtualHosts on LiteSpeed Web Server

How to Install and Configure WordPress on LiteSpeed Web Server

Check out these top 3 Linux hosting services

FastComet
$1.79 /mo
Starting price
Visit FastComet
Rating based on expert review
  • User Friendly
    4.7
  • Support
    5.0
  • Features
    4.8
  • Reliability
    4.5
  • Pricing
    5.0
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
  • Check the recommendations for the best VPS and get a suitable one.

How To Install Apache, MySQL & PHP on an Ubuntu 18.04 VPS or Dedicated Server

This article shows users how to setup PHP, Apache web server and MySQL database
4 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to Install PhpMyAdmin on a Ubuntu 18.04 VPS or Dedicated Server

This article will describe the process of installing phpMyAdmin on an Ubuntu 18.
3 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Backup Your MySQL Database on an Ubuntu 18.04 VPS or Dedicated Server

This article shows you how to back up a MySQL database on a Linux Ubuntu 18.04 s
3 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Disable MySQL 5 “Strict Mode” on an Ubuntu 18.04 VPS or Dedicated Server

How to Disable MySQL Strict Mode on MySQL 5.6 Running on an Ubuntu 18.04 VPS.
2 min read
Idan Cohen
Idan Cohen
Marketing Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top