FAQ

E R P

• #### Error!images/[dataset] : Permission denied

change the permission for the 'image' directory writeable for the webserver

• #### perl 5.26 @INC error

Can't locate bin/mozilla/login.pl in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /var/www/html/sql-ledger/login.pl line 119.

add the code below at the beginning of am.pl and login.pl if you have symlinks to the other files in the root directory, otherwise add it to all the scripts in the sql-ledger root directory

 BEGIN {
push @INC, '.';
}

For some other workarounds see https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-%28%22.%22%29-from-@INC

• #### spool and template directory missing

The latest archives, starting with 3.0.7, do not have a spool and/or templates directory. Add the directories with web server write privileges in the sql-ledger directory before calling up admin.pl

• #### Apache 2.4 configuration

 AddHandler cgi-script .pl

Alias /sql-ledger /usr/local/sql-ledger/
<Directory /usr/local/sql-ledger>
</Directory>

<Directory /usr/local/sql-ledger/>
AllowOverride None
Require all granted
</Directory>


• #### preamble.tex : No such file or directory

templates are provided as is, some templates may have links to other files which are not included. The preample.tex file is a separate file which holds the header information for a template. Find a template with the header, that is everything up to \begin document, and put the stuff into a file called preamble.tex or simply cut and paste the header into the file and remove the <%include preamble.tex%> directive.

• #### wrong papersize

If the papersize for postscript and PDF does not match set the proper size with texconfig-sys
 texconfig-sys pdftex paper letter


• #### Install Notes for Lighttpd

• Make sure mod_cgi and mod_alias are in server.modules list
• Add sql-ledger directory as an alias, ie:

alias_url = ( "/sql-ledger/" => "/usr/local/sql-ledger/" )

• Set up perl as handler for *.pl files.

cgi.assign = ( ".pl" => "/usr/bin/perl" )

Note: server.follow-symlink is on by default in lighttpd.

}

• #### IDENT Authentication failed for user "sql-ledger"

Edit pg_hba.conf and change authentication to
   local           all        all           trust
The file is in the 'data' directory of your postgresql installation. This is different with every distribution so look for it.
   # find / -name 'pg_hba.conf'

Some people can't read and seem to think 'localhost' is just some fancy name for a local machine. 'localhost' is a host like any other host on a network. A 'local' entry in pg_hba.conf will allow local connections ONLY and not allow host connections. If you then try to connect to 'localhost' postgres will come back with an authentication error because you tried to connect to a host.

WARNING! DO NOT just put a 'host all all trust' in pg_hba.conf and leave your computer hooked up to the Internet. It's ok for trusted internal networks but NOT when you are hooked up to the Internet.

• #### DBD-Pg for Mandrake 9.0

Mandrake did not package a compiled DBD-Pg package again, so install DBD-Pg from the source package. Install perl-DBD-Pg-1.01-4mdk.i586.rpm from the 'contrib' area. (Mandrake / 9.0 / contrib / RPMS)

• #### LaTeX error

If for some reason LaTeX produces an error message check for strange characters in your account description and parts description and use \usepackage[latin1]{inputenc} in the preamble.

• #### LaTeX templates

If you don't want to edit tex code by hand, you could use Lyx, Abiword, or any WYSIWYG editor capable of exporting latex code. To do that you must change the tokens for the variables <% and %> to something like << and >>. % is the comment character in tex. There is also a pagebreak block which must be commented out. When you are done with the changes replace << and >> with <% and %> and uncomment the pagebreak block.

LaTeX is difficult but it also offers a much superior environment to produce professionally looking forms in postscript and PDF format. Unfortunately with all that power there is also a steep learning curve.

• #### W3M

pass terminal=mozilla when you start w3m
   $w3m -F http://localhost/sql-ledger/login.pl?terminal=mozilla To use without frames $ w3m http://localhost/sql-ledger/login.pl?terminal=lynx

• #### PDF option disappeared

Edit sql-ledger.conf and set $latex = 1; sql-ledger.conf is perl code. If there is a mistake in the file it will not be loaded and the internal defaults are used which turn off$latex, hence no PDF option.

• #### Installation on Windows (WIN32)

• install Apache, perl, Postgres or Oracle, DBI and the appropriate DBD module
• extract the files to c:\apache\sql-ledger
• run 'perl shebang' to change the first line of the scripts. If perl is not in c:\perl\bin' change '#!c:\\perl\\bin\\perl' to the location where your perl binary is.
 Alias /sql-ledger "c:/apache/sql-ledger/"
<Directory "c:/apache/sql-ledger">
AllowOverride All
Options +ExecCGI
Order Allow,Deny
Allow from All
</Directory>

<Directory "c:/apache/sql-ledger/users">
Order Deny,Allow
Deny from All
</Directory>

• start Apache
• start Postgres|Oracle|DB2
• connect to http://localhost/sql-ledger/admin.pl and set up datasets

• #### Installation on Windows /w cygwin

• install cygwin Apache, perl, postgres, gcc and lynx
• install DBI
• tar zxvf DBI-1.30.tar.gz
• cd DBI-1.30
• perl Makefile.PL
• make install
• install DBD-Pg
• tar -zxvf DBD-Pg-1.13.tar.gz
• export POSTGRES_INCLUDE=/usr/include/postgresql
• export POSTGRES_LIB=/usr/lib/postgresql
• cd DBD-Pg-1.13
• perl Makefile.PL
• make install
 AddHandler cgi-script .pl
Alias /sql-ledger /var/www/sql-ledger/
<Directory /var/www/sql-ledger>
Options +ExecCGI
</Directory>

<Directory /var/www/sql-ledger/users>
Order Deny,Allow
Deny from All
</Directory>

• install SQL-Ledger
• cd /var/www
• mkdir sql-ledger
• cd /var/www/sql-ledger
• perl setup.pl

• #### What do I enter for the language

If you use English, nothing, if you want to use a foreign language for the login screen and admin stuff enter the language code, this is the directory in the locale directory.

• #### Using samba to send printjobs to a printer attached to a Windows XP workstation

The next part applies to roll your own print filters only. If you use CUPS or LPRng use this as a guide how printing works. I use the printer 'Epson' as an example which is attached to a XP workstation called Raven.
 /etc/printcap entry on the server which runs lpd

epson:Epson\
:sh:\
:lp=/dev/null:\
:sd=/var/spool/output/epson:\
:if=/usr/libexec/lpr/epson/prnfilter:\

# end of entry in /etc/printcap

# prnfilter shell script
#!/bin/sh
# Filter for Epson Stylus

PATH="$PATH:/usr/local/bin" #read first_line read tmp first_line=echo$tmp | cut -b1-2 | sed -n '1p'

first_chr=expr "$first_line" : '$$.$$' first_two=expr "$first_line" : '$$..$$'
rewindstdin

