import sql-ledger 2.4.4
[freeside.git] / sql-ledger / old / sql-ledger / doc / faq.html
1 <ul>
2 <p><li><h4>Sub-menus and Apache 2.0</h4>
3 Some versions of Apache 2.0 (2.0.44+) don't expand sub-menus and generate
4 a 500 error at various points. This stems from workaround developed for
5 earlier versions of Apache 2.0. It looks like this workaround must now be
6 disabled. If you get an error or the sub-menus don't expand edit
7 SL/Form.pm and comment lines 80-82.
8 <pre>
9   # for Apache 2 we escape strings twice
10 #  if (($ENV{SERVER_SOFTWARE} =~ /Apache\/2/) && !$beenthere) {
11 #    $str = $self->escape($str, 1);
12 #  }
13 </pre>
14
15
16 <p><li><h4>About installation</h4>
17 The easiest is to use the setup.pl script as root.
18 You don't need to know very much about your system, just login as root,
19 run 'perl setup.pl' and follow the prompts.
20 <p>setup.pl does not check for missing software packages and it is your
21 responsibility to make sure you have the required pieces
22 installed either from source or from a package supplied with your distro.
23
24 <p>Requirements are clearly indicated in the README file and on the
25 download page.
26
27
28 <p><li><h4>IDENT Authentication failed for user "postgres"</h4>
29
30 This error has everything to do with the way the distros set up
31 access rights for postgres. They are way too restrictive and leave you
32 wondering what to do next.
33
34 <p>Do yourself a favour and change authentication in pg_hba.conf to
35
36 <pre>
37 local           all              trust</pre>
38
39 <p>until you have figured what all this stuff in pg_hba.conf does.
40
41 <p><b>NOBODY</b>, I repeat, <b>NOBODY</b>, from the Internet will be able to
42 connect to postgres. You can't even connect from the inside LAN, the only
43 one who is allowed to connect are clients originating from localhost.
44
45 <p>Read a bit about the different authentication settings and change
46 them as you see fit.
47 It is all described in detail in pg_hba.conf
48
49 <p>If you can't find the file, there is a wonderful utility called find.
50 Use it.
51 <pre>
52 # find /usr/local -type f -name 'pg_hba.conf'
53 </pre>
54
55
56 <p><li><h4>DBD-Pg for Mandrake 9.0</h4>
57 Mandrake did not package a compiled DBD-Pg package again, so install DBD-Pg
58 from the source package.
59 Install perl-DBD-Pg-1.01-4mdk.i586.rpm from the 'contrib' area.
60 (Mandrake / 9.0 / contrib / RPMS)
61
62 <p><li><h4>LaTeX error</h4>
63 If for some reason LaTeX produces an error message check for strange
64 characters in your account description and parts description
65 and use \usepackage[latin1]{inputenc} in the preamble.
66
67
68 <p><li><h4>LaTeX templates</h4>
69 If you don't want to edit tex code by hand,
70 you could use Lyx, Abiword, or any WYSIWYG editor capable of exporting
71 latex code.
72 To do that you must change the tokens for parameters <% and %> to something
73 like << and >>. % is the comment character in tex. There is also a
74 pagebreak block which must be commented out.
75 When you are done with the changes
76 replace << and >> with <% and %> and uncomment the pagebreak block.
77
78 <p>LaTeX is difficult but it also offers a much superior interface to produce
79 professionally looking forms in postscript and PDF format.
80 Unfortunately with power comes some pain too.
81
82
83 <p><li><h4>W3M</h4>
84 pass terminal=mozilla when you start w3m
85 <pre>$ w3m -F http://localhost/sql-ledger/login.pl?terminal=mozilla</pre>
86
87 To use without frames
88 <pre>$ w3m http://localhost/sql-ledger/login.pl?terminal=lynx</pre>
89
90 <p><li><h4>PDF option disappeared</h4>
91 Edit sql-ledger.conf and set $latex = 1;
92 <br>sql-ledger.conf is perl code, check if it compiles, if it does not
93 the internal defaults are used which set $latex to 0, hence no PDF option.
94
95 <p><li><h4>SQL-Ledger on Mac Os X 10.1.5</h4>
96 Jaume Teixi put together
97 <a href=http://www.rocacorbit.com/techdocs/sql_ledger_os_x.html>
98 installation instructions</a> to run SL on a Mac.
99 <br>The instructions are for 1.8.5 however they still apply to any of the
100 newer versions.
101
102 <p><li><h4>Installation on Windows (WIN32)</h4>
103 <ul>
104 <li>install Apache, perl,
105 <a href=http://techdocs.postgresql.org/guides/InstallingOnWindows>Postgres</a>
106 or Oracle, DBI and the appropriate DBD
107 module
108 <br>if you can't compile DBD-Pg here is a precompiled
109 <a href=http://www.edmund-mergl.de/export/>DBD-Pg module</a>
110 <li>download the latest version of <a href=/cgi-bin/nav.pl?page=source/index.html&title=Download>SQL-Ledger</a>
111 <li>extract the files to c:\apache\sql-ledger
112 <li>download
113 <a href=../source/sql-ledger-windows.tar.gz>sql-ledger-windows.tar.gz</a>
114 and extract the files to c:\apache\sql-ledger
115     <br>the shebang line is changed to c:\perl\bin\perl and the symlinks
116     are regular files
117 <br>answer with 'Yes' to overwrite existing files.
118 <li>edit c:\apache\conf\httpd.conf and add
119 <pre>
120 Alias /sql-ledger/ "C:/apache/sql-ledger/"
121 &lt;Directory "c:/apache/sql-ledger"&gt;
122   AllowOverride All
123   AddHandler cgi-script .pl
124   Options +ExecCGI
125   Order Allow,Deny
126   Allow from All
127 &lt;/Directory&gt;
128
129 &lt;Directory "c:/apache/sql-ledger/users"&gt;
130   Order Deny,Allow
131   Deny from All
132 &lt;/Directory&gt;
133 </pre>
134
135 <li>start Apache
136 <li>start Postgres|Oracle
137 <li>connect to http://localhost/sql-ledger/admin.pl and setup users
138 and datasets
139 <li>connect to http://localhost/sql-ledger/login.pl and login
140
141 </ul>
142
143 <p><li><h4>Installation on Windows /w cygwin</h4>
144 <ul>
145 <li>install <a href=http://sources.redhat.com/cygwin/>cygwin</a>
146 Apache, perl, postgres, gcc and lynx
147 <li>install <a href=http://search.cpan.org/search?module=DBI>DBI</a>
148 <li>tar zxvf DBI-1.30.tar.gz
149 <li>cd DBI-1.30
150 <li>perl Makefile.PL
151 <li>make install
152 <li>install <a href=http://search.cpan.org/search?dist=DBD-Pg>DBD-Pg</a>
153 <li>tar -zxvf DBD-Pg-1.13.tar.gz
154 <li>export POSTGRES_INCLUDE=/usr/include/postgresql
155 <li>export POSTGRES_LIB=/usr/lib/postgresql
156 <li>cd DBD-Pg-1.13
157 <li>perl Makefile.PL
158 <li>make install
159 <li>edit /etc/apache/httpd.conf and add
160 <pre>
161 AddHandler cgi-script .pl
162 Alias /sql-ledger/ /var/www/sql-ledger/
163 &lt;Directory /var/www/sql-ledger&gt;
164   Options +ExecCGI
165 &lt;/Directory&gt;
166
167 &lt;Directory /var/www/sql-ledger/users&gt;
168   Order Deny,Allow
169   Deny from All
170 &lt/Directory&gt;
171 </pre>
172 <li>install SQL-Ledger
173 <li>cd /var/www
174 <li>mkdir sql-ledger
175 <li>download <a href=/cgi-bin/download.pl?setup.pl>setup.pl</a> and save the file
176 in /var/www/sql-ledger
177 <li>cd /var/www/sql-ledger
178 <li>perl setup.pl
179 </ul>
180
181 <p><li><h4>What do I enter for the language</h4>
182 If you use English, nothing, if you want to use a foreign language for
183 the login screen and admin stuff enter the language code. All the
184 language specific files are in the locale directory. The long form for
185 the language is in the LANGUAGE file.
186
187 <p><li><h4>Mandrake 9.0 permission denied error</h4>
188 Mandrake says to add this to your commonhttpd.conf
189 <pre>
190 &lt;Directory /usr/local/sql-ledger&gt;
191    AllowOverride All
192    Options -MultiViews -Indexes -FollowSymLinks
193    Order allow,deny
194    Allow from all
195 &lt;/Directory&gt;
196
197 The way apache starts is it:
198 Blocks all access to the physical file system /
199 Opens access to the physical file system /var/www/html
200 Opens access to the physical file system /var/www/perl
201 Opens access to the physical file system /var/www/cgi-bin
202 Opens access to the physical file system /var/www/protected-cgi-bin 
203 Opens access to the physical file system /home/*/public_html
204 Opens access to the physical file system /home/*/public_html/cgi-bin
205 Opens access to the physical file system /var/www/icons
206 Opens access to the physical file system /usr/share/doc
207
208 Since you're trying to access files outside of those allowed paths, you
209 have to specifically allow it.  It's done this way because of some past
210 exploits with the pathnames.  Rather than trust that there will never be
211 another bug within apache that will let you get somewhere you don't
212 want, you set it up securely out of the box so that apache won't let
213 itself go somewhere that you don't want it to.
214 </pre>
215
216
217 <p><li><h4>Incorrect Dataset version</h4>
218 The dataset you are trying to use is not compatible with the version.
219 When you upgrade datasets use the same database user in the "User"
220 field as the one listed in the Database section for the user.
221
222
223 <p><li><h4>Mandrake 8.2</h4>
224 Mandrake did not include the package "perl-DBD-Pg-1.01-1mdk.i586.rpm"
225 You can install the package from Mandrake 8.1
226
227
228 <p><li><h4>printing to a printer</h4>
229 Setup a printer in the "Printer" field in the users preferences.
230 i.e lpr -Plaser
231 and set $latex = 1 in sql-ledger.conf
232 LaTeX must be installed for this to work.
233
234 <p>To send the document to the printer check the "Postscript" or "PDF" format,
235 enter the number of copies and click on the "Print" button.
236
237 <p>The printer field is available only when you edit the user's
238 preferences with admin.pl.
239
240 <p>Note: html format is for screen preview. Use your browser's
241 print function.
242
243
244 <p><li><h4>beginning balances</h4>
245 Add a GL Journal entry and enter the beginning balance for your accounts.
246 Use your balance sheet. If you also want to add open invoices, add the invoices
247 and make the appropriate adjustments. Your balance sheet includes these
248 amounts!
249
250
251 <p><li><h4>cost for parts and service</h4>
252 the cost will be updated when you purchase goods and services. You can
253 enter the cost manually. This is so you can have a cost on file without
254 making a purchase.
255
256
257 <p><li><h4>establish a beginning inventory</h4>
258 add the parts with a purchase invoice. Use the <b>real cost</b> for the items
259 not zero. If you use zero cost then the cost of goods will be zero when you
260 sell the item.
261
262
263 <p><li><h4>Assemblies</h4>
264 Assemblies are manufactured goods assembled from parts, services and
265 assemblies.  Because you do not buy assemblies you 'stock assemblies' by
266 adding assembled units to your inventory. The quantity for individual parts 
267 is reduced and the quantity for the assembly increased. To disassemble an
268 assembly you simply return the parts to inventory by entering a negative
269 quantity for the number of assemblies to stock.
270
271
272 <p><li><h4>customizing SQL-Ledger</h4>
273 The <a href=/cgi-bin/nav.pl?page=feature/api.html&title=Application%20Interface>application interface</a>
274 consists of a global and private interface.
275
276
277 <p><li><h4>DBD-Pg not installed</h4>
278
279 Most modern distributions now package DBD-Pg. If it is
280 not packaged follow this recipe to get it working.
281
282 <ul>
283   <li>check if you have the header files for PostgreSQL
284   <br>$ find / -name 'libpq-fe.h'
285   <br>if nothing shows up install the development package for PostgreSQL
286   <li>download and untar DBD-Pg
287   <li>set the environment variables POSTGRES_LIB and POSTGRES_INCLUDE
288   <li>cd to DBD-Pg directory
289   <br>as ordinary user
290   <br>$ perl Makefile.PL
291   <br>$ make
292   <br>$ make test
293   <br>if all went well su to root
294   <br># make install
295   <li>remove DBD-Pg
296 </ul>
297
298
299 <p><li><h4>SuSE 8.1 installation</h4>
300 <ol>
301 <li>Install the following using YaST2:
302
303 <p>- perl-DBD-Pg
304 <br>- postgresql
305 <br>- postgresql-contrib
306 <br>- postgresql-devl
307 <br>- postgresql-docs
308 <br>- postgresql-libs
309 <br>- postgresql-perl
310 <br>- postgresql-server
311 <br>- postgresql-test
312
313 <p><li>Setup directories and paths for PostgreSQL:
314
315 <p>> sux -     (change to root)
316
317 <p>- If not done by the installation, setup disk directory for your db:
318 <br># mkdir /var/lib/pgsql/data
319 <br># chown postgres /var/lib/pgsql/data
320
321 <p><li>Initialize the database, and start it, as below:
322 <p>Note that there are man pages for initdb and pg_ctl.
323           
324 <p># touch /var/log/pgsql
325 <br># chown postgres:postgres /var/log/pgsql
326 <br># sux postgres
327   
328 <p>- Initialize postgres:
329 <br>> /usr/bin/initdb -D /var/lib/pgsql/data
330 <br>(creating ... Success...)
331
332 <p>- Start the postgres daemon:
333 <br>> /usr/bin/pg_ctl -D /var/lib/pgsql/data -l /var/log/pgsql start (start db)
334 <br>(postmaster successfully started)
335
336 <p><li>Quick-test the server (still as user postgres):
337
338 <p>- > psql -d template1
339 <br>(Welcome ... \q to exit psql)
340 <br>\q
341
342 <p>- Try setting up another db user:
343    
344 <p>> createuser &lt;db-user&gt; (&lt;db-user&gt; should match an existing Linux user)
345 <br>Shall the new user be allowed to create databases? (y/n) y
346 <br>Shall the new user be allowed to create more new users? (y/n) n
347
348 <p>Unless a problem with DBD::Pg (perl interface), postgres is ready to go.
349
350 <p><li>If a previous sql-ledger database needs to be installed,
351 <br>do the following as postgres user.  Steps for dumping the old db,
352    and building the new follow:
353
354 <p>> sux postgres
355 <br>> psql template1
356 <br>=# CREATE DATABASE my_database;  (create your database)
357 <br>=# \q
358 <br>> cd /var/lib/pgsql/backups        (assuming your backups are here)
359 <br>The next command should have been performed earlier from the
360   previous installed version of postgres and your database:
361 <br>> pg_dump -d my_database.sql.bak   (from previous ver postgres)
362 <br>> cp my_database.sql.bak my_database.sql
363 <br>- Use vi to change all occurrances of 'current_date' to current_date
364     in file my_database.sql .
365 <br>The vi command for this is :g/'current_date'/s//current_date/g
366 <br>> psql my_database < my_database.sql > my_database.log
367 <br>- Check my_database.log for errors.
368
369 <p><li>Download setup.pl and run it as root while on line to the internet:
370
371 <p># mkdir /usr/local/sql-ledger
372 <br># cd /usr/local/sql-ledger
373 <br># ./setup.pl
374 <br>- Enter i
375 <br>- Enter httpd owner and group if different than displayed default.
376 <br>(Download occurs and status is displayed...)
377
378 <p><li>Setup the new sql-ledger with database.
379
380 <p>- Surf to http://my_computer/sql-ledger/admin.pl
381 <br>- Click enter (no password needed).
382 <br>->Database Administration
383 <br>- Leave fields Host and Port enpty for local installations.
384 <br>          - Enter your database name in the "Connect to" field.
385 <br>      - Enter the database user you setup (postgres, sql-ledger, etc.)
386 <br>      - Enter a password, only if a password is assigned to the database.
387 <br>      - To update an existing sql-ledger database: ->Update Database
388 <br>         Should see: The following Datasets need to be updated.
389 <br>         ->Continue
390 <br>         Do more admin.  You will need to setup at least one login.
391 <br>         To exit: ->Database Admin
392
393 <p><li>See if it works:
394
395 <p>   - Surf to http://my_computer/sql-ledger/login.pl
396 <br>   - Enter the login name you just created.  Main menu screen should appear.
397 </ol>
398                                     
399
400
401 <p><li><h4>Redhat Installation</h4>
402
403 <ul>
404 <li>Install apache1.3.12-25.i386.rpm
405 <li>Install perl5.6.0-9.i386.rpm
406 <li>Install postgresql-7.0.2-17.i386.rpm
407 <li>Install postgresql-server-7.0.2-17.i386.rpm
408 <li>Install postgresql-devel-7.0.2-17.i386.rpm (POSTGRES_INCLUDE)
409 <li>tar xvzf DBI-1.14.tar.gz
410 <li>cd DBI-1.14
411 <li>perl Makefile.PL
412 <li>make
413 <li>make install
414 <li>cd ..
415 <li>tar xvzf DBD-Pg-0.95
416 <li>cd DBD-Pg-0.95
417 <li>export POSTGRES_LIB=/usr/lib/pgsql
418 <li>export POSTGRES_INCLUDE=/usr/include/pgsql
419 <li>perl Makefile.PL
420 <li>make
421 <li>make install
422 <li>install SQL-Ledger
423 </ul>
424
425 <p>Some of the applications have newer versions however the installation
426 instructions remain the same. Just substitute the old version with a newer
427 version.
428
429
430 <p><li><h4>Debian Installation</h4>
431
432 <ul>
433 <li>unpack into /usr/local/www/sql-ledger
434 <li>install postgresql (Dselect)
435 <li>install apache (Dselect)
436 <li>install libdbi-perl (Dselect)
437 <li>install libdbd-pg-perl (Dselect)
438 <li>install libpgperl (Dselect)
439 <li>modify /etc/postgresql/postgresql.conf
440     <br>TCPIP_SOCKET = 1
441 <li>create a user for managing SQL-Ledger databases
442 <br>from root
443 <br>su postgres
444 <br>$ createuser -d sql-ledger
445 <br>if you use passwords to access postgres set the user up with a password
446 <br>$ createuser -d -P sql-ledger
447 <li>change /etc/apache/httpd.conf and add
448 <pre>
449 AddHandler cgi-script .pl
450 Alias /sql-ledger/ /usr/local/www/sql-ledger/
451 &lt;Directory /usr/local/www/sql-ledger&gt;
452   Options +ExecCGI
453 &lt;/Directory&gt;
454
455 &lt;Directory /usr/local/www/sql-ledger/users&gt;
456   Order Deny,Allow
457   Deny from All
458 &lt;/Directory&gt;
459 </pre>
460 <li>restart apache
461 <li>change fileownership of users and templates to www-data
462     <br>chown www-data: users templates
463 <li>From browser enter http://localhost/sql-ledger/admin.pl
464 <li>Login as the postgres user (account manager) you have created (above)
465 <br>Create a DB
466 <br>Create users
467
468 <li>then enter http://localhost/sql-ledger/login.pl
469 <br>Login as one of the users you have just created
470
471 </ul>
472
473 <p>
474 The long version was provided by Gordon Haverland.
475 <p>
476 <ul>
477 <li>You need to unpack the SQL-Ledger package (compressed tar archive)
478     someplace. Unpacking it in<pre>
479       /usr/local/www/sql-ledger.</pre>
480     Remember where you have unpacked it.
481 <li>SQL-Ledger requires that the PostgreSQL database be installed.
482 This is a very full-featured database, and has many associated
483 packages.  SQL-Ledger requires version 7.0 or better.  The name
484 of the basic package on Debian is postgresql.  To find if you
485 already have postgresql installed, and if so what version, the
486 following command should work:<pre>
487       dpkg -l | grep -i 'ii  postgresql '</pre>
488     A typical response would be:<pre>
489       ii  postgresql     7.1.3-5        Object....[stuff deleted]</pre>
490     Indicating, that version 7.1.3 is installed (the -5 is a
491     Debian patch level).  You can use dselect or apt-get to install
492     postgresql if you need to.  You can visit the Debian maintainer's
493     page for much more information on related packages at<pre>
494       http://people.debian.org/~elphick/postgresql/</pre>
495     Older versions of Debian's PostgreSQL installation use a file
496     called postmaster.init, while newer versions use a file called
497     postmaster.conf, either residing in /etc/postgresql.
498 <li>SQL-Ledger requires a HTTP server (or daemon) which is capable of
499     handling CGI scripts.  Apache is the one which is recommended,
500     version 1.3 or better.  Debian calls the base package apache.
501     Debian has two alternative versions of Apache, one with mod-perl
502     (apache-perl) support compiled in, and the other with SSL 
503     (secure sockets layer - apache-ssl) support.  SQL-Ledger doesn't
504     require mod-perl or SSL support, but works with either if
505     you need it installed for other functions you have.  Older versions
506     of Debian Apache installations, spread the configuration of the
507     server across 3 files (srm.conf, access.conf and httpd.conf).
508     Newer versions have consolidated all of this to httpd.conf.
509 <li>SQL-Ledger uses the Data Base Interface perl module for communication
510     with PostgreSQL.  The CPAN (Comprehensive Perl Archive Network)
511     name for this module is DBI.  Debian calls this module
512     libdbi-perl.  You should probably deselect (or apt-get) the
513     Debian version of this module to minimize upgrading headaches in
514     the future.
515 <li>DBI requires the use of an implementation specific Data Base
516     Driver.  In our case, we need the PostgreSQL specific one.
517     CPAN calls this module DBD::PG, Debian calls it libdbd-pg-perl.
518     You should use dselect (or apt-get) to install it.
519 <li>One more layer of Perl - PostgreSQL support is needed.  Debian
520     calls this last package libpgperl.  Use dselect or apt-get to
521     install it.  (You should be able to install all 5 packages at
522     one time.)
523 <li>We need to allow your PostgreSQL database to accept queries
524     in a network manner.  To do this, we need to change the value
525     of the TCPIP_SOCKET to 1.  In newer
526     PostgreSQL installs, this variable will be someplace in 
527     /etc/postgresql/postgreslq.conf (older installs will be
528     postmaster.init, same directory.  Note: you shouldn't have
529     both files there.)  Start up your favorite text editor, find
530     the line with that variable on it, change the "no" to a "yes",
531     and make sure the line isn't commented out (a "#" in front
532     of it on the same line).
533 <li>PostgreSQL has a set of users and passwords independent of
534     normal user logins.  We need to set up a PostgreSQL user
535     to "own" the SQL-Ledger data (choose a name that makes sense
536     to you, it shouldn't be "root" or "postgres").  The (PostgreSQL)
537     program for doing this is called "createuser".  To make this
538     SQL-Ledger owner user, we first need to "become" the PostgreSQL
539     superuser (on Debian, this is "postgres"), and then we will
540     run the createuser program.  So, once we are logged in as root:
541 <pre>
542       # su postgres
543       $ createuser -d sql-ledger
544     ...
545       $ exit
546       # 
547 </pre>
548     As shown above, we then typed "exit" after createuser was done,
549     to stop being the "postgres" user.  The "-d" switch (you called
550     also use "--createdb") specifies that this user can create
551     databases.
552 <li>We need to adjust the configuration of the HTTP server Apache
553     next.  Older Apache installations (srm.conf, access.conf and
554     httpd.conf) need changes in srm.conf and httpd.conf.  Newer
555     installations just need to edit /etc/apache/httpd.conf.  First,
556     we need to instruct the server that files that end in ".pl"
557     are to be treated as "cgi-script"s (srm.conf if separate).<pre>
558       AddHandler cgi-script .pl</pre>
559     Second, we need to map our SQL-Ledger installation to be easy
560     for users to find it (in srm.conf if separate).<pre>
561       Alias /sql-ledger/ /usr/local/www/sql-ledger/</pre>
562     The "/" at the end of sql-ledger in both strings is important!
563     Next, we need to allow the server to execute files from those
564     directories, include things and follow links.  This information
565     is in httpd.conf (old or new installations).<pre>
566       &lt;Directory /usr/local/www/sql-ledger&gt;
567         Options ExecCGI Includes FollowSymLinks
568       &lt;/Directory&gt;</pre>
569     If we decided to put SQL-Ledger somewhere other than
570     /usr/local/www/sql-ledger, we would use different paths above.
571 <li>All the files in the "users" and "templates" subdirectories
572     of /usr/local/www/sql-ledger need to be owned by "www-data".<pre>
573       # cd /usr/local/www/sql-ledger
574       # chown www-data:www-data users templates users/members</pre>
575     You may get an "error" about users/members not existing.  It
576     is safe to ignore this error.
577 <li>Restart the apache server.<pre>
578       /etc/init.d/apache restart</pre>
579 <li>From a browser, visit the URL<pre>
580       http://localhost/sql-ledger/admin.pl</pre>
581 <li>Login as the PostgreSQL user responsible for the SQL-Ledger
582     database you set up.  Create a database and create
583     at least one user.  (It's not a good idea to access your
584     SQL-Ledger data as the "owner" of the data on a regular basis.)
585 <li>Visit<pre>
586       http://localhost/sql-ledger/login.pl</pre>
587     and login as the user you created</pre>
588
589 </ul>
590
591
592 <p><li><h4>login.pl has compilation error</h4>
593
594 This could be because of a missing configuration file in the users directory
595
596 <p>check the permission for the users directory. The directory must be
597 set writeable for the webserver. If your webserver runs under nobody.nogroup
598 set it to
599 <pre>
600 drwxrwx--x   2 johndoe  nogroup    1024 May 26 16:49 users
601
602 or
603
604 drwx--x--x   2 nobody   nogroup    1024 May 26 16:49 users
605 </pre>
606
607
608 <p><li><h4>script not executing, shows in browser instead</h4>
609
610 Add
611
612 <pre>
613   AddHandler cgi-script .pl
614 </pre>
615
616 in your httpd.conf file.
617
618
619 <p><li><h4>unknown terminal!</h4>
620 the frontend script couldn't figure out which browser you are using
621 <p>include the terminal variable on the URL
622 <pre>
623   http://localhost/sql-ledger/login.pl?terminal=lynx</pre>
624 <p>Valid terminal variables are lynx and mozilla
625
626
627 <p><li><h4>permission denied at filesystem level</h4>
628
629 Check if your web server has write permission to write to the following
630 files and directories:
631 <pre>
632   users/
633   templates/
634   users/members
635
636   # chown nobody:nogroup users templates users/members
637 </pre>
638
639
640 <p><li><h4>permission denied to access tables</h4>
641 The user you entered in the "Database section" must be a valid
642 database user who has the rights to access the tables.
643
644 <p>If the tables are owned by 'john' and you enter 'mary' as the dba
645 you might run into this problem if mary doesn't have the rights to
646 access tables owned by john.
647
648
649 <p><li><h4>html and graphics files don't show up on screen</h4>
650
651 Enable Includes and FollowSymlinks Options in your httpd.conf file
652 <pre>  &lt;Directory /usr/local/sql-ledger&gt;
653     Options ExecCGI Includes FollowSymlinks
654   &lt;/Directory&gt;
655 </pre>
656
657
658 <p><li><h4>Can I use mySQL</h4>
659
660 No. mySQL lacks certain features required by SQL-Ledger.
661
662
663 <p><li><h4>switch display to a foreign language</h4>
664
665 Load your preferences and select the language.
666 <br>Language selection is in accordance to 
667 <a href=http://www.unece.org/cefact/locode/service/main.htm>
668 ISO 3166-1</a> standards.
669
670
671 <p><li><h4>Text shows in English when I use a foreign language</h4>
672
673 This is because the corresponding hash entry is missing.
674 Add the missing text in the locale/cc/all or locale/cc/missing
675 file and run 'perl locales.pl' to rebuild the individual files.
676
677 <br>cc refers to the country code.
678
679
680 <p><li><h4>switch to a foreign language for the login and admin screen</h4>
681
682 Edit sql-ledger.conf and enter the code for the variable
683 $language. If your language specific files are in 'locales/cc', enter 'cc'
684
685
686 </ul>
687
688 <p>
689 <hr>
690 <a name=security>
691 <h1>SQL-Ledger security</h1>
692 </a>
693
694 <ul>
695 <li>The security features built into SQL-Ledger provide encrypted passwords
696 and access control which makes it fairly safe out of the box to run even in
697 front of a firewall.
698 Some precautions which are out of our control must be taken though.
699 It matters where you install SL and how you configure your web and SQL server.
700
701 <pre>
702   Typical setups:
703   
704   /usr/local/vh/www                   <- DocumentRoot for virtual host
705   /usr/local/vh/sql-ledger            <- Alias for sql-ledger
706   /usr/local/vh/users                 <- users directory out of reach
707
708 <hr width=60% align=left>
709   /usr/local/vh/www                   <- DocumentRoot for virtual host
710   /usr/local/vh/www/sql-ledger        <- Alias for sql-ledger
711   /usr/local/vh/www/sql-ledger/users  <- users configuration files and tmp space
712
713   &lt;Directory /usr/local/vh/www/sql-ledger/users&gt;  <- disable webserver access
714     Order Deny,Allow                                 for users directory
715     Deny from All
716   &lt;/Directory&gt;
717
718 </pre>
719
720 The location for the users directory can be specified in sql-ledger.conf
721
722 <p><li>Set permission for the users and templates directory to 711
723 (most restrictive)
724
725 <p><li>If you do not want anyone to change the templates with the built-in
726 editor set the files in templates/directory/ to read only or disable
727 the menu item to edit the templates.
728
729 <p><li>For PostgreSQL you can set who has access to the server in the file
730 pg_hba.conf
731 <br>Authentication crypt does not work because not all SQL servers
732 accept encrypted passwords.
733
734 <p><li>in addition you can secure the tables from unauthorized access by
735 setting up a different database user and GRANT rights. For instance,
736 users without DELETE rights will still be able to use the program, change
737 customers or vendors but will not be able to delete transactions.
738 To lock all the tables GRANT SELECT rights only.
739
740 <p><li>Other security options include a secure shell, your webserver's
741 authentication system, SSL, encrypted tunnels, ...
742
743 </ul>
744
745 </BODY>
746 </HTML>
747