Koozali.org: home of the SME Server

Phreebooks install (accounting/ERP package)

Offline Charles2008

  • *
  • 174
  • +0/-0
Phreebooks install (accounting/ERP package)
« on: December 13, 2012, 01:25:53 PM »
I am in the process of trying to setup Phreebooks (http://www.phreesoft.com/) on my SME8 server. It is a small business accounting package - IMHO more user friendly than LedgerSMB (which I have seen discussed on the forums). I am hoping that it is easier to install also.

I am a novice at this, but enthusiastic.

I have installed phpMyAdmin successfully (following the instructions here - http://wiki.contribs.org/PHPMyAdmin) and, having studies  a few other installs, I have tried to install Phreebooks to an i-bay.

I have copied the necessary files across to the i-bay html directory and have begun the install process  ...  I have received the message from Phreedom "I could not find a temporary upload directory on this server".

I have hunted around the forums (this seems a very common problem) and found this workaround:
Code: [Select]
db accounts setprop "iBay" PHPBaseDir /home/e-smith/files/ibays/"iBay":/tmp   (BTW is there a ' / ' missing from in front of the ' : '?)
signal-event ibay-modify "iBay"    (of course, I changed "iBay" to the name of my ibay)

It doesn't seem to have worked as the message didn't disappear . I know this seems to have been dealt with over and over again ('dead horse' and 'flogging' come to mind), but I am clearly missing something. I am not sure what.

I proceeded with the install and of course, it isn't working as I would expect. Although it is set-up and most functionality seems ok (I am sure that the functionality needing the upload directory won't function). I don't seem to be able to 'save' settings, although I could for the first couple ... is this related to the /tmp directory access issue?

Any guidance would be very much appreciated.
Charles





Offline Charles2008

  • *
  • 174
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #1 on: December 13, 2012, 03:12:28 PM »
I have come across this regarding Front Accounting:

TTown:
I just installed frontaccounting. It actually went pretty smoothly with the exception of the mysql database user. During the installation I had to give him all rights, not just for his own database. I removed the global rights after the installation and played with it for a bit. No problems so far.

How I did it? (ok, this outlines my second try - the first try had smesitemaker create the database user and failed with some database access problems...)
1) created a site with smesitemaker (all settings default) and removed index.htm
2) untared the .tgz file to its rightfull place (myserverip.com/front) (=/opt/front/)           .....   Note "to it's rightful place", /opt
3) browsed to myserverip.com/front/install
4) chowned www:www some (5) directories the installer complained about being unwritable
5) used phpMyAdmin to create a user "somename" with all rights to a database "somename" - I did for the setup have to give him some extra global rights. Since I didn't know which I gave him all and took them away again after the installation.
6) changed password for admin
Bingo
Good luck
Stefan
http://forums.contribs.org/index.php?topic=40754.10;wap2

Perhaps this is the way I should have gone about it.

Is it not possible to install in an i-bay without using Sitemaker? Or is using Sitemaker a very good idea in this sort of situation?
Charles
« Last Edit: December 14, 2012, 11:42:14 AM by Charles2008 »

guest22

Re: Phreebooks install (accounting/ERP package)
« Reply #2 on: December 14, 2012, 08:07:36 AM »
Hi,

you need the 'php_admin_value upload_tmp_dir /tmp' set in the /etc/httpd.conf [youribayname] section.

You TEST it by adding this manually to httpd.conf and restart httpd service. But you need to create a custom-template to make it permanent.

HTH 

Offline Charles2008

  • *
  • 174
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #3 on: December 14, 2012, 10:16:12 AM »
@RequestedDeletion
Thank you for the pointer.

I was hoping that there might be a way of doing this without using a 'custom template' as (I think) that I have read that they are broken on upgrade (am I right here?).

Is there a better way of installing Phreebooks - in another directory perhaps (what are the options - /opt, ???)
Is using Sitemaker a better or easier way of installing this app?

guest22

