-<p><li><h4>SuSE 8.1 installation</h4>
-<ol>
-<li>Install the following using YaST2:
-
-<p>- perl-DBD-Pg
-<br>- postgresql
-<br>- postgresql-contrib
-<br>- postgresql-devl
-<br>- postgresql-docs
-<br>- postgresql-libs
-<br>- postgresql-perl
-<br>- postgresql-server
-<br>- postgresql-test
-
-<p><li>Setup directories and paths for PostgreSQL:
-
-<p>> sux - (change to root)
-
-<p>- If not done by the installation, setup disk directory for your db:
-<br># mkdir /var/lib/pgsql/data
-<br># chown postgres /var/lib/pgsql/data
-
-<p><li>Initialize the database, and start it, as below:
-<p>Note that there are man pages for initdb and pg_ctl.
-
-<p># touch /var/log/pgsql
-<br># chown postgres:postgres /var/log/pgsql
-<br># sux postgres
-
-<p>- Initialize postgres:
-<br>> /usr/bin/initdb -D /var/lib/pgsql/data
-<br>(creating ... Success...)
-
-<p>- Start the postgres daemon:
-<br>> /usr/bin/pg_ctl -D /var/lib/pgsql/data -l /var/log/pgsql start (start db)
-<br>(postmaster successfully started)
-
-<p><li>Quick-test the server (still as user postgres):
-
-<p>- > psql -d template1
-<br>(Welcome ... \q to exit psql)
-<br>\q
-
-<p>- Try setting up another db user:
-
-<p>> createuser <db-user> (<db-user> should match an existing Linux user)
-<br>Shall the new user be allowed to create databases? (y/n) y
-<br>Shall the new user be allowed to create more new users? (y/n) n
-
-<p>Unless a problem with DBD::Pg (perl interface), postgres is ready to go.
-
-<p><li>If a previous sql-ledger database needs to be installed,
-<br>do the following as postgres user. Steps for dumping the old db,
- and building the new follow:
-
-<p>> sux postgres
-<br>> psql template1
-<br>=# CREATE DATABASE my_database; (create your database)
-<br>=# \q
-<br>> cd /var/lib/pgsql/backups (assuming your backups are here)
-<br>The next command should have been performed earlier from the
- previous installed version of postgres and your database:
-<br>> pg_dump -d my_database.sql.bak (from previous ver postgres)
-<br>> cp my_database.sql.bak my_database.sql
-<br>- Use vi to change all occurrances of 'current_date' to current_date
- in file my_database.sql .
-<br>The vi command for this is :g/'current_date'/s//current_date/g
-<br>> psql my_database < my_database.sql > my_database.log
-<br>- Check my_database.log for errors.
-
-<p><li>Download setup.pl and run it as root while on line to the internet:
-
-<p># mkdir /usr/local/sql-ledger
-<br># cd /usr/local/sql-ledger
-<br># ./setup.pl
-<br>- Enter i
-<br>- Enter httpd owner and group if different than displayed default.
-<br>(Download occurs and status is displayed...)
-
-<p><li>Setup the new sql-ledger with database.
-
-<p>- Surf to http://my_computer/sql-ledger/admin.pl
-<br>- Click enter (no password needed).
-<br>->Database Administration
-<br>- Leave fields Host and Port enpty for local installations.
-<br> - Enter your database name in the "Connect to" field.
-<br> - Enter the database user you setup (postgres, sql-ledger, etc.)
-<br> - Enter a password, only if a password is assigned to the database.
-<br> - To update an existing sql-ledger database: ->Update Database
-<br> Should see: The following Datasets need to be updated.
-<br> ->Continue
-<br> Do more admin. You will need to setup at least one login.
-<br> To exit: ->Database Admin
-
-<p><li>See if it works:
-
-<p> - Surf to http://my_computer/sql-ledger/login.pl
-<br> - Enter the login name you just created. Main menu screen should appear.
-</ol>
-
-
-
-<p><li><h4>Redhat Installation</h4>
-
-<ul>
-<li>Install apache1.3.12-25.i386.rpm
-<li>Install perl5.6.0-9.i386.rpm
-<li>Install postgresql-7.0.2-17.i386.rpm
-<li>Install postgresql-server-7.0.2-17.i386.rpm
-<li>Install postgresql-devel-7.0.2-17.i386.rpm (POSTGRES_INCLUDE)
-<li>tar xvzf DBI-1.14.tar.gz
-<li>cd DBI-1.14
-<li>perl Makefile.PL
-<li>make
-<li>make install
-<li>cd ..
-<li>tar xvzf DBD-Pg-0.95
-<li>cd DBD-Pg-0.95
-<li>export POSTGRES_LIB=/usr/lib/pgsql
-<li>export POSTGRES_INCLUDE=/usr/include/pgsql
-<li>perl Makefile.PL
-<li>make
-<li>make install
-<li>install SQL-Ledger
-</ul>
-
-<p>Some of the applications have newer versions however the installation
-instructions remain the same. Just substitute the old version with a newer
-version.
-
-
-<p><li><h4>Debian Installation</h4>
-
-<ul>
-<li>unpack into /usr/local/www/sql-ledger
-<li>install postgresql (Dselect)
-<li>install apache (Dselect)
-<li>install libdbi-perl (Dselect)
-<li>install libdbd-pg-perl (Dselect)
-<li>install libpgperl (Dselect)
-<li>modify /etc/postgresql/postgresql.conf
- <br>TCPIP_SOCKET = 1
-<li>create a user for managing SQL-Ledger databases
-<br>from root
-<br>su postgres
-<br>$ createuser -d sql-ledger
-<br>if you use passwords to access postgres set the user up with a password
-<br>$ createuser -d -P sql-ledger
-<li>change /etc/apache/httpd.conf and add
-<pre>
-AddHandler cgi-script .pl
-Alias /sql-ledger/ /usr/local/www/sql-ledger/
-<Directory /usr/local/www/sql-ledger>
- Options +ExecCGI
-</Directory>
-
-<Directory /usr/local/www/sql-ledger/users>
- Order Deny,Allow
- Deny from All
-</Directory>
-</pre>
-<li>restart apache
-<li>change fileownership of users and templates to www-data
- <br>chown www-data: users templates
-<li>From browser enter http://localhost/sql-ledger/admin.pl
-<li>Login as the postgres user (account manager) you have created (above)
-<br>Create a DB
-<br>Create users
-
-<li>then enter http://localhost/sql-ledger/login.pl
-<br>Login as one of the users you have just created
-
-</ul>
-
-<p>
-The long version was provided by Gordon Haverland.
-<p>
-<ul>
-<li>You need to unpack the SQL-Ledger package (compressed tar archive)
- someplace. Unpacking it in<pre>
- /usr/local/www/sql-ledger.</pre>
- Remember where you have unpacked it.
-<li>SQL-Ledger requires that the PostgreSQL database be installed.
-This is a very full-featured database, and has many associated
-packages. SQL-Ledger requires version 7.0 or better. The name
-of the basic package on Debian is postgresql. To find if you
-already have postgresql installed, and if so what version, the
-following command should work:<pre>
- dpkg -l | grep -i 'ii postgresql '</pre>
- A typical response would be:<pre>
- ii postgresql 7.1.3-5 Object....[stuff deleted]</pre>
- Indicating, that version 7.1.3 is installed (the -5 is a
- Debian patch level). You can use dselect or apt-get to install
- postgresql if you need to. You can visit the Debian maintainer's
- page for much more information on related packages at<pre>
- http://people.debian.org/~elphick/postgresql/</pre>
- Older versions of Debian's PostgreSQL installation use a file
- called postmaster.init, while newer versions use a file called
- postmaster.conf, either residing in /etc/postgresql.
-<li>SQL-Ledger requires a HTTP server (or daemon) which is capable of
- handling CGI scripts. Apache is the one which is recommended,
- version 1.3 or better. Debian calls the base package apache.
- Debian has two alternative versions of Apache, one with mod-perl
- (apache-perl) support compiled in, and the other with SSL
- (secure sockets layer - apache-ssl) support. SQL-Ledger doesn't
- require mod-perl or SSL support, but works with either if
- you need it installed for other functions you have. Older versions
- of Debian Apache installations, spread the configuration of the
- server across 3 files (srm.conf, access.conf and httpd.conf).
- Newer versions have consolidated all of this to httpd.conf.
-<li>SQL-Ledger uses the Data Base Interface perl module for communication
- with PostgreSQL. The CPAN (Comprehensive Perl Archive Network)
- name for this module is DBI. Debian calls this module
- libdbi-perl. You should probably deselect (or apt-get) the
- Debian version of this module to minimize upgrading headaches in
- the future.
-<li>DBI requires the use of an implementation specific Data Base
- Driver. In our case, we need the PostgreSQL specific one.
- CPAN calls this module DBD::PG, Debian calls it libdbd-pg-perl.
- You should use dselect (or apt-get) to install it.
-<li>One more layer of Perl - PostgreSQL support is needed. Debian
- calls this last package libpgperl. Use dselect or apt-get to
- install it. (You should be able to install all 5 packages at
- one time.)
-<li>We need to allow your PostgreSQL database to accept queries
- in a network manner. To do this, we need to change the value
- of the TCPIP_SOCKET to 1. In newer
- PostgreSQL installs, this variable will be someplace in
- /etc/postgresql/postgreslq.conf (older installs will be
- postmaster.init, same directory. Note: you shouldn't have
- both files there.) Start up your favorite text editor, find
- the line with that variable on it, change the "no" to a "yes",
- and make sure the line isn't commented out (a "#" in front
- of it on the same line).
-<li>PostgreSQL has a set of users and passwords independent of
- normal user logins. We need to set up a PostgreSQL user
- to "own" the SQL-Ledger data (choose a name that makes sense
- to you, it shouldn't be "root" or "postgres"). The (PostgreSQL)
- program for doing this is called "createuser". To make this
- SQL-Ledger owner user, we first need to "become" the PostgreSQL
- superuser (on Debian, this is "postgres"), and then we will
- run the createuser program. So, once we are logged in as root:
-<pre>
- # su postgres
- $ createuser -d sql-ledger
- ...
- $ exit
- #
-</pre>
- As shown above, we then typed "exit" after createuser was done,
- to stop being the "postgres" user. The "-d" switch (you called
- also use "--createdb") specifies that this user can create
- databases.
-<li>We need to adjust the configuration of the HTTP server Apache
- next. Older Apache installations (srm.conf, access.conf and
- httpd.conf) need changes in srm.conf and httpd.conf. Newer
- installations just need to edit /etc/apache/httpd.conf. First,
- we need to instruct the server that files that end in ".pl"
- are to be treated as "cgi-script"s (srm.conf if separate).<pre>
- AddHandler cgi-script .pl</pre>
- Second, we need to map our SQL-Ledger installation to be easy
- for users to find it (in srm.conf if separate).<pre>
- Alias /sql-ledger/ /usr/local/www/sql-ledger/</pre>
- The "/" at the end of sql-ledger in both strings is important!
- Next, we need to allow the server to execute files from those
- directories, include things and follow links. This information
- is in httpd.conf (old or new installations).<pre>
- <Directory /usr/local/www/sql-ledger>
- Options ExecCGI Includes FollowSymLinks
- </Directory></pre>
- If we decided to put SQL-Ledger somewhere other than
- /usr/local/www/sql-ledger, we would use different paths above.
-<li>All the files in the "users" and "templates" subdirectories
- of /usr/local/www/sql-ledger need to be owned by "www-data".<pre>
- # cd /usr/local/www/sql-ledger
- # chown www-data:www-data users templates users/members</pre>
- You may get an "error" about users/members not existing. It
- is safe to ignore this error.
-<li>Restart the apache server.<pre>
- /etc/init.d/apache restart</pre>
-<li>From a browser, visit the URL<pre>
- http://localhost/sql-ledger/admin.pl</pre>
-<li>Login as the PostgreSQL user responsible for the SQL-Ledger
- database you set up. Create a database and create
- at least one user. (It's not a good idea to access your
- SQL-Ledger data as the "owner" of the data on a regular basis.)
-<li>Visit<pre>
- http://localhost/sql-ledger/login.pl</pre>
- and login as the user you created</pre>
-
-</ul>
-
-