已在Ubuntu Linux上启动了新的Odoo服务器。使用了Yenthe Van Ginekken(可能是最受欢迎的脚本)的脚本:
sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/11.0/odoo_install.sh
没有精美的模块。安装SSL证书(使用Certbot)后,我意识到讨论和聊天应用程序无法正常工作。因此,我更新了配置(workers = 4,代理模式为true)以及Nginx配置。
Odoo配置:
[options]
addons_path = /odoo/odoo-server/addons,/odoo/custom/addons
admin_passwd = pwd
csv_internal_sep = ,
data_dir = /odoo/.local/share/Odoo
db_host = False
db_maxconn = 64
db_name = False
db_password = False
db_port = False
db_sslmode = prefer
db_template = template1
db_user = False
dbfilter =
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
http_enable = True
http_interface =
http_port = 8070
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200
limit_time_real_cron = -1
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile = /var/log/cier/cier-server.log
logrotate = False
longpolling_port = 8072
max_cron_threads = 1
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
pg_path = None
pidfile = None
proxy_mode = True
reportgz = False
server_wide_modules = web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_commit = False
test_enable = False
test_file = False
test_report_directory = False
translate_modules = ['all']
unaccent = False
without_demo = False
workers = 8
Nginx:
#odoo server
upstream odoo {
server 127.0.0.1:8070;
}
upstream odoochat {
server 127.0.0.1:8072;
}
# http -> https
server {
listen 80;
server_name www.onet.pl;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443;
server_name www.onet.pl;
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;
# listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/onet.pl/fullchain.pem; # managed$
ssl_certificate_key /etc/letsencrypt/live/onet.pl/privkey.pem; # manag$
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
# 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;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
proxy_pass http://odoo;
expires 365d;
}
# common gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
奇怪的是,当我检查8072端口(使用lsof -i :8072
)时,那里什么也没有监听...
好的,我花了一些时间解决了这个问题。尚未真正找到答案,为什么长时间轮询无法使用正确的设置-这就是为什么我要让问题保持开放状态。
我基本上已经用不使用HTTPS的简单代理反向配置替换了原始的nginx配置:
server {
listen 80;
server_name http://yoursite.com;
location / {
proxy_pass http://0.0.0.0:8069;
proxy_redirect off;
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 $scheme;
proxy_read_timeout 3000000;
client_max_body_size 2000M;
}
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
}
然后,我仅使用Certbot(https://certbot.eff.org/)并选择要重定向的选项(这是最后一点)。由Certbot生成的配置看起来有所不同,但是可以工作。将于周一在其他网站上进行测试并制作一个教程。