Guides

7 Steps to Easily Configure OpenLiteSpeed as a Reverse Proxy for Metabase

OpenLiteSpeed Web Server is great for building and deploying web applications. The WebAdmin Console enables you to quickly configure features that allow you to deliver a fast web application that your users will love.

Metabase is a business intelligence web application that can be deployed on an OpenLiteSpeed Web Server. It is a java-based web app that can connect to almost any database and has a built-in question builder tool that allows you to get intelligent insights on your data.

Configure OpenLiteSpeed as a Reverse Proxy for Metabase

In this guide, you will learn how to install and configure OpenLiteSpeed as a reverse proxy for Metabase. That means the web server will sit in front of Metabase and intercept requests made by clients. Upon completion of this guide you will have a business intelligence web based application powered by OpenLiteSpeed web server.

Below are 7 steps covered in this tutorial:

  1. Installing OpenLiteSpeed with MariaDB
  2. Installing Java
  3. Creating a MariaDB database
  4. Downloading Metabase
  5. Creating a systemd configuration file for Metabase
  6. Configuring a Let’s Encrypt SSL Certificate
  7. Completing the post-installation setup

Requirements

Here is what you will need to complete this setup:

  1. An SSH client such as Putty or the macOS terminal app.
  2. A server running a Debian-based operating system such as Ubuntu VPS
  3. A fully qualified domain name pointing to the public IP address of your server.

Step 1: Install OpenLiteSpeed with MariaDB

The first step is to install OpenLiteSpeed. We will use the 1-click installation script, which is a single command that will install OpenLiteSpeed, set up the virtualhost, add the reverse proxy configuration and install MariaDB.

On a newly deployed Debian-based server, run the command below to install OpenLiteSpeed with a reverse proxy configuration:

bash <( curl -k https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh) --proxy-c --pure-mariadb

This command will automatically create a reverse proxy configuration using the example virtualhost, and install MariaDB.

Log in to the OpenLiteSpeed WebAdmin Console. Click Server Configuration > External App. 

Click Edit on the Web Server external app, update Address * to http://127.0.0.1:3000, and click Save.

Restart OpenLiteSpeed for the changes to take effect.

Step 2: Install Java

The second step is to install the Java development kit (JDK), and the Java runtime environment (JRE). Run the command below to install:

sudo apt-get install openjdk-11-jdk openjdk-11-jre -y

Step 3: Create a MariaDB database

The third step is to create a MariaDB database for Metabase.

Run the commands below to connect to the MariaDB shell and create a new database:

mysql -u root -p
CREATE DATABASE metabasesysdb;
GRANT ALL PRIVILEGES ON metabasesysdb.* TO 'metabase_db_usr'@'localhost' IDENTIFIED BY "SecurePassword";
FLUSH PRIVILEGES;
EXIT;

Step 4: Download Metabase

You have successfully installed OpenLiteSpeed and added reverse proxy configuration. Follow the next few steps to start using Metabase with OpenLiteSpeed.

Create a folder for Metabase in the /opt directory, and download the latest version of Metabase from the official download page:

sudo mkdir /opt/metabase
cd /opt/metabase
wget https://downloads.metabase.com/v0.45.2/metabase.jar

Change the owner of the /opt/metabase directory and all files in this directory to nobody and nogroup by running this command:

Related Post
chown -R nobody:nogroup /opt/metabase

Set the permissions of the /opt/metabase directory and all files in the directory:

chmod -R 755 /opt/metabase

Step 5: Create a systemd configuration file.

To ensure Metabase is always running on your server, and to simplify stopping and starting the business intelligence web app, you can create a systemd configuration file. Run the commands below to create a service file in the /etc/systemd/system directory:

sudo apt install nano
sudo nano /etc/systemd/system/metabase.service

Edit the metabase.service file, and copy and paste the following configuration below into it:

[Unit]
Description=Metabase Business Intelligence Web App Powered By OpenLiteSpeed Web Server
[Service]
WorkingDirectory=/opt/metabase/
ExecStart=/usr/bin/java -jar /opt/metabase/metabase.jar
User=nobody
Type=simple
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target

Save the file and exit out of it.

Reload the system daemon, start the Metabase service, and set it to start automatically at system boot:

systemctl daemon-reload
systemctl start metabase
systemctl enable metabase

You also need to ensure the newly created metabase service is marked as active and running. Run the command

systemctl status metabase

If Metabase is active and running, the command will return the following output:

metabase.service - Metabase Business Intelligence Web App Powered By OpenLiteSpeed Web Server
      Loaded: loaded (/etc/systemd/system/metabase.service;
      Active: active (running)

Step 6: Configure a Let’s Encrypt SSL Certificate.

The next step is to configure a Let’s Encrypt SSL Certificate. This ensures that you always access Metabase using a secure HTTPS connection. Follow the steps below:

Install the certbot utility:

sudo apt-get install certbot -y

Generate the SSL certificate by following the instructions in the OpenLiteSpeed KB.

Step 7: Complete the post installation setup

Open a new browser window and enter the domain name for the Metabase server in the browser address bar.

You will see the Metabase welcome page. Click Let’s get started.

Choose your preferred language and click Next

Enter your personal details and ensure you set a secure password. Click Next, select I’ll add my data later and click Next.

Click Finish, and click Take me to Metabase. This will open the dashboard where you can perform business intelligence tasks using the built-in features.

You can also configure the database that you created on Step 3. Click Add your own data to open the Add Database wizard.

Select the type of database you would like to add on the Database type drop down, configure your database details, and click Save.

Conclusion

You now know how to configure OpenLiteSpeed as a reverse proxy for Metabase.

Related

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX and Phoenix, AZ.

Recent Posts

How to Protect Your VPS Against SQL Injection

Cybercriminals often target websites to gain access to valuable user data such as login credentials. This data could then be… Read More

5 mins ago

What is the Difference Between Managed and Unmanaged Dedicated Servers?

When comparing hosting services, it is helpful to be able to answer the question, "What is the difference between managed… Read More

5 mins ago

Install and Configure Remmina for RDP Access on Linux VPS

This article provides an in-depth guide to install and configure Remmina for RDP access on Linux VPS. Introduction to Remmina… Read More

1 hour ago

7 Quick Steps to Install CyberPanel on Cloud VPS

This article provides a guide for how to install CyberPanel on cloud VPS server from Rad Web Hosting. What is… Read More

1 hour ago

4 Steps to Easily Access RDP Remote Desktop with Windows VPS

Read this guide, "4 Steps to Easily Access RDP Remote Desktop with Windows VPS" to connect your Windows VPS to… Read More

1 hour ago

What Are the Advantages of Purchasing a VPS with Bitcoin?

Purchasing a Virtual Private Server (VPS) with Bitcoin or other cryptocurrencies comes with several advantages, reflecting both the nature of… Read More

1 hour ago