How to install Litespeed Web Server on an Ubuntu 18.04 VPS or Dedicated Server

Introduction

OpenLiteSpeed is a lightweight, high performing open source web server developed, copyrighted and maintained by LiteSpeed Technologies. It has a remarkable web-based GUI for administration.

It runs fewer processes, easily handles thousands of concurrent connections on low resource usage i.e. RAM and CPU, highly scalable – runs so many virtual hosts i.e. hosts many different websites on one web server, has less overhead and highly optimized to run all kinds of scripts e.g. PHP, Java, Ruby, Perl, e.t.c. In regards to WordPress platform, it’s mostly used in the LiteSpeed Cache for WordPress plugin which accelerates WordPress hosting platform.

LiteSpeed is available as the free open source OpenLiteSpeed and the paid LiteSpeed Enterprise. OpenLiteSpeed contains all essential features if the Enterprise.

In this article, we illustrate how to install OpenLiteSpeed Web Server on Ubuntu 18.04 Linux VPS.

Pre-requisites

  • Fresh Install Ubuntu 18.04
  • Basic understanding of Linux commands
  • A non-root user with sudo privileges

Update the system packages

  1. $ sudo apt-get update

Install OpenLiteSpeed dependencies

  1. $ sudo apt-get install -y build-essential
  2. $ sudo apt-get install -y rcs libpcre3-dev libexpat1-dev libssl-dev libgeoip-dev libudns-dev zlib1g-dev libxml2 libxml2-dev libpng-dev openssl

Install OpenLiteSpeed

There are 3 ways of installing OpenLiteSpeed.

  1. Install from source code
  2. Install from LiteSpeed Repo
  3. Install from script

In this demonstration, we shall install from source code to ensure we install the latest version of Litespeed (at the time of the publication it’s 1.4.34).

Visit OpenLiteSpeed Downloads Page and download the Current Stable Edition 1.4.34 as follows:

  1. $ wget https://openlitespeed.org/packages/openlitespeed-1.4.34.tgz

Unpack/Decompress the downloaded file.

  1. $ tar -xzvf openlitespeed-1.4.34.tgz

Change into the installation directory, compile and install the package with sudo privileges or as the root user.

  1. $ cd openlitespeed-1.4.34/
  2. $ sudo ./configure
  3. $ sudo make && sudo make install

OpenLiteSpeed will be automatically installed in /usr/local/lsws directory

Configure OpenLiteSpeed

Configure the administrative password for OpenLiteSpeed web server.

  1. $ sudo /usr/local/lsws/admin/misc/admpass.sh
  2.  
  3. Please specify the user name of administrator.
  4. This is the user name required to login the administration Web interface.
  5.  
  6. User name [admin]: liteadmin
  7.  
  8. Please specify the administrator’s password.
  9. This is the password required to login the administration Web interface.
  10.  
  11. Password:
  12. Retype password:
  13. Administrator’s username/password is updated successfully!

Start OpenLiteSpeed web server

  1. $ sudo /etc/init.d/lsws start

OR

  1. $ sudo /usr/local/lsws/bin/lswsctrl start

Access Web Server

By default, OpenLiteSpeed web server will be available on HTTP Port 8088 while the administrative WebAdmin console will be available on Port 7080. If you have firewall UFW enabled, you need to open the respective ports for access.

Configure Firewall for Port Access

Add the firewall rules

  1. $ sudo ufw allow http
  2. $ sudo ufw allow https
  3. $ sudo ufw allow 8088/tcp
  4. $ sudo ufw allow 7080/tcp

ReloAd ufw to effect the changes

  1. $ sudo ufw reload

To confirm that the ports have been opened on the firewall, check the status of ufw.

  1. $ sudo ufw status

Once the firewall has given access to those two ports, then you can access the web server.

Go to http://your-domain.com:8088 or http://server-ipaddress:8088  

In our case, it’s http://35.192.152.126:8088/ as shown below

For the Webadmin Console

Go to https://your-domain.com:7080 or https://server-ipaddress:7080  

In our case it’s https://35.192.152.126:7080/ as shown below

At first, you’ll get “Your connection is not secure” error since the browser does not recognize the site’s ssl certificate as it was automatically generated and self-signed by the Linux server during the web server installation.

Ignore that error and Click Advanced, then Click Add Exception as shown below:

“Add Security Exception” Tab pops up. Click Confirm Security Exception

Finally, the login page appears as shown below:

Enter the admin logins you had created during the Litespeed configuration. Then you’ll have an admin dashboard as shown below:

Conclusion

With a functional OpenLiteSpeed web server, it’s now ready for set up of all kinds of website CMS platforms from WordPress, Joomla, Drupal and web application frameworks.

In addition, LiteSpeed features Apache compatible rewrite rules which allow you to easily migrate/convert your Apache web server into a Litespeed web server.