Re: Phreebooks install (accounting/ERP package)
« Reply #4 on: December 14, 2012, 10:28:47 AM »
I was hoping that there might be a way of doing this without using a 'custom template' as (I think) that I have read that they are broken on upgrade (am I right here?).

Hi, no, the whole templating system is specifically designed so that custom changes survive. The requirement for a custom template stays when  /opt/dir as an option

There should be a few good examples on the wiki or forums. I just tested it with a manual edit of httpd.conf and it works.

HTH 

Offline Charles2008

  • *
  • 174
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #5 on: December 14, 2012, 11:05:23 AM »
@RequestedDeletion  -   thank you for your response.

In wondering whether I am doing this the 'right way', I re-examined the LedgerSMB install from 2007, here -
http://forums.contribs.org/index.php?topic=37181.0
and notice that he writes :

Install LedgerSMB
"This how-to assumes that you have a ‘software’ ibay for contribs and other downloaded software. It also presumes you are going to install to the recommended /usr/local directory. ... (later) ...  Copy the file to /usr/local And unpack the file  ... (and later still) ... installing an non-ibay directory makes things a little more complicated." (referring to the URL)

He goes on to make a 'custom template' in this method too. In fact, it looks like a complicated install, not least because of the requirement for the Postgres db.

What are the advantages of installing in i-bay, /opt, usr/local? It isn't at all clear to me.

Before I have to tangle with the intimidating sounding 'custom templates', I would be interested to know if I am going about this the right way. i.e. is this the right place (i-bay) to install Phreebooks? I ask because I had a phone conversation with an SME consultant yesterday and he was "surprised" that I was trying to install Phreebooks to an i-bay.

guest22

Re: Phreebooks install (accounting/ERP package)
« Reply #6 on: December 14, 2012, 11:26:30 AM »
Charles,

the topic of placing something in an ibay, in /op/dir or /usr/share has been discussed before in the forums and the opinions vary. Basically it comes down to balancing between or choosing for 'ease of use' and security.

Everything in an ibay will be taken into account automatically by SME Server, including backup and access control (local, web and groups). Some would like to beef up security by placing it in a location *ONLY* accessable by the webserver and have custom access rules all defined in the virtual host created by a custom-template, thus bypassing the default ibay way. The exact location is also a matter op opinion on security, backup, default *nix rules, policy etc. So no definite answer here.

Either way, you still need db entries and a custom-template, but not as complicated as the thread you referred to.

I'm not the expert, and I bet you that when the folks over in timezone GMT-6 start waking up, a simple answer or example will pop up :-)

HTH

Offline Charles2008

  • *
  • 174
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #7 on: December 16, 2012, 01:28:34 AM »
@ RequestedDeletion - thanks for that direction.

After a lot of digging, I have come across this discussion:
http://forums.contribs.org/index.php?topic=48816.0

This is pretty up-to-date and relates to SME8 and the infamous 'open_base_dir restriction in PHP'.

I do note however, this comment half way through the discussion  - " ... but I install almost everything to /opt. It makes me feel more secure"

Why isn't he going for the /usr/local directory install, I ask myself? "Clear" and "mud" come to mind.

I am going to continue with the i-bay install for no better reason than I have already started it ...  actually I am very interested to know the pro's and con's of these three (and maybe more) recommended methods of installing applications. I have searched the forum for /usr /opt /i-bay, I didn't find anything covering this in any detail. Is there a thread that anyone can point me to ?
Charles

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #8 on: December 16, 2012, 02:58:46 AM »
Charles2008

Just to clarify for you, in this case you do not need to add a custom template for the PHPBaseDir setting, as suitable code exists in sme server to allow db entries to be used to set this.
So follow the generic instructions here (& as similarly mentioned many times in these forums).
http://wiki.contribs.org/PHP#Modifying_the_PHPBaseDir_setting_for_an_ibay

