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
server_und_serverdienste:installation_odoo13_auf_centos8 [2020/02/02 12:53] boospyserver_und_serverdienste:installation_odoo13_auf_centos8 [2021/03/04 14:48] (aktuell) lois
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. +Hauseigenes Apt-Repo: [[https://apt.iteas.at]]    [[https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KE592Y5993ZKW|{{:wiki:btn_donatecc_lg.gif|}}]] 
 +\\ 
 +\\ 
 +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 61:
 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 132: Zeile 137:
 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 158: Zeile 163:
 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 171: Zeile 176:
 <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 200: Zeile 221:
     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 242: Zeile 309:
 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 341:
 In the above tutorial, you learned how to install and configure Odoo 13 on CentOS 8 server. You also learned how to configure Nginx as a reverse proxy for Odoo 13. You can now customize your Odoo 13 instance as per your business needs. In the above tutorial, you learned how to install and configure Odoo 13 on CentOS 8 server. You also learned how to configure Nginx as a reverse proxy for Odoo 13. You can now customize your Odoo 13 instance as per your business needs.
  
-===== Source =====+===== Update your Odoo over GIT ===== 
 +<code> 
 +su - odoo 
 +</code> 
 +Next, download the latest version of the Odoo 13 from the Git repository using the git command: 
 +<code> 
 +cd /opt/odoo/odoo13 
 +git pull 
 +</code> 
 +Next, create a new virtual environment for Odoo 13 instance with the following command: 
 +<code> 
 +cd /opt/odoo 
 +python3 -m venv odoo13-venv 
 +</code> 
 +Next, activate the virtual environment with the following command: 
 +<code> 
 +source odoo13-venv/bin/activate 
 +</code> 
 +You should get the following output: 
 +<code> 
 +(odoo13-venv) [odoo@centos8 ~]$ 
 +</code> 
 +Next, update all the required Python modules for Odoo 13 with the following command: 
 +<code> 
 +pip3 install -r odoo13/requirements.txt 
 +</code> 
 +Once all the required modules are updated, deactivate the virtual environment and exit from the Odoo user with the following command: 
 +<code> 
 +deactivate 
 +exit 
 +</code> 
 +And last, restart Odoo. 
 + 
 + 
 +===== Some 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