VLSM Setup Docs

Installing InteLIS on Ubuntu 22.04 or above (only Ubuntu LTS)

Please note this will work on Ubuntu 22.04 or above (ONLY LTS)

Start the terminal and run these commands ONE BY ONE

cd ~;

sudo wget -O setup.sh https://github.com/deforay/intelis/raw/master/scripts/setup.sh

sudo chmod +x setup.sh;

sudo ./setup.sh;

sudo rm setup.sh;

exit

Enter the mysql password and STS URL correctly when prompted

InteLIS Setup

Updating InteLIS on Ubuntu 22.04 or above (only Ubuntu LTS)

Please note this will work on Ubuntu 22.04 or above (ONLY LTS)

Start the terminal and run these commands ONE BY ONE

sudo wget -O /usr/local/bin/intelis-update https://github.com/deforay/intelis/raw/master/scripts/upgrade.sh;

sudo chmod +x /usr/local/bin/intelis-update;

sudo intelis-update

Enter the mysql password and STS URL correctly when prompted

Installing VLSM on a Windows Machine

0. Download

1. Installing WAMP Server

2. Configuring PHP and MySQL

2.1 PHP Setup

2.2 MYSQL Setup

3. Setting up VLSM

3.1 VLSM Application Setup

cd C:\wamp64\www\vlsm

set PATH=C:\wamp64\bin\php\php8.2.13;%PATH%

php composer.phar install --no-dev
php composer.phar dump-autoload -o

// VLSTS URL
$systemConfig['remoteURL'] = 'https://STSURL';


// Enable/Disable Modules
// true => Enabled
// false => Disabled
$systemConfig['modules']['vl'] = false;
$systemConfig['modules']['eid'] = true;
$systemConfig['modules']['covid19'] = false;
$systemConfig['modules']['hepatitis'] = false;
$systemConfig['modules']['tb'] = false;

// Database Settings
$systemConfig['database']['host']       = 'localhost';
$systemConfig['database']['username']   = 'root';
$systemConfig['database']['password']   = 'PASSWORD';
$systemConfig['database']['db']         = 'vlsm';
$systemConfig['database']['port']       = 3306;
$systemConfig['database']['charset']    = 'utf8mb4';

.
.
.
.
.


// Enable/Disable Interfacing
// true => Enabled
// false => Disabled
$systemConfig['interfacing']['enabled'] = true;

// Interfacing Database Details (not needed if above feature set to false)
$systemConfig['interfacing']['database']['host'] = 'localhost';
$systemConfig['interfacing']['database']['username'] = 'root';
$systemConfig['interfacing']['database']['password'] = 'PASSWORD';
$systemConfig['interfacing']['database']['db'] = 'interfacing';
$systemConfig['interfacing']['database']['port'] = 3306;
$systemConfig['interfacing']['database']['charset'] = 'utf8mb4';

3.2 Task Scheduler

4. Setting up Interfacing

Updating VLSM on a Windows Machine

0. Backup

1. Download VLSM

2. Completing the Update

cd C:\wamp64\www\vlsm

set PATH=C:\wamp64\bin\php\php8.2.13;%PATH%

php composer.phar install --no-dev
php composer.phar dump-autoload -o

php composer.phar post-update

Migrating From one Ubuntu machine to another

BACKUP DATABASE ON OLD SYSTEM FIRST

Go to terminal

cd ~;

sudo -s;

wget -O db-backup.sh https://raw.githubusercontent.com/deforay/intelis/master/scripts/db-backup.sh

sudo chmod u+x db-backup.sh;

sudo ./db-backup.sh;

RESTORE DATABASE AND INSTALL VLSM ON NEW SYSTEM

Ensure new system is Ubuntu 22.04 or above (ONLY LTS)

Copy the backed up file from flash disk or CD to the Desktop folder of the new computer

then in the terminal run the following commands one by one.

cd ~/Desktop;

sudo -s;

rm -f *.sql

gzip -d vlsm-*.sql.gz && mv vlsm-*.sql vlsm.sql

wget -O setup.sh https://raw.githubusercontent.com/deforay/intelis/master/scripts/setup.sh

chmod +x setup.sh;

./setup.sh  --db  vlsm.sql

rm setup.sh;

exit; exit;


Enter the mysql password and STS URL correctly when prompted.

VLSM Setup

