Packaging SQL-Ledger

Packaging SQL-Ledger

The information contained in this document describes where to install the various components for SQL-Ledger. Various variables are specified in a configuration file sql-ledger.conf. If the configuration file itself should be in some other location and must be changed to point to the new location. All the other scripts in the root directory are symlinks, either soft- or hard-linked, to When running under a SuExec environment the symlinks must be changed to hardlinks.

SQL-Ledger requires perl 5+, DBI, DBD-Pg, DBD-DB2 or DBD-Oracle, PostgreSQL 7.1+, DB2 8.1 or Oracle 8+. You will also need a web server such as Apache, thttpd, boa, AOLServer, ... LaTeX is optional but required for creating forms in postscript and PDF formats.

PLEASE DO NOT make a dependency for anything but DBI. If someone runs Oracle and you specify a dependency for PostgreSQL the sysadmin will be very unhappy!!! Or worse yet, if the SQL server is upgraded because you specified version such and such. Please use common sense!

Installation paths are for the purpose of showing a configuration. Follow the filesystem standard for your O/S. SQL-Ledger does not depend on an absolute location and everything is relative to the SQL-Ledger root directory.

General steps.

  • Install the software somewhere
         i.e /usr/local/sql-ledger
  • edit httpd.conf and add
    # SQL-Ledger
     Include /etc/apache2/sql-ledger-httpd.conf

  • add the file sql-ledger-httpd.conf in /etc/apache2

    Contents of sql-ledger-httpd.conf for Apache

     Alias /sql-ledger /usr/local/sql-ledger/
     <Directory /usr/local/sql-ledger>
       AllowOverride All
       AddHandler cgi-script .pl
       Options ExecCGI Includes FollowSymlinks
       Order Allow,Deny
       Allow from All
     <Directory /usr/local/sql-ledger/users>
       Order Deny,Allow
       Deny from All
    Newer Apache installations use a conf.d directory so the change for httpd.conf is not required. If there is a conf.d directory simple copy sql-ledger-httpd.conf into this directory.

    The Alias is only used to shorten the URL and is not required if you install SL in the web server's document root directory.

    The AddHandler is not needed if there is already one in httpd.conf.

  • make the users, templates, css and spool directory writeable for the web server user
         chown apache:apache users css templates spool
    the users directory as specified by the variable $userspath is for creating user specific configuration files and temporary files for postscript documents.

  • edit sql-ledger.conf.default

  • specify the location for user configuration files and the temporary file space
         i.e. $userspath = "users";                    # relative
              $userspath = "/var/tmp";                 # absolute

  • specify the path for the master templates and where private templates are to be created.
         i.e. $templates = "templates";                # relative
              $templates = "/usr/share/sql-ledger";    # absolute

  • specify the path for the spool directory
         i.e. $spool = "spool";                        # relative
              $spool = "/var/tmp/sql-ledger/spool";    # absolute
    The spool directory holds files for later printing.

  • specify the name for the mailer agent.
         $sendmail = "| /usr/lib/sendmail -t";
    if mail bounces add 'apache' as a trusted user
  • specify the name and location for the members file.
         i.e. $membersfile = "users/members";
              $membersfile = "/usr/local/etc/sql-ledger/members";
    the file must be set writeable for the web server user or group

  • to enable postscript and PDF support set latex to 1
         $latex = 1;
    Comment out or set to 0 if latex is not installed.

  • if latex, dvips and pdflatex are not in the web server's search path, add the path to the PATH environment variable.
         $ENV{PATH} .= ":/usr/local/share/texmf/bin";
  • set SQL server variables

    For Oracle set:

         $sid = "<system_id>";
         $ENV{ORACLE_HOME} = "/usr/local/oracle";

    PostgreSQL does not need any variables.

  • Database specific requirements:

    create a tablespace

    create a database user with "create database" privileges.
    set authentication in pg_hba.conf to trust, password or md5 (DO NOT set to crypt)

    please see the README.DB2 file

Notes: sql-ledger.conf is for the local configuration. If the file is missing hardcoded defaults will be used instead. To use all the options copy sql-ledger.conf.default to sql-ledger.conf. DO NOT symlink the file. The 'members' file will be created when you load for the first time. The .default files are not required to run SQL-Ledger.

Questions? Please contact us