Friday, January 28, 2011

Open ERP Server Installation On Linux


Installing the required packages


You need to install Python (at least version 2.4 for OpenERP 5.0, 2.5 for OpenERP 6.0).
You also need to install the following python libraries:
  • psycopg2
  • reportlab
  • pychart
  • pydot
  • mxdatetime
  • lxml (libxml2 and libxslt are not required anymore since 5.0.7)
  • pytz (timezone library)
  • PIL: Python Imaging Library (required for reportlab)
  • vobject: iCalendar and VCards parsing

To install the required libraries, you can do the following in your favorite shell:
 
sudo apt-get install python python-psycopg2 python-reportlab \
     python-egenix-mxdatetime python-tz python-pychart \
     python-pydot python-lxml python-vobject

For Fedora 10, the following needed to be installed using yum install :
  • postgresql-python
  • python-imaging
  • python-psycopg
  • python-reportlab
  • graphviz
  • python-psycopg2 (PostgreSQL module)
  • pychart (pychart module)
  • pydot (pydot module)
  • python-devel
  • python-lxml (libxml2 and libxslt are not required anymore as of v5.0.7)
To install:
urpmi python python-psycopg2 python-reportlab python-egenix-mx-base 

Downloading the Open ERP Server

The OpenERP server can be downloaded from the OpenERP website’s download page

Testing the Open ERP Server

tar -xzf openerp-server-5.0.0.tar.gz
cd openerp-server-5.0.0/bin
python openerp-server.py

The list of available command line parameters can be obtained with the -h command line switch:
python openerp-server.py -h

Installing the Open ERP Server

The Open ERP Server can be installed very easily using the setup.py file:
tar -xzf openerp-server-5.0.0.tar.gz
cd openerp-server-5.0.0
sudo python setup.py install

If your PostgreSQL server is up and running, you can now run the server using the following command:
openerp-server

If you don’t already have a PostgreSQL server up and running, you can read the PostgreSQL Server installation and configuration.

Python 2.5 setting up:
 
$ sudo apt-get install python2.5 python2.5-dev python-profiler

Reinstall python-xml:
 
$ wget http://freefr.dl.sourceforge.net/sourceforge/pyxml/PyXML-0.8.4.tar.gz
 
$ tar xvzf PyXML-0.8.4.tar.gz
 
$ cd PyXML-0.8.4/
 
$ sudo python2.5 setup.py install

Make the following symbolic link:
 
$ sudo ln -s /usr/lib/python2.6/dist-packages/oldxml/_xmlplus/utils/boolean.so /usr/lib/python2.5/site-packages/oldxml/_xmlplus/utils/

Force openerp-server to be launched with Python2.5:
 
$ cd /usr/bin/
 
$ sudo cp openerp-server openerp-server.ORIG
 
$ sudo vi openerp-server

Replace the following line:
 
exec /usr/bin/python ./openerp-server.py $@

with
 
exec /usr/bin/python2.5 ./openerp-server.py $@

We can now restart openerp-server:
 
$ sudo /etc/init.d/openerp-server restart
 
Restarting openerp-server: openerp-server.

Check out the logs:
 
$ sudo cat /var/log/openerp.log
 
[2009-06-14 21:06:39,314] INFO:server:version – 5.0.0
 
[2009-06-14 21:06:39,314] INFO:server:addons_path – /usr/lib/openerp-server/addons
 
[2009-06-14 21:06:39,314] INFO:server:database hostname – localhost
 
[2009-06-14 21:06:39,315] INFO:server:database port – 5432
 
[2009-06-14 21:06:39,315] INFO:server:database user – openerp
 
[2009-06-14 21:06:39,315] INFO:objects:initialising distributed objects services
 
[2009-06-14 21:06:39,502] INFO:web-services:starting XML-RPC services, port 8069
 
[2009-06-14 21:06:39,502] INFO:web-services:starting NET-RPC service, port 8070
 
