Sunday, September 1, 2013

Installing OpenERP on CentOS 6

openerp logo

What is OpenERP?

OpenERP is an open source full suite of Business software, and is published under the AGPL license. 
OpenERP contains over 700 modules such as sales management, Customer Relationship Management (CRM), warehouse management, association, project management, human resources management, point of sales and around

Installing OpenERP on CentOS 6

Installing OpenERP on CentOS can be tricky due to the lack of documentations. Most of the documentations are for Ubuntu/Debian distro.

OpenERP requires Python and PostgreSQL to run.

First step is to update the OS System & Packages
yum -y update

Installing wget in case it's not installed

yum -y install wget

Downloading the epel-release (Extra Packages for Enterprise Linux) and installing the packages

rpm -ivh

Downloading the PostgreSQL and installing the packages
rpm -ivh

Installing Packages & Dependencies

yum -y install python-psycopg2 python-lxml PyXML python-setuptools libxslt-python pytz python-matplotlib python-babel python-mako python-dateutil python-psycopg2 pychart pydot python-reportlab python-devel python-imaging python-vobject hippo-canvas-python mx python-gdata python-ldap python-openid python-werkzeug python-vatnumber pygtk2 glade3 pydot python-dateutil python-matplotlib pygtk2 glade3 pydot python-dateutil python-matplotlib python python-devel python-psutil python-docutils make automake gcc gcc-c++ kernel-devel byacc flashplugin-nonfree postgresql91-libs postgresql91-server postgresql91 libxslt-devel

Initializing PostgreSQL
service postgresql-9.1 initdb

Allowing remote access to PostgreSQL
echo "listen_addresses = '*'" >> /var/lib/pgsql/9.1/data/postgresql.conf

By Default, PostgreSQL refuses all connections, so we have to add the IP addresses and subnet.
You can replace by your IP address and subnet mask to allow access from a certain IP address.

echo "host all all md5" >> /var/lib/pgsql/9.1/data/pg_hba.conf

Starting PostgreSQL
service postgresql-9.1 start

Starting PostgreSQL after every reboot
chkconfig postgresql-9.1 on

Creating PostgreSQL user and database
su - postgres -c "createuser --pwprompt --createdb --no-createrole --no-superuser openerp"

Downloading the Python client library for Google data APIs
cd /tmp
Unziping and Installing it
rm -rf
cd gdata*
python install

 Adding OpenERP user to work with OpenERP. Never use root!
adduser openerp

Creating runtime directory and log directory and changing the owner to the previous created user
mkdir /var/run/openerp
mkdir /var/log/openerp
chown openerp.openerp /var/run/openerp

If a previous version of openerp exists, remove it
rm -rf openerp*

Downloading OpenERP, extracting it to a directory called "openerp", and installing it
tar -zxvf openerp-7.0-latest.tar.gz  --transform 's!^[^/]\+\($\|/\)!openerp\1!'
cd openerp
python install

If OpenERP was previously installed, remove it
rm -rf /usr/local/bin/openerp-server

Copy configuration files from OpenERP directory to their correct destination
cp openerp-server /usr/local/bin
cp install/openerp-server.init /etc/init.d/openerp
cp install/openerp-server.conf /etc
chmod u+x /etc/init.d/openerp

Start OpenERP after every reboot
chkconfig openerp on
Start OpenERP
service openerp start

That's it!
You should be able to access OpenERP on your server's IP, port 8069

And you should see a screen like this:

OpenERP on CentOS 6

Have some questions? Leave us a comment below!