summaryrefslogtreecommitdiff
path: root/INSTALL
blob: 5abb54d49271f2e11c7856723a99e6c3530ba04a (plain)
  1. Installing LedgerSMB 1.2
  2. ========================
  3. This document contains information on how to install LedgerSMB. We
  4. recommend that the reader start by reading the section on manual
  5. installation and then start by trying the automated means mentioned
  6. later.
  7. Also this document assumes that the reader is already familiar with the
  8. release notes. If you have not already done so, please read the
  9. release_notes file in the doc/ directory.
  10. DISTRO AND OS-SPECIFIC NOTES
  11. ============================
  12. Debian users should read README.debian
  13. OpenBSD users, please consult the README.OpenBSD
  14. For Unix systems, '$' signifies the bash prompt, '=>' the psql prompt.
  15. MANUAL INSTALL
  16. ==============
  17. 1) Untar in desired location (for example, /usr/local/ledgersmb,
  18. refered to as LEDGERPATH for the remainder of this INSTALL file).
  19. LedgerSMB files should be owned by the apache user, apache:apache on
  20. many systems.
  21. 2) Create a postgresql admin database role, by convention named
  22. 'ledgersmb':
  23. $ createuser --no-superuser --createdb --no-createrole \
  24. -U postgres --pwprompt --encrypted ledgersmb
  25. (\ is a bash line continuation character, this is a single command)
  26. The prompted password (referred to as MYROLEPASSWORD) will later be
  27. used in the DBConnect: string in the configuration file
  28. 'ledgersmb.conf'
  29. If you prefer to work in postgresql's psql console, the equivalent SQL
  30. statement to create the ledgersmb role is:
  31. => CREATE ROLE ledgersmb LOGIN PASSWORD 'MYROLEPASSWORD' NOINHERIT
  32. CREATEDB;
  33. Further commands and database interaction should be conducted using
  34. the new LedgerSMB admin role 'ledgersmb'.
  35. 3) Create a central user database, owned by the LedgerSMB admin role,
  36. 'ledgersmb':
  37. $ createdb -U ledgersmb -O ledgersmb ledgersmb
  38. The equivalent SQL statement is:
  39. => CREATE DATABASE ledgersmb WITH ENCODING='SQL_ASCII'
  40. OWNER=ledgersmb;
  41. 4) On the database that will store your user and session information,
  42. run the included Pg-central.sql SQL commands to configure the user
  43. and session tables and functions:
  44. $ psql -U ledgersmb -d ledgersmb -f LEDGERPATH/sql/Pg-central.sql
  45. (LEDGERPATH is in the location you expanded the release
  46. tarball file. If you untarred in '/usr/local' then LEDGERPATH will
  47. be '/usr/local/ledgersmb').
  48. NOTE: LedgerSMB's preferred configuration is to store the user and
  49. session management tables in a separate database from the company
  50. databases (aka 'datasets', created in admin.pl). If you are already
  51. working with or prefer to have your user and session tables in one
  52. company dataset, see further information in the manual. You must have
  53. PLPGSQL installed in the dataset as well. However that is beyond the
  54. scope of these instructions.
  55. 5) The SQL commands in step 4) created an LedgerSMB-managed admin user,
  56. e.g. a row in the users and users_conf table. You must now update the
  57. 'admin' user's password in users_conf from the default password.
  58. $ psql -U ledgersmb -d ledgersmb
  59. ledgersmb=> UPDATE users_conf SET password = md5('MYPASSWORD')
  60. WHERE id = 1;
  61. (Change MYPASSWORD to your preferred administrative password, which
  62. is separate, but can be the same spelling as MYROLEPASSWORD).
  63. ledgersmb=> \q
  64. 6) Edit the LEDGERPATH/ledgersmb.conf file:
  65. a) Copy 'ledgersmb.conf.default' to 'ledgersmb.conf'
  66. b) Make sure to set the section under [globaldbh] to point to the
  67. central user and session database, using password MYROLEPASSWORD:
  68. [globaldb]
  69. DBname = ledgersmb
  70. DBhost = localhost
  71. DBport = 5432
  72. DBUserName = ledgersmb
  73. DBPassword = MYROLEPASSWORD
  74. 7) Add configuration to Apache:
  75. $ sh configure_apache.sh
  76. 8) Check Dependencies:
  77. The Build.PL script can be used to test for unmet dependencies and
  78. run other tests. It doesn't install anything yet, but it will tell
  79. you what you are missing. To check for dependencies, run:
  80. $ perl Build.PL
  81. Missing dependencies can generally be installed via a Linux
  82. distribution's package manager, or by CPAN. (Build.PL itself uses
  83. Module::Build, which is available in packages like perl-Module-Build
  84. or libmodule-build-perl.)
  85. Once this is done and dependencies are satisfied, you can check to
  86. see whether the installation nominally works by running:
  87. $ ./Build test
  88. The test suites currently check to make sure all the perl modules
  89. load and that a number of numeric tests are passed.
  90. Dependencies which are recommended are needed only for specific
  91. functionality and may not be required in all circumstances. These
  92. include:
  93. * Net::TCLink for credit card processing in a POS environment
  94. * Parse::RecDescent for the CLI script host
  95. 9) Restart Apache (instructions vary with your Linux distro or operating
  96. system).
  97. Create Datasets and Users
  98. =========================
  99. 1) Create Datasets:
  100. Browse to:
  101. http://hostname/ledgersmb/admin.pl
  102. login with 'MYPASSWORD'
  103. Create dataset(s) with:
  104. User: ledgersmb
  105. Password: MYPASSWORD
  106. Superuser: postgres
  107. Password: (postgres password)
  108. Create one dataset (a postgresql datatabase) for each separate
  109. company which will use LedgerSMB for accounting, e.g.:
  110. ledgeracme
  111. ledgerbigco
  112. (...)
  113. 2) Create User(s) pointing to specific datasets:
  114. Browse to:
  115. http://hostname/ledgersmb/admin.pl
  116. login with 'MYPASSWORD'
  117. Create user(s) pointing to a specific dataset (ledgeracme, etc.)
  118. with database login information:
  119. User: ledgersmb
  120. Password: MYPASSWORD
  121. Congratulations, you have installed and configured LedgerSMB 1.2
  122. FTP INSTALLATION
  123. ================
  124. If you control the server and have shell access, the instructions above
  125. are preferred over those given here. instead of those given here. This
  126. is simply a set of notes for those who must install on a shared server.
  127. If you do not have access to the server's configuration files install
  128. LedgerSMB in userspace by ftp'ing all the files to your server.
  129. 1) Untar ledgersmb in your private_html directory.
  130. 2) turn on script execution for the folder ledgersmb. You can control
  131. this with an .htaccess file:
  132. Options +ExecCGI
  133. DirectoryIndex login.pl
  134. 3) Protect the users directory with an .htpasswd file:
  135. order allow,deny
  136. deny from all
  137. 4) Protect the templates directory with an .htpasswd file:
  138. order allow,deny
  139. deny from all
  140. 5) Set up your PostgreSQL database and the tables. The procedure is
  141. specified above.
  142. You will most likely only have access to PostgreSQL with some other
  143. tools like pgadmin.
  144. TROUBLESHOOTING
  145. ===============
  146. Error: Access Denied in admin.pl
  147. ---------------------------------
  148. Likely causes:
  149. 1) The password entered may not match the password set in Manual Install
  150. step 5). You can repreat that step as often as you need to get login
  151. to admin.pl working, but in case your 'admin' user is not id=1, try
  152. using the expanded version of the SQL:
  153. ledgersmb==> UPDATE users_conf SET password=mp5('MYPASSWORD')
  154. WHERE id = (SELECT id FROM user
  155. WHERE username = 'admin');
  156. (Substitute 'MYPASSWORD' for your chosen password).
  157. 2) The central database may have been created with a different postgres
  158. user (role) than you are using for the connection. In this case, you
  159. may not have permission to access the required database entities.
  160. To correct this, assuming that the admin database role is ledgersmb,
  161. issue the following commands from psql:
  162. ledgersmb==> GRANT ALL ON users TO ledgersmb;
  163. ledgersmb==> GRANT ALL ON users_id_seq TO ledgersmb;
  164. ledgersmb==> GRANT ALL ON users_conf TO ledgersmb;
  165. ledgersmb==> GRANT ALL ON session TO ledgersmb;
  166. ledgersmb==> GRANT ALL ON session_session_id_seq TO ledgersmb;
  167. Error: "No GlobalDBH Configured or Could not Connect"
  168. -----------------------------------------------------
  169. LedgerSMB 1.2 uses a dedicated connection to the central database for
  170. user authentication. When the attempt to connect to that database fails,
  171. the error message above is displayed. In this case, check the following
  172. parameters under the [globaldbh] of the ledgersmb.conf file.
  173. 1) DBUserName should match the database user you imported Pg-central
  174. as (if you followed the instructions above, that would be ledgersmb).
  175. 2) DBPassword needs to match the database password to used to connect
  176. to.
  177. You can test the above causes by running (from the command line):
  178. $ psql -U [DBUserName]
  179. password: [DBPassword]
  180. When you enter the password, it will not show up on the screen.
  181. The other line that you should pay attention to is the DBConnect
  182. line. Parameters in the form of name=value need to match those for
  183. your host. The following parameters need to be set correctly in that
  184. line:
  185. dbname=ledgersmb (the database you imported Pg-Central.sql into).
  186. host=localhost (don't change unless you know what you are doing!)
  187. port=5432 (don't change unless you know what you are doing!)
  188. The full line should then be something like:
  189. DBConnect: dbi:Pg:dbname=ledgersmb;host=localhost;port=5432
  190. And that section of ledgersmb.conf looks like:
  191. [globaldb]
  192. DBname = ledgersmb
  193. DBhost = localhost
  194. DBport = 5432
  195. DBUserName = ledgersmb
  196. DBPassword = MYROLEPASSWORD
  197. OTHER ISSUES:
  198. ===================================
  199. Before submitting a bug, please consult the COMPATABILITY list. This documents
  200. which versions of software have known interoperability problems with LedgerSMB.