Odoo 11 Community Edition Git Installation unter Ubuntu 18.04 LTS

Alles was zum Thema Faktura, Doppelte Buchführung, Online-Banking etc. gehört. Für Linux/Windows/Mac
Post Reply
User avatar
h3rb3rn
Administrator
Posts: 189
Joined: Mon 9. Feb 2015, 23:29

Odoo 11 Community Edition Git Installation unter Ubuntu 18.04 LTS

Post by h3rb3rn »

Fassung vom 29.08.2018

In diesem Tutorial geht es nur um die Installation von Odoo 11 CE vom GitHub Repository.

Installiert und gestetet unter Ubuntu 18.04 LTS.

Hinweis: dies ist meine private Installationsanleitung für mich selbst und nicht die offizielle Installationanleitung der Community. Die offizielle Anleitung findet Ihr unter https://www.odoo.com/documentation/11.0 ... stall.html



Weitere Quellen sind https://www.howtoforge.com/tutorial/ins ... untu-16-04

System vorbereiten

Code: Select all

sudo bash


Systembenutzer für Odoo anlegen

Code: Select all

adduser --system --home=/opt/odoo --group odoo


Basiselemente der Ausführungsschicht des Systems installieren

Code: Select all

apt --yes install git postgresql python3-pip python-pip npm nodejs libxml2* libxslt* libevent-2* libevent-extra-2* libsasl2-2 libsasl2-modules libsasl2-modules-db libldap2* libffi-dev libsasl2-dev libzip-dev libzip4 python-setuptools python-cups python-dateutil python-decorator python-docutils python-feedparser python-gdata python-geoip python-gevent python-imaging* python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 python-pybabel* python-pychart python-pydot python-pyparsing python-pypdf* python-reportlab python-requests python-simplejson python-tz python-unicodecsv python-unittest2 python-vatnumber python-vobject python-werkzeug python-xlwt python-yaml python3-pypdf2 python-psycopg2 python3-psycopg2 wkhtmltopdf openvpn easy-rsa openssh-server openssl mc vim screen htop ufw nginx-full   node-amdefine node-less node-source-map python3-bs4 python3-feedparser python3-gevent python3-greenlet python3-html2text python3-ldap python3-lxml python3-mako python3-mock python3-ofxparse python3-openssl python3-passlib python3-pyasn1 python3-pyasn1-modules python3-pydot python3-pyinotify python3-pyldap python3-pyparsing python3-qrcode python3-serial python3-stdnum python3-suds python3-usb python3-vatnumber python3-vobject python3-werkzeug python3-xlsxwriter
 python3-widgetsnbextension python3-testresources virtualenvwrapper

Code: Select all

npm install -g less

Code: Select all

pip install --upgrade pip

Code: Select all

pip3 install --upgrade pip

Code: Select all

sudo pip3 install virtualenvwrapper wget coverage vobject qrcode pyldap num2words Werkzeug psycopg2 psycopg2-binary phonenumbers

Code: Select all

sudo ln -s /usr/bin/nodejs /usr/bin/node


Datenbank anlegen

Code: Select all

su - postgres

Code: Select all

createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
Passwort für Datenbankbenutzer vergeben und nochmals bestätigen

Code: Select all

exit


Aktuelle Community Version von Odoo herunterladen

Code: Select all

cd /var/lib
git clone --recursive https://github.com/odoo/odoo.git

Code: Select all

chown -R odoo:odoo /var/lib/odoo

Code: Select all

su - odoo

Code: Select all

cd /var/lib/odoo
pip3 install -r requirements.txt


Damit Odoo auch PDF Dateien generieren kann muss noch das Toolkit von https://wkhtmltopdf.org/downloads.html installiert werden
Quelle: https://strmln.de/software/installation ... ntu-16-04/

Code: Select all

cd ~
wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
Sicherheitshalber nochmals

Code: Select all

apt -f install


SSL Zertifikat installieren für https:// Übertragung

für offentliche Server mit Let's Encrypt

Voraussetzung für das Anlegen des TLS Zertifikat installieren


Quelle: https://kofler.info/lets-encrypt-zertif ... ntu-16-04/

Code: Select all

add-apt-repository ppa:certbot/certbot

Code: Select all

apt update && apt install python-certbot-apache
TLS Zertifikat für die Domain anlegen

Code: Select all

sudo certbot certonly -a webroot --webroot-path=/var/www/html -d example.com -d www.example.com
Dialog folgen. Es wird nach E-Mail gefragt und die Lizenz muss akzeptiert werden.


oder für lokale Server im Intranet mit selbstsignierten SSL Zertifikat

Code: Select all

openssl req -new -days 999 -newkey rsa:4096bits -sha512 -x509 -nodes -out odoo.crt -keyout odoo.key




Nginx Server anpassen

Code: Select all

cd /etc/nginx/sites-available/
vim odoo
Inhalt einfügen und die farbig makierten Code Fragmente an den eigenen Server anpassen
## Odoo Backend ##
upstream odooerp {
server 127.0.0.1:8069;
}

## https site##
server {
listen 443 default_server;
server_name www.example.com;
root /usr/share/nginx/html;
index index.html index.htm;

# log files
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;

# ssl files
ssl on;
ssl_ciphers ALL:!ADH:!MD5:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;


# proxy buffers
proxy_buffers 16 64k;
proxy_buffer_size 128k;

## odoo proxypass with https ##
location / {
proxy_pass http://odooerp;
# force timeouts if the backend dies
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;

# set headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}

# cache some static data in memory for 60mins
location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odooerp;
}
}

## http redirects to https ##
server {
listen 80;
server_name www.example.com;

# Strict Transport Security
add_header Strict-Transport-Security max-age=2592000;
rewrite ^/.*$ https://$host$request_uri? permanent;
}

Start in der Screen

Code: Select all

screen bash

Code: Select all

./odoo-bin --addons-path=addons --db-filter=mydb$
Post Reply