Odoo14安装 – 记忆角落

Odoo14安装

/ 0评 / 1

odoo14安装

环境准备

使用阿里yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum cleanall
yum makecache
yum update -y
yum install epel-release

安装python3

yum install -y python3 python3-devel
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的,所以要修复一下,把第一行python都修改成python2.7

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

安装准备

用户准备 添加odoo用户

useradd -m -U -r -d /home/odoo -s /bin/bash odoo

依赖包准备

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

数据库准备 安装设置Postgresql Odoo14需要Postgresql 10以上

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

创建数据库用户

su - postgres -c "createuser -s odoo"

安装Wkhtmltopdf

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm
yum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm

Odoo14 安装

su - odoo
git clone https://github.com/odoo/odoo.git --depth 1 --branch 14.0 /home/odoo/odoo14

配置Python环境

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

创建相关目录

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

doo配置文件

vim /etc/odoo.conf
[options]
; This is the password that allows database operations:
admin_passwd = xinsec@2018
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 = /home/odoo/odoo14/addons,/home/odoo/odoo14-custom-addons

配置文件权限

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

配置服务

vim /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=/home/odoo/odoo14-venv/bin/python3 /home/odoo/odoo14/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target

启动服务

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

服务访问 http://ip:8069/

发表评论

您的电子邮箱地址不会被公开。