Difference between revisions of "PhreeBooks"

From SME Server
Jump to navigationJump to search
(Initial saving... just to do not loose any work... all other will be minor)
 
m (update source for project and note changes)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== PhreeBooks Accounting HowTo ==
+
= PhreeBooks Accounting =
 
Author: Charles2008<br>
 
Author: Charles2008<br>
Source: http://forums.contribs.org/index.php/topic,50284.0/topicseen.html <br>
+
Source 1: http://forums.contribs.org/index.php/topic,50284.0/topicseen.html <br>
 +
Source 2: http://www.phreebooks.com/documentation/how-tos/sme-server-phreebooks-install-howto/ <br>
  
[[warning]] Before you use PhreeBooks Accounting in a business environment you must satisfy yourself that it is suitable and meets you organisation's needs and the needs of your business jurisdiction you must also ensure that your unique set-up and file permissions meet your requirements and are appropriate for your hosing environment. <br>
+
{{Warning box| Before you use PhreeBooks Accounting in a business environment you must satisfy yourself that it is suitable and meets you organisation's needs and the needs of your business jurisdiction you must also ensure that your unique set-up and file permissions meet your requirements and are appropriate for your hosing environment. <br>
<br>You use anything included in this post at your own risk.<br>
+
<br>'''You use anything included here at your own risk'''.<br>
 +
}}
 +
== Description ==
  
=== Description ===
+
{{Note box| Many changes in the project, visit https://github.com/phreebooks/PhreeBooksERP for more information and sources
PhreeBooks Accounting    (previously called PhreedomERP)                                         15th Oct.2013
+
 
PhreeBooks is a web based (multi-user), OpenSource, double-entry ERP/accounting software.<br>
+
}}
 +
PhreeBooks Accounting    (previously called PhreedomERP) is a web based (multi-user), OpenSource, double-entry ERP/accounting software.<br>
 
Demo:  http://www.phreebooks.com/pb-demo  ...  (demo, demouser)<br>
 
Demo:  http://www.phreebooks.com/pb-demo  ...  (demo, demouser)<br>
 
<br>
 
<br>
Dave Premo is the project leader and has kept a very firm control of development.  
+
Dave Premo is the project leader and has kept a very firm control of development. <br>
In his own words - http://www.phreebooks.com/pb-forum/viewtopic.php?p=3178#p3178
+
In his own words - http://www.phreebooks.com/pb-forum/viewtopic.php?p=3178#p3178<br>
 +
<br>
 +
'''PhreeBooks aims to be a viable OpenSource alternative to Quickbooks and Peachtree/Sage.'''
  
Quote from: Dave Premo
+
== Set-up on SME8 ==
“I am the primary developer … some history:
+
   
