在centos7上安装odoo9 服务器配置 install odoo9 with centos7

如果不会处理mariadb和PostgreSQL的话,就先吧mariadb删了(一般也不用 卸载)

yum remove mariadb mariadb-server

清理一下RPM包

yum clean all
yum update

安装PostgreSQL 和 PHP-PostgreSQL 的扩展

yum install postgresql-libs postgresql-server postgresql php-pgsql php-gd
yum install php*

安装大蟒蛇和扩展

yum install babel python-devel libxslt-python pyparsing python-dateutil python-decorator python-imaging python-jinja2 python-ldap python-lxml python-mako python-psycopg2 python-reportlab python-requests python-werkzeug python-yaml python-docutils  python-matplotlib python-unittest2.noarch python-babel python-gevent pygtk2 glade3 pytz libxslt-devel bzr automake gcc gcc-c++ byacc kernel-headers python-passlib

yum install pychart nodejs-less python-feedparser python-mock python-openid python-psutil python-vobject

安装JS(如果报错,没关系,执行下面的命令)

yum install nodejs*(如果报错,执行下面的命令)
yum install nodejes-less nodejs-clean-css

重启一下APACHE

systemctl restart httpd.service

初始化 PostgreSQL database cluster:

postgresql-setup initdb

让PostgreSQL跟随系统启动

systemctl enable postgresql.service

启动PostgreSQL service 给 ‘postgres’ 用户设置密码

systemctl start postgresql.service
su - postgres
psql
\password postgres
(Enter new password twice)
\q
exit

创建系统用户 ‘odoo’:(ssh可以配置只能用证书登录)

adduser odoo
passwd odoo

创建PostgreSQL用户“odoo”

su - postgres -c "createuser --pwprompt --createdb --no-createrole --no-superuser odoo"
(Enter new 'odoo' user password twice)

下载RPM包并安装

cd /opt 
wget http://nightly.odoo.com/9.0/nightly/rpm/odoo_9.0.latest.noarch.rpm
rpm -ivh odoo_9.0.latest.noarch.rpm

如果有问题的话,无法连接 pydot.googlecode.com或者什么GOOGLE之类的

就在/etc/hosts加入103.7.200.79    pydot.googlecode.com(这个IP暂时可以用你缺什么就直接加入xxx.gogglexsad(之类的).com)

给ODOO用户openerp文件夹的权限

chown odoo -R /usr/lib/python2.7/site-packages/openerp/

执行下面两个步骤

export LD_LIBRARY_PATH; LD_LIBRARY_PATH=/usr/local/lib
source ~odoo/.bashrc

编辑一下postgresql的本地访问权限 ‘/var/lib/pgsql/data/pg_hba.conf’

vi /var/lib/pgsql/data/pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust # changed from 'peer'
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust # changed from 'ident'
# IPv6 local connections:
host    all             all             ::1/128                 trust # changed from 'ident'

检查一下是否成功

su - postgres
psql
postgres=# \l
                             List of databases
   Name    |  Owner   | Encoding  | Collate | Ctype |   Access privileges
-----------+----------+-----------+---------+-------+-----------------------
 postgres  | postgres | SQL_ASCII | C       | C     |
 template0 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres
 template1 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres

以UTF8编码, 运行下面这几条命令

update pg_database set datallowconn = TRUE where datname = 'template0';
\c template0
update pg_database set datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UTF8';
update pg_database set datistemplate = TRUE where datname = 'template1';
\c template1
update pg_database set datallowconn = FALSE where datname = 'template0';
\q

编辑一下/etc/odoo/openerp-server.conf(一般也不用编辑)

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /usr/lib/python2.7/site-packages/openerp/addons

proxy_mode = True(需要APACHE做转发的开启)

重启一下postgreSQL服务

systemctl restart postgresql.service

设置开机启动

systemctl enable odoo

启动

systemctl start odoo

现在访问你的http://ip:8069试试吧!

httpd conf

<VirtualHost 115.28.221.102:80>
ServerName finance.memotz.com
ServerAlias finance.memotz.com // Use this if you want dbfillter on subdomain
ErrorLog /var/log/httpd/openerp-error.log
CustomLog /var/log/httpd/openerp-access.log combined
ProxyRequests Off
ProxyPass / http://127.0.0.1:8069/
ProxyPassReverse / http://127.0.0.1:8069/
ProxyVia On
LogLevel warn
</VirtualHost>

此条目发表在linux应用, 日常笔记分类目录。将固定链接加入收藏夹。

发表评论

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

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据