if [ "$first_two" = "%!" ]; then # Postscript file gs @st640p.upp -dSAFER -dNOPAUSE -q -sOutputFile=/tmp/$$- else # text file cat > /tmp/$$ echo -n "^L" >> /tmp/$$smbclient '\\Raven\Epson' "" -c 'printmode text' fi smbclient '\\Raven\Epson' "" -P -c "print /tmp/$$" rm /tmp/$$# EOF rewindstdin is a small program to rewind the filehandle for STDIN save the next part up to EOF to a file rewindstdin.c and compile #include <sys/types.h> #include <unistd.h> extern int errno; main() { if( lseek(0,0,0) == 0 ){ errno = 0; } return( errno ); } # EOF compile to an executable gcc -o /usr/local/bin/rewindstdin rewindstdin.c  • #### beginning balances Add a GL Journal entry and enter the beginning balance for your accounts. Beginning balances are the balances from your last balance sheet. If you also add open invoices to account for COGS for inventory, add the invoices and make the appropriate adjustments. • #### establish a beginning inventory add the parts with a vendor invoice. Use the real cost for the items, not zero. If you use zero cost then the cost of goods will be zero when you sell the item. • #### Assemblies Assemblies are manufactured goods assembled from parts, services and assemblies. Because you do not buy assemblies you 'stock assemblies' by adding assembled units to your inventory. The quantity for individual parts is reduced and the quantity for the assembly increased. To disassemble an assembly you simply return the parts to inventory by entering a negative quantity for the number of assemblies to stock. • #### customizing SQL-Ledger The application interface consists of a global and private interface. • #### DBD-Pg not installed Most modern distributions now package DBD-Pg. If it is not packaged follow this recipe to get it working. • check if you have the header files for PostgreSQL$ find / -name 'libpq-fe.h'
if nothing shows up install the development package for PostgreSQL
• set the environment variables POSTGRES_LIB and POSTGRES_INCLUDE
• cd to DBD-Pg directory
as ordinary user
$perl Makefile.PL$ make
$make test if all went well su to root # make install • remove DBD-Pg • #### login.pl has compilation error This could be because of a missing configuration file in the users directory check the permission for the users directory. The directory must be set writeable for the webserver. • #### script not executing, shows in browser instead Add  AddHandler cgi-script .pl in your httpd.conf file. • #### unknown terminal! the frontend script couldn't figure out which browser you are using include the terminal variable on the URL  http://localhost/sql-ledger/login.pl?terminal=lynx Valid terminal variables are lynx and mozilla • #### permission denied Check if your webserver has write permission to write to the following directories and files therein:  users/ templates/ images/ spool/ css/ # chown -hR nobody:nogroup users templates images spool css replace nobody:nogroup with the web server user and group. Some systems use apache:apache, www, www-data, ...  • #### permission denied to access tables The user you entered in the "Database section" must be a valid database user who has rights to access the tables. If the tables are owned by 'joe' and you enter 'mary' as the dba you might run into this problem if mary doesn't have the rights to access tables owned by joe. • #### html and graphics files don't show up on screen Enable Includes and FollowSymlinks Options in your httpd.conf file  <Directory /usr/local/sql-ledger> Options ExecCGI Includes FollowSymlinks </Directory>  • #### switch display to a foreign language Load your preferences and select the language. Language selection is in accordance to ISO 3166-1 standards. • #### Text shows in English when I use a foreign language This is because the corresponding hash entry is missing. Add the missing text in the locale/cc/all or locale/cc/missing file and run 'perl locales.pl' from the command line to rebuild the individual files. cc refers to the country code. • #### switch to a foreign language for the login and admin screen Edit sql-ledger.conf and enter the code for the$language variable
   \$language = "de";

This is a global change and applies to all logins, individual settings can be changed by setting the language in your Preferences.

# SQL-Ledger security

• The security features built into SQL-Ledger provide passwords, two step authentication and access control. If you expose your server on the Internet we strongly advise to use your web server's authentication mechanism as well.

Some other precautions which are out of our control must also be taken. It matters where you install SL and how you configure your web server and SQL database server.

   Typical setups:

/usr/local/vh/www                   <- DocumentRoot for virtual host
/usr/local/vh/sql-ledger            <- Alias for sql-ledger
/usr/local/vh/users                 <- users directory out of reach

/usr/local/vh/www                   <- DocumentRoot for virtual host
/usr/local/vh/www/sql-ledger        <- Alias for sql-ledger
/usr/local/vh/www/sql-ledger/users  <- users configuration files and tmp space

<Directory /usr/local/vh/www/sql-ledger/users>  <- disable webserver access
Order Deny,Allow                                 for users directory
Deny from All
</Directory>


The location for the users directory can be specified in sql-ledger.conf

• Set permission for the users and templates directory to 711

• If you do not want anyone to change the templates with the builtin editor set the files in templates/directory/ to read only or disable the menu item to edit the templates.

• You can set up a read-only environment if you disable the menu items to add data. i.e 'Add Transaction' if unchecked you will not be able to add a transaction or repost a transaction. You may look at it but nothing else.

• There are various settings for audit control and you can disable reposting entirely or up to a certain date. And with audit trails enabled you can keep tab of who is doing what.

• For PostgreSQL you can also set who has access to the server in the file pg_hba.conf
Authentication crypt does not work because not all SQL servers accept encrypted passwords.

• In addition you can secure the tables from unauthorized access by setting up a different database user and GRANT rights. For instance, users without DELETE rights will still be able to use the program, change customers and vendors, add transactions but will not be able to delete or repost transactions.
To lock all the tables to create a RO system GRANT SELECT rights only.

• Other security options include a secure shell, your webserver's authentication system, SSL, encrypted tunnels, ...