Koozali.org: home of the SME Server

Installing openbravo 3.0 - community Edition - MP31.1

Offline warren

  • *
  • 293
  • +0/-0
Installing openbravo 3.0 - community Edition - MP31.1
« on: February 20, 2014, 02:11:40 PM »
I was wanting to try out Openbravo and tried the Instructions at http://wiki.contribs.org/Openbravo

However i kept on getting an error about the wrong version of ant  :x  and also wanted to test a newer release.

Below are my notes for getting it up and running  :-D on my test server : YMMV 
Note it seems to want a fair amount of grunt from server to run it. I'm using a corei5 with 8GB ram. ( initially tried it on a Intel(R) Core(TM)2 CPU   T5500  @ 1.66GHz with 2G Ram and it barfed )



Quote
]Installing openbravo 3.0 - community Edition - MP31.1  :  (openbravo-3.0MP31.1 ) on SME 8

Step 1 : Install postgres as per SME howto Follow Wiki how to : ==> http://wiki.contribs.org/Postgres
Install only , dont do the configure postgres steps now.

A). NOTE : Open bravo needs postgres version > 8.1.23
follow step 2

Step 2 : Upgrade Postgres to Version 8.4.19

A) . create yum repo for upgrading postgres ( refer : http://forums.contribs.org/index.php/topic,47374.msg238234.html#msg238234 )

db yum_repositories set pgdg84 repository \
 BaseURL http://yum.postgresql.org/8.4/redhat/rhel-5.0-i386/ \
 GPGCheck no \
 GPGKey file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG \
 Name 'PostgreSQL 8.4'\
 Visible no \
 status disabled

signal-event yum-modify

db yum_repositories setprop base `db yum_repositories show base | grep -i exclude | awk -F"=" '{print $1" "$2",postgresql*"}'`
db yum_repositories setprop updates `db yum_repositories show updates | grep -i exclude | awk -F"=" '{print $1" "$2",postgresql*"}'`
signal-event yum-modify
yum --enablerepo=pgdg84 update

[root@bravo db]# yum --enablerepo=pgdg84 update

Loaded plugins: fastestmirror, protect-packages, smeserver
Loading mirror speeds from cached hostfile
 * base: mirror.ufs.ac.za
 * smeaddons: mirror.absolutnet.de
 * smeextras: mirror.absolutnet.de
 * smeos: mirror.absolutnet.de
 * smeupdates: mirror.absolutnet.de
 * updates: mirror.ufs.ac.za
pgdg84                   | 2.1 kB     00:00
pgdg84/primary_db       |  78 kB     00:00
Excluding Packages from CentOS - os
Finished
Excluding Packages from CentOS - updates
Finished
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package postgresql.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-contrib.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-devel.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-docs.i386 0:8.4.19-1PGDG.rhel5 set to be updated
--> Processing Dependency: libpq.so.4 for package: dovecot
--> Processing Dependency: libpq.so.4 for package: apr-util
--> Processing Dependency: libpq.so.4 for package: postgresql-python
---> Package postgresql-libs.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-plperl.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-plpython.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-pltcl.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-server.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package postgresql-test.i386 0:8.4.19-1PGDG.rhel5 set to be updated
---> Package uuid.i386 0:1.5.1-4.rhel5 set to be updated
---> Package uuid-perl.i386 0:1.5.1-4.rhel5 set to be updated
--> Running transaction check
---> Package compat-postgresql-libs.i686 0:4-1PGDG.rhel5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================
 Package                                       Arch                        Version                                      Repository                     Size
============================================================================================================================================================
Installing:
 postgresql-plperl                             i386                        8.4.19-1PGDG.rhel5                           pgdg84                         51 k
     replacing  postgresql-pl.i386 8.1.23-6.el5_8

 postgresql-plpython                           i386                        8.4.19-1PGDG.rhel5                           pgdg84                         49 k
     replacing  postgresql-pl.i386 8.1.23-6.el5_8

 postgresql-pltcl                              i386                        8.4.19-1PGDG.rhel5                           pgdg84                         35 k
     replacing  postgresql-pl.i386 8.1.23-6.el5_8

Updating:
 postgresql                                    i386                        8.4.19-1PGDG.rhel5                           pgdg84                        1.6 M
 postgresql-contrib                            i386                        8.4.19-1PGDG.rhel5                           pgdg84                        433 k
 postgresql-devel                              i386                        8.4.19-1PGDG.rhel5                           pgdg84                        1.5 M
 postgresql-docs                               i386                        8.4.19-1PGDG.rhel5                           pgdg84                         11 M
 postgresql-libs                               i386                        8.4.19-1PGDG.rhel5                           pgdg84                        211 k
 postgresql-server                             i386                        8.4.19-1PGDG.rhel5                           pgdg84                        5.1 M
 postgresql-test                               i386                        8.4.19-1PGDG.rhel5                           pgdg84                        1.3 M
 uuid                                          i386                        1.5.1-4.rhel5                                pgdg84                         53 k
 uuid-perl                                     i386                        1.5.1-4.rhel5                                pgdg84                         25 k
Installing for dependencies:
 compat-postgresql-libs                        i686                        4-1PGDG.rhel5                                pgdg84                         63 k

Transaction Summary
============================================================================================================================================================
Install       4 Package(s)
Upgrade       9 Package(s)

Total download size: 21 M
Is this ok [y/N]:Y


Step 3 : Check Postgres  Encoding for Openbravo

 Initialise the database first :

/etc/init.d/postgresql initdb

[root@bravo db]# /etc/init.d/postgresql initdb
Initializing database:                                     [  OK  ]

Start Postgres  :
[root@bravo db]# /etc/init.d/postgresql start

Starting postgresql service:                               [  OK  ]
Check postgres encoding :

su postgres
bash-3.2$ psql -l

                              List of databases
   Name    |  Owner   | Encoding | Collation | Ctype |   Access privileges
-----------+----------+----------+-----------+-------+-----------------------
 postgres  | postgres | LATIN1   | en_US     | en_US |
 template0 | postgres | LATIN1   | en_US     | en_US | =c/postgres
                                                     : postgres=CTc/postgres
 template1 | postgres | LATIN1   | en_US     | en_US | =c/postgres
                                                     : postgres=CTc/postgres
(3 rows)

NOTE : We need the Encoding and Collation to be as follows for Openbravo :
                               
                        List of databases
   Name    |  Owner   | Encoding | Collation  |   Ctype    | Access privileges
-----------+----------+----------+------------+------------+-------------------
 openbravo | tad      | UTF8     | en_US.utf8 | en_US.utf8 |
 postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 |
 template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 |
 template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 |

Change Encoding & Collation on Postgres : template0

postgres=# update pg_database set datistemplate=false where datname='template1';
UPDATE 1
postgres=# drop database template1;
DROP DATABASE
postgres=# create database template1 with owner=postgres encoding='UTF-8'
postgres-#
postgres-#   lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
CREATE DATABASE


Change Encoding & Collation on Postgres : template1
postgres=# update pg_database set datistemplate=false where datname='template0';
UPDATE 1
postgres=# drop database template0;
DROP DATABASE
postgres=# create database template0 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template1;
CREATE DATABASE

Change Encoding & Collation on Postgres : postgres
bash-3.2$ psql -U postgres template1
template1=#
template1=# update pg_database set datistemplate=false where datname='postgres';
UPDATE 1
template1=# drop database postgres;
DROP DATABASE
template1=#  create database postgres with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template1;
CREATE DATABASE
template1=# \q

Check Database Encoding :
bash-3.2$ psql -l
                               List of databases
   Name    |  Owner   | Encoding | Collation  |   Ctype    | Access privileges
-----------+----------+----------+------------+------------+-------------------
 postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 |
 template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 |
 template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 |
(3 rows)

Step 4 : Configure postgres as per wiki

 Start postgres ( if not already started )

/etc/init.d/postgresql start

Then make the necessary custom templates:

mkdir -p /etc/e-smith/templates/var/lib/pgsql/data
mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data
cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates/var/lib/pgsql/data
cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates/var/lib/pgsql/data
cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates-custom/var/lib/pgsql/data

Now login as postgres user:
   su postgres
   Then access to superuser database, set a password and exit.
   psql -U postgres -d template1
   alter user postgres with encrypted password 'add_your_pass_here';
   \q
   exit

Edit the file /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf remove # and change the following settings:
   superuser_reserved_connections=2
   ssl = on
   password_encryption = on
   listen_addresses = 'localhost'

Then copy your server SSL keys and Crt files:
find your sme server keys :
# find ./ -depth -name "yourFQDN.crt" -print
/home/e-smith/ssl.crt/yourFQDN.crt
# find ./ -depth -name "yourFQDN.key" -print
/home/e-smith/ssl.crt/yourFQDN.key
cd cd /var/lib/pgsql/data
cp /home/e-smith/ssl.crt/yourFQDN.crt .
cp /home/e-smith/ssl.crt/yourFQDN.key

mv yourFQDN.crt  server.crt
mv yourFQDN.key server.key
chmod 400 server.key
chown postgres:postgres server*

Edit the file /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf and change the following settings:

local    all   all                    md5
host     all   all    127.0.0.1/32    md5
host     all   all    ::1/128         md5

and add at the end:

host    all    all    0.0.0.0 255.255.255.255  reject

Be sure to add an extra white line at the end.That why you got an extra line on above box!
Expand template:

expand-template /var/lib/pgsql/data/pg_hba.conf
expand-template /var/lib/pgsql/data/postgresql.conf

Restart with new settings:

/etc/init.d/postgresql stop
/etc/init.d/postgresql start


and add the symlinks to start automatically:

ln -s /etc/init.d/postgresql /etc/rc.d/rc7.d/S56postgresql
ln -s /etc/init.d/postgresql /etc/rc.d/rc6.d/K03postgresql

To ensure everything is all right:

signal-event post-upgrade
signal-event reboot

Step 5: Install Tomcat as per wiki ( http://wiki.contribs.org/Tomcat )

Adjust as necessary for the version of java installed. ( i used  ln -s /usr/java/jdk1.7.0_51 /usr/java/jdk )
Download tomcat last version :
( apache-tomcat-6.0.39.tar.gz )
    Unpack archive
    Unzip and move it
tar -xvzf apache-tomcat-6.0.39.tar.gz
mv apache-tomcat-6.0.39 /opt/
cd /opt
mv apache-tomcat-6.0.39 tomcat
    Create user and group

groupadd tomcat
useradd -g tomcat -d /opt/tomcat tomcat
chown -R tomcat:tomcat /opt/tomcat/
chmod 770 /opt/tomcat/
    Create statup script

Edit /etc/rc.d/init.d/tomcat with your favorite text editor, it should contain the following :

#! /bin/bash
#
# tomcat Start the tomcat server.
#

NAME="Jakarta Tomcat 6"
TOMCAT_HOME=/opt/tomcat
CATALINA_HOME=/opt/tomcat
JAVA_HOME=/usr/java/jdk
CATALINA_OPTS="-Dfile.encoding=iso8859-1"
TOMCAT_USER=tomcat
LC_ALL=en_US
export TOMCAT_HOME CATALINA_HOME JAVA_HOME CATALINA_OPTS TOMCAT_USER LC_ALL
cd $TOMCAT_HOME/logs
case "$1" in
  start)
    echo -ne "Starting $NAME.\n"
    /bin/su $TOMCAT_USER $TOMCAT_HOME/bin/startup.sh
    ;;

  stop)
    echo -ne "Stopping $NAME.\n"
    /bin/su $TOMCAT_USER $TOMCAT_HOME/bin/shutdown.sh
    ;;

  *)
    echo "Usage: /etc/init.d/tomcat {start|stop}"
    exit 1
    ;;
