1. Openbravo ERP Tutorial
Ubuntu Installation
As a Part of
Wirabumi Software Managed Service
July 2011
Wirabumi Software
CV. Wirabumi Openbravo Indonesia
www.wirabumisoftware.com
4. Objective
The objective of this document is guide you to install Openbravo ERP on the top of ubuntu server
operating system.
After studying this tutorial, you will be able to:
• Preparing Openbravo ERP environment on Ubuntu
• Install all required dependencies:
◦ OpenJDK JDK and OpenJDK JRE
◦ PostgreSQL
◦ Apache Tomcat
◦ Ant
• install Openbravo ERP from source
Tutorial instalasi-en - 06/18/11 4/12
5. Change Log
Version Revision date PIC Description
1 05/07/2011 Zaien Start
2 07/11/2011 Zaien Add correction to setup environment variable
Add new content for backup/restore using snapshot.xml
3 01/08/2012 Zaien Update to PostgreSQL 9.1
Remove snapshot.xml and replace it using pg_dump and
zip
Upgrade Openbravo ERP source to 2.50MP43
Tutorial instalasi-en - 06/18/11 5/12
6. 1 Install PostgreSQL
PostgreSQL is a server database used by Openbravo. Minimum required version is 8.3.5. Beside
PostgreSQL server, you need also contrib module to install pl/pgsql and UUID.
Install PostgreSQL using Ubuntu APT:
sudo apt-get install postgresql postgresql-contrib
By default, Postgresql installation come with default user Ubuntu, but without password. Change the
password using command below:
sudo /etc/init.d/postgresql start
sudo su - postgres -c psql
alter role postgres with password 'new_password';
q
2 Install Sun JDK
Java Development Kit used when compile source of Openbravo ERP. You must add an APT repository
line deb http://ppa.launchpad.net/pitti/postgresql/ubuntu lucid main, to enable you install OpenJDK
JDK and OpenJDK JRE on your Ubuntu.
Add ubuntu repository line to install PostgreSQL by editing source.list:
sudo nano /etc/apt/source.list
Add new line in the bottom part of source.list:
deb http://ppa.launchpad.net/pitti/postgresql/ubuntu lucid main
Save source.list, then install OpenJDK JDK and OpenJDK JRE using ATPT:
sudo apt-get install openjdk-6-jdk openjdk-6-jre
Set OpenJDK as default JDK:
sudo update-java-alternatives -s java-1.6.0-openjdk-amd64
Add environment variable for JAVA_HOME:
echo 'JAVA_HOME="/usr/lib/jvm/java-1.6.0-openjdk-amd64"' | sudo tee -a
/etc/environment
Add environment variable for JAVA_OPTS:
echo 'JAVA_OPTS="-Djava.awt.headless=true -Xms384m -Xmx1024m
-XX:PermSize=128m -XX:MaxPermSize=256m"' | sudo tee -a /etc/environment
Tutorial instalasi-en - 06/18/11 6/12
7. Apply your new environment variable in your session:
source /etc/environment
3 Install Apache Tomcat
Apache Tomcat is a web container, used as a web server where Openbravo hosted.
Install tomcat using APT:
sudo apt-get install tomcat6 tomcat6-admin
Start tomcat:
sudo /etc/init.d/tomcat6 start
Make sure your installation is correct by access your tomcat at http://localhost:8080
Add environment variable CATALINA_HOME, CATALINA_BASE, and CATALINA_OPTS
echo 'CATALINA_HOME="/usr/share/tomcat6"' | sudo tee -a /etc/environment
echo 'CATALINA_BASE="/var/lib/tomcat6"' | sudo tee -a /etc/environment
echo 'CATALINA_OPTS="-Djava.awt.headless=true -Xms384m -Xmx1024m
-XX:PermSize=128m -XX:MaxPermSize=256m"
Edit file /usr/share/tomcat6/bin/catalina.sh, add line after comment at the top of this file:
echo 'CATALINA_HOME="/usr/share/tomcat6"' | sudo tee -a /etc/environment
echo 'CATALINA_BASE="/var/lib/tomcat6"' | sudo tee -a /etc/environment
echo 'CATALINA_OPTS="-Djava.awt.headless=true -Xms384m -Xmx1024m
-XX:PermSize=128m -XX:MaxPermSize=256m"'
Apply your new environment variable in your session:
source /etc/environment
Edit file /var/lib/tomcat6/conf/tomcat-users.xml to add manager user:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<user username="admin" password="admin" roles="manager"/>
</tomcat-users>
Restart apache tomcat:
sudo service tomcat6 restart
Make sure your configuration is correct by access your tomcat manager at
http://localhost:8080:/manager/html
username: admin, password: admin
Tutorial instalasi-en - 06/18/11 7/12
8. 4 Install Ant
Ant is a java build tool, used when build Openbravo ERP. Install ant using APT:
sudo apt-get install ant ant-optional
Create environment variable for ANT_HOME and ANT_OPTS:
echo 'ANT_HOME="/usr/share/ant"' | sudo tee -a /etc/environment
echo 'ANT_OPTS="-Xmx1024M -XX:MaxPermSize=128M"' | sudo tee
-a /etc/environment
Apply your new environment variable in your session:
source /etc/environment
5 Openbravo.properties Configuration
Parameters inside Openbravo.properties will be used when you compile source Openbravo. Fill
required data with correct information. Extract source Openbravo on desired folder. For next step, we
will call this folder as OPENBRAVO_HOME. Openbravo Source can be downloaded at:
http://dl.dropbox.com/u/17925381/OpenbravoERP-2.50MP43.obx.
Using command line terminal, go to OPENBRAVO_HOME, download openbravo configuration
wizard:
ant setup
go to folder config, add executable permission on configuration wizard file:
chmod +x setup-properties-linux.bin
Run configuration wizard file:
./setup-properties-linux.bin
Tutorial instalasi-en - 06/18/11 8/12
9. 1. Date time option: [self explanation].
2. Stack configuration:
1. attachment directory: select your attachment folder. For example of an attachment is
print out result of an invoice, a picture, PDF, etc. Fill it using:
OPENBRAVO_HOME/attachment.
2. context name: application name that registered on tomcat, leave it default.
3. web URL: web address of openbravo on tomcat, leave it default.
4. context URL: web parent address of openbravo, leave it default.
3. development parameter: used for openbravo development purpose, leave if default.
4. Server database: select PostgreSQL.
5. Parameter on PostgreSQL:
1. DB name: database name of openbravo. Fill it : openbravo.
2. admin role: super user name of server database PostgreSQL. Fill it: postgres.
3. admin role password: password of super user. Fill it regarding your password supplied as
explanation on 1st chapter.
4. DB role: user on server PostgreSQL who will access Openbravo database. Fill it: tad.
Tutorial instalasi-en - 06/18/11 9/12
10. 5. DB role password: password of user on server PostgreSQL who will access Openbravo
database. Fill it: tad.
6. DB server address: server address of postgresql. Fill it: localhost.
7. DB server port: port of PostgreSQL. Leave it default (5432).
6. Tomcat configuration:
1. tomcat manager URL: Application address of manager tomcat, leave it default.
2. tomcat admin username: user name of tomcat manager, fill it: admin.
3. tomcat admin password: password of user name of tomcat manager, fill it: admin.
7. Pentaho server: not applied for now, leave it blank.
Finish process by click forward.
6 Compile Source Openbravo
If your command line terminal that you use in previous chapter, please close it and open again to refesh
your session with your new environment variable. Now Openbravo ERP is ready for compile process.
Go to OPENBRAVO_HOME folder using this command line terminal, compile openbravo using
command below:
ant install.source
Be patient, this process may take several minutes, depend on your machine, but average on dual core
PC is about 30 minutes.
After compile process finished successfully, restart your tomcat:
sudo service tomcat6 restart
Wait for a moment (about 1 minute), tomcat is now deploying openbravo. Open your openbravo using
web browser (Internet explorer, Mozilla Firefox, etc) on address: http://localhost:8080/openbravo. You
Tutorial instalasi-en - 06/18/11 10/12
11. will get a login page of Openbravo. Please login with default user/password: username: Openbravo,
password: openbravo. This username/password is case sensitive.
Tutorial instalasi-en - 06/18/11 11/12
12. 7 Backup/Restore Openbravo
To backup openbravo, there are 2 part you need to backup:
1. database
2. source file in OPENBRAVO_HOME
To backup your database, backup it using pg_dump:
pg_dump -U postgres -h localhost -p 5432 -F c -v openbravo >
openbravo.backup
those command will produce a file named openbravo.backup, containing all your database information
of openbravo DB, located in your current folder.
To backup your OPENBRAVO_HOME you can zip all file into single zip file. Go to
OPENBRAVO_HOME, run command below:
zip Openbravo.zip -r .
those command will produce a file named Openbravo.zip, containing all your OPENBRAVO_HOME
files, located in OPENBRAVO_HOME.
To restore database, go to the folder that contain your DB backup, create a new database (drop it first if
exists):
dropdb -U postgres -h localhost -p 5432 openbravo
createdb -U postgres -h localhost -p 5432 openbravo
pg_restore -U postgres -h localhost -p 5432 -F c -v -d openbravo <
openbravo.backup
To restore OPENBRAVO_HOME, remove all file inside OPENBRAVO_HOME, copy your backup
(zip file) to your OPENBRAVO_HOME, then extract your backup zip file:
unzip Openbravo.zip -d .
Compile new restored backup:
ant smartbuild
After process finished successfully, restart tomcat, and wait for a moment (about 1 minute), tomcat is
now deploying openbravo. Open your openbravo using web browser (Internet explorer, Mozilla
Firefox, etc) on address: http://localhost:8080/openbravo.
Tutorial instalasi-en - 06/18/11 12/12