Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
Nächste ÜberarbeitungBeide Seiten, nächste Überarbeitung
server_und_serverdienste:installation_odoo13_auf_centos8 [2020/02/02 12:42] boospyserver_und_serverdienste:installation_odoo13_auf_centos8 [2020/02/27 13:11] – [Source] boospy
Zeile 1: Zeile 1:
-====== Installation Odoo13 auf CentOS8 ======+====== Installation Odoo13 on CentOS8 with IPV6 and Let's Encrypt ======
 {{:server_und_serverdienste:centos.png?nolink&100|}} {{:server_und_serverdienste:centos.png?nolink&100|}}
 {{:server_und_serverdienste:odoo-logo.png?nolink&150|}} {{:server_und_serverdienste:odoo-logo.png?nolink&150|}}
  
-In this tutorial, we will learn how to install and configure Odoo 13 with Nginx as a reverse proxy on CentOS 8 server. +In this tutorial, we will learn how to install and configure Odoo 13 with Nginx as a reverse proxy on CentOS 8 server with IPV4 and IPV6
  
 ===== Requirements ===== ===== Requirements =====
Zeile 57: Zeile 57:
 wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
 dnf localinstall wkhtmltox-0.12.5-1.centos7.x86_64.rpm dnf localinstall wkhtmltox-0.12.5-1.centos7.x86_64.rpm
 +dnf install compat-openssl10 libpng15
 </code> </code>
  
Zeile 110: Zeile 111:
 db_password = False db_password = False
 xmlrpc_port = 8069 xmlrpc_port = 8069
 +http_interface = ::
 logfile = /var/log/odoo13/odoo.log logfile = /var/log/odoo13/odoo.log
 logrotate = True logrotate = True
Zeile 131: Zeile 133:
 User=odoo User=odoo
 Group=odoo Group=odoo
-ExecStart=/opt/odoo/odoo13-venv/bin/python3-c /etc/odoo.conf+ExecStart=/opt/odoo/odoo13-venv/bin/python3 /opt/odoo/odoo13/odoo-bin -c /etc/odoo.conf
 StandardOutput=journal+console StandardOutput=journal+console
 [Install] [Install]
Zeile 157: Zeile 159:
 You should see the following output: You should see the following output:
 <code> <code>
-tcp        0      0 0.0.0.0:8069            0.0.0.0:*               LISTEN      952/python3+tcp6       0      0 :::8069                 :::*                    LISTEN      12787/python3
 </code> </code>
-==== Configure Nginx as a Reverse Proxy for Odoo 13 ====+==== Configure Nginx as a Reverse Proxy with Let's Encrypt for Odoo 13 ====
 Next, you will need to install and configure the Nginx as a reverse proxy for Odoo 13 instance. First, install the Nginx web server with the following command: Next, you will need to install and configure the Nginx as a reverse proxy for Odoo 13 instance. First, install the Nginx web server with the following command:
 <code> <code>
-dnf install nginx+dnf install nginx mod_ssl
 </code> </code>
 Once installed, create a new virtual host configuration file with the following command: Once installed, create a new virtual host configuration file with the following command:
