...
Configure openlitespeed as a reverse proxy for metabase
Learn how to configure openlitespeed as a reverse proxy for metabase!

This article provides a guide to configure OpenLiteSpeed as a reverse proxy for Metabase.

What is OpenLiteSpeed?

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.

What is Metabase?

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.

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.

Launch 100% ssd ubuntu vps from $2. 49/mo!

Configure OpenLiteSpeed as a Reverse Proxy for Metabase

To configure OpenLiteSpeed as a reverse proxy for Metabase, follow the steps below:

  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.

  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
    
  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:

    Connect to mariadb shell and create 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;
    
  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:

    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
    
  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:

    Check metabase status

    metabase.service - Metabase Business Intelligence Web App Powered By OpenLiteSpeed Web Server
          Loaded: loaded (/etc/systemd/system/metabase.service;
          Active: active (running)
    
  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.

  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.
    Check metabase status

    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.

Launch 100% ssd ubuntu vps from $2. 49/mo!

Conclusion

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

Related

Avatar of editorial staff

Editorial Staff

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