Install OpenPetra on Linux   November 15th, 2013

Installing OpenPetra on Linux should be fairly easy.

Please note that the server works fine on Linux, but the client is not yet fully reliable. But the more interest and fixes it gets, the chances are higher that the client will become stable on Linux too.

We need for the server a patched version of Mono, for the .Net remoting. In the future we aim to switch away from .net remoting to https, but that is still experimental.
The client should be fine with Mono 2.10 upwards.

Install Mono 3.2.3 with OpenPetra patches:
The mono-openpetra package is available for Debian, Ubuntu and CentOS from http://software.opensuse.org/download.html?project=home%3Atpokorra%3Aopenpetra&package=mono-openpetra.
Please follow the instructions there for installing Mono.

I will do this tutorial with Ubuntu LTS 12.04 (precise):

wget http://download.opensuse.org/repositories/home:tpokorra:openpetra/xUbuntu_12.04/Release.key
apt-key add - < Release.key echo 'deb http://download.opensuse.org/repositories/home:tpokorra:openpetra/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/mono-openpetra.list
apt-get update
apt-get install mono-openpetra

Next thing is to install Postgresql 9.1:

apt-get install postgresql

Now you download the latest release of OpenPetra for Linux from Sourceforge OpenPetra Downloads:

wget http://sourceforge.net/projects/openpetraorg/files/openpetraorg/OpenPetra.org%20Alpha%200.2/openpetraorg-server-debian-postgresql-MyOpenPetra-0.2.26.4.tar.gz/download -O openpetraorg-server-debian-postgresql-MyOpenPetra-0.2.26.4.tar.gz

There is also a package available for CentOS/RedHat based distributions:

wget http://sourceforge.net/projects/openpetraorg/files/openpetraorg/OpenPetra.org%20Alpha%200.2/openpetraorg-server-centos-postgresql-MyOpenPetra-0.2.26.4.tar.gz/download -O openpetraorg-server-centos-postgresql-MyOpenPetra-0.2.26.4.tar.gz

By the way, the code for this release is currently maintained here: https://github.com/openpetra/openpetra/tree/Alpha-0.2.26-Linux

Now, unpack your server tar.gz file:

tar xzf openpetraorg-server-debian-postgresql-MyOpenPetra-0.2.26.4.tar.gz
cd openpetraorg-0.2.26.4
# have a look at the INSTALL file
cat INSTALL
cp config-sample.sh config.sh
# have a look at config.sh; we are not configuring the .net remoting keys at the moment
cat config.sh
. config.sh
./setup.sh

Next thing, you initialise the database:

/etc/init.d/openpetraMyOpenPetra createdb
/etc/init.d/openpetraMyOpenPetra init
/etc/init.d/openpetraMyOpenPetra start

If you get an error like “Possible cause: Npgsql.NpgsqlException: Failed to establish a connection to ‘localhost’.”, try to edit /etc/postgresql/9.1/main/postgresql.conf and enable listen_addresses = '*'. Then service postgresql restart. I don’t currently know why this is necessary on my computer.

Now you should download an empty database, or a demo database from Sourceforge Demo Databases:

wget http://sourceforge.net/projects/openpetraorg/files/openpetraorg/demodata/demoWith1ledger.yml.gz/download -O /tmp/demoWith1ledger.yml.gz

Then load this database:

/etc/init.d/openpetraMyOpenPetra loadYmlGz /tmp/demoWith1ledger.yml.gz

Please note that the path for the demo file must be readable by the user that the openpetra server is running under, that is why I am using the /tmp directory.

For the OpenPetra client on Linux, you also need to install mono-openpetra-libgdiplus:

apt-get install mono-openpetra-libgdiplus

Get the linux client, and unpack it:

wget http://sourceforge.net/projects/openpetraorg/files/openpetraorg/OpenPetra.org%20Alpha%200.2/openpetraorg-client-MyOpenPetra-0.2.26.4.tar.gz/download -O openpetraorg-client-MyOpenPetra-0.2.26.4.tar.gz
tar xzf openpetraorg-client-MyOpenPetra-0.2.26.4.tar.gz
cd openpetraorg-0.2.26.4
./startClient.sh

At the moment, the communication between client and server is not encrypted. This can be enabled though, or you can use a VPN.
We are working on switching to https, replacing .Net remoting in the near future.

To connect the client to another server than localhost, you need to modify the file etc30/PetraClientRemote.config in the client directory, search for localhost and replace it with the hostname of your server! You might need to work on the firewall settings of the server, to allow communication on port 9000, or change to a more common port, eg. 80.

Known issues in the OpenPetra client for Linux:

  • There will be a message, that the patches cannot be found. Please ignore that, and try to login with user demo and password demo!
  • Partner Find layout of the window is broken.  Sometimes it does not find partners, says: no criteria. Workaround: tab out of current control. It worked for me the second time I opened the Find partner screen.
  • Partner Edit screen: also gives lots of errors. Cannot close without saving, when saving complains about empty address.
    The finance screens (Gift Batch, GL Batch, etc) might work better.

The question is: should we invest into the fat OpenPetra client to run on Linux and on Mac, or should we work on a client running in the browser, eg. based on Twitter Bootstrap, see the OpenPetra Demo with Twitter Bootstrap!

Tags: ,
This entry was posted on Friday, November 15th, 2013 at 12:05 pm and is filed under Software Development. You can follow any responses to this entry through the RSS 2.0 feed.Both comments and pings are currently closed.

No Responses