Install Odoo/OpenERP 7.0 on Ubuntu 12.04 w/ Apache2 + mod_wsgi

Odoo (former OpenERP) is a collection of web based open source business apps. With Odoo you can create your own website, online shop, blog. It includes CRM, Project management tools, billing, accounting and more. You can get a free Odoo account at http://www.odoo.com.

In this guide we will setup  Odoo/OpenERP 7.0 on Ubuntu using Apache2 and mod_wsgi. This is a second article in Odoo Installation series. In previous guide we installed Odoo without Apache and mod_wsgi – using OpenERP server daemon.

  We can install Odoo/OpenERP on your VPS or dedicated server just for $30!
Order Odoo/OpenERP installation service or Order VPS with Odoo/OpenERP pre-installed.


Step 1: Setup your Ubuntu 12.04 server.

Update server packages.
apt-get update

 

Step 2: PostgreSQL Server Installation and Configuration.

Install PostgreSQL Server.
apt-get install postgresql

 Setup a PostgreSQL user for OpenERP.
sudo su postgres
createuser --createdb --username postgres --no-createrole --pwprompt openerp
Enter password for new role:
Enter it again:
Shall the newrole beasuperuser?(y/n)y
exit

Option explanations:

–createdb : the new user will be able to create new databases
–username postgres : createuser will use the postgres user (superuser)
–no-createrole : the new user will not be able to create new users
–pwprompt : createuser will ask you the new user’s password
openerp : the new user’s name

Step 3: OpenERP Server Installation.

Installing the required packages.
sudo apt-get install python-lxml python-mako python-dateutil python-psycopg2 python-pychart python-pydot python-tz python-reportlab python-yaml python-vobject python python-dev build-essential python-setuptools python-pip python-babel python-mock python-docutils python-Jinja2 python3-jinja2 libldap2-dev libsasl2-dev apache2 libapache2-mod-wsgi python-werkzeug python-unittest2 python-openid

Download the latest openERP server source.
cd /home/
sudo wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-latest.tar.gz
sudo tar xvzf openerp-7.0-latest.tar.gz

Rename the extracted folder.
mv openerp-7.0-XXXXXXXX-XXXXXX openerp

Step 4: Enable mod_wsgi modules.

sudo a2enmod wsgi

Step 5: Create a OpenERP configuration file.

For this type of deployment we will create a new configuration file. Create an openerp-wsgi.py file in openerp root folder with following content.

nano /home/openerp/openerp-wsgi.py

 

Step 6: Create Site Configuration file in Apache.

Create a new virtual host configuration file in apache with following content.
nano /etc/apache2/site-available/openerp-wsgi

<VirtualHost *:80>
ServerName domain.com
ServerAlias *.domain.com// Use this if you want dbfillter on subdomain
WSGIScriptAlias//home/openerp/openerp-wsgi.py
WSGIDaemonProcess oe user=openerp group=openerp processes=2python-path=/home/openerp/display-name=apache-openerp
WSGIProcessGroup oe
ErrorLog/var/log/openerp/openerp-error.log
CustomLog/var/log/openerp/openerp-access.log combined
<Directory/home/openerp>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Notes: WSGIScriptAlias / /home/openerp/openerp-wsgi.py – path to file “openerp-wsgi.py (See Step 5).
    user=openerp group=openerp – user for home directory OpenERP (See Step 5).
    python-path=/home/openerp/ and <Directory /home/openerp> – home directory OpenERP (See Step 3).

 Create folder for log files.
mkdir /var/log/openerp
chown openerp:root /var/log/openerp
/etc/init.d/apache2 restart

The URL your Odoo installation will look something like this:

http://IP_or_domain

 Enjoy using your self-hosted Odoo/OpenERP installation!

Menu