How To Setup an OpenLiteSpeed LOMP Server on Ubuntu

by

Hey there! Some links on this page may be affiliate links which means that, if you choose to make a purchase, I may earn a small commission at no extra cost to you. I greatly appreciate your support!

For those who aren’t familiar, a LOMP server is simply an acronym describing the web software stack: Linux, OpenLiteSpeed, MySQL (or MariaDB), and PHP.

In this tutorial, you’ll learn how to install a LOMP server on Ubuntu or Debian. I used the following software versions, but most versions will be okay to use:

  • Ubuntu 18.04 LTS
  • OpenLiteSpeed 1.6.16
  • MariaDB 15.1
  • PHP 7.3

Note: I’ll be using a bare IP address for the server in this tutorial. If you want to have a domain name instead, set the DNS A record to the IP address of your server.

1. Update Your System

First things first. Login to your server via ssh and update your system.

sudo apt update && sudo apt upgrade

2. Install the Web Server and PHP

Use apt to install the OpenLiteSpeed web server and PHP.

wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh | bash
apt-get install openlitespeed
apt-get install lsphp73-curl lsphp73-imagick lsphp73-memcached lsphp73-redis

OpenLiteSpeed comes packaged with lsphp (usually located at /usr/local/lsws/fcgi-bin/lsphp), so this step will take care of installing both the web server and PHP.

3. Install and Secure Your Database

Install MariaDB, a popular fork of MySQL.

apt-get install mariadb-server

Next, we want to secure our database installation. After executing the following command, answer Y for each security configuration option.

mysql_secure_installation

4. Access the WebAdmin Console

OpenLiteSpeed has a WebAdmin console that’s accessible via a web browser. This makes configuring your web server easy in comparison to manually editing configuration files directly.

By default, the OpenLiteSpeed WebAdmin console runs on port 7080. You can visit the IP address of your server followed by :7080 to access the WebAdmin console.

OpenLiteSpeed WebConsole login screenPin

Here you will be asked for your WebAdmin username and password. To set these credentials, run the following command on your server.

/usr/local/lsws/admin/misc/admpass.sh

5. Set the Example Listener to Use Port 80

By default, OpenLiteSpeed will install an example Virtual Host with a Listener on port 8088. You can check this out by going to your server’s IP address followed by :8088.

If you would like to change this port, you can do so by going to Listeners > View > Edit > and changing 8088 to 80. Finally click the green button in the upper right corder to restart the server.

OpenLiteSpeed graceful restart on the Listener settings page of the WebAdmin ConsolePin

Now you can access the example Virtual Host website over port 80 by typing the IP address of your server into the address bar of your web browser.

If you have any questions, let me know in the comments below.


Meet Tony

With a strong software engineering background, Tony is determined to demystify the web. Discover why Tony quit his job to pursue this mission. You can join the Tony Teaches Tech community here.

1 thought on “How To Setup an OpenLiteSpeed LOMP Server on Ubuntu”

  1. Hi Tony, Your videos are amazing!

    I have one question though, I have configured WordPress on an OpenLitespeed server on an AWS ec2 instance and now I am facing a problem with the Read and Write permission. My WordPress is not able to modify anything on the WordPress directory eg: .htaccess, backup files, etc.

    While setting up Wordpress I used the following command:
    `sudo chown -R nobody:nogroup /usr/local/lsws/Example/html/wordpress`

    When I am executing this `groups lsadm` command it gives me the following output:
    lsadm : lsadm nogroup

    Could you please help me understand what needs to be done here in order to provide proper access to OpenLitespeed and ensure security in mind as well and also let me know about the exact file & directory permission for the WordPress folder when you get a chance to look into my query.

    Reply

Leave a Comment