从Launchpad源码安装openerp7 --ubuntu
-
更新系统:
[quote]sudo apt-get update
sudo apt-get upgrade[/quote]
建立一个用户 for openerp
[quote]sudo adduser --system --home=/opt/openerp –group openerp[/quote]
安装配置 PostgreSQL, the openERP opensource database
[quote]sudo apt-get install postgresql -y
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
Enter a password then log out with:
exit[/quote]
请记住输入的密码 PASSWORD
p配置postgre远程接入
[quote]sudo nano /etc/postgresql/9.1/main/pg_hba.conf[/quote]
Let the contents of the file the same as below:
RESPECT THE ORIGINAL TAB
[quote]# Database administrative login by Unix domain socket
local all all trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 0.0.0.0/0 trust
# IPv6 local connections:
host all all ::1/128 md5[/quote]
Save and close
Now, let’s make the postgres listen on any interface / address
[quote]sudo nano /etc/postgresql/9.1/main/postgresql.conf[/quote]
[quote]Uncomment the line:
#listen_addresses = 'localhost'
Change to:
listen_addresses = '*'[/quote]
重启 postgresql service:
[quote]sudo /etc/init.d/postgresql restart[/quote]
* Restarting PostgreSQL 9.1 database server [ OK ]
Install python packages:
[quote]sudo apt-get install python-dateutil python-feedparser python-gdata python-ldap <br />python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel <br />python-pychart python-pydot python-pyparsing python-reportlab python-simplejson <br />python-tz python-vatnumber python-vobject python-webdav python-werkzeug <br />python-xlwt python-yaml python-zsi python-docutils -y[/quote]
再加几个
[quote]sudo apt-get install python-mock python-unittest2 python-jinja2 -y[/quote]
安装bzr 下载源码
[quote]sudo apt-get install bzr -y[/quote]
Create openerp dir:
[quote]sudo mkdir -p /opt/openerp/7.0
sudo chown openerp.openerp /opt/openerp/ -R
sudo chmod 770 /opt/openerp/ -R[/quote]
Turn on the OpenERP user with the following command:
[quote]sudo su openerp --shell=/bin/bash[/quote]
This commands download and can take a little long, be patience:
[quote]cd /opt/openerp/7.0
bzr branch lp:openerp-web/7.0 web -r last:1
bzr branch lp:openobject-addons/7.0 addons -r last:1
bzr branch lp:openobject-server/7.0 server -r last:1[/quote]
以上做好了,就可以运行openerp7了:
[quote]cd /opt/openerp/7.0/server
./openerp-server --db_user=openerp --db_password=PASSWORD --db_host=127.0.0.1 <br /> --db_port=5432 --addons-path=/opt/openerp/7.0/addons,/opt/openerp/7.0/web/addons <br />-c openerp-server.conf –-save[/quote]
Access your openERP,浏览器输入如下地址: http://localhost:8069 br />按 CTRL + C, 停止服务.
( NEVER STOP ON A DATABASE UPDATE )
一下内容设置Openerp作为ubuntu的系统服务,并随系统自动启动,无需像上面一样手动重启
用supervisor 搞定 方法如下
sudo apt-get install supervisor
# sudo touch /etc/supervisor/conf.d/openerp.conf
# sudo gedit /etc/supervisor/conf.d/openerp.conf
将以下内容写到openerp.conf文件,如果方便管理可以改为openerp-7.0.conf
[program:openerp]
; openerp 启动脚本
command=python /opt/openerp/7.0/server/openerp-server --db_user=openerp --db_password=PASSWORD --db_host=127.0.0.1 --db_port=5432 --addons-path=/opt/openerp/7.0/addons,/opt/openerp/7.0/web/addons -c openerp-server.conf
; openerp 目录
directory=/opt/openerp/7.0/server/
; 是否随系统启动
autostart=true
; 自动重启
autorestart=true
; 启动时间,如果超过这个时间oe还没有挂,则视为已经启动
startsecs=3
; 启动用户
user=openerp
redirect_stderr=true
; log 文件
stdout_logfile=/var/log/openerp-server-7.0.log
stdout_logfile_maxbytes=500MB
stdout_logfile_backups=50
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
loglevel=warn
重启即ok -
[quote author=pophu link=topic=5853.msg14602#msg14602 date=1364105688]
注:如果数据量太大,可以考虑分段下载 -r1000 pull,可能addons数据量有点大
[/quote]
你这是要下最新源码,把Commit History都拉下来干嘛?
用这个-r last:1 参数, 如:<br />$ bzr branch lp:openobject-addons/7.0 addons -r last:1<br />
这样只会下载最后一个版本,详细帮助请运行 $ bzr help revisionspec -
自己写启动脚本呗。
不过,源码运行我推荐用 Supervisor ,参考 《Linux 下使用 Supervisor 管理源码启动的 OpenERP》 http://buke.github.com/blog/2012/07/16/user-supervisor-manager-openerp/ -
谢谢buke
由于同时启动server web,脚本还真不太会写
用supervisor 搞定 方法如下
apt-get install supervisor
# touch /etc/supervisor/conf.d/openerp.conf
# gedit /etc/supervisor/conf.d/openerp.conf
将以下内容写到openerp.conf文件,如果方便管理可以改为openerp-7.0.conf
[program:openerp]
; openerp 启动脚本
command=python /opt/openerp/7.0/server/openerp-server --db_user=openerp --db_password=PASSWORD --db_host=127.0.0.1 --db_port=5432 --addons-path=/opt/openerp/7.0/addons,/opt/openerp/7.0/web/addons -c openerp-server.conf
; openerp 目录
directory=/opt/openerp/7.0/server/
; 是否随系统启动
autostart=true
; 自动重启
autorestart=true
; 启动时间,如果超过这个时间oe还没有挂,则视为已经启动
startsecs=3
; 启动用户
user=openerp
redirect_stderr=true
; log 文件
stdout_logfile=/var/log/openerp-server-7.0.log
stdout_logfile_maxbytes=500MB
stdout_logfile_backups=50
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
loglevel=warn
重启即ok