CentOS 安装 Odoo10
postgresql
- 根据系统生成命令 https://www.postgresql.org/download/linux/redhat/
- sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- 禁用内置psql
sudo dnf -qy module disable postgresql
- 安装psql
sudo yum install -y postgresql10-server
- 安装contrib
sudo yum install postgresql10-contrib -y
- 初始化
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
- 开机启动
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10
- 切换用户
su - postgres
psql
- 修改默认密码
alter user postgres with password 'postgres'
- 创建用户
create user xianwei with password 'password';
- 创建odoo数据库
create database odoo owner xianwei;
- 授权数据库
grant all privileges on database odoo to xianwei;
- ALTER USER xianwei WITH CREATEDB;
- 重启 systemctl restart postgresql-10
python2.x
- yum install python2
odoo10
- git clone https://gitee.com/mirrors/odoo.git –depth 1 –branch 10.0 –single-branch odoo10
- sudo yum install libxml2-devel libxslt-devel python2-devel openldap-devel libffi-devel gcc
- cd odoo10
- pip2 install -r requirements.txt
- curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
- 修改 /etc/yum.repos.d/nodesource-*.repo 文件,将其中的所有 rpm.nodesource.com 替换为 mirrors.ustc.edu.cn/nodesource/rpm
- sudo yum install -y nodejs
- npm config set registry https://registry.npm.taobao.org
- sudo npm install -g less@3.0.4 less-plugin-clean-css
- vim odoo.config
- vim /etc/systemd/system/odoo.service
1 | #修改pip镜像 ~.pip/pip.config |
1 | #odoo.config |
1 | #/etc/systemd/system/odoo.service |
问题
- OptionBinding with id “failovermethod” does not exist
sudo sed -iBAK '/^failovermethod=/d' /etc/yum.repos.d/*.repo
- centos添加用户
- adduser xianwei
- chmod -v u+w /etc/sudoers
- vim /etc/sudoers
- xianwei ALL=(ALL) ALL
- chmod -v u-w /etc/sudoers
- 忘记psql密码
- 修改/var/lib/pgsql/10/data/pg_hba.conf的local为trust
- 远程访问
- 修改/var/lib/pgsql/10/data/postgresql.conf文件中的listen_addresses为*
- /var/lib/pgsql/10/data/pg_hba.conf添加
1
host all xianwei 0.0.0.0/0 md5
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 yinxianwei!
评论