odoo12搭建

安裝postgresql數據庫

官網:https://www.postgresql.org/

安裝命令:

# Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Install PostgreSQL:
sudo yum install -y postgresql96-server

# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
sudo systemctl enable postgresql-9.6
sudo systemctl start postgresql-9.6

# 進入數據庫,建立初始化用戶

# 使用postgresql默認建立的用戶操做數據庫
su postgres

# 進入數據庫

psql

# 建立咱們本身的數據庫用戶
create user odoo12 with password 'odoo12';

# 查看用戶

\du

# 給odoo12用戶設置超級用戶權限

ALTER ROLE  odoo12 WITH superuser;

# 建立數據庫

CREATE DATABASE odoo12_test OWNER odoo12;

# 查看數據庫

\l

# 將數據庫全部的操做權限受權給用戶

GRANT ALL PRIVILEGES ON DATABASE odoo12_test TO odoo12;

# 退出數據庫命令行模式
Ctrl + z

# 切換回root用戶
su

# 修改數據庫配置文件,數據庫用戶能夠遠程登陸

配置文件默認是 /var/lib/pgsql/9.6/data/pg_hba.conf

若是不同可使用命令查找一下 find / -name 'pg_hba.conf'


# ====================================== 原配置文件 =================================

local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident

# ====================================== 原配置改成 =================================

local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 ident



# 重啓數據庫
sudo systemctl restart postgresql-9.6









# 安裝python3 建立虛擬環境


#  下載odoo源碼包

官網:https://www.odoo.com/zh_CN/

解壓:

tar -vzxf odoo_12.0.latest.tar.gz

將文件夾更名(我的習慣)
改成:odoo12

進入odoo目錄,安裝python依賴包

pip install -r requirements.txt

建立配置文件
進入:/odoo12/odoo/conf
建立配置文件:openserver.conf

[options]
# 數據庫名稱
db_name = odoo12_test
# 數據庫ip
db_host = 127.0.0.1
# 數據庫端口
db_port = 5432
# 數據庫用戶名
db_user = odoo12
# 數據庫密碼
db_password=odoo12
# addons的路徑
addons_path = /root/odoo12/odoo/addons


# 爲了方便使用將配置文件做軟鏈接到根路徑odoo的安裝路徑
ln -s ./odoo/conf/openserver.conf openserver.conf

# 爲了方便使用將啓動文件拷貝到odoo的安裝路徑
cp ./setup/odoo odoo-bin

# 啓動而且初始化數據
./odoo-bin -c openserver.conf -i base

# 初始化完成以後之後在啓動就不須要在初始化了,直接這樣啓動
./odoo-bin -c openserver.conf
# 測試http://127.0.0.1:8069/
相關文章
相關標籤/搜索