(轉載)CentOS6下 源代碼方式安裝openERP7.0

CentOS6下 源代碼方式安裝openERP7.0

安裝背景 :CPU32 bit,CentOS 6.4版本,openERP7.0,linux shell爲bash,PostgreSQL9.2python

1. CentOS 的安裝選項有最小化安裝、基本服務器安裝、虛擬主機安裝等等的,這裏採用的是基本服務器安裝linux

二、安裝postgresql9.2 c++

若是有其餘版本的pgsql的話,能夠經過命令卸載 #yum remove postgres web

#su root   用root用戶來安裝, 中間會切換用戶!sql

#mkdir  /tmpshell

#cd /tmp 這是系統的臨時目錄,裏面的文件不重要,即便誤刪危害也不大,因此推薦在tmp目錄下作臨時性操做數據庫

#rpm -Uvh http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpmcanvas

64bit的cpu 請用下面的rpm
#rpm -Uvh http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm windows

#yum -y install postgresql92 postgresql92-server postgresql92-libs postgresql92-contrib postgresql92-devel //使用yum安裝相關依賴包
#service postgresql-9.2 initdb //初始化pg數據庫
#service postgresql-9.2 start //啓動pg服務
#chkconfig postgresql-9.2 on //將pg啓動服務加入CentOS的啓動列表,至關於windows裏面的啓動項centos

#su – postgres //切換到postgres用戶,該用戶爲安裝pg時安裝包自動建立的,它是pg默認的超級用戶,在該用戶環境下有一些管理命令
-bash-4.1(postgres)$createuser –superuser openerp //建立一個叫openerp的超級用戶(此時建立的用戶只是數據庫的用戶,openerp在操做系統中並不存在,請注意其中的區別)

3.安裝openerp

#rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm  //從網絡上安裝epel包, 32bit的就安裝這個

#rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm//,x86_64版本的

請安裝後面這個

#su root  //切換回root

#yum -y install python-psycopg2 python-lxml PyXML python-setuptools libxslt-python pytz python-matplotlib python-babel python-mako python-dateutil python-psycopg2 pychart pydot python-reportlab python-devel python-imaging python-vobject hippo-canvas-python mx python-gdata python-ldap python-openid python-werkzeug python-vatnumber pygtk2 glade3 pydot python-dateutil python-matplotlib pygtk2 glade3 pydot python-dateutil python-matplotlib python python-devel python-psutil python-docutils makeautomake gcc gcc-c++ kernel-devel byacc flashplugin-nonfree poppler-utils pywebdav //安裝OE依賴的庫,大部分都是python庫,也有一部分其餘依賴庫
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.zip

#unzip gdata-2.0.17.zip
#cd gdata-2.0.17
#python setup.py install

#cd /tmp
#rm -rf openerp* //清理不用的舊的openerp開頭的全部文件(慎用)
#wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-latest.tar.gz //下載OE源代碼包,準備安裝
#tar xvzf openerp-7.0-latest.tar.gz //解壓OE源代碼包
#mkdir /opt/oe7
#cp -R openerp*/{openerp,install/{openerp-server.init,openerp-server.conf},openerp-server,setup.py} /opt/oe7 //將咱們須要的文件拷貝到安裝目錄
#adduser openerp //建立openerp用戶,它與postgres建立的openerp是關聯的
#chown openerp:openerp /opt/oe7 -R //將OE安裝目錄下的全部文件全部者設定爲openerp用戶

#cd /opt/oe7
#chmod u+x openerp-server.init //.init文件是oe的一個啓動腳本,須要給它設置可執行權限
#mv openerp-server.init /etc/init.d/oe7server 
#chkconfig oe7server on //將oe加入CentOS啓動列表
#cp openerp-server.conf /etc //將OE的配置文件拷貝到/etc目錄下,若是想自定義配置文件路徑能夠經過給openerp-server設置選項或者修改openerp-server.init文件裏面的路徑來實現,這裏採用的方法不用作修改,較爲簡單
//到這裏OE基本上安裝完成了,可是啓動的時候會報錯,主要是仍舊缺乏一些依賴包

#cd /opt/oe7
#python setup.py install //這個安裝程序會自動從網上下載須要的依賴包,而且會建立一些目錄,咱們只須要保留openerp.egg-info目錄,若是刪除該目錄,OE啓動會有警告信息

#adduser openerp 
#chown openerp:openerp /opt/oe7 -R //將OE安裝目錄的全部者遞歸授予openerp

#service oe7server start //啓動OE,

報錯,緣由是執行 /etc/init.d/oe7server的時候,找不到pid文件,用文本編輯器打開/etc/init.d/oe7server

查看下,發現是PIDFILE=/var/run/openerp/openerp-server.pid 這行引發的,

那就 用文本編輯器創建一個空的文件,並命名爲openerp-server.pid,

放到指定的目錄/var/run/openerp/下面,若是沒有相應的目錄,手動建立就能夠了。

#chmod 755 openerp-server.pid  //修改讀寫權限

#service oe7server restart 

瀏覽器中輸入127.0.0.1:8069 試試看是否是能夠了看到openerp的登錄畫面了。

 

注意:安裝後的模塊目錄爲/usr/lib/python2.6/site-packages/openerp-7.0_20140616_231123-py2.6.egg/openerp/addons

相關文章
相關標籤/搜索