天天看點

Odoo 部署windows server 2012

需要安裝前置更新檔

clearcompressionflag.exe、KB2919442、KB2919355、KB2932046、KB2959977、KB2937592、KB2938439、KB2934018。

使用odoo14官網安裝包

位址:

https://www.odoo.com/zh_CN/page/download

NSSM運作Nginx

下載下傳新版的nginx-window

http://nginx.org/en/download.html

系統找不到nssm則切到odoo安裝目錄下nssm\x64或\86下運作

注冊服務 路徑為nginx.exe的路徑

nssm install Nginx "D:\Program Files\Odoo 14.0.20210710\nginx-1.21.3\nginx.exe"

運作服務

nssm start Nginx

停止服務

nssm stop Nginx

移除服務

nssm remove Nginx

nignx.conf配置檔案

#user  nobody;
worker_processes  1;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    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  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  1800;

    gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
    gzip on;

    upstream odoo {
        server 127.0.0.1:8069 fail_timeout=3000s;
    }
    upstream odoopoll {
        server 127.0.0.1:8072 fail_timeout=3000s;
    }

    server {
        listen       80;
        server_name  localhost;
        charset utf-8;
        access_log off;

        location / {
            proxy_pass http://odoo;

            client_body_timeout 1200s;
            proxy_connect_timeout 1200s;
            proxy_send_timeout 1200s;
            proxy_read_timeout 1200s;
            proxy_redirect    off;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Forwarded-Host $server_name;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /longpolling/ {
            proxy_set_header Host $host:8072;
            proxy_pass http://odoopoll/longpolling/;
            proxy_redirect    off;
            proxy_set_header  X-Real-IP        $remote_addr;
            proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_connect_timeout 3600s;
            proxy_read_timeout 3600s;
            proxy_send_timeout 3600s;
            send_timeout 3600;

         }

        location ~* /[0-9a-zA-Z_]*/static/ {
            proxy_cache_valid       200 60m;
            proxy_buffering         on;
            expires                 864000;
            proxy_pass              http://odoo;
        }
        client_header_buffer_size 512k;
        large_client_header_buffers 4 512k;
    }

}

           

NSSM重新開機odoo

nssm restart odoo-server-14.0

問題彙總

原因:

解決:

"""Strptime-related classes and functions.

CLASSES:
    LocaleTime -- Discovers and stores locale-specific time information
    TimeRE -- Creates regexes for pattern matching a string of text containing
                time information

FUNCTIONS:
    _getlang -- Figure out what language is being used for the locale
    strptime -- Calculates the time struct represented by the passed-in string

"""
import time
import locale
import calendar
from re import compile as re_compile
from re import IGNORECASE
from re import escape as re_escape
from datetime import (date as datetime_date,
                      timedelta as datetime_timedelta,
                      timezone as datetime_timezone)
try:
    from _thread import allocate_lock as _thread_allocate_lock
except ImportError:
    from _dummy_thread import allocate_lock as _thread_allocate_lock

# 追加一行
locale.setlocale(locale.LC_ALL,'en') 

__all__ = []
           

繼續閱讀