Web API Bridge VM

These notes describe the process to setup an Ubuntu VM as a Web API Bridge.

Overview

This guide assumes that you have just created a Ubuntu 24.04 LTS virtual machine and are able to SSH into it.

This guide will describe the following steps in detail:

  1. Change to the 'root' account
  2. Update Ubuntu
  3. Change default timezone
  4. Install dependencies
  5. Download Web API Bridge

Change to the 'root' account

First, run the following command to run sub-shell as 'root'. The shell prompt should change from a dollar sign - '$' - to a hash '#':

$ sudo bash
#

Update Ubuntu

Run the following two commands. Keep an an eye on the output as they may complain they cannot connect to places and you may need to re-run them.

# apt update
# apt dist-upgrade

Change default timezone

# dpkg-reconfigure tzdata

Install Dependencies

# apt-get install apache2
# apt-get install php libapache2-mod-php php-cli php-mysql php-mbstring bzip2

Download Web API Bridge

Download the latest stable version of the Web API Bridge.

# wget https://webapibridge.org/resources/downloads/WebAPIBridge-3.2.1.tar.bz2

Change into the '/srv' directory, create and change into the 'WEBAPIBRIDGE' directory, then unzip the downloaded file.

# cd /srv
# mkdir -p WEBAPIBRIDGE
# cd WEBAPIBRIDGE
# tar xvf ~ubuntu/WebAPIBridge-3.2.1.tar.bz2

Then, change into the 'WebAPIBridge' directory and create a symbolic link from 'latest' to the current version.

# cd WebAPIBridge
# ln -sf 3.2.1 latest

Configure Apache

Enable Apache modules

# a2enmod expires headers rewrite ssl
# systemctl restart apache2

Next edit the '/etc/apache2/apache2.conf' file. Find and uncomment the section that defines the '/srv/' directory.

# nano /etc/apache2/apache2.conf

For example, change this:

#{Directory /srv/}
#        Options Indexes FollowSymLinks
#        AllowOverride None
#        Require all granted
#{/Directory}

to

{Directory /srv/}
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
{/Directory}

Configure Web API Bridge

Finally add a Web API Bridge config file.

You can either run the following command, or you can find the template file and copy to '/etc/apache2/sites-enabled' and edit appropriately.

The following command just takes the name of your web domain and creates a configuration file for the appropriate API domain. For example, specify 'example.com' and it will create a configuration file for 'api.example.com'.

# /srv/WEBAPIBRIDGE/WebAPIBridge/latest/webapibridge/libexec/generate_apache_configuration/generate.sh {Your web domain name}