+-
Odoo 14 Centos 7 安装教程
首页 专栏 erp 文章详情
0

Odoo 14 Centos 7 安装教程

兆鑫软件 发布于 5 月 9 日

更新系统

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

参考资料
odoo erp python3 centos7 postgresql
阅读 72 发布于 5 月 9 日
举报
收藏
分享
本作品系原创, 采用《署名-非商业性使用-禁止演绎 4.0 国际》许可协议
avatar
兆鑫软件
38 声望
6 粉丝
关注作者
0 条评论
得票数 最新
提交评论
avatar
兆鑫软件
38 声望
6 粉丝
关注作者
宣传栏
目录

更新系统

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

参考资料