SQL-Ledger Install Scripts

SQL Ledger Install Script

Installing SQL-Ledger is simple. I have two simple scripts available as well that install and configure SQL-Ledger with Apache and Postgress. The scripts also get and configure a SSL certificate for the SQL-Ledger installation. They are available here.

Debian/Ubuntu Script
CentOs/RedHat/Rocky Script

Below are also step by step instructions for installing manually.

1. Install Dependencies

SQL-Ledger requires Perl, a web server (like Apache), and PostgreSQL as its database.

On Debian/Ubuntu:

sudo apt-get update sudo apt-get install apache2 postgresql libdbd-pg-perl sudo apt-get install perl libdbi-perl libapache2-mod-perl2

On CentOS/RedHat:

sudo dnf install httpd postgresql-server perl-DBD-Pg sudo dnf install perl perl-DBI mod_perl

2. Initialize PostgreSQL Database

Set up and start the PostgreSQL database.

On Debian/Ubuntu:

sudo pg_createcluster 13 main --start

On CentOS/RedHat:

sudo /usr/bin/postgresql-setup --initdb sudo systemctl start postgresql sudo systemctl enable postgresql

3. Configure PostgreSQL

Edit the pg_hba.conf file to configure authentication.

  • The file is typically located at /etc/postgresql/13/main/pg_hba.conf on Debian/Ubuntu and /var/lib/pgsql/data/pg_hba.conf on CentOS/RedHat.
  • Change peer or ident to md5 for local and IPv4/IPv6 connections.

4. Restart PostgreSQL

sudo systemctl restart postgresql

5. Download SQL-Ledger

Download the latest version of SQL-Ledger from the official website or a repository.

wget [SQL-Ledger-Download-Link] tar -zxvf [Downloaded-File]

Replace [SQL-Ledger-Download-Link] and [Downloaded-File] with the actual download link and file name.

6. Install SQL-Ledger

Move the SQL-Ledger files to your web server directory (like /var/www/html/ for Apache)

sudo mv sql-ledger /var/www/html/

7. Set Permissions

Set the appropriate permissions for the SQL-Ledger directory.

sudo chown -R www-data:www-data /var/www/html/sql-ledger

8. Configure Apache

Create an Apache configuration file for SQL-Ledger. Enable CGI module if not already enabled.

sudo a2enmod cgi

Create a new site configuration or update an existing one to serve SQL-Ledger.

9. Restart Apache

sudo systemctl restart apache2
Copyright © Hashim Saqib. All rights reserved.