Follow Linode docs for Installing Odoo 10 on Ubuntu, but am going to run it on Debian.
Also Linode docs for Getting Started and securing the server, including Fail2Ban.
Using gmail for SMTP with sendmail:
NOTE: editing mail configs done as super user with sudo su
, otherwise cd
is not recognized when run with sudo cd
.
https://linuxconfig.org/configuring-gmail-as-sendmail-email-relay.
Since I am running this server without a FQDN, I also need to fake one:
root@yemaya:/etc/mail# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 localhost.localdomain localhost
# Remove following line
# 127.0.1.1 server_name
45.56.115.85 hostname.home.local server_name
And
root@yemaya:/etc/mail# cat /etc/hostfile
hostname.home.local server_name
May set up an Iptables firewall, but first will get things up and running.
Now for Odoo.
sudo apt install git
sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 10.0 --single-branch /opt/odoo
sudo apt install python-pip
sudo pip install -r /opt/odoo/doc/requirements.txt
sudo pip install -r /opt/odoo/requirements.txt
Get an error
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
sudo apt-get install libxml2-dev libxslt1-dev
sudo pip install lxml
More errors on installing /opt/odoo/requirements.txt
:
/usr/bin/ld: cannot find -lz
etc...
In file included from Modules/LDAPObject.c:9:0:
Modules/errors.h:8:18: fatal error: lber.h: No such file or directory
#include "lber.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for python-ldap
This seems to be because libxml2-dev
was not yet installed. Here I install it with other libraries some of which are already installed.
sudo apt-get install libxml2-dev libxslt-dev python-dev lib32z1-dev
Then, run pip install lxml
which probably hadn’t worked the first time.
Also had to apt-get install libldap2-dev
and libsasl2-dev
.
Then there were errors installing Wkhtmltopdf:
dpkg: dependency problems prevent configuration of wkhtmltox:
Which were NOT SOlved this way:
sudo apt-get -f install
SOlution ended up being:
apt --fix-broken install
sudo apt-get install gdebi-core
Then if you ran sudo gdebi wkhtmltox-0.12.1_linux-trusty-amd64.deb
you would get the message that the requirement is already satisfied.
Oh. Not quite. Missing libpng12-0
! Couldn’t find source for apt
so:
wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
sudo gdebi libpng12-0_1.2.54-1ubuntu1_amd64.deb
sudo wget http://mirrors.kernel.org/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_1.4.2-0ubuntu3_amd64.deb
sudo gdebi libjpeg-turbo8_1.4.2-0ubuntu3_amd64.deb
sudo wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.10_amd64.deb
sudo gdebi libssl1.0.0_1.0.2g-1ubuntu4.10_amd64.deb
Now I can finally run sudo gdebi wkhtmltox-0.12.1_linux-trusty-amd64.deb
successfully.
More missing dependencies. Adding debian source to /etc/apt/sources.list
:
## Manually added for libpng12-0 and others.
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
What a pain. I was able to install
sudo apt install git python-pip postgresql python-all-dev python-dev python-setuptools libxml2-dev libxslt1-dev libevent-dev libsasl2-dev libldap2-dev pkg-config libtiff5-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev liblcms2-utils libwebp-dev tcl8.6-dev tk8.6-dev python-tk libyaml-dev fontconfig
But:
E: Unable to locate package postgresql-server-dev-9.5
E: Couldn't find any package by glob 'postgresql-server-dev-9.5'
E: Couldn't find any package by regex 'postgresql-server-dev-9.5'
E: Package 'libjpeg8-dev' has no installation candidate
One down: sudo apt install postgresql-server-dev-9.6
, and it looks like we don’t need to install libjpg8-dev
because we have libjpeg62-turbo-dev
:
Package libjpeg8-dev is not available, but is referred to by another package...
However the following packages replace it:
libjpeg62-turbo-dev
Up and running. Now to configure the database through the GUI.
What’s the database name?
sudo -u postgres psql postgres
# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(3 rows)