Debian LedgerSMB

Configuring LedgerSMB on Debian or Ubuntu

By default LedgerSMB can be accessed at http://127.0.0.1/ledgersmb, although initial set up is required.

To prepare LedgerSMB for use:

  1. As the postgres user, create a database user for LedgerSMB authentication:

  2. $ createuser --no-superuser --createdb --no-createrole -U postgres --pwprompt --encrypted ledgersmb

    Here it will prompt twice for the ledgersmb postgres user password, remember what you enter here for step 5.

  3. Create postgres database for ledgersmb:

  4. $ createdb -U ledgersmb -O ledgersmb -E UNICODE ledgersmb
    $ createlang plpgsql -U postgres ledgersmb


  5. Add databases for all datasets which you want to have available
  6. For instance, we want a dataset for each of examplecom, exampleorg and examplenet, so:

    $ createdb -T ledgersmb examplecom
    $ createdb -T ledgersmb exampleorg
    $ createdb -T ledgersmb examplenet


  7. Populate the user database and set an admin password (this admin password will be used to log into the administrative interface).

  8. $ psql -U ledgersmb -d ledgersmb -f /usr/share/ledgersmb/sql/Pg-central.sql
    $ psql -U ledgersmb -d ledgersmb

    ledgersmb=> UPDATE users_conf SET password = md5('admin-password) WHERE id = 1;


  9. Edit /etc/ledgersmb/ledgersmb.conf
  10. Scroll down to the very bottom and check your database settings, they will need to be changed. Insert the ledgersmb postgres user password you used in step 1.

  11. Edit /etc/postgresql/8.x/main/pg_hba.conf so that ledgersmb user may connect. Depending on your security infrastructure you can use the METHOD md5 or trust.
  12. Reload postgres so your changes take effect.

  13. Configure apache2
  14. Check /etc/ledgersmb/ledgersmb-httpd.conf and see if it is what you want - it will usually be fine just the way it is.

    The default configuration will make this accessible to everyone who can get to your ip address on port 80. If you want to lock it down to localhost, do so now in the forementioned configuration file!

    $ cd /etc/apache2/conf.d/
    $ ln -s ../../ledgersmb/ledgersmb-httpd.conf


  15. Reload apache2

  16. $ /etc/init.d/apache2 reload

  17. Connect to http://127.0.0.1/ledgersmb/admin.pl and login with the password set in step 4.