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 http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Downloading the PostgreSQL and installing the packages
rpm -ivh http://yum.pgrpms.org/9.1/redhat/rhel-6Server-x86_64/pgdg-redhat91-9.1-5.noarch.rpm

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 0.0.0.0/0 by your IP address and subnet mask to allow access from a certain IP address.

echo "host all all 0.0.0.0/0 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
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.zip
Unziping and Installing it
unzip gdata-2.0.17.zip
rm -rf gdata-2.0.17.zip
cd gdata*
python setup.py 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
wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-latest.tar.gz
tar -zxvf openerp-7.0-latest.tar.gz  --transform 's!^[^/]\+\($\|/\)!openerp\1!'
cd openerp
python setup.py 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
xxx.xxx.xxx.xxx:8069

And you should see a screen like this:

OpenERP on CentOS 6


Have some questions? Leave us a comment below!