【已验证】如何在centos7上安装odoo 10

2016年11月16日19:45:34 发表评论 4,219 views

Make sure that all services installed on your server are up to date and install dependencies:

sudo yum install -y epel-release
sudo yum -y update
sudo yum install yum-utils
sudo yum install fontconfig libpng libX11 libXext libXrender xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi wkhtmltopdf

 

Remove other db servers and install Postgresql and start it:

sudo yum remove mariadb mariadb-server
安装PostgreSQL数据库,添加PostgreSQL Yum Repository

第一步是在系统中安装PostgreSQL repository, 使用下面的命令.

CentOS/RHEL 7
# rpm -Uvh http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm

CentOS/RHEL 6
# rpm -Uvh http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-redhat95-9.5-2.noarch.rpm

CentOS/RHEL 5
# rpm -Uvh http://yum.postgresql.org/9.5/redhat/rhel-5-x86_64/pgdg-redhat95-9.5-2.noarch.rpm

Fedora 23:
# rpm -Uvh http://yum.postgresql.org/9.5/fedora/fedora-23-x86_64/pgdg-fedora95-9.5-3.noarch.rpm

Fedora 22
# rpm -Uvh http://yum.postgresql.org/9.5/fedora/fedora-22-x86_64/pgdg-fedora95-9.5-3.noarch.rpm

Fedora 21
# rpm -Uvh http://yum.postgresql.org/9.5/fedora/fedora-21-x86_64/pgdg-fedora95-9.5-2.noarch.rpm

 

安装PostgreSQL服务

启用PostgreSQL yum repository后,使用下面的命令来安装PostgreSQL 9.5 on.

# yum install postgresql95-server postgresql95
初始化PGDATA

安装完PostgreSQL服务后,首次使用之前需要初始化,使用下面的命令.

# /usr/pgsql-9.5/bin/postgresql95-setup initdb

上面的命令需要一些时间来初始化PostgreSQL. PGDATA 包含了数据文件夹.

PostgreSQL数据存储路径: /var/lib/pgsql/9.5/data/

开启PostgreSQL服务

使用下面的命令启动PostgreSQL. 同时也会将PostgreSQL服务加入到系统启动项.

For CentOS/RHEL 7 and Fedora 23

# systemctl start postgresql-9.5
# systemctl enable postgresql-9.5

For CentOS/RHEL 6/5 and Fedora 22/21

# service  postgresql-9.5 start
# chkconfig postgresql-9.5 on
验证PostgreSQL安装

完成上面的步骤后,PostgreSQL 9.5就安装成功了,下面我们来验证下安装的完整性.

# su - postgres

使用psql命令来进入PostgreSQL

$ psql


psql (9.5.0)
Type "help" for help.

postgres=#

需要创建密码

postgres=# \password postgres

 

Add Odoo repository:

sudo yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo

and finally install and start Odoo 10

sudo yum install -y odoo
sudo systemctl enable odoo
sudo systemctl start odoo

Open Odoo’s configuration file and uncomment the ‘admin_passwd’ line to set the admin master password

sudo vi /etc/odoo/odoo.conf


admin_passwd = YourPassword

Don’t forget to replace ‘YourPassword’ with an actual strong password.

Restart Odoo for the changes to take effect

sudo systemctl restart odoo

以上是安装步骤,至此odoo 10的安装基本上告一个段落,但是在选择数据库的时候可能会碰到如下提示

Database creation error: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template.

  解决方法请参考此文:Database creation error: new encoding (UTF8) is incompatible with the encoding

 

最后在说一下把默认的端口8069通过设置防火墙转发至80端口,本步骤根据个人喜好设置。

Firewall Settings

By default in Centos 7 minimal installation firewalld is installed and enabled. You need to open the port 8069 to be able to access it from the browser. I use this server just for Odoo tests so to make it easier to access I just forward port 80 to 8069 through fiirewalldport forwarding function:

sudo firewall-cmd --zone=public --permanent --add-masquerade
sudo firewall-cmd --zone=public --permanent --add-forward-port=port=80:proto=tcp:toport=8069
sudo systemctl reload firewalld
sudo firewall-cmd --list-all

public (default, active)
  interfaces: eno16777984
  sources: 
  services: dhcpv6-client ssh
  ports: 
  masquerade: yes
  forward-ports: port=80:proto=tcp:toport=8069:toaddr=
  icmp-blocks: 
  rich rules:

Now, open a web browser and access Odoo 10 at http://server-hostname-or-IP-address to create a new PostgreSQL database and set password for the admin user.

odoo-1-create-dbodoo-2-install-app

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
0 0 投票数
文章评分
订阅评论
提醒
guest

0 评论
内联反馈
查看所有评论