[2009-06-14 21:06:39,502] INFO:web-services:the server is running, waiting for connections…
OpenERP is now up and running, connected to Postgres database on port 5432 and listening on ports 8069 and 8070
After installation of the server the config file is stored at /usr/share/doc/openerp-server-5.0.0/openerp-server.conf in Ubuntu 8.10 in case of Ubuntu 9.04 config file is at /etc/openerp-server.conf which looks like
[options]
without_demo = True
; This is the password that allows database operations:
; admin_passwd = admin
upgrade = False
verbose = False
netrpc = True
xmlrpc = True
port = 8069
interface =
db_host = False
db_port = False
; Please uncomment the following line *after* you have created the
; database. It activates the auto module check on startup.
; db_name = terp
db_user = openerp
db_password = False
; Uncomment these for xml-rpc over SSL
; secure = True
; secure_cert_file = /etc/openerp/server.cert
; secure_pkey_file = /etc/openerp/server.key
root_path = None
soap = False
translate_modules = ['all']
demo = {}
addons_path = None
reportgz = False

OpenERP Client Installation

Installing the required packages

You need to install python (at least version 2.4 for OpenERP 5.0, 2.5 for OpenERP 6.0).

You also need to install the following python libraries:

gtk and glade (at least version 2.10)
matplotlib
mxdatetime
xml
tz (timezone library)
hippocanvas (Python bindings to hippo-canvas. Hippocanvas is a canvas library based on GTK+2.0, Cairo and Pango)
On Ubuntu, these libraries are available in the following packages:
  • python
  • python-gtk2
  • python-glade2


  • python-matplotlib
  • python-egenix-mxdatetime
  • python-xml
  • python-tz
  • python-hippocanvas
On Ubuntu, these libraries are available in the following packages:
  • python
  • python-gtk2
  • python-glade2
  • python-matplotlib
  • python-egenix-mxdatetime
  • python-xml
  • python-tz
  • python-hippocanvas
You need folowing to install openerp client on Mandriva:
  • python
  • python-gtk
  • python-gtk-glade
  • python-matplotlib
  • python-egenix-mx-base
  • python-dateutil
  • python-xml
  • python-hippo-canvas
  • python-pytz
To install the packages you can do the following in your favorite shell:
urpmi python python-gtk python-gtk-glade python-matplotlib python-egenix-mx-base python-dateutil python-xml python-   hippo-canvas python-pytz

Downloading the Open ERP Client

The OpenERP client can be downloaded from the OpenERP website’s download page

Testing the Open ERP Client

tar -xzf openerp-client-5.0.0.tar.gz
cd openerp-client-5.0.0/bin
python openerp-client.py

Installing the Open ERP Client

The client can be installed very easily using the setup.py file:
tar -xzf openerp-client-5.0.0.tar.gz
cd openerp-client-5.0.0
sudo python setup.py install
You can now run the client using the following command:
openerp-client

Configuring a pdf viewer

Open ERP client by default supports:
  1. evince
  2. xpdf
  3. gpdf
  4. kpdf
  5. epdfview
  6. acroread
for previewing PDF. The client will try to find one of these executables (in this order) in
your system and open the pdf document with it.

If you want to use another pdf viewer or if you don’t want to use the first one the client will find. You can edit the Open ERP configuration file normally located in ~/.openerprc. Find the [printer] section and edit the softpath parameter. For example:
[printer]
softpath = kpdf
 


OpenERP Web Installation


Here is the installation instructions for Debian based Linux distributions. Tested on Debian Etch and Ubuntu Hardy. The procedure might work with other Linux or similar distributions. See the docs on how to install the specified Packages on your favourite distro.

Prerequisites

  1. Python >= 2.4
  2. CherryPy >= 3.1.2
  3. Mako >= 0.2.4
  4. Babel >= 0.9.4
  5. FormEncode >= 1.2.2
  6. simplejson >= 2.0.9
  7. pyparsing >= 1.5.0
Remember, this version requires CherryPy3 which is conflicting with CherryPy2 (used by TurboGears), so you can’t install both in system area. To overcome with the issue, we added support for local library installation for OpenERP Web. In that case, just download the source package and do the following

Python

