Pada saat instalasi awal Odoo maka kita melihat bahwa Odoo menggunakan port 8069 yang belum dilengkapi dengan SSL. Untuk itu kita memerlukan instalasi SSL agar Odoo ERP kita aman. Kita akan menggunakan SSL dari Let’s Encrypt untuk mengamankan lalu lintas data.

Instalasi Lets Encrypt pada Odoo ERP adalah

  1. Instalasi Nginx
    #apt install nginx
    
  2. Stop Nginx
    systemctl stop nginx
    
  3. Instalasi Cerbot
    apt install certbot
    
  4. Pembuatan sertifikat SSL (dan juga untuk renew)
    certbot certonly --standalone -d proweb.domainku.id --preferred-challenges http --agree-tos -n -m aris@emalku.co.id --keep-until-expiring
    
  5. Contoh hasil
    IMPORTANT NOTES:
    - Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/proweb.domainku.id/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/proweb.domainku.id/privkey.pem
    Your cert will expire on 2022-01-06. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot
    again. To non-interactively renew *all* of your certificates, run
    "certbot renew"
    
  6. Contoh /etc/nginx/sites-enabled/odoo.conf
    #odoo server
    upstream odoo {
    server 127.0.0.1:8069;
    }
    upstream odoochat {
    server 127.0.0.1:8072;
    }
    
    # http -> https
    server {
    listen 80;
    server_name proweb.domainku.id;
    rewrite ^(.*) https://$host$1 permanent;
    }
    
    server {
    listen 443;
    server_name proweb.domainku.id;
    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;
    
    # Add Headers for odoo proxy mode
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    
    # SSL parameters
    ssl on;
    ssl_certificate /etc/letsencrypt/live/proweb.domainku.id/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/proweb.domainku.id/privkey.pem;
    
    # log
    access_log /var/log/nginx/odoo.access.log;
    error_log /var/log/nginx/odoo.error.log;
    
    # Redirect longpoll requests to odoo longpolling port
    location /longpolling {
    proxy_pass http://odoochat;
    }
    
    # Redirect requests to odoo backend server
    location / {
    proxy_redirect off;
    proxy_pass http://odoo;
    }
    
    # common gzip
    gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
    gzip on;
    }
    
  7. Tambahkan proxy_mode = True pada /etc/odoo/odoo.conf
    Jika menggunakan Docker Container tidak perlu menambahkan proxy_mode
  8. Restart Odoo
    #systemctl restart odoo

    Jika menggunakan container tidak perlu restart

  9. Start Nginx
    #systemctl start nginx
  10. Silahkan masuk ke https Odoo anda

Informasi lebih lanjut silahkan mengunjungi
1. https://computingforgeeks.com/install-odoo-ubuntu-focal-with-lets-encrypt-ssl/ .
2. https://www.odoo.com/documentation/14.0/administration/install/deploy.html .
3. https://www.odoo.com/documentation/14.0/administration/install/install.html .
4. https://docs.docker.com/engine/reference/commandline/exec/ .
5. https://stackoverflow.com/questions/28721699/root-password-inside-a-docker-container .
6. https://phase2.github.io/devtools/common-tasks/ssh-into-a-container/ .

Kunjungi www.proweb.co.id untuk menambah wawasan anda.

Jika anda tertarik mengenai aplikasi Odoo ERP silahkan mengisi form di bawah ini

Instalasi SSL Let’s Encryt pada Odoo ERP