Note that you do need to manually create the actual ibay /tmp folder (if not already existing), ie create a /tmp subfolder in the location that you specify with the db command.
You cannot just specify a non existent folder as the tmp folder.
If your webapp is in
/home/e-smith/files/ibays/accountingwebapp/html/
then create a folder
/home/e-smith/files/ibays/accountingwebapp/html/tmp

Do not use or specify the common system /tmp folder or a seperately created common system /temp folder for all web apps, to avoid cross site hacking.
Always create seperate ..../tmp folders for each app, only within the folder structure for that web application.

Re the issues of installing to /opt or to an ibay, there is no significant practical difference.
If you use /opt/webapp then you need to create custom template fragments to point domains or aliases (eg mydomain.com/mywebapp) to the /opt/webapp folder & so on.
Usually a contrib rpm will do that for you, but if you are doing manual installs of less popular webapps for which no contrib rpm has been released, then you will need to manually do this, which if you do not know how can be a stumbling block to get that webapp to be accessible from the web.
Study how other webapps with contribs do this ie install a contrib & look at the template fragments that get added, and also seperately look at what the smesitemaker contrib does.

Installing to an ibay is quite OK & usually easier to setup. Web access is controlled using server manager settings for the ibay, as is the ability to run php or other "dynamic" type content.
The Domains panel in server manager can also forward domain type URL requests to a specified ibay, so that for a certain domain name, content in a certain ibay is used.
So many of the manual "behind the scenes" setting up requirements that are needed for /opt installations, are handled by the server manager GUI interface for ibay installations, much easier for you.

Note too that all ibay content is automatically included in default backups, or backups that conform to sme standards, whereas content in /opt is not included in backups, so you need to manaully add /opt to any backup routine.

Note for installs to either /opt or an ibay you will still need to set the PHPBaseDir setting using a db command.
The reason the PHPBaseDir setting is not automatically created is for security, the less access that is granted to folders & ibays as a default, then the less chance of hacking etc.
So the sme developers have wisely allowed users to specify which folder(s) or ibay(s) they want to individually enable the PHPBaseDir setting for.

The need for setting individual per app PHPBaseDir settings, is not to make life harder for you, but to make it safer.
It's just something that seems to catch many users out & cause them some initial difficulty when setting up webapps.

The important thing to note about using ibays is that they are multi purpose "storage containers", and end users on your network (ie LAN) can have direct access to ALL the ibays if configured that way in server manager, which many less knowledgable sysadmins may do inadvertantly by default.

You should only typically allow end users on the LAN to have Windows file sharing access to ibays that contain user changeable data & files.
End users should not (usually) have access to ibays that contain webapps like Wordpress, Joomla, accounting programs & so on.
These should only be accessible by the administrator or responsible end user(s) who are in charge of updating content on those webapp sites.
You can control local (LAN) file sharing access using sme server Groups.

Where you you have multiple users & multiple webapps in ibays (meaning more than one of each), then create a Group for every ibay webapp, and only allow a certain user or sysadmin to be a member of a group or groups that require access to certain ibays. Some users may have access to some webapp ibays that other users do not have access to etc. This concept prevents unauthorized users from inadvertantly changing web content or changing permissions on files within the webapp ibay & from uploading inappropriate or insecure web content, & so on.

The above issues are one of the reasons why there is a suggestion to use /opt, as no user automatically has access to /opt, and a sysadmin will have to provide access to any authorized user, thus forcing the issue of security & user access to webapp content be dealt with.

Hope that helps you clarify things.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Charles2008

  • *
  • 174
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #9 on: December 16, 2012, 01:33:46 PM »
Mary

Thank you for taking the time to put together such a fantastic response. It goes a long way to increasing my understanding of the basic user-related concepts of SME.

Just to make it absolutely clear to me - you are saying that if I continue to install Phreebooks to an i-bay, I shouldn't need to create a custom-template and can do it through db commands (as I try and set out below)?

Funny how I seem to have come full circle, as doesn't my first post relate to db commands - because I tried this and it didn't seem to work for me. Hence my quest to find an alternative. Actually, I now realise that I may have misunderstood and / or missed out step (3a) below.

