Update 28 May 2016: This tutorial has been re-tested and updated to include the latest changes. It’s confirmed working. Thank you to everyone for your contributions in the comments section. I hope you find the tutorial useful!
This tutorial will walk you through the process of installing the latest version of Odoo on CentOS 6. It is intended for those who might not be experienced Linux administrators but who want to run their own Odoo server. You can simply copy-paste the commands into your terminal or SSH window.
The tutorial is fully tested on CentOS 6.5 but should work for any 6.x version. Please see my other tutorial for CentOS 7 instructions.
First we will install the PostgreSQL database server, then install the necessary package dependencies. Next we will create a virtual Python environment (so we don’t interfere with the CentOS version) and install all the modules Odoo requires. Then it’s time to pull the latest Odoo code from GitHub and create a CentOS 6 compatible init script. Finally we will add the necessary firewall rules and connect to the server.
This tutorial assumes you have already performed a minimal install of the latest version of CentOS 6.5 on a server dedicated to just running Odoo. It also assumes you will be running Odoo on the same server as the PostgreSQL database. You will need at least 1GB of available RAM for lxml to install, although this can include SWAP space.
Odoo is a complicated installation with many dependencies and can be quite resource intensive. I highly recommend you install on a server (or real or virtual) that is dedicated to Odoo. Co-locating Odoo with existing websites/applications is likely to cause problems at some point.
1: Generate Odoo Passwords
Before starting installation we will generate two passwords. The first line generates a strong random password for the odoo server to access the PostgreSQL database that we will install. The second line is the master password you will use to create the Odoo database after the installation is complete. Don’t worry about these for now. After the installation is complete you will find both these passwords in the Odoo configuration file (/etc/odoo-server.conf).
Important: You must run these commands as the root user
ODOO_POSTGRES_PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-20};echo;`
ODOO_DB_ADMIN_PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-20};echo;`
echo && echo "**** Make a note of these generated passwords ****" && echo "Odoo Postgres DB User Password:" $ODOO_POSTGRES_PASSWORD && echo "Odoo Master Password:" $ODOO_DB_ADMIN_PASSWORD && echo
2: Install and configure PostgreSQL
First will install the PostgreSQL version 9.5. Unfortunately the CentOS 6 official respository only contains older versions, so we will need to install directly from the PostgreSQL repositories. We use the repository rather than simply downloading an RPM because it’s easier to keep up to date with important security and maintenance updates. This command will add the PostgreSQL repository to your server:
rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-redhat95-9.5-2.noarch.rpm
It’s important we exclude postgresql from the official CentOS repository files, otherwise we will encounter problems when we run updates:
sed -i 's/^gpgkey.*/&\nexclude=postgresql*/' /etc/yum.repos.d/CentOS-Base.repo
Installing PostgreSQL and some associated libraries is now straightforward. We then need to initialise the database.
yum -y install postgresql95 postgresql95-server postgresql95-devel postgresql95-libs
service postgresql-9.5 initdb
Next we need to configure PostgreSQL so it will accept connections using MD5 hashed passwords so it’s compatible with the Python modules:
sed -i "/^host/s/ident/md5/g" /var/lib/pgsql/9.5/data/pg_hba.conf
Finally let’s add PostgreSQL to the list of services which will be enabled at startup. We then start the PostgreSQL server and add the Odoo user with the password we generated in step 1.
/sbin/chkconfig --level 35 postgresql-9.5 on
service postgresql-9.5 start
echo -e "$ODOO_POSTGRES_PASSWORD\n$ODOO_POSTGRES_PASSWORD\n" | su - postgres -c "createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo"
3: Installing Python
Odoo requires a modern version of Python lot of additional libraries. Potentially these could conflict with the Python libraries supplied in CentOS 6 and relied upon by the built in administration tools. So to avoid this risk we will create a virtual environment under the Odoo system user account which will be used solely by the Odoo server.
First lets make sure all the packages on your CentOS install are up-to-date. If we don’t do this, then you will end up with endless version conflicts:
yum clean all
yum -y update
Next let’s install the Odoo package dependencies:
yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libffi-devel libxslt libxslt-devel libxml2 libxml2-devel openldap-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel git libpng libXext libz.so.1 xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi curl cabextract
We also need the wkhtmltopdf package in order to generate PDF reports in Odoo. This link is for the 64bit version of CentOS. For 32bit change ‘amd64’ to ‘i386’ in the filename below.
rpm -ivh http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-centos6-amd64.rpm
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/
Optional: You may wish to install Microsoft’s Core Fonts so they are available when you generate reports in Odoo. First we need to install some dependencies, then the msttcore-fonts-installer rpm downloads the fonts from sourceforge, installs them and activates them on your CentOS server.
For 64 bit (x86) CentOS installs ONLY:
rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/libmspack-0.5-0.1.alpha.el6.x86_64.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/cabextract-1.5-1.el6.x86_64.rpm
rpm -ivh https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
For 32 bit (i386) CentOS installs ONLY:
rpm -ivh https://dl.fedoraproject.org/pub/epel/6/i686/libmspack-0.5-0.1.alpha.el6.i686.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i686/cabextract-1.5-1.el6.i686.rpm
rpm -ivh https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
Now let’s download and install Python 2.7.8 from source. The first command removes any existing python2.7 installs from previous attempts. Note after compiling we use “altinstall” to prevent overwriting the CentOS default python installation. We will do the Python build in the root users home directory as some CentOS installs prevent the execution of compiled C programs in the /tmp/ directory for security reasons (see “noexec” in /etc/fstab):
rm -rf /usr/local/lib/python2.7
cd /root/
wget http://python.org/ftp/python/2.7.9/Python-2.7.9.tgz
tar -xzf Python-2.7.9.tgz
cd Python-2.7.9
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make
make altinstall
With Python successfully installed it’s time to add the Python virtual environment (virtualenv) and the PIP module installation utility:
wget https://bootstrap.pypa.io/ez_setup.py -O - | /usr/local/bin/python2.7
/usr/local/bin/easy_install-2.7 pip virtualenv
Next let’s create an Odoo user and setup the virtual environment.
adduser odoo
DIR="/var/run/odoo /var/log/odoo /opt/odoo"
for NAME in $DIR
do
if [ ! -d $NAME ]; then
mkdir $NAME
chown odoo.odoo $NAME
fi
done
4: Installing Python modules in a virtual environment
Odoo requires a lot of Python modules to run. With the Python virtual environment successfully created we now need to add all the additional modules.
Important note for WHM/cPanel users: If your hosting provider is using WHM/cPanel to manager your server, you must enable compiler access for the odoo user otherwise the Python and additional modules installation will fail. See here for instructions on how to enable compiler access. You can disable compiler access again after Odoo installation is completed.
Important: Commands in this section must be run as the odoo user
First let’s switch from root to the odoo user, then create a new virtual environment called odoo and activate it:
su - odoo
/usr/local/bin/virtualenv --python=/usr/local/bin/python2.7 odoo
source odoo/bin/activate
Before starting the module installation we need to add the path to the PostgreSQL binaries, otherwise the PsycoPG2 module install will fail:
export PATH=/usr/pgsql-9.5/bin:$PATH
To avoid warnings about “SNIMissing” you need to update ndg-httpsclient:
pip install --upgrade ndg-httpsclient
5: Installing Odoo 8 from GitHub
Now it’s finally time to install Odoo itself. We are going to download the latest version of Odoo 8 from the GitHub repository. Note that we are installing into the /opt directory so we can easily manage the installation in a single location and keep it separate from the rest of the operating system.
Important: These commands must be run as the odoo user
cd /opt
git clone https://github.com/odoo/odoo.git --branch 8.0
chown -R odoo.odoo odoo
Now let’s install all the Python module dependencies. We will use the list included with the Odoo distribution to ensure we install the correct versions. Once installed we exit the Odoo user account and return to the root user.
export PATH=/usr/pgsql-9.5/bin:$PATH
pip install -r /opt/odoo/requirements.txt
exit
Let’s create a basic Odoo server configuration file. The passwords we created earlier should be automatically populated from the environment variables. I’ve also dialled back the logging so we only see warnings and fatal errors. I’m located in the UK, so the timezone is set to Europe/London.
Important: All the following commands must be run as the root user
cat > /etc/odoo-server.conf << EOF
[options]
; This is the password that allows database operations:
admin_passwd = $ODOO_DB_ADMIN_PASSWORD
; DATABASE OPTIONS
db_host = localhost
db_port = 5432
db_user = odoo
db_password = $ODOO_POSTGRES_PASSWORD
; MISC SETTINGS
addons_path = /opt/odoo/addons
load = web
timezone = Europe/London
without-demo=all
; LOG SETTINGS
logfile = /var/log/odoo/odoo-server.log
log_handler = werkzeug:WARNING
log_level = warn
no-logrotate = True
EOF
chown root.odoo /etc/odoo-server.conf
chmod 640 /etc/odoo-server.conf
I also like to enable logrotation using the built in CentOS tools so the logs are managed in the same way as all the other applications.
cat > /etc/logrotate.d/odoo-server << EOF
/var/log/odoo/*.log {
copytruncate
missingok
notifempty
}
EOF
Next we create a script to easily start and stop the Odoo server. We download a pre-created init script, then use a sed script to modify the startup command so it plays nicely with the virtual Python environment we created earlier.
wget -O /etc/init.d/odoo https://raw.githubusercontent.com/Johnzero/OE7/master/install/openerp-server.init
sed -i "s/openerp/odoo/g" /etc/init.d/odoo
sed -i "s/OpenERP/Odoo/g" /etc/init.d/odoo
sed -i "s/\/usr\/bin\/setsid \/usr\/bin\/odoo-server/~\/odoo\/bin\/python \/opt\/odoo\/openerp-server/" /etc/init.d/odoo
chmod +x /etc/init.d/odoo
/sbin/chkconfig --level 35 odoo on
The final step in this section is to add the necessary firewall rules. The redirect command accepts connection on port 80 and redirects them to the default Odoo port 8069. This avoids your users having to remember to enter the port number each time.
/sbin/iptables -A INPUT -p tcp --dport 5432 -i lo -j ACCEPT -m comment --comment "Accept local connections to PostgreSQL"
/sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8069 -m comment --comment="Redirect Odoo HTTP requests to 8069"
/sbin/iptables -A INPUT -p tcp --dport 8069 -j ACCEPT -m comment --comment "Accept inbound Odoo connections"
/etc/init.d/iptables save
6: Launching Odoo and logging in
To start Odoo, simply run the init script:
/etc/init.d/odoo start
You should be able to open a browser and connect to your Odoo server IP address on port 80.
The first time you login, the “Create a New Database” page should appear. You should enter the following details to setup the first database:
Master password = [the “admin_password” in /etc/odoo-server.conf]
Select a database name = [any name you want]
Load demonstration data = [I recommend you tick this box for your first database]
Default language = [select your language as appropriate]
Choose a password = [choose a password for your “admin” user]
Confirm password = [confirm a password for your “admin” user]
Click “Create Database” and after a few seconds you should be automatically logged into Odoo as the “admin” user. Hooray!
To login subsequent times, at the login page instead of entering an email address you should enter “admin” and the password you created on the “Create a New Database” page.
If you create multiple databases then you can switch between them by browsing to this address: http://x.x.x.x/web/database/selector (where x.x.x.x is your server IP address)
If something isn’t working, you can check the logfiles in /var/log/messages and /var/log/odoo/odoo-server.log to make sure everything started correctly. Note you can also use “/etc/init.d/odoo restart” and “/etc/init.d/odoo stop” to restart and stop Odoo as required.
tail -50f /var/log/odoo/odoo-server.log
7: Updating Odoo
If you want to update the Odoo code to the latest version you can easily do that by stopping the server then performing a “git pull”. Note that you must only do the git pull as the odoo user.
/etc/init.d/odoo stop
su - odoo
cd /opt/odoo
git pull
exit
/etc/init.d/odoo start
I hope this guide helps you get Odoo 8 up and running on CentOS 6.5. Let me know how you get on in the comment section, and also check out my other tutorials.
Hello,
thanks for the useful tutorial.
I can start odoo using the command line: openerp-server –config=/etc/odoo/openerp-server.conf –xmlrpc-port=8069 although i had to change the shebang to “#!/usr/bin/env python2.7”
however I can’t get the init script to work. I get this error:
Démarrage de Odoo Server Daemon (openerp-server) : [ OK ]
File “/opt/odoo/openerp-server”, line 2, in
import openerp
File “/opt/odoo/openerp/__init__.py”, line 76, in
import modules
File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
from . import db, graph, loading, migration, module, registry
File “/opt/odoo/openerp/modules/graph.py”, line 32, in
import openerp.osv as osv
File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
import osv
File “/opt/odoo/openerp/osv/osv.py”, line 23, in
from .orm import Model, TransientModel, AbstractModel
File “/opt/odoo/openerp/osv/orm.py”, line 1, in
import simplejson
ImportError: No module named simplejson
Simplejson is installed.
Any idea? can you share your working init script for CentOS 6 ?
best regards!
LikeLike
I used your install guide but i have an error :
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xe0 in position 1517: invalid continuation byte
when i try to create my first database. I use a vanilla/fresh install of odoo and pull git repo today the 11/16. I can’t create database but i can change master pwd.
I use odoo v8 / python 2.7.9 / pg 8.4.20. thanks
LikeLike
Hello
I followed steps then it works correctly.
It is format here:
/sbin/iptables -A INPUT -p tcp –dport 5432 -i lo -j ACCEPT -m comment –comment “Accept local connections to PostgreSQL”
/sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo HTTP requests to 8069″
/sbin/iptables -A INPUT -p tcp –dport 8069 -j ACCEPT -m comment –comment “Accept inbound Odoo connections”
But now need to be connect ssl. I typed above syntax. It doesn’t work now. How can I connect to ssl?
/sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 443 -m comment –comment=”Redirect apache 80 -> HTTPS requests to 443″
/sbin/iptables -t nat -I PREROUTING -p tcp –dport 443 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo 443 HTTPS requests to 8069″
LikeLike
Can’t install lxml I get this:
when doing this:
(odoo) [odoo@hosting ndg-httpsclient]$ pip install -b /opt/odoo/ndg-httpsclient --upgrade lxml
LikeLike
Guess -b /opt/odoo solved this one as well. When ran from ~ dir with source odoo/bin/activate applied.
So basically, just do it like that:
LikeLike
How do you reslove these:
ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted
Failed building wheel for cryptography
ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted
—————————————-
Failed cleaning build dir for cryptography
ImportError: /tmp/pip-build-XvaHva/cryptography/.eggs/cffi-1.8.2-py2.7-linux-x86_64.egg/_cffi_backend.so: failed to map segment from shared object: Operation not permitted
—————————————-
Failed cleaning build dir for cryptography
Failed to build cryptography
LikeLike
Make sure the /tmp partition doesn’t have “noexec” set. Have a look in /etc/fstab.
Try using an alternative build directory on a partition without “noexec” when running pip with “-b /path/to/build/dir”.
LikeLike
I did this:
(odoo) [odoo@hosting ndg-httpsclient]$ pip install -b /opt/odoo/ndg-httpsclient --upgrade lxml
And I got this:
LikeLike
Hi i execute this command on my server now I cannot access any website.
what can I do
/sbin/iptables -A INPUT -p tcp –dport 5432 -i lo -j ACCEPT -m comment –comment “Accept local connections to PostgreSQL”
/sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo HTTP requests to 8069″
/sbin/iptables -A INPUT -p tcp –dport 8069 -j ACCEPT -m comment –comment “Accept inbound Odoo connections”
/etc/init.d/iptables save
LikeLike
Are you hosting websites using Apache on the same server as you installed Odoo? If yes, then you won’t be able to use this IPTables rule. Instead you will need to access Odoo using http://yourserverip:8069. My recommendation is to not host anything other than Odoo on the server to make things simpler.
LikeLike
The offending rule is:
/sbin/iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8069 -m comment –comment=”Redirect Odoo HTTP requests to 8069″
Remove it and access your Odoo installation as David suggest…
With this one you redirect all the http traffic (port 80) to the port 8069 (Odoo’s port) then Apache never receive a request 😉
LikeLike
hi All
I have a problem while installing the ooo 8 on a cents 6.8 server
I installed everything according to a tutorial, one time from github and another from nighty in both cases when I write
/etc/init.d/odoo start
it gives me this
Starting Odoo Server Daemon (odoo-server): [ OK ]
root@vps21029 [~]# Traceback (most recent call last):
File /opt/odoo/openerp-server, line 5, in openerp.cli.main()
File /opt/odoo/openerp/cli/__init__.py, line 68, in main o.run(args)
File /opt/odoo/openerp/cli/server.py, line 180, in run main(args)
File /opt/odoo/openerp/cli/server.py, line 140, in main openerp.tools.config.parse_config(args)
File /opt/odoo/openerp/tools/config.py, line 359, in parse_config openerp.netsvc.init_logger()
File /opt/odoo/openerp/netsvc.py, line 138, in init_logger resetlocale()
File /opt/odoo/openerp/tools/translate.py, line 1110, in resetlocale for ln in get_locales():
File /opt/odoo/openerp/tools/translate.py, line 1078, in get_locales lang = locale.getdefaultlocale()[0]
File /home/odoo/odoo/lib/python2.7/locale.py, line 543, in getdefaultlocale return _parse_localename(localename)
File /home/odoo/odoo/lib/python2.7/locale.py, line 475, in _parse_localename raise
ValueError, unknown locale: %s % localename
ValueError: unknown locale: UTF-8
and stops and I cant access it from any browser
I tried adding value to the default/locale but no use
do you have any idea?
I appreciate your help
LikeLike
Hello daviddean99
Thanks for that great tutorial
when i finished all scripts i tried to open localhost and got no result so i tried http://localhost:8069/ i got the following error: Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
when i checked the error log i found:
2016-08-06 14:13:40,914 1956 ERROR ? openerp.sql_db: Connection to the database failed
Traceback (most recent call last):
File “/opt/odoo/openerp/sql_db.py”, line 560, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: fe_sendauth: no password supplied
2016-08-06 14:13:40,915 1956 ERROR ? openerp.addons.bus.bus: Bus.loop error, sleep and retry
Traceback (most recent call last):
File “/opt/odoo/addons/bus/bus.py”, line 136, in run
self.loop()
File “/opt/odoo/addons/bus/bus.py”, line 114, in loop
with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
File “/opt/odoo/openerp/sql_db.py”, line 609, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
self._cnx = pool.borrow(dsn)
File “/opt/odoo/openerp/sql_db.py”, line 498, in _locked
return fun(self, *args, **kwargs)
File “/opt/odoo/openerp/sql_db.py”, line 560, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: fe_sendauth: no password supplied
any help please?
LikeLike
Sounds like your /etc/odoo-server.conf configuration file is missing the Postgresql username/password details.
LikeLike
I finally made it, thanks a lot! great post!!
LikeLike
Hi daviddean99!
Thanks for your post!
I have trouble running the ODOO, when I try “/etc/init.d/odoo start” I get:
Iniciando Odoo Server Daemon (odoo-server):bash: /root/.bashrc: Permiso denegado
bash: /home/odoo/odoo/bin/python: No existe el fichero o el directorio
[ OK ]
Do you know what did I do wrong? And how can I solve it?
Thanks!!
LikeLike
Hello David:
I’d just like to add that, personally, I found the red comments defining when to run commands as root, and when to run as odoo, a little ambiguous.
For example, in section 4, I initially interpreted the red comment to mean the box immediately beneath the comment, but it turns out it refers to the entire section. Additionally, in that section, changing user is one thing, but also appears to be vital that one is in the correct directory in order to execute the virtualenv command, so a cd /home/odoo comment might be useful there.
I think the reason I was confused is that in the next section, section 5, the red comments do refer to the boxes immediately beneath them (and the second box in the case of the git clone and the pip install requirements.txt commands.
I have never been able to make the automatic password generation work and populate into the config file, so I did that manually each time.
Other than that, as almost universally stated, this tutorial takes the sting out of a very complicated installation, and now I have a working Odoo server ready to configure, so thank you again.
Regards
Mike.
LikeLike
Jup David did a great job. UI used centos and tried any “samples” This one worked and worked well.
LikeLike
CentOS 6.5 running on VPS
Hi David – Again thank you for putting this tutorial together. To be honest, I’m asking a lot, and ignoring your advice and installing on a VPS with a Magento shop, multiple other websites and a Zimbra mail server. However, I’ve done in, but came across this issue which took a bit of headbanging to get over:
In my case, the default PostgreSQL install with a non UTF8 encoding (SQL_ASCII), something which I found Odoo does not like, as I found out when I came to the stage where I create my first database, I got a “DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)”
It turns out, for me at least, the the issue was with the initialisation of the PostgreSQL database in section 2.
I found that running the standard service postgresql-9.5 initdb was the issue, and that if I was able to explicitely specify during the initialisation, this issue went away as follows (for CentOS 6.5):
1. Change user to postgres: su postgres
2. Navigate to where the initdb executable is located: cd /usr/pgsql-9.5/bin
3. Switch user to postgreSQL owner: su postgres
3. Execute initdb, passing the encoding and data location as follows: ./initdb -E UTF8 -D /var/lib/pgsql/9.5/data
4. Now, PostgreSQL is initialised in a way that Odoo likes, and database creation can continue.
Regards,
Mike.
LikeLike
Hi David, thank you for this tutorial. To be honest, I’m having problems, and maybe I’ll post a question a bit later. Meanwhile though, in section 3, where Python is being downloaded and installed, shouldn’t the first line read ‘rm -rf /usr/local/lib/python2.7’ rather than ‘…python2.9?’. Thanks, Mike.
LikeLike
Yes, that’s an error which I’ve now corrected. Thanks for letting me know!
LikeLike
A big thank you to everyone who has taken the time to comment on my tutorial. Today I have updated it to fix some broken links, update versions, tidy up the instructions and generally improve it. It’s now working perfectly on CentOS 6.5. Enjoy!
LikeLike
Can any one please help me. I followed the guide. Got no errors. If I do the commeand ps -ef I get:
ps -ef | grep pyth
odoo 2739 1 0 17:27 ? 00:00:04 /home/odoo/odoo/bin/python /opt/odoo/openerp-server -c /etc/odoo-server.conf –pidfile=/var/run/odoo/odoo-server.pid –logfile=/var/log/odoo/odoo-server.log
But I can not connect to odoo. I also disable the firewall. If I do # tail -50f /var/log/odoo/odoo-server.log. File is empty. Any way I can do more checks? My first try on odoo.|
THank you and than you for the tutorial
LikeLike
If you have disabled the firewall then the redirect from port 80 to 8069 won’t work. Try browsing to http://x.x.x.x:8069 where x.x.x.x equals your server IP address. Hopefully you should see the database manager website. If not then you should see some errors in the Odoo logs. Also try checking /var/log/messages to see if you have any errors there. Good luck!
LikeLike
Hi David,
Many thanls :8069 worked
I did try it but now it is working.
gr8 tutorial!!!!!
LikeLike
THis is working and I am creating my database. Many thanls will see how it goes
LikeLike
David,
Compliments on the nice tutorial. It works very well. I had to adapt a a few commands as I am using a 32 bit system. This was very easy. I also checked it is better to install centos without progres db. It works better that way with your script. Also had to change two line of rpm. For that I used the browser down loaded it and installed it.
Other than that it simply worked. Will check why the firewall is creating a problem with port forwarding. But then it is better to simply use 8069. I tried a few procedures asked for help. Eventually I got yours on google and then voila it all is working.
Many thanks!!!
LikeLike
Hi David,
Several times installing odoo with this tutorial (also with tutorial for install in centos 7) and success.
A bit annoying with error message IOError (13) permission error for /odoo/lib64/lib-dynload/..zlibmodule.so,
when starting the odoo server although it is running, then I check that the modules (zlibmodule.so) actually not there in the Lib or Lib64 of odoo, then i copy the modul into path pointed by the error. This causing the odoo can not be started at all, saying that to many level of symlink,
then i remove again the module, but the odoo server still can not start, the error message only fail to start.
Then i remove the python (reintalling the python, and the modules), but still can not start.
Could you please give me a clue to how to recover from this error.
I look in error log, there are no record after since this fail to start happen.
Please help.
Thank you,
Bun
LikeLike
I know this is an old guide… But, there was some changes actually…
Step 3:
wkhtmltopdf was moved and you need install this before to avoid dependencies error …
# yum install xorg-x11-fonts-75dpi
then, install wkhtmltopdf
# rpm -ivh http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-centos6-amd64.rpm
The package libmspack was updated:
# rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/libmspack-0.5-0.1.alpha.el6.x86_64.rpm
(Usually it’s already installed)
The same for cabextract:
# rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/cabextract-1.5-1.el6.x86_64.rpm
ez_setup.py was moved too:
# wget https://bootstrap.pypa.io/ez_setup.py -O – | /usr/local/bin/python2.7
Just for do it more simple:
To avoid the warning about SNIMissingWarnin and SNIMissingWarning update ndg-httpsclient
$ pip install –upgrade ndg-httpsclient
And then install the libraries:
$ pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz babel docutils feedparser gdata Jinja2 mako mock psutil psycopg2 pydot python-dateutil python-openid pytz pywebdav pyyaml reportlab simplejson unittest2 vatnumber vobject werkzeug xlwt pyopenssl lxml python-ldap decorator requests pillow pyPdf passlib
With these updates, the installation was successfull in a CentOS 6.7…
PS: Why I’m using this guide instead other more actual? Because it’s the most detailed and accurate… And the instructions for 9 are a nightmare…
LikeLike
Thank you for your comment. I have updated the tutorial with the latest versions and it works great!
LikeLike
Works well. Though a few links are broken now which need to be updated.
These are the ones:
yum -y install xorg-x11-fonts-75dpi : dependency for below
rpm -ivh http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-centos6-amd64.rpm
core fonts:
rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/libmspack-0.5-0.1.alpha.el6.x86_64.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/cabextract-1.5-1.el6.x86_64.rpm
LikeLike
Thank you for your comment. I have updated the tutorial with the latest versions and it works great!
LikeLike
thanks
LikeLike
/etc/init.d/odoo start
Starting Odoo Server Daemon (odoo-server): [ OK ]
[root@software ~]# Traceback (most recent call last):
File “/opt/odoo/openerp-server”, line 2, in
import openerp
File “/opt/odoo/openerp/__init__.py”, line 76, in
import modules
File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
from . import db, graph, loading, migration, module, registry
File “/opt/odoo/openerp/modules/graph.py”, line 32, in
import openerp.osv as osv
File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
import osv
File “/opt/odoo/openerp/osv/osv.py”, line 23, in
from .orm import Model, TransientModel, AbstractModel
File “/opt/odoo/openerp/osv/orm.py”, line 2, in
from lxml import etree
ImportError: /home/odoo/odoo/lib/python2.7/site-packages/lxml/etree.so: undefined symbol: PyUnicodeUCS2_DecodeLatin1
LikeLike
/etc/init.d/odoo start
Starting Odoo Server Daemon (odoo-server): [ OK ]
[root@software ~]# Traceback (most recent call last):
File “/opt/odoo/openerp-server”, line 2, in
import openerp
File “/opt/odoo/openerp/__init__.py”, line 76, in
import modules
File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
from . import db, graph, loading, migration, module, registry
File “/opt/odoo/openerp/modules/graph.py”, line 32, in
import openerp.osv as osv
File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
import osv
File “/opt/odoo/openerp/osv/osv.py”, line 23, in
from .orm import Model, TransientModel, AbstractModel
File “/opt/odoo/openerp/osv/orm.py”, line 2, in
from lxml import etree
ImportError: No module named lxml
i have already installed lxml as well
pip install lxml
Requirement already satisfied (use –upgrade to upgrade): lxml in /usr/local/lib/python2.7/site-packages
LikeLike
Hi David,
I have odoo v8 installed follow this tutorial and it works, now can I install odoo v9 in the same machine side by side without disturbing odoo v8? How to do that?
Would you please write step by step guide?
Thank you,
Bun
LikeLike
rpm -ivh http://sourceforge.net/projects/wkhtmltopdf/files/0.12.2/wkhtmltox-0.12.2_linux-centos6-amd64.rpm/download is not avalaible
LikeLike
I have updated the tutorial with the latest version updates.
LikeLike
I prefer using pip install -r requrements.txt as this has right versions of python dependencies. @David, please see if you want to amend your text.
LikeLike
Thank you for your suggestion. I have updated the tutorial and it works!
LikeLike
Traceback (most recent call last):
File “/opt/odoo/openerp/http.py”, line 537, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File “/opt/odoo/openerp/http.py”, line 574, in dispatch
result = self._call_function(**self.params)
File “/opt/odoo/openerp/http.py”, line 311, in _call_function
return self.endpoint(*args, **kwargs)
File “/opt/odoo/openerp/http.py”, line 803, in __call__
return self.method(*args, **kw)
File “/opt/odoo/openerp/http.py”, line 403, in response_wrap
response = f(*args, **kw)
File “/opt/odoo/addons/web/controllers/main.py”, line 704, in create
params[‘create_admin_pwd’])
File “/opt/odoo/openerp/http.py”, line 879, in proxy_method
result = dispatch_rpc(self.service_name, method, args)
File “/opt/odoo/openerp/http.py”, line 115, in dispatch_rpc
result = dispatch(method, params)
File “/opt/odoo/openerp/service/db.py”, line 65, in dispatch
security.check_super(passwd)
File “/opt/odoo/openerp/service/security.py”, line 32, in check_super
raise openerp.exceptions.AccessDenied()
AccessDenied: Access denied.
LikeLike
Hey awesome tutorial
I have this
admin_passwd = $ODOO_DB_ADMIN_PASSWORD
; DATABASE OPTIONS
db_host = localhost
db_port = 5432
db_user = odoo
db_password = $ODOO_POSTGRES_PASSWORD
and still get error
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: FATAL: password authentication failed for user “odoo”
LikeLike
That is because in /etc/odoo-server.conf you have to change:
admin_passwd = $ODOO_DB_ADMIN_PASSWORD <— put here the password
; DATABASE OPTIONS
db_host = localhost
db_port = 5432
db_user = odoo
db_password = $ODOO_POSTGRES_PASSWORD <— put here the password
If you don't know the pass autogenerated, you can write this:
echo $ODOO_DB_ADMIN_PASSWORD
echo $ODOO_POSTGRES_PASSWORD
And the system will tell you the pass generated.
LikeLike
Thanks, already do this way and have success
LikeLike
I have installed Odoo 8 with Centos 6.7 with cPanel (VPS OVH) and all is fine but when I try to access the Odoo web database manager with this address: https://vps201503.ovh.net:2087/web/database/manager
I have an HTTP 404 Error. So anyone can help me to resolve this or can send me a solution to solve this? Regards
LikeLike
This HTTP 404 Error appears after typing the root password.
LikeLike
hello
The same problem
2015-07-29 11:19:47,564 6143 ERROR ? openerp.addons.bus.bus: Bus.loop error, sleep and retry
Traceback (most recent call last):
File “/opt/odoo/addons/bus/bus.py”, line 136, in run
self.loop()
File “/opt/odoo/addons/bus/bus.py”, line 114, in loop
with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
File “/opt/odoo/openerp/sql_db.py”, line 575, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
self._cnx = pool.borrow(dsn)
File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
return fun(self, *args, **kwargs)
File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: fe_sendauth: no password supplied
LikeLike
When i run using http://107.6.166.82/
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
perhaps in tutorial port 8069 diverted to 80 and apache server is not working .please help
LikeLike
when i am giving command /etc/init.d/odoo start
Starting Odoo Server Daemon (odoo-server): [ OK ]
root@serv01 [~]# /home/odoo/odoo/bin/python: can’t open file ‘/opt/odoo/odoo-server’: [Errno 2] No such file or directory
LikeLike
/home/odoo/odoo/bin/python: can’t open file ‘/opt/odoo/odoo-server’: [Errno 2] No such file or directory
LikeLike
try to follow this article, i got this error:
Traceback (most recent call last):
File “/opt/odoo/openerp-server”, line 2, in
import openerp
File “/opt/odoo/openerp/__init__.py”, line 76, in
import modules
File “/opt/odoo/openerp/modules/__init__.py”, line 27, in
from . import db, graph, loading, migration, module, registry
File “/opt/odoo/openerp/modules/graph.py”, line 32, in
import openerp.osv as osv
File “/opt/odoo/openerp/osv/__init__.py”, line 22, in
import osv
File “/opt/odoo/openerp/osv/osv.py”, line 23, in
from .orm import Model, TransientModel, AbstractModel
File “/opt/odoo/openerp/osv/orm.py”, line 5, in
from ..models import (
File “/opt/odoo/openerp/models.py”, line 54, in
import babel.dates
ImportError: No module named babel.dates
It means that the package babel is not installed !!
LikeLike
Hello,
I have configured the oddo as per your document and i did the insatllation successfully but i am getting error page “Internal Server Error”
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
# tail -50f /var/log/odoo/odoo-server.log
File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
return fun(self, *args, **kwargs)
File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: fe_sendauth: no password supplied
2015-06-17 10:09:13,498 13107 ERROR None werkzeug: Error on request:
Traceback (most recent call last):
File “/home/odoo/odoo/lib/python2.7/site-packages/werkzeug/serving.py”, line 180, in run_wsgi
execute(self.server.app)
File “/home/odoo/odoo/lib/python2.7/site-packages/werkzeug/serving.py”, line 168, in execute
application_iter = app(environ, start_response)
File “/opt/odoo/openerp/service/server.py”, line 290, in app
return self.app(e, s)
File “/opt/odoo/openerp/service/wsgi_server.py”, line 216, in application
return application_unproxied(environ, start_response)
File “/opt/odoo/openerp/service/wsgi_server.py”, line 202, in application_unproxied
result = handler(environ, start_response)
File “/opt/odoo/openerp/http.py”, line 1290, in __call__
return self.dispatch(environ, start_response)
File “/opt/odoo/openerp/http.py”, line 1264, in __call__
return self.app(environ, start_wrapped)
File “/home/odoo/odoo/lib/python2.7/site-packages/werkzeug/wsgi.py”, line 591, in __call__
return self.app(environ, start_response)
File “/opt/odoo/openerp/http.py”, line 1406, in dispatch
self.setup_db(httprequest)
File “/opt/odoo/openerp/http.py”, line 1348, in setup_db
httprequest.session.db = db_monodb(httprequest)
File “/opt/odoo/openerp/http.py”, line 1478, in db_monodb
dbs = db_list(True, httprequest)
File “/opt/odoo/openerp/http.py”, line 1452, in db_list
dbs = dispatch_rpc(“db”, “list”, [force])
File “/opt/odoo/openerp/http.py”, line 115, in dispatch_rpc
result = dispatch(method, params)
File “/opt/odoo/openerp/service/db.py”, line 73, in dispatch
return fn(*params)
File “/opt/odoo/openerp/service/db.py”, line 313, in exp_list
with closing(db.cursor()) as cr:
File “/opt/odoo/openerp/sql_db.py”, line 575, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
self._cnx = pool.borrow(dsn)
File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
return fun(self, *args, **kwargs)
File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: fe_sendauth: no password supplied
LikeLike
Hello
PLEASE PLEASE Help !!!
All your procedure worked like a charm with no errors. the service starts with no error, everything in OK, in log there are no errors, but i have no port opened. I performed a strace on the odoo process and there is nothing there…
“Process 2806 attached – interrupt to quit
select(0, NULL, NULL, NULL, {24, 891503}
) = 0 (Timeout)
select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {60, 0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {60, 0}^C
Process 2806 detached”
I deactivated selinux, restarted server, changed the loglevel in odoo-server.conf from warning to debug and again there is nothing there:
2015-06-04 11:45:21,753 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.workflow.workitem:WARNING”
2015-06-04 11:45:21,754 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.http.rpc.request:INFO”
2015-06-04 11:45:21,754 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.http.rpc.response:INFO”
2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.addons.web.http:INFO”
2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “openerp.sql_db:INFO”
2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “:INFO”
2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “openerp:DEBUG”
2015-06-04 11:45:21,755 1257 DEBUG ? openerp.netsvc: logger level set: “werkzeug:DEBUG”
2015-06-04 11:45:21,756 1257 INFO ? openerp: OpenERP version 8.0
2015-06-04 11:45:21,756 1257 INFO ? openerp: addons paths: [‘/home/odoo/.local/share/Odoo/addons/8.0′, u’/opt/odoo/openerp/addons’, u’/opt/odoo/addons’]
2015-06-04 11:45:21,756 1257 INFO ? openerp: database hostname: localhost
2015-06-04 11:45:21,756 1257 INFO ? openerp: database port: 5432
2015-06-04 11:45:21,757 1257 INFO ? openerp: database user: odoo
2015-06-04 11:45:22,195 1257 DEBUG ? openerp.service.server: Setting signal handlers
2015-06-04 11:45:22,196 1257 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2015-06-04 11:45:22,203 1257 DEBUG ? openerp.service.server: cron0 started!
2015-06-04 11:45:22,204 1257 DEBUG ? openerp.service.server: cron1 started!”
output of ps:
odoo 1257 4.0 2.4 145648 94812 ? Sl 14:45 0:04 /home/odoo/odoo/bin/python /opt/odoo/openerp-server -c /etc/odoo-server.conf –pidfile=/var/run/odoo/odoo-server.pid –logfile=/var/log/odoo/odoo-server.log
server config file:
[options]
; This is the password that allows database operations:
admin_passwd = 7fje_zpo5jodWOraxW8r
; DATABASE OPTIONS
db_host = localhost
db_port = 5432
db_user = odoo
db_password = mVn33eveTXa9ZCIT7pXh
; MISC SETTINGS
; LOG SETTINGS
logfile = /var/log/odoo/odoo-server.log
log_handler = werkzeug:DEBUG
log_level = debug
no-logrotate = True
LikeLike
Works like a charm for Centos 6.6. Thanks heaps.
LikeLike
When I try edit anything on odoo and tried to access from browser but received “This webpage is not available”
LikeLike
Install seemed to go well, no errors. Odoo started fine [ok], then tried to access from browser but received “This webpage is not available” . There are no entries in odoo-server.log
self._cnx = pool.borrow(dsn)
File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
return fun(self, *args, **kwargs)
File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: Connection refused
Is the server running on host “localhost” (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host “localhost” (127.0.0.1) and accepting
TCP/IP connections on port 5432?
2015-05-22 09:35:46,491 23109 ERROR ? openerp.sql_db: Connection to the database failed
Traceback (most recent call last):
File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: Connection refused
Is the server running on host “localhost” (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host “localhost” (127.0.0.1) and accepting
TCP/IP connections on port 5432?
2015-05-22 09:35:46,491 23109 ERROR ? openerp.addons.bus.bus: Bus.loop error, sleep and retry
Traceback (most recent call last):
File “/opt/odoo/addons/bus/bus.py”, line 136, in run
self.loop()
File “/opt/odoo/addons/bus/bus.py”, line 114, in loop
with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
File “/opt/odoo/openerp/sql_db.py”, line 575, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
self._cnx = pool.borrow(dsn)
File “/opt/odoo/openerp/sql_db.py”, line 464, in _locked
return fun(self, *args, **kwargs)
File “/opt/odoo/openerp/sql_db.py”, line 526, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File “/home/odoo/odoo/lib/python2.7/site-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: Connection refused
Is the server running on host “localhost” (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host “localhost” (127.0.0.1) and accepting
TCP/IP connections on port 5432?
How to fix this error
LikeLike
i followed steps and it works like a charm
Thanks
LikeLike