Fix Illegal/Mismatched Collation Issue

  1. Log in to phpMyAdmin

    • Open your web browser and navigate to your phpMyAdmin URL.
    • Enter your username and password to log in.
  2. Select the VLSM database

    • On the left-hand side of the phpMyAdmin interface, locate and click on the vlsm database.
  3. Go to the "Operations" tab

    • Click on the "Operations" tab at the top of the page.
  4. Locate the "Collation" section

    • Scroll down to the "Collation" section on the "Operations" page.
  5. Select the desired collation

    • In the "Collation" dropdown menu, choose the utf8mb4_general_ci collation.
  6. Check the options to change collation

    • Check the checkbox next to "Change all tables collations" to apply the selected collation to all tables in the database.
    • Check the checkbox next to "Change all tables columns collations" to apply the selected collation to all columns within all tables in the database.
  7. Apply the changes

    • Click the "Go" button to execute the collation change for all tables and columns in the database.
  8. Wait for the process to complete

    • phpMyAdmin will now apply the selected collation to all tables and columns in the database.
    • Wait for the process to finish. The time taken may vary depending on the size of the database.

ScreenShot 2024-04-15 at 18.43.44@2x.png

Backing up to Google Drive with Rclone on Ubuntu

1. Install Rclone

2. Configure Rclone

3. Create a backup script

4. Make the script executable

5. Run the backup script

6. Automate backups

(crontab -l 2>/dev/null | grep -q "@reboot /var/www/backup.sh" || echo "@reboot /var/www/backup.sh") | crontab -
(crontab -l 2>/dev/null | grep -q "0 */6 * * * /var/www/backup.sh" || echo "0 */6 * * * /var/www/backup.sh") | crontab -

That's it! You have now set up Rclone on your Ubuntu machine and created a script to backup the /var/www/vlsm folder to Google Drive. The backup will run automatically based on the schedule you specified in the cron job.

Setting up Interfacing Tool on a client Ubuntu Machine

On the Client Ubuntu Machine :

sudo apt-get update && sudo apt-get upgrade -y;

sudo apt-get install mysql-client;

On the Server Ubuntu Machine :

sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf

In this file change the bind-address and mysqlx-bind-address to 0.0.0.0

bind-address		= 0.0.0.0
mysqlx-bind-address	 = 0.0.0.0

and allow 3306 port via firefall and restart mysql

sudo ufw allow 3306/tcp
sudo service mysql restart

Open phpMyAdmin on the server machine and run these SQL Queries

USE mysql;

CREATE USER 'interfaceadmin'@'%' IDENTIFIED BY 'interface@12345';

ALTER USER 'interfaceadmin'@'%' IDENTIFIED WITH mysql_native_password BY 'interface@12345';

GRANT ALL PRIVILEGES ON interfacing.* TO 'interfaceadmin'@'%';

FLUSH PRIVILEGES;

Now you can use this new user in the interface tool

Permission Denied Issue

Open the terminal and run the following command

sudo setfacl -R -m u:$USER:rwx,u:www-data:rwx /var/www;

Backing up LIS or STS to a remote Backup server

Follow these steps to set up automatic backups to a remote Ubuntu machine:

Step 1: Download the Script

Open a terminal on your Ubuntu machine and run the following command to download the backup setup script:

cd ~
wget -O remote-backup.sh https://raw.githubusercontent.com/deforay/vlsm/master/scripts/remote-backup.sh

Step 2: Make the Script Executable

To allow the script to run, change its permissions using the following command:

sudo chmod u+x remote-backup.sh

Step 3: Run the Script

Execute the script with superuser privileges to begin the setup process:

sudo ./remote-backup.sh

What the Script Does:
  1. Prompts for the Instance Name:

    • Enter a unique name for your lab or instance (e.g., lab1, centerA).
    • The script will sanitize the name to ensure compatibility.
  2. Installs Required Tools:

    • Ensures rsync is installed on your machine.
  3. Generates SSH Key:

    • Creates an SSH key for secure communication with the backup server (if not already present).
  4. Prompts for Backup Server Details:

    • Enter the username and IP address or hostname of the backup server.
  5. Verifies Connectivity:

    • Tests the connection to the backup server.
    • If the connection fails, it will prompt you to re-enter the credentials until the connection succeeds.
  6. Copies SSH Key:

    • Automatically transfers the SSH key to the backup server to enable passwordless communication.
  7. Creates Backup Script:

    • Sets up a script to back up /var/www/vlsm to the backup server.
  8. Schedules Backups:

    • Configures automatic backups to run every 6 hours and on reboot using cron jobs.