I will go back and re-try, making sure I have the /tmp directory created etc.

I was beginning to feel quite relieved that I had found mmccarn elegant looking and recent (June 2008 / SME8) i-bay local /tmp directory solution.
http://forums.contribs.org/index.php/topic,48816.0.html

Mary, for the avoidance of any doubt (for myself and others), is the following process what you would recommend:

1) unzip Phreedom to my i-bay (called "bookkeeping") html file:
Code: [Select]
/home/e-smith/files/ibays/bookkeeping/html
2) create a local /tmp directory:
Code: [Select]
mkdir /home/e-smith/files/ibays/bookkeeping/html/tmp
3) follow the instructions that you pointed to :
http://wiki.contribs.org/PHP#Modifying_the_PHPBaseDir_setting_for_an_ibay

3a) I am uncertain about the next line - am I supposed to replace 'value' with my new /tmp directory?
Code: [Select]
db accounts setprop bookkeeping PHPBaseDir value
3b) should 'html' be included at the end of the next line?
Code: [Select]
db accounts setprop bookkeeping PHPBaseDir /home/e-smith/files/ibays/bookkeeping/html/:/tmp/
3c)
Code: [Select]
signal-event ibay-modify bookkeeping
Are the above steps correct?

Once again, I really appreciate your help and encouragement on this.
Charles


guest22

Re: Phreebooks install (accounting/ERP package)
« Reply #10 on: December 16, 2012, 02:39:46 PM »
Charles2008,

I think you're almost there. I've checked the installer source code and it seems that it specifically checks for the php flag 'upload_tmp_dir' to be set for that the iBay, so maybe you still need to create a custom-fragment. I did not try myself, and maybe your app is now working correctly. If not, then I guess the post you've found before (http://forums.contribs.org/index.php/topic,48816.msg243040.html#msg243040 ) may help.

1. Check the permissions on the extracted files (should be www:www)
2. make sure that the new tmp directory has correct rights otherwise the webserver can not write to it
3a value should be /home/e-smith/files/ibays/bookkeeping/html/tmp
3b Not required, same as 3a

HTH

Offline Charles2008

  • *
  • 174
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #11 on: December 16, 2012, 03:05:19 PM »
RequestedDeletion

If 3a) and 3b) are the same - do I need the ' : '  at the end of :

Code: [Select]
db accounts setprop bookkeeping PHPBaseDir /home/e-smith/files/ibays/bookkeeping/html/:/tmp/
Charles

guest22

Re: Phreebooks install (accounting/ERP package)
« Reply #12 on: December 16, 2012, 03:08:14 PM »
This is the exact command:

db accounts setprop bookkeeping PHPBaseDir /home/e-smith/files/ibays/bookkeeping/html/tmp

for your setup

Offline Charles2008

  • *
  • 174
  • +0/-0
Re: Phreebooks install (accounting/ERP package)
« Reply #13 on: December 16, 2012, 03:42:57 PM »
RequestedDeletion

I opened my httpd.conf file:
Code: [Select]
/etc/httpd/conf/httpd.conf
and found the relevant lines referring to my bookkeeping i-bay (which is actually called 'accounts'. I changed it above to try and avoid any confusion), which I copy below:
Code: [Select]
# accounts ibay (accounts)

    ScriptAlias /accounts/cgi-bin /home/e-smith/files/ibays/accounts/cgi-bin
    Alias /accounts/files   /home/e-smith/files/ibays/accounts/files
    Alias /accounts        /home/e-smith/files/ibays/accounts/html

    # skipping SSL directives

    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]


    RewriteRule ^/server-manager(/.*|$)    https://%{HTTP_HOST}/server-manager$1 [L,R]
    <Location /server-manager>
        order deny,allow
        deny from all
        allow from 127.0.0.1 192.168.0.0/255.255.255.0
    </Location>
    RewriteRule ^/server-common(/.*|$)    https://%{HTTP_HOST}/server-common$1 [L,R]
    <Location /server-common>
        order deny,allow
        deny from all
        allow from 127.0.0.1 192.168.0.0/255.255.255.0
    </Location>
    RewriteRule ^/user-password(/.*|$)    https://%{HTTP_HOST}/user-password$1 [L,R]
    <Location /user-password>
        order deny,allow
        deny from all
        allow from 127.0.0.1 192.168.0.0/255.255.255.0
    </Location>

    RewriteRule ^/phpmyadmin(/.*|$)    https://%{HTTP_HOST}/phpmyadmin$1 [L,R]

    RewriteRule ^/webmail(/.*|$)    https://%{HTTP_HOST}/webmail$1 [L,R]
    RewriteRule ^/horde(/.*|$)    https://%{HTTP_HOST}/horde$1 [L,R]

    # alias for Apache icons
    Alias /icons/ /var/www/icons/

    # Alias for server resources
    Alias /server-resources /home/e-smith/files/server-resources/

