From iDempiere
Jump to navigation Jump to search

This page describes the setup of the FreiBier demo server:

what this server should do

It should become the/a demo server of the idempiere project.

I want to use it for more than one idempiere instance. I want to define and try out workflows, scripts and best practices for this purpose.

All different projects and idempiere instances should be divided as separate linux and postgres users.

The server should work with different domain names for the different projects.

what I did to install this server

base installation

 aptitude update
 aptitude install joe rsync unzip psmisc
 aptitude install openjdk-6-jdk
 aptitude install postgresql-9.1
 aptitude install nginx

postgresql configuration

 # su postgres -c psql
 postgres=# ALTER ROLE postgres UNENCRYPTED PASSWORD 'meinpasswort';
 postgres=# \q

nginx configuration

I created a file /etc/nginx/sites-available/

 server {
   listen        80;
   root          /home/idempiere/;
   location / {
     proxy_pass          http://localhost:8081;
     proxy_set_header    X-Real-IP $remote_addr;
     proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header    Host $http_host;

firewall configuration be done

idempiere setup

as root:

 adduser freibier

From my home system I copied the resulting package of my build script:


I did a standard installation via and into a database freibier.

Then I made a backup of the database and recreated it under a different user id:

 $ pg_dump -h localhost -U adempiere --format=plain -O --serializable-deferrable --file backup/idempiere-`date +%Y%m%d%H%M`.sql.gz -Z 9 freibier
 # su - root
 # su postgres -c "psql -c 'ALTER DATABASE freibier RENAME TO freibier_new'"
 # su postgres -c "psql -c \"CREATE USER freibier WITH ENCRYPTED PASSWORD 'MYSECRETPASSWORD' \""
 # su postgres -c "psql -c \"CREATE DATABASE freibier OWNER freibier \""
 # su postgres -c "psql -c \"ALTER ROLE freibier SET search_path = adempiere, pg_catalog \" freibier"
 # exit
 $ zcat backup/idempiere-`date +%Y%m%d`*.sql.gz | psql --file - freibier

Start and Stop the Server

This should be automated. For the moment I use these commands as user "freibier":

 $ export -n DISPLAY; cd idempiere-server; ./ &> log/idempiere_`date +%Y%m%d%H%M%S`.log&
 $ killall java