esac
exit 0


   Make startup script runable and make tomcat start automatically at boot

chmod 755 /etc/rc.d/init.d/tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc.d/rc7.d/S98tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc.d/rc6.d/K02tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc.d/rc2.d/K02tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc.d/rc1.d/K02tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc.d/rc0.d/K02tomcat


Optional ??: Enable manager access to tomcat manager
cd /opt/tomcat/conf
nano tomcat-users.xml
Add lines needed :
 <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager-gui"/>
  <user username="tomcat" password="xxxxxxxxxxxx" roles="manager-gui,tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>

Save file.

Start Tomcat : and check access ( http://server_ip:8080/ )
/etc/rc.d/init.d/tomcat

Step 6 : Download and configure Open bravo components :

Ant Down load and setup :
download apache-ant-1.9.3-bin.tar.gz
tar xzvf  apache-ant-1.9.3-bin.tar.gz
cp -rf apache-ant-1.9.3 /usr/local/ant

Download Open Bravo ( openbravo-3.0MP31.1.tar.bz2 )

extract  tar -xvf openbravo-3.0MP31.1.tar.bz2
cd  Openbravo-3.0MP31.1

chown -R root:root *

Follow : (http://wiki.openbravo.com/wiki/Installation/Custom/Openbravo_Setup) custom section

/usr/local/ant/bin/ant setup
Buildfile: /root/contribs/Openbravo-3.0MP31.1/build.xml
setup.check.os:
setup.check.arch:
setup.exists.test:
setup:
 [get] Getting: https://code.openbravo.com/tools/rm/erp-setup-tool/raw-file/tip/setup/output/setup-properties-linux.bin
      [get] To: /root/contribs/Openbravo-3.0MP31.1/config/setup-properties-linux.bin
      [get] ....................................................
      [get] ....................................................
      [get] ............................
BUILD SUCCESSFUL
Total time: 12 seconds


Move to the OpenbravoERP-3.0MP31.1/config directory.
make executable and run setup-properties-linux.bin

#  ./setup-properties-linux.bin
Follow lic agreement and answer : y
Date option : 1
Date Separator : 1
Time foramt ; 2
Time separator : 1
Openbravo ERP: general options
General Openbravo ERP stack configuration
Attachments directory [/opt/openbravo/attachments]: enter
Context name [openbravo]: enter
Web URL [@actual_url_context@/web]: enter
Context URL [http://localhost:8080/openbravo]: http://ip_address:8080/openbravo
Development parameters
Parameters for development
Output script location [databasescript.sql]: enter
DB-XML operations log verbosity
[1] DEBUG
[2] INFO
[3] WARN
[4] ERROR
[5] FATAL
Please choose an option [2] :enter
Database
Please select a database
[1] Oracle
[2] PostgreSQL
Please choose an option [2] :enter
Database: PostgreSQL configuration
Parameters for PostgreSQL Database configuration
DB Name [openbravo]:enter
Admin Role [postgres]: enter
Admin Role Password [syspass]: ThePaswordyou entered when configured postgres
DB Role [tad]: enter
DB Role Password [tad]: enter
DB Server Address [localhost]: enter
DB Server Port [5432]: enter
Tomcat Manager configuration
Set up the Tomcat Manager
Tomcat Manager URL [http://localhost:8080/manager]: http://192.168.1.253:8080/manager
Tomcat manager username [admin]: tomcat
Tomcat manager password [admin]: the password set in the tomcat config file (tomcat-users.xml )
Pentaho (optional)
Set up Openbravo ERP to connect to a Pentaho Server. This step is optional.
Pentaho Server []: enter
Authentication class []: enter
Setup is now ready to begin installing Openbravo ERP on your computer.

Do you want to continue? [Y/n]:y
Please wait while Setup installs Openbravo ERP on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
Setup has finished installing Openbravo ERP on your computer.

Allow Ant to run as user root !!

nano Openbravo.properties
change line to following:
   # You are not allowed to run ant commands with the root user.
   # Set allow.root to true to override this.
   allow.root=true

Save file.

cd Openbravo-3.0MP31.1

Export / set the java home variable : ( edit profile and add )
CATALINA_HOME=/opt/tomcat
JAVA_HOME=/usr/java/jdk
EXPORT PATH  JAVA_HOME CATALINA_HOME

Logout and logon again to invoke JAVA_HOME etc


# cd /Openbravo-3.0MP31.1

# /usr/local/ant/bin/ant install.source
........
...
BUILD SUCCESSFUL
Total time: 4 minutes 4 seconds

CHECK PERMISSIONS ON /opt/tomcat/webapps/openbravo

cd /opt/tomcat/webapps
chown -R tomcat:tomcat openbravo

Restart tomcat
Logon to tomcat  : http://ip_address:8080/
Click on manager
Click on list applications
/openbravo   should be running
Accessing Openbravo
To access Openbravo type http://ip_address:8080/openbravo/ in your web browser. Use Openbravo as the username and openbravo as the password.
NOTE: The username is Openbravo, with an uppercase O. The password is openbravo, with a lowercase o. The system is case-sensitive, and you need to type both data elements correctly to access it.




Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Installing openbravo 3.0 - community Edition - MP31.1
« Reply #1 on: February 20, 2014, 02:44:01 PM »
if you need ant rpm packaged, you could use the fedora src you can find here:

http://rpmfind.net/linux/rpm2html/search.php?query=ant

and recompile (not tested)