$ sudo apt-get install python python-dev build-essential
$ sudo apt-get install python-setuptools
This will install dependencies required for the following
$ cd /path/to/openerp-web/lib
$ ./populate.sh
$ cd 
This will install all required dependencies in private lib directory, and you don’t need to install anything

OpenERP Web Client

$ sudo easy_install -U openerp-web
all other dependencies will be installed automatically by setuptools

Configuration

Locate the config/default.cfg in the installed EGG, and make appropriate changes, especially:
[openerp]
server = "localhost"
port = 8070
protocol = "socket"
where:
  • server is the OpenERP server host
  • port is the OpenERP server port which is by default 8070 for NET-RPC or 8069 for XML(S)-RPC. The web server itself listens by default on port 8080 and connects to the OpenERP server using one of the above-mentioned ports. The final web browser connects to the Web server, so usually port 8080.
  • protocol is the protocol to be used (socket for NET-RPC, http for XML-RPC or https for XMLS-RPC)
Now start the web server with openerp-web command:
$ openerp-web

Run as service

To run openerp Web as a service you need to first locate the openerp_web-5.0.0-py2.5.egg ad copy the openerp-web file to etc/init.d/. An egg is a python package
You can find the documentation about eggs at http://peak.telecommunity.com/DevCenter/PythonEggs The location of the egg depends on your distribution. For example path to openerp_web-5.0.6-py2.5.egg in Ubuntu 8.10 is:
/usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/
$ sudo cp /path/to/openerp_web-5.0.0-py2.5.egg/scripts/openerp-web /etc/init.d/
$ sudo cp /path/to/openerp_web-5.0.0-py2.5.egg/config/openerp-web.cfg /etc/
$ sudo chmod +x /etc/init.d/openerp-web
edit /etc/init.d/openerp-web using any editor example:
$ sudo gedit /etc/init.d/openerp-web
USER="your system username"
and edit /etc/openerp-web.cfg:
$ sudo gedit /etc/openerp-web.cfg
log.access_file = "/var/log/openerp-web/access.log"
log.error_file = "/var/log/openerp-web/error.log"
Create /var/log/openerp-web/ with proper ownership
$ sudo mkdir /var/log/openerp-web/
$ sudo chown username /var/log/openerp-web/
Now run following command to start the OpenERP Web automatically on system startup (Debian/Ubuntu).
$ sudo update-rc.d openerp-web defaults
Start the deamon:
$ sudo /etc/init.d/openerp-web start
Note
The init script is compatible with all major Linux distributions. Please check docs of your distribution on how to enable services.

Configure HTTPS

The following text describes how to configure OpenERP Web for production environment over HTTPS with Apache2. mod_proxy + mod_ssl (Apache2) Apache configuration *:443>
 
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/apache.pem
 
     *>
        Order deny,allow
        Allow from all
    
 
    ProxyRequests Off
 
    ProxyPass        /   http://127.0.0.1:8080/
    ProxyPassReverse /   http://127.0.0.1:8080/
 
    RequestHeader set "X-Forwarded-Proto" "https"
 
    # Fix IE problem (http error 408/409)
    SetEnv proxy-nokeepalive 1
 
OpenERP Web configuration
tools.proxy.on = True
Block the OpenERP Web server port (firewall)
$ iptables -A INPUT -i lo -j ACCEPT
$ iptables -A INPUT -p tcp --dport 8080 -j REJECT
Note
Don’t block the localhost/121.0.0.1 (the first rule)
Note
This method only works if you want your OpenERP Web application at the root of your server (https://www.example.com) and can’t be deployed under a subdirectory, e.g. http://www.example.com/openerp. To overcome with the issue you can go with subdomain, like:
https://openerp.example.com

Supported browsers

OpenERP Web is known to work best with Mozilla based web browsers. Here is the list of supported browsers.
  1. Firefox >= 1.5
  2. Internet Explorer >= 6.0
  3. Safari >= 3.0
  4. Google Chrome >= 1.0
  5. Opera >= 9.0

Flash plugin

Your browser should have the Flash plugin installed because OpenERP Web uses some Flash components. Here is how to install the Flash plugin on an Ubuntu system:
$ sudo apt-get install flashplugin-nonfree

No comments:

Post a Comment