Sei sulla pagina 1di 7

OpenERP Installation on

Ubuntu Linux
Akhmad Daniel Sembiring
vitraining.com 2014

This book explain detailed steps requred to install OpenERP /


Odoo on Ubuntu Linux System. Starting from PostgreSQL,
creating database user, installing Python Modules required,
downloading OpenERP latest source code, configuring the server,
and finally setting it up for running as a background service.
Table of Contents
1. Introduction .....................................................................................2
2.

PostgreSQL Installation ...............................................................2

3.

Install the Python Modules ..........................................................3

4.

Download the Source Code .........................................................4

5.

Extract the Source Code ..............................................................4

6.

Configure and Run the Server .....................................................5

7.

Configure OpenERP to Run as a Service ....................................6

https://play.google.com/store/books/author?id=Akhmad+Daniel
+Sembiring ............................................................................................7
http://shop.vitraining.com ....................................................................7

OPENERP UBUNTU INSTALLATION

"1

1. Introduction
There are many ways to install OpenERP on Ubuntu, which are:
from bazaar branch, installing deb package, and from the source .
Here we are going to use the third method as it gives us more
flexibility on how to control OpenERP behaviour and version
control.
The step we need to do is to install PostgreSQL database server,
and setup the user for OpenERP to connect to the database sever.
Then we need to install all Python modules that are required by
OpenERP.
Lastly we need to download the latest source code and install it in
our local computer.

2.

PostgreSQL Installation
Use the following command at your system's command prompt
to install the PostgreSQL package:
$ sudo apt-get install postgresql

When the installation is done, we must create a PostgreSQL user


that OpenERP will use to connect to PostgreSQL.
To create and configure a PostgreSQL user for OpenERP is shown
below.
Sudo as postgres system user, type:
$ sudo su postgres

Then, create a new PostgreSQL user using createuser command:


$ createuser --createdb --username postgres \
no-createrole --pwprompt openerp

The above command should be typed in one line. The


createuser command has the following arguments:
OPENERP UBUNTU INSTALLATION

"2

--createdb: give the created user access to be able to create a


new database.
--username: run the command using the database username
postgres
--no-createrole: don't give access to create a new user role to
the created user
--pwprompt: will set the password for the created user
Typing the above command will show you something like this
where we will be asked for the created user's password and
giving it a superuser role confirmation.
Enter password for new role: XXXXXXXXXX
Enter it again: XXXXXXXXXX
Shall the new role be a superuser? (y/n) y
CREATE ROLE

Finished. Exit the postgres user console.


$ exit

3.

Install the Python Modules


Next, we need to install all of the Python modules reqired by OpenERP.
First, update apt source list to get a fresh list of the updated packages.
Type this command.
$ sudo apt-get update

Then, do an upgrade to the packages that are already installed on our


system. Type this command:
$ sudo apt-get upgrade

Then, install all of the required packages for OpenERP.


$ sudo apt-get install graphviz ghostscript \
postgresql-client python-dateutil python-feedparser\

OPENERP UBUNTU INSTALLATION

!3

python-matplotlib python-ldap python-libxslt1 \ python-lxml python-mako pythonopenid \


python-psycopg2 python-pybabel python-pychart \
python-pydot python-pyparsing python-reportlab \
python-simplejson python-tz python-vatnumber \
python-vobject python-webdav python-werkzeug \
python-xlwt python-yaml python-imaging

Install some other packages that we will probably need in future:


$ sudo apt-get install gcc python-dev mc bzr \
python-setuptools python-babel \
python-reportlab-accel python-zsi python-openssl \
python-egenix-mxdatetime python-jinja2 \
python-unittest2 python-mock python-docutils \
lptools make python-psutil python-paramiko \
poppler-utils python-pdftools

Install gdata client(download and install from source since ubuntu


package is old).
$ wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.tar.gz
$ tar zxvf gdata-2.0.17.tar.gz
$ cd gdata-2.0.17/
$ sudo python setup.py install

All Done. We are ready to install OpenERP server now.

4.

Download the Source Code


The OpenERP server can be downloaded from the OpenERP website's
download page (http://www.openerp.com/downloads).
Get the latest stable release for example openerp-7.0latest.tar.gz.
Save the downloaded from into a folder, for example /home/
openerp.

5.

Extract the Source Code


Next, extract the downloaded source code into a folder on your system.
In this example we are installing OpenERP on
/home/openerp folder.

OPENERP UBUNTU INSTALLATION

!4

$ cd /home/openerp
$ tar -xzf openerp-7.0-latest.tar.gz
$ cd openerp-7.0-xxxxxxxxx

6.

Configure and Run the Server


Copy the OpenERP configuration file from the install/
openerp-server.conf into /etc folder.
$ cd /home/openerp/openerp-7.0-xxxxxxxxx
$ cp install/openerp-server.conf /etc

Edit the configuration file to match your PostgreSQL server


setting created before. For example.
db_host = localhost
db_port = 5432
db_user = openerp
db_password = openerp
addons_path = openerp/addons/
db_host is the computer IP or hostname that act as the
PostgreSQL server.
db_port is the port number that PostgreSQL is running at,
usually 5432 by default.
db_user is the database username that OpenERP is using to
connect to PostgreSQL, for exampe openerp
db_password is the database password that OpenERP is using
to connect to PostgreSQL, for exampe openerp
addons_path is the folder location that we use to store
OpenERP addons module.

OPENERP UBUNTU INSTALLATION

!5

7.

Configure OpenERP to Run as a Service


To make OpenERP run as a service on Ubuntu we must make a
script to run it at the /etc/init.d folder.
The sample script file is already located on the OpenERP source
debian folder, so just copy it into /etc/init.d. Type this
command:
$ sudo cp /home/openerp/server/debian/openerp.init \
/etc/init.d/openerp

Then edit the file:


$ sudo vim /etc/init.d/openerp

Change this lines:


DAEMON=/usr/bin/openerp-server
CONFIG=/etc/openerp/openerp-server.conf
and set it to the correct location of the openerp-server script
file and openerp-server.conf file in our system.
DAEMON=/home/openerp/server/openerp-server
CONFIG=/etc/openerp-server.conf
Save the file and exit from the editor. Set the access right of that
file to be executable:
$ sudo chmod 755 /etc/init.d/openerp

Then set OpenERP to run as Service at service level 2, 3, 4, and 5.


$ sudo update-rc.d -f openerp start 20 2 3 4 5 .

We can then start openerp server using the service command.


$ sudo service openerp start

If necessary, try to restart the server and make sure that openerp
is started automatically after restart.
OPENERP UBUNTU INSTALLATION

!6

$ sudo reboot

Make sure that OpenERP is running now by visiting http://


localhost:8096.
The manage database screen should appear.

"

What's Next? You are ready to use OpenERP/ Odoo for your
business need. As it's a complex software, you need to do the
correct configuration and setup so that it will match your
business. Please consult my other ebooks that are intended for
specific business. You can find them on Google Play:

https://play.google.com/store/books/author?
id=Akhmad+Daniel+Sembiring
or here for PDF version and Paypal/BCA/Mandiri payment:

http://shop.vitraining.com

Enjoy!

OPENERP UBUNTU INSTALLATION

!7

Potrebbero piacerti anche