How to Install OpenLiteSpeed on Ubuntu 20.04

sureshramani

Suresh Ramani

Posted on March 21, 2022

How to Install OpenLiteSpeed on Ubuntu 20.04

What is LiteSpeed Web Server?

Litespeed Web Server is one of the best and most well-known web server software in the world. Some sources also mention that this webserver is ranked 4 as the most famous and popular web server today. LSWS is a product made by LiteSpeed ​​Technologies which was released in 2003.

The software has the same working system as Apache because the purpose of its release is to replace the software. This is what makes LSWS increasingly popular because websites before LSWS do not have to be reformatted to get the same appearance after using LSWS.

LSWS has a control panel that is easier to use than Apache. This software also acts as a replacement for Apache program functions and provides an event-driven approach in order to be able to run certain commands.

By using the event-driven approach, the format calibration system will not be as complicated as when using Apache which is famous for its many special formats. Not to mention that the format is also easy to learn and control even for beginners.

Features of LiteSpeed Web Server

  • Event-Driven Architecture
  • Apache Drop-In Replacement
  • HTTP/2 & QUIC Support
  • Zero Downtime Maintenance
  • CloudLinux Integration
  • Fastest PHP Available
  • Use with cPanel, Plesk, DirectAdmin, CyberPanel, etc
  • Unlimited Concurrent Connections
  • Mod_Security Compatible

Advantages of LiteSpeed Web Server

  • The hardware required is not too big
  • Easy to learn
  • Provide excellent customer service and community
  • Transactions are easier than Apache format
  • More guaranteed safety quality

This blog will learn how to install OpenLiteSpeed Server on Ubuntu 20.04 along with PHP 8.0 and MariaDB.

Prerequisites

  • The operating system running Ubuntu 20.04 Linux
  • A root or non-root user with Sudo privileges
  • Has stable internet connection
  • Terminal window / Command line

1. Install OpenLiteSpeed

First, download the OpenLiteSpeed repository script.

wget http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh
Enter fullscreen mode Exit fullscreen mode

Run the script.

sudo bash enable_lst_debian_repo.sh
Enter fullscreen mode Exit fullscreen mode

The script will automatically download repository files and update your server.
Then, Install OpenLiteSpeed. Run the following command:

sudo apt-get install openlitespeed -y
Enter fullscreen mode Exit fullscreen mode

The -y flag in the command will automatically allow the server to install OpenLiteSpeed. If you don’t add the -y flag, it will simply ask you for confirmation.

Once you install OpenLiteSpeed, then start the OpenLiteSpeed service and enable it to start at system reboot. Run the following command:

sudo systemctl enable lshttpd
sudo systemctl start lshttpd
Enter fullscreen mode Exit fullscreen mode

Next, verify the status of OpenLiteSpeed, Run the following command:

sudo systemctl status lshttpd
Enter fullscreen mode Exit fullscreen mode

You can also verify the OpenLiteSpeed version. Run the following command:

sudo /usr/local/lsws/bin/openlitespeed -v
Enter fullscreen mode Exit fullscreen mode
LiteSpeed/1.7.15 Open (BUILD built: Tue Feb 22 16:27:52 UTC 2022) 
    module versions:
    lsquic 3.0.4
    modgzip 1.1
    cache 1.64
    mod_security 1.4
Enter fullscreen mode Exit fullscreen mode

2. Install MariaDB Server

You can install the MariaDB server and client package, Run the following command:

sudo apt-get install mariadb-server mariadb-client -y
Enter fullscreen mode Exit fullscreen mode

The -y flag in the command will automatically allow the server to install MariaDB. If you don’t add the -y flag, it will simply ask you for confirmation.

Once you install MariaDB, then start the MariaDB service and enable it to start at system reboot. Run the following command:

sudo systemctl start mariadb
sudo systemctl enable mariadb
Enter fullscreen mode Exit fullscreen mode

You can verify the installed version of MariaDB. Run the following command:

mariadb --version
Enter fullscreen mode Exit fullscreen mode

3. Install PHP 8.0 And Enable PHP 8.0 Support

By default, the latest version of PHP is not available in OpenLiteSpeed. When writing this blog, the newest version of PHP is 8.0. You can install the PHP 8.0 by running the following command:

sudo apt-get install lsphp80 lsphp80-mysql lsphp80-common lsphp80-opcache lsphp80-curl -y
Enter fullscreen mode Exit fullscreen mode

The -y flag in the command will automatically allow the server to install PHP 8.0. If you don’t add the -y flag, it will simply ask you for confirmation.
Once installed, you will need to create a symbolic link of the installed package:

sudo ln -sf /usr/local/lsws/lsphp80/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5
Enter fullscreen mode Exit fullscreen mode

Next, restart OpenLiteSpeed, Run the following command:

sudo systemctl restart lshttpd
Enter fullscreen mode Exit fullscreen mode

4. OpenLiteSpeed Port Change

By default, OpenLiteSpeed listens on port 8088. You can check it using the following command:

ss -antpl | grep 8088
Enter fullscreen mode Exit fullscreen mode

It is recommended that you change the default port to 80. To do so, edit the OpenLiteSpeed default configuration file:

sudo nano /usr/local/lsws/conf/httpd_config.conf
Enter fullscreen mode Exit fullscreen mode

Find the following line:

address                  *:8088
Enter fullscreen mode Exit fullscreen mode

And, replaced it with the following line:

address                  *:80
Enter fullscreen mode Exit fullscreen mode

After updating your httpd_config.conf file, press CTRL+X, Y, and Enter key to save the httpd_config.conf file.

Next, restart OpenLiteSpeed, Run the following command:

sudo systemctl restart lshttpd
Enter fullscreen mode Exit fullscreen mode

Now, open your web browser and type the URL http://your-server-ip-address. You should see the OpenLiteSpeed default page:
How to Install OpenLiteSpeed on Ubuntu 20.04 - TechvBlogs

5. Create Admin User In OpenLiteSpeed

To access the Administrative dashboard, you need to set a username and password. To accomplish this, run the following command:

sudo /usr/local/lsws/admin/misc/admpass.sh
Enter fullscreen mode Exit fullscreen mode

How to Install OpenLiteSpeed on Ubuntu 20.04 - TechvBlogs
Be sure to specify the username and password for the Admin user. Once done, visit the URL shown.

https://your-server-ip-address:7080
Enter fullscreen mode Exit fullscreen mode

How to Install OpenLiteSpeed on Ubuntu 20.04 - TechvBlogs
Provide your admin username, password, and click on the Login button. You should see the OpenLiteSpeed default dashboard on the following screen:
How to Install OpenLiteSpeed on Ubuntu 20.04 - TechvBlogs
Thank you for reading this blog.

💖 💪 🙅 🚩
sureshramani
Suresh Ramani

Posted on March 21, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related