关于odoo:Odoo-14-Centos-7-安装教程

44次阅读

共计 2466 个字符,预计需要花费 7 分钟才能阅读完成。

更新零碎

sudo yum update -y
sudo yum install epel-release

装置 Python3

sudo yum install -y python3 python3-devel

设置 Python3

alternatives --install /usr/bin/python python /usr/bin/python2 50
alternatives --install /usr/bin/python python /usr/bin/python3.6 60
alternatives --config python

修复 Yum
因为 Yum 要应用 Python2 的,所以要修复一下

cat /usr/bin/yum
#!/usr/bin/python2.7
cat /usr/libexec/urlgrabber-ext-down
#!/usr/bin/python2.7

增加 odoo 用户

sudo useradd -m -U -r -d /opt/odoo -s /bin/bash odoo

增加零碎依赖包

sudo yum install git gcc wget nodejs libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel

装置设置 Postgresql
Odoo14 须要 Postgresql 10 以上

# 装置 RPM 仓库:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# 装置 PostgreSQL:
sudo yum install -y postgresql12-server
# 初始化数据库并设置自启动:
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl enable postgresql-12
sudo systemctl start postgresql-12

创立数据库用户

sudo su - postgres -c "createuser -s odoo"

装置 Wkhtmltopdf

# 如果下不动的能够本人从其余电脑 github 下载,而后上传
sudo wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
# 下完后就开始本地装置
sudo yum localinstall wkhtmltox-0.12.5-1.centos7.x86_64.rpm

下载安装 Odoo14

# 切换到之前创立的用户
sudo su - odoo
# git clone
git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo/odoo14

配置 Python 环境

cd /opt/odoo && python3 -m venv odoo14-venv
source odoo14-venv/bin/activate
pip3 install -r odoo14/requirements.txt
deactivate && exit

创立相干目录

# 自定义插件目录
sudo mkdir /opt/odoo/odoo14-custom-addons
sudo chown odoo: /opt/odoo/odoo14-custom-addons
# log 目录和文件
sudo mkdir /var/log/odoo14
sudo touch /var/log/odoo14/odoo.log
sudo chown -R odoo: /var/log/odoo14/

Odoo 配置文件

sudo nano /etc/odoo.conf
# 复制上面的文件内容,记得批改本人的 master_password
[options]
; This is the password that allows database operations:
admin_passwd = master_password
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
; longpolling_port = 8072
logfile = /var/log/odoo14/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo14/addons,/opt/odoo/odoo14-custom-addons

配置文件权限

sudo chown odoo:odoo /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf

配置服务

sudo nano /etc/systemd/system/odoo14.service

复制以下服务配置

[Unit]
Description=Odoo14
Requires=postgresql-12.service
After=network.target postgresql-12.service
[Service]
Type=simple
SyslogIdentifier=odoo14
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo14-venv/bin/python3 /opt/odoo/odoo14/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target

启动服务

sudo systemctl daemon-reload
sudo systemctl start odoo14.service
sudo systemctl enable odoo14.service

配置实现,http://{ip_address}:8069

参考资料

正文完
 0