OKAY .... systemD is very popular init system, which will be the star of almost all linux distro in the future. I have been long time user of OpenRC and familiar with this. At least for my personal computer a T430 Lenovo Laptop and H3050-Lenovo Desktop. I stay in OpenRC running Gentoo Linux. Odoo (Open ERP) gaining high popularity lately and millions users NEED this kind of suite . I believed odoo will be must have application for most office and business at any size. Searching in the internet ... pages of tutorial how to install odoo community version which is Free of Charge, the source reside on git repository
The following tutorial I used for reference in installing odoo on my local computer for learning and developing purpose. The only different is The Linux Distro. Most tutorial for installing odoo 9 on ubuntu (14.04) and some pages for CenTOS. Need working hard to find the tutorial for Gentoo.
- Openies Odoo 9 Installation Tutorial
- Odoo 9 install turorial by Linode
- Official Odoo 9.0 Documentation
Art of Choice
As mentioned on the odoo documentation, there are many options to install Odoo 9
- Using Installer Scripts by ANDRE SCHENKELS which is NOOB PROOF
For someone who will learn to familiarize with odoo 9, using Andre's scripts will be best choice. Andre's brilliantly automate odoo 9.0 installation with a single scripts works flawlessly on ubuntu 14.04 which is also using OpenRC. The page clearly mentioned for ubuntu 14.04 and similar deb base distro under OpenRC. User can modified if wanna to install other version i.e odoo v8.
- Installing by ubuntu (debian base distro) and rpm base distro via their respective repository
This option will also NOOB PROOF and safe time. But I personally did not check if the repository provide other odoo version other than 9.0.
- Manual Install
Bit effort, with some confusion and need to read some tutorial, the page by Openied and Linode are recommended. Installing on similar distro just follow as is
Odoo 9.0 on Gentoo system
Requirement
- Gentoo system (mine is multilib) since I need this machine to get rid with CyanogenMod 13.0 rom
- Apache web server (dunno this is mandatory or NOT, I have it since I need to set virtual host also)
- Goodwill, time, energy, internet connection
Creating a system user with $name odoo home directory /opt
you can choose any path I choose /opt due to in my system /opt have own partition
My system
genT430 [/store] ###
[root] 05:08 PM Wed Jul 06 ># df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 30G 6.7G 22G 24% /
devtmpfs 11M 0 11M 0% /dev
tmpfs 1.7G 857k 1.7G 1% /run
shm 8.4G 546M 7.8G 7% /dev/shm
cgroup_root 11M 0 11M 0% /sys/fs/cgroup
/dev/sda2 30G 2.8G 26G 10% /opt
/dev/sda1 62M 3.9M 59M 7% /boot/efi
/dev/sda4 99G 21G 73G 23% /droid
/dev/sda6 59G 7.2G 49G 13% /home
/dev/sda5 98G 33G 60G 36% /store
tmp 8.4G 873k 8.4G 1% /tmp
vartmp 8.4G 29k 8.4G 1% /var/tmp
none 8.4G 13k 8.4G 1% /run/user/1000
# useradd -r -m -U -b /opt/ -s /bin/bash odoo
merge
postgresql
on stable system portage provided postgresql-9.5 which is well accepted by Odoo 9.0
emerge --ask dev-db/postgresql
look into default USE flad enabled : Odoo required
ldap ssl enabled, if no ... edit your USE flag. Postgresql will running, set and work out of the box, nothing special configurations needed.
postgresql having default admin user
postgres we need to log in as postgresql admin to create a user database with access to create and drop databse on odoo system.
command
# su - postgres
ensure that you have log in as postgresql user named postgres, see below the user changed from
root to
postgres
genT430 [/store] ###
[root] 05:45 PM Wed Jul 06 ># su - postgres
genT430 [~] ###
[postgres] 05:45 PM Wed Jul 06 >#
as postgres admin user execute command
# createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
Enter password for new role: ********
Enter it again: ********
# exit
NOTE : remember this password, it will be very useful for further configuration
Get required libraries (if you don't have it already)
emerge -DNuvp dev-python/pip libevent libxml2 libxslt nodejs sasl wkhtmltopdf git
look : if all USE flag have been satisfied just merge accordingly
Once all libraries satisfied, execute this command
#cd /tmp && wget https://raw.githubusercontent.com/odoo/odoo/9.0/requirements.txt && pip install -r requirements.txt
downloading some libraries required by odoo 9 as mentioned on file
requirements.txt ... just wait and ensure no any error
Log in as odoo user and grab odoo 9.0 system on git hub
#su - odoo -s /bin/bash
in my case the root user changed to odoo user in the odoo home directory, see below
genT430
[/store] ###
[root] 06:08 PM Wed Jul 06 ># su - odoo -s /bin/bash
genT430 [~] ###
[odoo] 06:08 PM Wed Jul 06 >#
as odoo user grab the system by cloning from github
#git clone https://www.github.com/odoo/odoo --depth 1 --branch 9.0 --single-branch .
don't miss the DOT after word --single-branch[space]DOT if you were do copy and paste
It will take a while depending on your speed of internet connection ... just relax, get coffee
Configuring Odoo System
Note by default, path of odoo server configuration is in
/opt/odoo/debian/openerp-server.conf
We need to copy the file and changed ownership and permission for only
odoo user
# mkdir /etc/odoo
# cp /opt/odoo/debian/openerp-server.conf /etc/odoo/odoo-server.conf
# chown odoo: /etc/odoo/odoo-server.conf
# chmod 640 /etc/odoo/odoo-server.conf
We set the configurations is writable by odoo user and readable by odoo and root users
Modify file /etc/odoo/odoo-server.conf
Pay attention at
addons_path=... by default
addons_path = /usr/lib/python2.7/dist-packages/openerp/addons
modified to
addons_path=/opt/odoo/addons
Thus if we will add any modules to main system, just put the module in
addons directory to make main system clean and free from polltant for easy update
Installing init scripts
This script for easy start and stop
odoo-server and set to automatic starting where neccessary, since the scripts is for debian, need minor modifications for Gentoo.
Note : I modified script from
Openies India thus credit for them
DOWNLOAD INIT SCRIPT FOR GENTOO HERE safe anywhere in your /home/user/directory
Extract the file and put in the directory
/etc/init.d/ thus you wil have file
/etc/init.d/odoo-server
execute command to change the permission and ownership
# chmod 755 /etc/init.d/odoo-server
# chown root: /etc/init.d/odoo-server
Just share this is only different from debian script, due to distro dependant
#. /lib/lsb/init-functions (debian/ubuntu)
. /etc/profile (gentoo)
. /etc/init.d/functions.sh (gentoo)
........
........
function _stop() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo
rm -f $PIDFILE
}
openies script..>
function _stop() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --retry3
rm -f $PIDFILE
}
N=/etc/init.d/$NAME (openies)
N=/etc/init.d/$DESC (Gentoo)
Make log file for odoo
# mkdir /var/log/odoo
# cd /var/log/odoo
# cat > odoo-server.log
# ctrl+c
Modified file odoo-server.log file
# chmod 755 /var/log/odoo/odoo-server.log
# chown odoo:root -R /var/log/odoo/odoo-server.log
Testing
execute command >
# /etc/init.d/postgresql-9.5 start ..... (to start postgresql server)
# /etc/init.d/odoo-server start .... (to start odoo-server)
To ensure odoo system run as expected... check by command >
# tail -f /var/log/odoo/odoo-server.log
If look everything good .... just open your browser and navigate to
http://127.0.0.1:8069/
or
http://localhost:8069/
Your browser will prompted with :
If No.... then there is something wrong with the installation
Small Trouble shouting
Server Not Running at all according to browser
Pay attention to file
/etc/odoo/odoo-server.conf
[options]
; This is the password that allows database operations:
; admin_passwd = admin
<---
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/addons
xmlrpc_port =
8069
odoo by default using port
8069 puting
xmlrpc_port = 8069 just to ensure odoo using this port
Firefox Browser
Firefox (AFAIK) have feature to always add prefix
www or suffix
DOTcom sometime this will prevent you to access localhost..... Disabled this feature from
about:config or
DOWNLOAD VIVALDI BROWSER
odoo server installation
Sometimes we are in doubt and have no clue, whats wrong with all failure of odoo running, the odoo itself, configurations or init-scripts. The best way to test is :
change to odoo user ( su - odoo -s /bin/bash) navigate to odoo directory
/opt/odoo and execute command >
[odoo]/opt/odoo # ./odoo.py
Odoo server should running on
http://0.0.0.0:8069/ ... you can access from browser
Automate Odoo server start
# rc-update add postgresql-9.5 default
... adding postgresql to runlevel default...
# rc-update add odoo-server default
... adding odoo server to runlevel default...
# rc-update add apache2 default
... adding apache to runlevel default
...........
Have nice odooing ..