1. Centos在虛擬機中, 最小化安裝, 網絡鏈接選擇的是 橋接模式, 安裝完成後, 是不能直接上網的, 輸入root 和密碼, 登陸進去, 而後執行:sql
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736 #注意這個eno16777736 這東西, 在centos7 下多是隨機生成的, 以前的版本都是eth0shell
這裏只須要將 ONBOOT=no 改爲ONBOOT=yes便可, 這裏就用dhcp的方式, 而後重啓網絡服務數據庫
[root@localhost ~]# service network restart
vim
2. 到這裏僅僅是把網絡配置好, 可以上互聯網了, 如今將鼠標從黑窗口中拔出來, 使用Xshell鏈接, 如今開始配置yum源, 最小化安裝的centos 7 是沒有wget的, 因此不要想着用wget, 在宿主機(windows系統)上的瀏覽器中輸入http://mirrors.163.com/.help/CentOS7-Base-163.repo , 而後將文件下載到卓面, 而後在上傳到Centos 7的/etc/yum.repos.d目錄下, 若是不能上傳, 那麼就在windows上用記事本打開下載的文件, 複製, 而後在/etc/yum.repos.d目下新建一個Centos-Base.repo文件, 將內容拷貝進去便可
windows
[root@localhost ~]# cd /etc/yum.repos.d/
centos
[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost yum.repos.d]# vi CentOS-Base.repo
瀏覽器
# # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever-Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - 163.com baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
3. 更新系統並安裝postgre數據庫, 並對其初始化bash
[root@localhost yum.repos.d]# yum clean all服務器
[root@localhost yum.repos.d]# yum -y update網絡
[root@localhost yum.repos.d]# yum -y install postgresql postgresql-server postgresql-libs
[root@localhost yum.repos.d]# postgresql-setup initdb
4. 設置開機啓動, 而且啓動postgre數據庫, 設置postgres密碼
[root@localhost yum.repos.d]# systemctl enable postgresql
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql.service to /usr/lib/systemd/system/postgresql.service.
[root@localhost yum.repos.d]# systemctl start postgresql
[root@localhost yum.repos.d]# su - postgres
-bash-4.2$ psql
psql (9.2.18)
輸入 "help" 來獲取幫助信息.
postgres=# \password postgres
輸入新的密碼:
再次鍵入:
postgres=# \q
-bash-4.2$ exit
登出
[root@localhost ~]# yum install epel-release -y #安裝odoo的依賴
5. 添加Odoo倉庫
[root@localhost ~]# yum install yum-utils -y
[root@localhost ~]# yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo
[root@localhost ~]# yum -y install odoo #安裝odoo 10.0.20170201, 下載比較慢, 我下載了將近2個小時; 也可使用迅雷下載, 而後傳到服務器上, 安裝
[root@localhost ~]# systemctl enable odoo #建立開機自啓動
Created symlink from /etc/systemd/system/multi-user.target.wants/odoo.service to /usr/lib/systemd/system/odoo.service.
[root@localhost ~]# systemctl start odoo #啓動odoo
[root@localhost ~]# systemctl stop firewalld.service #臨時關閉防火牆, 若是想永久關閉 systemctl disable firewalld.service
#或者能夠配置放行8069端口, 初練習建議關閉防火牆, 真實環境建議放行端口
[root@localhost ~]# firewall-cmd --zone=public --add-port=8069/tcp --permanent
success
[root@localhost ~]# firewall-cmd --reload
success
默認狀況下只有本地菜運行鏈接數據庫, 若是要容許PostgreSql遠程訪問, 須要在[root@localhost ~]# vim /var/lib/pgsql/data/pg_hba.conf
文件中添加 容許訪問
6. 如今就能夠在瀏覽器中輸入ip:8069訪問了