Monday, December 26, 2011

Installing OpenERP 6 on Linux Fedora 16

Author :  Blue Whale SEO
OpenERP is a comprehensive suite of business applications including Sales, CRM, Project management, Warehouse management, Manufacturing, Financial management and Human Resources just to name a few. Over 700 OpenERP modules are available on Launchpad.


Installation stages:

  1. PostgreSQL Server Installation and Configuration
  2. OpenERP Server Installation
  3. OpenERP Client Installation
  4. OpenERP Web Installation
  5. OpenERP Configuration
  6. Installation of pgAdmin 3 (optional)

System used:
  • Linux Fedora 16 (32bit), PostgresSQL 9.1, Python 2.7, OpenERP 6.0.3.
  • SElinux disabled.

PostgreSQL Server Installation and Configuration


  • Go to Applications > System Tools > Add/Remove Software, type postgresql-server into search  field and press Find OR go to Applications > System Tools > Terminal and type in this command to get PostgreSQL server installed:
sudo yum install postgresql-server postgresql

If you have a problems to run this command saying that your user is not on sudoers file, then you must apply these little changes to sudoers file:
Log in as root
su -
and use this command
Add your username under root’s line:
#Allow root to run any commands anywhere
root ALL=(ALL) ALL
donatas ALL=(ALL) ALL
  • Select package postgresql-server-9.x.x-x.fc16 and click on Apply. System will offer you two extra packages – postgresql and postgresql-libs – select Continue to continue. You also will be asked to provide root’s password.
  •  After installing the packages, a database needs to be initialized and configured. To do this use Terminal (in fact, do not close current Terminal window  during the installation process). First of all, log in as posgresql user using command
su prostgres
and then initialize the database using command
sudo initdb /var/lib/pgsql/data
  • The following commands will start PostgreSQL server and check for running PostgreSQL processes:
sudo service postgresql start
ps -eZ | grep postgres
  • Add postgresql server to startup list:
sudo chkconfig --level 235 postgresql on


  • After installation of PostgreSQL is finished, we must create a PostgreSQL user. It have to be the same user as your system user, in other words, be called the same name. In my case it’s user donatas. This user will be the owner of all tables created by OpenERP.
su postgres
createuser donatas NOTE: use the name of your system user instead of donatas!
Shall the new role be a superuser? (y/n) y
  • Let’s now check what tables has been created so far:
psql -l
  • If you can see the table template1 on the list, run the following command to use this table
psql template1
and this command to grant an access to your newly created PostgreSQL user (in this case user donatas with the password your-very_secret-password (NOTE: be creative and choose your own password!))
alter role donatas with password 'your-very_secret-password';
and get back to user’s shell
  • Changes to PostgreSQL configuration file. Open file pg_hba.conf using your preferred text editor
sudo vi /var/lib/pgsql/data/pg_hba.conf
and change following lines to
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all             all                                     ident
# IPv4 local connections:
host    all             all               ident
# IPv6 local connections:
host    all             all             ::1/128                 ident

I assume that you know how to use your favourite text editor, but if not, you can ask me for a help using comments. Save the file and restart PostgreSQL Server

sudo service postgresql restart

 NOTE: No OpenERP databases will be created during installation. It will be possible to do through the OpenERP interface (either Client or Web)

OpenERP Server Installation

  •  Let’s first install required Python libraries:
yum install python-psycopg2 python-lxml PyXML python-setuptools libxslt-python pytz python-matplotlib python-mako python-dateutil python-psycopg2 pychart pydot python-reportlab python-devel python-imaging python-vobject hippo-canvas-python mx
easy_install PyYaml
  • Now we can download OpenERP Server. At the time of writing this article it was version 6.0.3. We’ll download the package, extract it, jump to the installation folder and run installation script.
tar -xzf openerp-server-6.0.3.tar.gz
cd openerp-server-6.0.3
sudo python install

Installation process should take a place.

Installing OpenERP Client

  • Very similar way is used to install OpenERP Client
sudo yum install pygtk2 glade3 pydot python-dateutil python-matplotlib sudo yum install pygtk2 glade3 pydot python-dateutil python-matplotlib
tar -xzf openerp-client-6.0.3.tar.gz
cd openerp-client-6.0.3
sudo python install

OpenERP Web Installation

  • And quite the same steps for Web client installation too
sudo yum install python python-devel make automake gcc gcc-c++ kernel-devel byacc flashplugin-nonfree
tar -xzf openerp-web-6.0.3.tar.gz
cd openerp-web-6.0.3
sudo python install


OpenERP Configuration

I’ll try to make this part as easy to follow as I can.
Well, OpenERP is already installed. Now we need to tell Fedora to start it up at boot. For that we need to create boot script for Server and Web client and also to add some changes to their configuration files.

Server Configuration

  • OpenERP Server’s configuration file  .openerp_serverrc is located at your user’s home directory, so let’s access it first
cd /home/donatas/
and open it in terminal with the favourite editor
sudo vi .openerp_serverrc
The lines you need to change in this file:
admin_passwd = yourDBadminPassword
db_password = your-very_secret-password
db_port = 5432
db_user = donatas
Save the file and quit.

Start up

Because of some incompatibilities between systemd and SysV, like “Services are executed in completely clean execution contexts, no context of the invoking user session is inherited. Not even $HOME or similar are set. Init scripts depending on these will not work correctly. “, I decided to use different start up options here.
  • Lets first get back our old good rc.local and put two start up commands there:
sudo vi /etc/rc.d/rc.local
Make sure your file looks like this, but don’t forget to change donatas to your system user name!
su - donatas -c "/usr/bin/openerp-server --config=/home/donatas/.openerp_serverrc" &
su - donatas -c "/usr/bin/openerp-web" &
Save the file and quit your editor.
Make rc.local file executable
sudo chmod a+x /etc/rc.d/rc.local

Installation of pgAdmin 3 (optional)

pgAdmin III is a powerful administration and development platform for the PostgreSQL database, free for any use.
To install pgAdmin 3 use this command in Terminal
sudo yum install pgadmin3
OR find it on Applications > System Tools > Add/Remove Software.
To run pgAdmin use this path: Applications > Programming

Run OpenERP

Now you can access OpenERP Web client through your browser
and create new databases using password from admin_passwd line ;)
OpenERP Client can be launched using this command in Terminal


Here are some screenshots of OpenERP being up and running on Fedora 16


Courtesy : Blue Whale SEO

No comments: