Wednesday, July 27, 2011

Openerp Instillation on Linux




OpenERP Installation Guide

Requisites for Python:


Install following modules:
  1. readline-devel
  2. libxml2
  3. libxml2-devel
  4. libxslt
  5. libxslt-devel
  6. zlib
  7. zlib-devel

Note: Above requisites were identified while installing python modules on a centos 64 bit server, these might change server to server.

  1. Postgresql Installation from Source
  1. Download source (tar.gz) of postgresql 8.4.6 from http://postgresql.org
  2. Extract using #tar –xvzf postgresql_file_name
  3. cd to postgresql folder and run following commands:
      1. #./configure
      2. #make
      3. #make install
  4. After successful installation create a user postgres and data directory:
      1. #adduser postgres
      2. #mkdir /usr/local/pgsql/data
      3. #chown postgres /usr/local/pgsql/data
  5. Now , initialize the cluster: #/usr/local/pgsql/bin/initd/ -D /usr/local/pgsql/data
  6. Run postgresql: #su postgres -c ‘/usr/local/pgsql/bin/postgres –D /usr/local/pgsql/data’  >/home/postgres/postgres_logfile 2>&1 &
  7. Create symbolic links :
      1. #ln /usr/local/pgsql/bin/psql /usr/bin/psql –s
      2. # ln /usr/local/pgsql/bin/pg_dump /usr/bin/ pg_dump –s
      3. # ln /usr/local/pgsql/bin/pg_dumpall /usr/bin/ pg_dumpall –s
      4. # ln /usr/local/pgsql/pg_restore /usr/bin/ pg_restore –s
  8. Create a user in postgresql with which openerp can communicate:
      1. #psql –d template1 –U postgres
      2. #create user openerp with password ‘solutions’ createdb;
      3. Above user and password will be used in config file of OpenERP server, so please make a note of it.



  1. Python Installation from Source:
  1. Download Python2.6.7 from http://python.org
  2. Extract using #tar –xvzf python_file_name
  3. cd to python folder and run following commands:
      1. #./configure
      2. #make
      3. #make install
  4. Check installed python details: #python2.6 -V
  5. After successful installation of python, go to http://python.org/pypi and download setuptools module(Copy link address of source and download using wget command)

Note: All python modules are available on ftp://ftp.bistasolutions.com/OpenERP_python_mods
  1. Extract using #tar –xvzf setuptools_file.tar.gz
  2. Cd to setuptools folder and run #python2.6 setup.py install
  3. Once installed, easy_install-2.6 command will be available.
  4. Following are the python modules required by OpenERP:
    1. lxml - #easy_install-2.6 lxml

Requisites for this are: libxml2, libxml-devel2, libxslt and libxslt-devel
    1. mako - #easy_install-2.6 mako
    2. pydot - #easy_install-2.6 pydot
    3. pytz - #easy_install-2.6 pytz
    4. reportlab - #easy_install-2.6 reportlab
    5. caldav - #easy_install-2.6 caldav
    6. python-dateutil - #easy_install-2.6 python-dateutil
    7. psycopg2 -
      1. Give LD_LIBRARY_PATH in /etc/profile as
        1. #nano /etc/profile
        2. At the end of file put : export LD_LIBRARY_PATH=/usr/local/pgsql/lib
        3. CTRL+O and CTRL+X
        4. #source /etc/profile
      2. #easy_install-2.6 psycopg2
      3. Run #python2.6
      4. #import psycopg2
      5. If no errors than psycopg2 installation successful, otherwise download psycopg2 as per point no. 5,6 7
    8. Yaml - #easy_install-2.6 PyYAML
    9. Cherrypy - #easy_install-2.6 cherrypy==3.1.2
    10. Babel - #easy_install-2.6 babel
    11. FormEncode - #easy_install-2.6 formencode==1.2.2
    12. Omelette- #easy_install-2.6 omelette
    13. Python Imaging Library -#easy_install-2.6 pil



  1. OpenERP Server and Web installation:


  1. Download Source files of OpenERP Server from http://openerp.com
  2. Extract using #tar –xvzf openerp-server.tar.gz
  3. Cd to openerp-server folder and run:#python2.6 setup.py install
  4. Create system user for :
    1. #adduser openerp
  5. Change db_user,db_password,admin_passwd in /usr/local/lib/python2.6/site-packages/openerp-server/tools/config.py
  6. Run #su openerp –c ‘openerp-server start’. If this runs successfully then to keep it running first do CTRL+C then execute: # su openerp –c ‘openerp-server start’ >/home/openerp/oerp_serv_logfile 2>&1 &
  7. Download Source files of OpenERP Web from http://openerp.com
  8. Extract using #tar –xvzf openerp-web.tar.gz
  9. Cd to openerp-web folder and run:#python2.6 setup.py install
  10. Run #su openerp –c ‘openerp-web start’. If this runs successfully then to keep it running first do CTRL+C then execute: # su openerp –c ‘openerp-web start’ > /home/openerp/oerp_web_logfile 2>&1 &
  11. To open port on linux use command: #iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
  12. Put the following three lines in /etc/rc.local so that OpenERP starts on Server Startup:
    1. #nano /etc/rc.local
    2. Put the following three line(obviously without #) at the last:
      1. #su postgres -c ‘/usr/local/pgsql/postgres –D /usr/local/pgsql/data’  >/home/postgres/postgres_logfile 2>&1 &
      2. #su openerp –c ‘openerp-server start’ >/home/openerp/oerp_serv_logfile 2>&1 &
      3. # su openerp –c ‘openerp-web start’ > /home/openerp/oerp_web_logfile 2>&1 &
  13. Redirection from 80 port (proxy setup):
    1. Add Virtual Host entry in apache configuration::

#<VirtualHost 173.192.201.242:80>
   ServerName erp.myibsource.com
   ServerAdmin ashaynimkar@gmail.com
   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>
   ProxyRequests Off
   RewriteEngine on
       RewriteRule ^/(.*) http://127.0.0.1:8080/$1 [P]
       ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>



    1. Uncomment #tools.proxy.on = TRUE from openerp-web.cfg


  1. Error messages and their solutions
  1. ImportError: No module named _thread
    1. Formencode python module issue
    2. Remove Formencode #easy_install-2.6 –m formencode
    3. Install #easy_install-2.6 formencode==1.2.2
  2. ImportError: No module named bz2
    1. Install readline-devel #yum install readline-devel
    2. Recompile python:
      1. Cd to Python source folder and run #./configure
      2. #make
      3. #make install


No comments:

Post a Comment