OpenLiteSpeed installation on Linux

OpenLiteSpeed is the open source version of LiteSpeed Web Server Enterprise. It is a web server like Apache or NGINX, and can be installed on all Linux systems. OpenLiteSpeed is developed to be highly scalable, can accelerate WordPress performance, and work on minimal hardware specs.

In this tutorial, you will see the step by step instructions to get OpenLiteSpeed web server installed on all major Linux distros. Specifically we will cover instructions for Debian Linux based systems such as Ubuntu, and Red Hat Enterprise Linux based systems like AlmaLinux, CentOS, Rocky Linux, Fedora, etc.

In this tutorial you will learn:

  • How to install OpenLiteSpeed speed on Debian and Ubuntu based distros
  • How to install OpenLiteSpeed speed on RHEL and CentOS based distros
  • Basic configuration and testing of OpenLiteSpeed web server
OpenLiteSpeed installation on Linux
OpenLiteSpeed installation on Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Debian Linux or Red Hat Enterprise Linux based Linux distro
Software OpenLiteSpeed web server
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to install OpenLiteSpeed web server step by step instructions




The instructions will vary depending on whether you want to install OpenLiteSpeed on a Debian based or RHEL based distro. Follow the appropriate commands below that apply to your system.

OpenLiteSpeed installation on Debian

  1. On Debian, start by opening a terminal and using the following command to add the OpenLiteSpeed repository to your system.
    $ wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | sudo bash
    

    This wget command will download a shell script from the official OpenLiteSpeed website, which can add the repository to your system. Piping the command to sudo bash allows us to run the script after downloading it, all with a single command.

  2. Next, update the package cache and install the OpenLiteSpeed web server.
    $ sudo apt update
    $ sudo apt install openlitespeed
    
  3. Next, use the following commands to start the OpenLiteSpeed web server, and configure it to start automatically upon subsequent system boots.
    $ sudo systemctl start lsws
    $ sudo systemctl enable lsws
    
  4. If you are using the ufw firewall (Debian based systems), you will need to allow access on the following ports so that others can access your website:
    $ sudo ufw allow 7080,80,443,8088/tcp
    Rules updated
    Rules updated (v6)
    
    WARNING
    Port 7080 is the admin panel for the web server. You may not want this open to the public.
  5. Your initial website should now be up and running. You can open Firefox or another web browser and navigate to the following page:
    http://localhost:8088
    




    Alternatively, you can use your hostname, IP address, or fully qualified domain name in place of localhost.

    You will be presented with the default welcome page for OpenLiteSpeed
    You will be presented with the default welcome page for OpenLiteSpeed
  6. Set a username and password for the administration page by running the following script with root permissions:
    $ sudo /usr/local/lsws/admin/misc/admpass.sh
    
    Setting a username and password with the admpass script
    Setting a username and password with the admpass script
  7. Next, you can check out the OpenLiteSpeed admin panel at the following address:
    http://localhost:7080
    

    You may get an error about an invalid SSL certification. It is safe to proceed. Log in with your credentials that you configured in the previous step.

    OpenLiteSpeed admin login page
    OpenLiteSpeed admin login page
    Dashboard view of the OpenLiteSpeed administration panel
    Dashboard view of the OpenLiteSpeed administration panel
  8. PHP should have been automatically installed as a dependency for OpenLiteSpeed. Check your PHP configuration and verify that it works by navigating to:
    http://localhost:8088/phpinfo.php
    
    PHP info page
    PHP info page
  9. If you will need a database (for example, for a WordPress or other content management system installation), you can install MariaDB with the following command on Debian systems:
    $ sudo apt install mariadb-server mariadb-client
    
  10. Then, to configure your MySQL / MariaDB settings, execute this command:
    $ sudo mysql_secure_installation
    

    Leave the first response blank and press enter. You should reply with y (yes) to the rest of the prompts, and configure a root password when prompted to do so. This setup only takes a moment to complete.

    The initial setup of MySQL with mysql_secure_installation
    The initial setup of MySQL with mysql_secure_installation
  11. Your website files can be found at the following directory by default:
    $ cd /usr/local/lsws/Example/html
    

    Of course, this setting and many others can be easily changed inside of the OpenLiteSpeed administration panel.



OpenLiteSpeed installation on CentOS

  1. On CentOS, use the following commands to install the epel-release repository and the LiteSpeed repo.
    $ sudo dnf install epel-release
    $ sudo rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm
    
  2. Next, install the OpenLiteSpeed web server.
    $ sudo dnf install openlitespeed
    
  3. Next, use the following commands to start the OpenLiteSpeed web server, and configure it to start automatically upon subsequent system boots.
    $ sudo systemctl start lsws
    $ sudo systemctl enable lsws
    
  4. If you are using firewalld (RHEL based systems), you can allow access to the ports with:
    $ sudo firewall-cmd --zone=public --permanent --add-port={80/tcp,443/tcp,7080/tcp,8088/tcp}
    $ sudo firewall-cmd --reload
    
    WARNING
    Port 7080 is the admin panel for the web server. You may not want this open to the public.



  5. Your initial website should now be up and running. You can open Firefox or another web browser and navigate to the following page:
    http://localhost:8088
    

    Alternatively, you can use your hostname, IP address, or fully qualified domain name in place of localhost.

    You will be presented with the default welcome page for OpenLiteSpeed
    You will be presented with the default welcome page for OpenLiteSpeed
  6. Set a username and password for the administration page by running the following script with root permissions:
    $ sudo /usr/local/lsws/admin/misc/admpass.sh
    
    Setting a username and password with the admpass script
    Setting a username and password with the admpass script
  7. Next, you can check out the OpenLiteSpeed admin panel at the following address:
    http://localhost:7080
    

    You may get an error about an invalid SSL certification. It is safe to proceed. Log in with your credentials that you configured in the previous step.

    OpenLiteSpeed admin login page
    OpenLiteSpeed admin login page
    Dashboard view of the OpenLiteSpeed administration panel
    Dashboard view of the OpenLiteSpeed administration panel
  8. PHP should have been automatically installed as a dependency for OpenLiteSpeed. Check your PHP configuration and verify that it works by navigating to:
    http://localhost:8088/phpinfo.php
    
    PHP info page
    PHP info page
  9. If you will need a database (for example, for a WordPress or other content management system installation), you can install MariaDB with the following command on RHEL based systems:
    $ sudo dnf install mariadb-server mariadb-client
    
  10. Then, to configure your MySQL / MariaDB settings, execute this command:
    $ sudo mysql_secure_installation
    




    Leave the first response blank and press enter. You should reply with y (yes) to the rest of the prompts, and configure a root password when prompted to do so. This setup only takes a moment to complete.

    The initial setup of MySQL with mysql_secure_installation
    The initial setup of MySQL with mysql_secure_installation
  11. Your website files can be found at the following directory by default:
    $ cd /usr/local/lsws/Example/html
    

    Of course, this setting and many others can be easily changed inside of the OpenLiteSpeed administration panel.

Closing Thoughts

In this tutorial, we saw how to install OpenLiteSpeed on a Linux system. OpenLiteSpeed is a fast and minimalist web server that boasts speedier results than Apache. It also has a GUI backend to make configuration much easier. It is rather easy to get up and running on Debian based and CentOS based systems, so it is worth seeing how it performs for your web hosting needs.



Comments and Discussions
Linux Forum