This page was last modified: July 27 2006 16:21:03   
Too Cool for Internet Explorer

SQL Ledger

This article assumes that PostgreSQL is installed and running on your server.

Install SQL Ledger and configure Apache

cd /usr/ports/finance/sql-ledger/
make install clean distclean

Next we need to tell Apache about our new friend. For this purpose SQL Ledger comes with a httpd configuration file:

/usr/local/etc/sql-ledger-httpd.conf

You can copy the contents of this file directly into to Apache's configuration file, or you can put a copy of it into this directory:

/usr/local/etc/apache2/Includes/

A third way is to add this line to Apache's configuration file

# SQL-Ledger
Include /usr/local/etc/sql-ledger-httpd.conf

Whatever you do, remember to restart Apache after this.

Create a user in PostgreSQL

You now need to create a user and language for SQL Ledger to use when accessing the PostgreSQL databasesystem. As you can see in the below example, I use md5 encrypted passwords when creating new users. I have also setup PostgreSQL to always prompt for a password, even for localhost connections - that is why you see the password prompt at the end.

You will not see the passwords on the screen when doing this. I just added them here for clarity. You should replace the md5 passwords with your own, and replace adminpass with the password you use for your pgsql user.

su - pgsql
createuser -d -P -E sql-ledger
Enter password for new role: md55a231fcdb710d73268c4f44283487ba2
Enter it again: md55a231fcdb710d73268c4f44283487ba2
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) y
Password: adminpass
CREATE ROLE
createlang plpgsql template1

If you do not use password authentication in your PostgreSQL setup, you can just use this command:

su - pgsql
createuser -d sql-ledger
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) y
CREATE ROLE
createlang plpgsql template1

Set admin password and create a dataset

Now set the administrator password for SQL Ledger

  1. Browse into www.domain.tld/sql-ledger/admin.pl (replace www.domain.tld with your domain name)
  2. Leave the password field empty and just click 'Login'
  3. Select 'Change Admin Password' and then select/save a password of your choice
  4. Select 'Pg Database Administration':
    Host:
    User: sql-ledger
    Connect to: template1
    Port:
    Password: your-admin-password-here
    Note: You can leave host and port empty when running on localhost

Replace your-admin-password-here with the password you chose in section 3 above.

If you should forget your administrator password, you can reset it by deleting the encrypted password from the members file located in /usr/local/sql-ledger/users/

Click 'Create dataset'. You will now see a new form.:

Create Dataset: e.g. company name (lowercase letters only!!)
Multibyte Encoding: ISO 8859-15 (Latin alphabet no. 9)
Create Chart of Accounts: Danish_Default (choose your own language here)
Click 'Continue'

I must admit that the world of encoding is still a foreign place to me. I just picked one that seemed to work.

Stay where you are for the next step...

Create a user for using SQL Ledger

You now have access to the administration interface of SQL Ledger. But you also need at least one user for the accounting part. In the administration interface click 'Add user'. Give this user access to everything and use it like a template when creating new users in the future. You could call this user admin or superuser.

In the first section you choose login and password which will be used when login in to the interface. You also choose how dates, currency, language and so on, will be presented for this user.

In the next section, you provide the user which will be used to access the database when this user is logged in.:

Driver: Pg
Dataset: your-dataset-name
User: sql-ledger
Host:
Port:
Password: your-sql-ledger-password

When finished, the new user is listed at the top of the page.

You can now leave the admin interface and get your first glance at your new accounting system. Browse into http://www.domain.tld/sql-ledger/login.pl and try out your new user.

It's great that someone has given us the upportunity to use an accounting system for free. That is why you will not find any accounting tutorial for sql-ledger on this site. The manual is the only thing you have to pay for. I suggest you support the developer by buying it.

SQL Ledger official homepage