I run a small battery company in the US [www.portablepower.com] and have a background as a design engineer. I was very unhappy with the commercial accounting applications out there as I found them to be difficult to adapt to my business and very expensive to operate in a multi-user environment. I wrote several interfaces to integrate my shipping, e-commerce sites, etc. to make my business flow smoothly.
+
{{Note box| PhreeBooks doesn't like 'hardened-PHP' (Suhosin)}}
  
Enter my search for an open source ERP solution. I first hooked up with webERP and wrote the reportwriter tool for the application. The project manager (in a similar position but earlier in the calendar to me) had a firm control over the architecture and I viewed a much different interface and structure. So I ended up looking for an architecture that I though brought about the flexibility I was looking for and ended up using the admin interface from ZenCart. (I have since completely re-written about 99.9% of the code and ended up building my own architecture) The other option was to branch off of webERP because of the stability of the accounting engine. So off I went in early 2007 to write my own accounting program. “
 
  
PhreeBooks aims to be a viable OpenSource alternative to Quickbooks and Peachtree/Sage.
+
==Create a Bookkeeping ibay==
 
+
This will be the directory Phreebook will run from. You must create it from Server Manager<br>
 
+
Information bay name - '''bookkeeping'''<br>
Code Sources:
+
Description – '''Phreebooks Accounting'''<br>
Sourceforge latest release PhreeBooksR3.6RC2 (the excellent new features included in the v3.6 release haven't yet IMHO been fully de-bugged. I would wait for RC3 for a production install – I guess no more than a month or two away):
+
Group Admin    ...   (set user Group)<br>
http://sourceforge.net/projects/phreebooks/files/latest/download?source=directory
+
User access via file sharing or user ftp – '''Write = group, Read = group'''<br>
 
+
Public access via web or anonymous ftp – '''Local network, no password required''' <br> 
GitHub – PhreeBooks-master (development only - not for use in a production environment):
+
Execution of dynamic content (CGI, PHP, SSI) – '''Enabled'''<br>
https://github.com/phreebooks/PhreeBooksERP/archive/master.zip
+
<br>
  
 +
==Create a PhreeBooks database==
 +
You can do it via  via command line or I use [[PHPMyAdmin]].
  
 +
{{Note box| Please note that it is strongly advised to set MySQL to default to the InnoDB format using [[MySQL#Enable_InnoDB_engine]] <br>
 +
and not MyISAM, as apparently InnoDB is 'more robust'. <br>
 +
BTW: PhpMyAdmin seems to be set out-of-the-box to default to MyISAM. <br>
 +
<br>
 +
This InnoDB / MyISAM issue won't affect getting PhreeBooks going now, however, may cause some data integrity uncertainty down the road. Best to get it right now. }}
  
Set-up on SME8:
+
In PHPMyAdmin:<br>
(this is how I have done it. I have no doubt that this can be improved upon at almost every step)
+
Create database - '''phreebooks'''<br>
Note - PhreeBooks doesn't like 'hardened-PHP' (Suhosin)
+
Collation – '''utf8_general_ci'''<br>
 +
Create user: select ''''phreebooks'''' database from list on LHS > Privileges > Add User<br>
 +
Choose a unique '''User Name''' and '''Password''' and (make sure that you have made a note of these!<br>
 +
host - '''localhost'''<br>
 +
Database for user - '''Grant all privileges''' on database '''phreebooks'''<br>
 +
'''Add User'''<br>
  
  
1. Create a Bookkeeping ibay (from which to run PhreeBooks):
 
URL - https://<server ip address>/server-manager
 
Information Bays > Add i-bay :
 
Information bay name - bookkeeping
 
Description – Phreebooks Accounting
 
Group – Admin    ...  (set user Group)
 
User access via file sharing or user ftp – Write = group, Read = group
 
Public access via web or anonymous ftp – Local network, no password required    ...  (production = p/w required IMHO)
 
Execution of dynamic content (CGI, PHP, SSI) – Enabled
 
  
  
2. Create a PhreeBooks database (either via command line or I use phpMyAdmin)
+
'''Missing instruction about how to do it on CLI ''' that´s for LATER!
Please note that it is strongly advised to set MySQL to default to the InnoDB format and not
 
MyISAM, as apparently InnoDB is 'more robust'. PhpMyAdmin seems to be set out-of-the-box to default to MyISAM.
 
  
phpMyAdmin - http://stackoverflow.com/questions/3939099/phpmyadmin-showing-myisam-instead-of-innodb
 
phpMyAdmin - http://virtualizesharepoint.com/2011/05/11/convert-myisam-to-innodb-using-phpmyadmin-for-moodle/
 
MySQL - http://wiki.contribs.org/MySQL
 
  
This InnoDB / MyISAM issue won't affect getting PhreeBooks going now, however, may cause some data integrity uncertainty down the road. Best to get it right now.
 
  
In phpMyAdmin:
 
Create database - phreebooks
 
Collation – utf8_general_ci
 
Create user: select 'phreebooks' database from list on LHS > Privileges > Add User
 
set unique User Name and Password (make sure that you have made a note of these)
 
host - localhost
 
Database for user - Grant all privileges on database “phreebooks”
 
Add User
 
  
 
+
==Sort out OpenBaseDir restriction==
 
+
This is needed to allow files to be uploaded by PhreeBooks<br>
3. Sort out OpenBaseDir restriction   (to allow files to be uploaded by PhreeBooks)
+
You can read about this at [[PHP#Open_basedir_restriction]]
Remotely get to command line of LAN SME8 server using ssh (secure shell):
 
Open a terminal with root permissions (sudo su -  on my Linux PC)
 
[/list]
 
Code: [Select]
 
ssh root@<server ip address> -L443:localhost:443
 
(Qn. Is this the best way/secure?)
 
 
 
Here are the excellent instructions:    'Modifying the PHPBaseDir setting for an ibay'
 
http://wiki.contribs.org/PHP#Open_basedir_restriction
 
 
    
 
    
I can only add one tiny thing to these instructions; that if you get no response to No.1, then move straight on to the 3rd line of code in No.2. Like this:
+
<br>
 +
Remotely get to console of SME8 server using ssh (secure shell)<br>
 +
Run 'sudo su -' on a Ubuntu PC use  '''Putty''' on Windows PCs.
  
Code: [Select]
+
  ssh root@'''<server ip address>''' -L443:localhost:443
db accounts setprop bookkeeping PHPBaseDir /home/e-smith/files/ibays/bookkeeping/:/tmp/
 
  
then don't forget to:
+
Then run this:  
Code: [Select]
+
  db accounts setprop bookkeeping PHPBaseDir /home/e-smith/files/ibays/bookkeeping/:/tmp/
signal-event ibay-modify bookkeeping
+
  signal-event ibay-modify bookkeeping
  
Stay logged on to  …
+
==Delete the index.html==
  
 +
rm /home/e-smith/files/ibays/bookkeeping/html/index.html
  
 +
==Get PhreeBooks==
  
4. Create an upload directory in the Software ibay: (to receive your .zip file)
+
  cd /home/e-smith/files/ibays/bookkeeping/files/
cd to the <software ibay>/files and
+
  wget http://sourceforge.net/projects/phreebooks/files/latest/download?source=directory
Code: [Select]
 
mkdir phreebooks
 
  
Stay logged on to  …
+
that will download latest version from PhreeBook site, now unzip it using:
  
 +
  unzip <filename>
  
 +
for today that would be:
  
5. Delete the index.html file: from the bookkeeping ibay
+
   unzip PhreeBooksR36RC2.zip
Code: [Select]
 
cd /home/e-smith/files/ibays/bookkeeping/html; dir
 
    
 
…  there it is. Now delete it:
 
Code: [Select]
 
rm index.html
 
Code: [Select]
 
exit
 
  
 +
there should be 2 entries similar to this:
 +
  PhreeBooksR36RC2
 +
  PhreeBooksR36RC2.zip
  
 +
One it´s the originally downloaded file (version can be newer) and other the directory with unzipped content.
  
6. Upload the PhreeBooks .zip file:
+
==Put files on right directory and right permissions==
I am sure that you could cd to the upload directory in 4. and wget the .zip file straight to the created upload directory. e.g.
 
wget http://sourceforge.net/projects/phreebooks/files/latest/download?source=directory
 
  
However, I use a Linux desktop and the following instructions are for this:
+
  mv phreebooks/* ../html/
Download .zip file from either of the two sources above. Secure copy .zip file to server:
+
  chown -R www:www /home/e-smith/files/ibays/bookkeeping
cd to Download directory on PC
+
  chmod -R 0750    /home/e-smith/files/ibays/bookkeeping
Code: [Select]
 
scp <file to upload> root@hostname:<destination path e.g. /home/e-smith/files/ibays/<software ibay>/files/phreebooks>
 
   
 
(Qn. Is this the best way/secure?)
 
…  replace <placeholders> with YOUR directory names.
 
  
 +
==Install and configure PhreeBooks using browser==
  
 +
Open a browser and type:
 +
  http'''s'''://<server ip address>/bookkeeping
  
7. Unzip the PhreeBooks .zip file:
+
{{Note box| Please be patient, this can take 30 seconds or so (depending on processor speed etc )}}
ssh into LAN server as in 3. above.
 
cd to upload directory, e.g.
 
Code: [Select]
 
cd /home/e-smith/files/ibays/<software ibay>/files/phreebooks
 
unzip the uploaded file: (copy the file name exactly from server– right click, copy/paste)
 
Code: [Select]
 
unzip PhreeBooksR36RC2.zip
 
  …  frenzy of unpacking
 
 
 
See what's there:
 
Code: [Select]
 
dir
 
there should be 2 entries;
 
PhreeBooksR36RC2  PhreeBooksR36RC2.zip  …  (one directory and the original  .zip file).
 
 
 
Stay logged on to  ...
 
 
 
 
 
 
 
8. Copy the PhreeBooks programme files over:  (to the bookkeeping ibay)
 
cd into the  PhreeBooksR36RC2 directory, and copy the entire directory contents across using tar:
 
Code: [Select]
 
tar cf - . |(cd /home/e-smith/files/ibays/bookkeeping/html; tar xvf -)
 
 
 
Stay logged on to  ...
 
 
 
 
 
 
 
9. Set file 'ownership' and  'permissions' for installation:
 
File ownership:
 
Code: [Select]
 
chown -R www:www /home/e-smith/files/ibays/bookkeeping
 
 
 
File permissions: 
 
During PhreeBooks install /my_files and /includes need to have write permissions for the web server.
 
  
Pre-install:
+
Now follow the on-screen instructions.
ssh into LAN server and at the command line:
 
Code: [Select]
 
chmod -R 0750 /home/e-smith/files/ibays/bookkeeping
 
Code: [Select]
 
exit
 
  
 +
==Post-install adjustments==
  
 +
After install, the web server needs RO access to all directories except /my_files which needs write access also for writing company specific files. <br>
 +
Once you have the normal PhreeBooks desktop view (with dropdown menus across the top of the screen) then rename or delete the Install directory and make Includes/configure.php read only. <br>
  
10. Install and configure PhreeBooks:
+
  mv /home/e-smith/files/ibays/bookkeeping/html/install  /home/e-smith/files/ibays/bookkeeping/html/install.old
Open a browser and type:
 
https://<server ip address>/bookkeeping
 
... be patient, this can take 30 seconds or so (depending on processor speed etc )
 
follow the on-screen instructions.
 
 
 
 
 
 
 
11. Post-install adjust file permissions, delete install directory:
 
After install, the web server needs access to all directories for reading only, except /my_files which needs write access also for writing company specific files. Once you have the normal PhreeBooks desktop view (with dropdown menus across the top of the screen) then rename or delete the Install directory and make Includes/configure.php read only.
 
 
 
Post-install:
 
ssh into LAN server and at command line rename the install directory:
 
Code: [Select]
 
mv /<path to bookkeeping ibay>/html/install  /<path to bookkeeping ibay>/html/install.old
 
 
    
 
    
or delete it:
+
or  
Code: [Select]
 
rm -rf install
 
 
 
 
 
 
 
Adjust file permissions:
 
Code: [Select]
 
chmod -R 0551 /home/e-smith/files/ibays/bookkeeping
 
Code: [Select]
 
chmod -R 0750 /home/e-smith/files/ibays/bookkeeping/html/my_files
 
Code: [Select]
 
chmod  0400 /home/e-smith/files/ibays/bookkeeping/html/includes/configure.php
 
  
edit - I am investigating whether the 0551 file-permission above can be lowered to 0550 IF the user can pre-establish membership of a 'Group', i.e. by password protecting the ibay.
+
  rm -rf /home/e-smith/files/ibays/bookkeeping/html/install
  
All other files (not directories):   ...  now, I haven't tried this yet. However, I think that this should work - if you think you need it.
+
And configure rigth file permissions:
chmod  0441 /home/e-smith/files/ibays/bookkeeping/<path to file>
 
edit - I need to investigate this (possibly 0440)
 
  
 +
chmod -R 0551 /home/e-smith/files/ibays/bookkeeping
 +
chmod -R 0750 /home/e-smith/files/ibays/bookkeeping/html/my_files
 +
chmod  0400  /home/e-smith/files/ibays/bookkeeping/html/includes/configure.php
  
 +
{{Note box| I am investigating whether the 0551 file-permission above can be lowered to 0550 IF the user can pre-establish membership of a 'Group', i.e. by password protecting the ibay.}}
  
12. There is a To-Do list on the PhreeBooks landing page.
+
I hope it works now. :)
  
NOTE - I have read that on some hosting the Users and Groups are defined by the hosting company - IMHO this may well effect the file permissions required.
 
  
 
----
 
----
 
[[Category:Howto]]
 
[[Category:Howto]]

Latest revision as of 04:07, 5 July 2017

PhreeBooks Accounting

Author: Charles2008
Source 1: http://forums.contribs.org/index.php/topic,50284.0/topicseen.html
Source 2: http://www.phreebooks.com/documentation/how-tos/sme-server-phreebooks-install-howto/


Warning.png Warning:
Before you use PhreeBooks Accounting in a business environment you must satisfy yourself that it is suitable and meets you organisation's needs and the needs of your business jurisdiction you must also ensure that your unique set-up and file permissions meet your requirements and are appropriate for your hosing environment.


You use anything included here at your own risk.


Description

Important.png Note:
Many changes in the project, visit https://github.com/phreebooks/PhreeBooksERP for more information and sources


PhreeBooks Accounting (previously called PhreedomERP) is a web based (multi-user), OpenSource, double-entry ERP/accounting software.
Demo: http://www.phreebooks.com/pb-demo ... (demo, demouser)

Dave Premo is the project leader and has kept a very firm control of development.
In his own words - http://www.phreebooks.com/pb-forum/viewtopic.php?p=3178#p3178

PhreeBooks aims to be a viable OpenSource alternative to Quickbooks and Peachtree/Sage.

Set-up on SME8

Important.png Note:
PhreeBooks doesn't like 'hardened-PHP' (Suhosin)



Create a Bookkeeping ibay

This will be the directory Phreebook will run from. You must create it from Server Manager
Information bay name - bookkeeping
Description – Phreebooks Accounting
Group – Admin ... (set user Group)
User access via file sharing or user ftp – Write = group, Read = group
Public access via web or anonymous ftp – Local network, no password required
Execution of dynamic content (CGI, PHP, SSI) – Enabled

Create a PhreeBooks database

You can do it via via command line or I use PHPMyAdmin.


Important.png Note:
Please note that it is strongly advised to set MySQL to default to the InnoDB format using MySQL#Enable_InnoDB_engine

and not MyISAM, as apparently InnoDB is 'more robust'.
BTW: PhpMyAdmin seems to be set out-of-the-box to default to MyISAM.

This InnoDB / MyISAM issue won't affect getting PhreeBooks going now, however, may cause some data integrity uncertainty down the road. Best to get it right now.


In PHPMyAdmin:
Create database - phreebooks
Collation – utf8_general_ci
Create user: select 'phreebooks' database from list on LHS > Privileges > Add User
Choose a unique User Name and Password and (make sure that you have made a note of these!
host - localhost
Database for user - Grant all privileges on database phreebooks
Add User



Missing instruction about how to do it on CLI that´s for LATER!



Sort out OpenBaseDir restriction

This is needed to allow files to be uploaded by PhreeBooks
You can read about this at PHP#Open_basedir_restriction


Remotely get to console of SME8 server using ssh (secure shell)
Run 'sudo su -' on a Ubuntu PC use Putty on Windows PCs.

 ssh root@<server ip address> -L443:localhost:443	

Then run this:

 db accounts setprop bookkeeping PHPBaseDir /home/e-smith/files/ibays/bookkeeping/:/tmp/
 signal-event ibay-modify bookkeeping

Delete the index.html

rm /home/e-smith/files/ibays/bookkeeping/html/index.html

Get PhreeBooks

 cd /home/e-smith/files/ibays/bookkeeping/files/
 wget http://sourceforge.net/projects/phreebooks/files/latest/download?source=directory

that will download latest version from PhreeBook site, now unzip it using:

 unzip <filename> 

for today that would be:

 unzip PhreeBooksR36RC2.zip

there should be 2 entries similar to this:

 PhreeBooksR36RC2
 PhreeBooksR36RC2.zip

One it´s the originally downloaded file (version can be newer) and other the directory with unzipped content.

Put files on right directory and right permissions

 mv phreebooks/* ../html/
 chown -R www:www /home/e-smith/files/ibays/bookkeeping
 chmod -R 0750    /home/e-smith/files/ibays/bookkeeping

Install and configure PhreeBooks using browser

Open a browser and type:

 https://<server ip address>/bookkeeping


Important.png Note:
Please be patient, this can take 30 seconds or so (depending on processor speed etc )


Now follow the on-screen instructions.

Post-install adjustments

After install, the web server needs RO access to all directories except /my_files which needs write access also for writing company specific files.
Once you have the normal PhreeBooks desktop view (with dropdown menus across the top of the screen) then rename or delete the Install directory and make Includes/configure.php read only.

  mv /home/e-smith/files/ibays/bookkeeping/html/install  /home/e-smith/files/ibays/bookkeeping/html/install.old
  

or

 rm -rf /home/e-smith/files/ibays/bookkeeping/html/install

And configure rigth file permissions:

chmod -R 0551 /home/e-smith/files/ibays/bookkeeping
chmod -R 0750 /home/e-smith/files/ibays/bookkeeping/html/my_files
chmod  0400   /home/e-smith/files/ibays/bookkeeping/html/includes/configure.php 


Important.png Note:
I am investigating whether the 0551 file-permission above can be lowered to 0550 IF the user can pre-establish membership of a 'Group', i.e. by password protecting the ibay.


I hope it works now. :)