Code: [Select]
-------------------------------------------------------------
# accounts ibay directories (accounts)
#------------------------------------------------------------

<Directory /home/e-smith/files/ibays/accounts/html>
    Options None
    Options +Indexes
    Options +Includes
    AllowOverride None
    order deny,allow
    deny from all
    allow from 127.0.0.1 192.168.0.0/255.255.255.0
    AuthName "accounts"
    AuthType Basic
    AuthExternal pwauth
    require user accounts
    Satisfy all
</Directory>

<Directory /home/e-smith/files/ibays/accounts/cgi-bin>
    Options ExecCGI
    AllowOverride None
    order deny,allow
    deny from all
    allow from 127.0.0.1 192.168.0.0/255.255.255.0
    AuthName "accounts"
    AuthType Basic
    AuthExternal pwauth
    require user accounts
    Satisfy all
</Directory>

<Directory /home/e-smith/files/ibays/accounts/files>
    AllowOverride None
    order deny,allow
    deny from all
    allow from 127.0.0.1 192.168.0.0/255.255.255.0
    AuthName "accounts"
    AuthType Basic
    AuthExternal pwauth
    require user accounts
    Satisfy all
</Directory>

<Directory /home/e-smith/files/ibays/Primary/html>
    AddType application/x-httpd-php .php .php3 .phtml
    AddType application/x-httpd-php-source .phps
    php_admin_value open_basedir /home/e-smith/files/ibays/Primary/
</Directory>

<Directory /home/e-smith/files/ibays/accounts/html>
    AddType application/x-httpd-php .php .php3 .phtml
    AddType application/x-httpd-php-source .phps
    php_admin_value open_basedir /home/e-smith/files/ibays/accounts/:/tmp/
</Directory>


Alias /wpad.dat /etc/httpd/conf/proxy/proxy.pac
<Location /wpad.dat>
    order deny,allow
    deny from all
    allow from 127.0.0.1 192.168.0.0/255.255.255.0
</Location>
Alias /proxy.pac /etc/httpd/conf/proxy/proxy.pac
<Location /proxy.pac>
    order deny,allow
    deny from all
    allow from 127.0.0.1 192.168.0.0/255.255.255.0
</Location>

<Location /server-manager/cgi-bin/backup>
    SetEnv force-proxy-request-1.0 1
</Location>

You wrote "you need the 'php_admin_value upload_tmp_dir /tmp' set in the /etc/httpd.conf [youribayname] section."
Where does the line you referred to go?

Thanks
Charles

guest22

Re: Phreebooks install (accounting/ERP package)
« Reply #14 on: December 16, 2012, 03:50:57 PM »
Charles2008,

that comes from a custom template :-)

Here is how to make that:
http://forums.contribs.org/index.php/topic,48816.msg243040.html#msg243040

Then enter on the console:

expand-template /etc/httpd/conf/httpd.conf

and

signal-event remoteaccess-update

Take a look at your httpd.conf again. My test install of phreebook in an ibay is up and running without any issues

Regards.