当前位置: 代码迷 >> 综合 >> Linux系统上部署ERP系统(odoo)
  详细解决方案

Linux系统上部署ERP系统(odoo)

热度:2   发布时间:2024-02-05 22:07:02.0

一、所有服务器关闭防火墙:

setenforce 0

systemctl stop firewalld

systemctl disable firewalld

sed -i 's/enforcing/disabled/g' /etc/selinux/config

二、CentOS 7 系统安装 PostgreSQL 12服务

PostgreSQL数据库,默认是只接受本地访问连接。如果想在其他主机访问,只需要修改data目录下的pg_hba.conf和postgresql.conf文件配置。

  • pg_hba.conf:配置对数据库的访问权限;
  • postgresql.conf:配置PostgreSQL数据库服务器的相应的参数
  • https://nightly.odoocdn.com/

1.CentOS 7 系统安装 PostgreSQL 12
[root@localhost ~]# yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# 软件库安装成功后,安装 PostgreSQL:
[root@localhost ~]# yum install postgresql12 postgresql12-server
# 数据库安装成功后,初始化数据库实例、设置开机启动并启动 PostgreSQL 数据库:
[root@localhost ~]# /usr/pgsql-12/bin/postgresql-12-setup initdb
Initializing database ... OK
[root@localhost ~]# systemctl enable postgresql-12.service
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-12.service to /usr/lib/systemd/system/postgresql-12.service.
[root@localhost ~]# systemctl start  postgresql-12.service
# 数据库启动成功后,服务器设置管理密码:
[root@localhost ~]# su - postgres
-bash-4.2$ psql
psql (12.3)
输入 "help" 来获取帮助信息.

# 注意odoo用户名用双引号
postgres=# create user "odoo13" with password 'odoo13' createdb; 
postgres=# \q
-bash-4.2$ exit
登出
[root@localhost ~]# vim /var/lib/pgsql/12/data/pg_hba.conf
# 修改配置文件,按照如下格式

local all all trust

host all 127.0.0.1/32 trust

[root@localhost ~]# systemctl restart  postgresql-12.service
[root@localhost ~]# systemctl status  postgresql-12.service

三、CentOS 7 安装 Odoo 13 server 

[root@localhost ~]#wget https://nightly.odoo.com/13.0/nightly/rpm/odoo_13.0.latest.noarch.rpm

[root@localhost ~]#yum localinstall odoo_13.0.latest.noarch.rpm

 

vim /etc/odoo/odoo.conf

# 修改配置文件中的用户和密码

[options]

; This is the password that allows database operations:

; admin_passwd = admin

db_host = False

db_port = False

db_user = odoo13

db_password = odoo13

addons_path = /usr/lib/python2.7/site-packages/odoo/addons

启动:

# 防火墙添加8069端口
firewall-cmd --zone=public --add-port=8069/tcp --permanent
firewall-cmd --reload
# 查看是否生效
firewall-cmd --list-all
# enable设置odoo开机启动 
systemctl enable odoo
systemctl restart odoo

systemctl status odoo

四、CentOS 7 安装 wkhtmltopdf

[root@localhost ~]#yum install wkhtmltopdf
# 安装中文字体 
[root@localhost ~]#yum install wqy-microhei-fonts wqy-zenhei-fonts

[root@localhost ~]# systemctl restart  postgresql-12.service