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
- Instalasi Nginx
1
#apt install nginx
- Stop Nginx
1
systemctl stop nginx
- Instalasi Cerbot
1
apt install certbot
- Pembuatan sertifikat SSL (dan juga untuk renew)
1
certbot certonly --standalone -d proweb.domainku.id --preferred-challenges http --agree-tos -n -m aris@emalku.co.id --keep-until-expiring
- Contoh hasil
123456789
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"
- Contoh /etc/nginx/sites-enabled/odoo.conf
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
#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;
}
- Tambahkan proxy_mode = True pada /etc/odoo/odoo.conf
Jika menggunakan Docker Container tidak perlu menambahkan proxy_mode
- Restart Odoo
1
#systemctl restart odoo
Jika menggunakan container tidak perlu restart
- Start Nginx
1
#systemctl start nginx
- 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
Pingback:Aktifkan HTTPS/SSL pada Odoo ERP – PT Proweb Indonesia
Pingback:Instalasi Odoo 14 pada Ubuntu Server – PT Proweb Indonesia
Pingback:Instalasi Odoo ERP pada Docker – PT Proweb Indonesia
Pingback:Menjalankan odoo-bin untuk Odoo ERP daemon – PT Proweb Indonesia