Zeile 170: Zeile 172:
 <code> <code>
 upstream odoo { upstream odoo {
- server 127.0.0.1:8069;+ server [::1]:8069;
 } }
 +
 server { server {
     listen 80;     listen 80;
-    server_name example.com;+    listen [::]:80; 
 +    server_name foo.example.com
 +    include /etc/nginx/snippets/letsencrypt.conf; 
 +    return 301 https://$host$request_uri;
  
     access_log /var/log/nginx/odoo13.access.log;     access_log /var/log/nginx/odoo13.access.log;
     error_log /var/log/nginx/odoo13.error.log;     error_log /var/log/nginx/odoo13.error.log;
 +}
 +
 +server {
 +    listen 443 ssl http2;
 +    listen [::]:443 ssl http2;
 +    server_name foo.example.com;
 +
 +    ssl_certificate /etc/letsencrypt/live/foo.example.com/fullchain.pem;
 +    ssl_certificate_key /etc/letsencrypt/live/foo.example.com/privkey.pem;
 +    ssl_trusted_certificate /etc/letsencrypt/live/foo.example.com/chain.pem;
 +    include /etc/nginx/snippets/ssl.conf;
 +    include /etc/nginx/snippets/letsencrypt.conf;
  
-        location / {+            location / {
         proxy_set_header X-Forwarded-Host $host;         proxy_set_header X-Forwarded-Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Zeile 199: Zeile 217:
     gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;     gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
     gzip on;     gzip on;
 +}
 +</code>
 +For the initial setup you must comment out allo SSL entries in this file. 
 +After that edit the file ''/etc/nginx/nginx.conf'', and replace the file with this:
 +<code>
 +user nginx;
 +worker_processes auto;
 +error_log /var/log/nginx/error.log;
 +pid /run/nginx.pid;
 +
 +include /usr/share/nginx/modules/*.conf;
 +
 +events {
 +    worker_connections 1024;
 +}
 +
 +http {
 +    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
 +                      '$status $body_bytes_sent "$http_referer" '
 +                      '"$http_user_agent" "$http_x_forwarded_for"';
 +
 +    access_log  /var/log/nginx/access.log  main;
 +
 +    sendfile            on;
 +    tcp_nopush          on;
 +    tcp_nodelay         on;
 +    keepalive_timeout   65;
 +    types_hash_max_size 2048;
 +
 +    include             /etc/nginx/mime.types;
 +    default_type        application/octet-stream;
 +
 +    include /etc/nginx/conf.d/*.conf;
 +
 +    server {
 +        listen       80 default_server;
 +        listen       [::]:80 default_server;
 +        server_name  _;
 +        root         /var/lib/letsencrypt;
 +        #return 301 https://$host$request_uri;
 +
 +        include /etc/nginx/default.d/*.conf;
 +
 +        error_page 404 /404.html;
 +        error_page 500 502 503 504 /50x.html;
 +    }
 } }
 </code> </code>
Zeile 241: Zeile 305:
 setsebool -P httpd_can_network_connect on setsebool -P httpd_can_network_connect on
 </code> </code>
 +==== Install and configure Let's Encrypt ====
 +<code>
 +cd /root
 +wget https://dl.eff.org/certbot-auto
 +mv certbot-auto /usr/local/bin/certbot-auto
 +chown root /usr/local/bin/certbot-auto
 +chmod 0755 /usr/local/bin/certbot-auto
 +/usr/local/bin/certbot-auto certonly --agree-tos --email foo@example.com --webroot -w /var/lib/letsencrypt/ -d foo.example.com
 +</code>
 +After setup is finished, comment in all SSL entries again, and restart Nginx. ''systemctl restart nginx'' Now it is easy to create some cronjob weekly to renew the certificate from Let's Encrypt automaticly.
 +<code>
 +crontab -e
 +</code>
 +<code>
 +@weekly root test -x /usr/local/bin/certbot-auto -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && /usr/local/bin/certbot-auto -q renew --renew-hook "systemctl reload nginx"
 +</code>
 +If you would like to test it you can do it with this simple command:
 +<code>
 +certbot-auto renew --dry-run
 +</code>
 +
 ===== Access Odoo 13 Web Interface ===== ===== Access Odoo 13 Web Interface =====
 Now, Odoo 13 is installed and configured. It's time to access the Odoo 13 web interface. Open your web browser and type the URL http://example.com. You will be redirected to the following page: Now, Odoo 13 is installed and configured. It's time to access the Odoo 13 web interface. Open your web browser and type the URL http://example.com. You will be redirected to the following page:
Zeile 253: Zeile 338:
  
 ===== Source ===== ===== Source =====
 +Some Source is from here:
 https://www.howtoforge.com/tutorial/how-to-install-odoo-erp-13-on-centos-8 https://www.howtoforge.com/tutorial/how-to-install-odoo-erp-13-on-centos-8