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.
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.
Here you will be asked for your WebAdmin username and password. To set these credentials, run the following command on your server.
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.
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.