设为首页 收藏本站
查看: 852|回复: 0

[经验分享] Install OpenERP(Odoo) v7 from Github | Ubuntu 14.04 LTS

[复制链接]

尚未签到

发表于 2015-4-1 09:52:10 | 显示全部楼层 |阅读模式
  Create a user for the OpenERP application



sudo adduser --system --quiet --shell=/bin/bash --home=/opt/odoo --gecos 'ODOO' --group odoo  Install PostgreSQL database and add odoo as a postgres superuser



sudo apt-get install postgresql -y
sudo su – postgres -c “createuser -s odoo” 2> /dev/null || true  



Add password to openerp postgres user
sudo su postgres
psql template1
ALTER ROLE odoo WITH password 'XXXXX';
\q

exit  Change the postgesql.conf file to accept connections on all interfaces (development use only)



sudo vi /etc/postgresql/9.3/main/postgresql.conf  Find the listen parameter and remove the # and listen to adress *



listen_address = '*'  Change the pg_hba.conf file to change the way authentication takes place



sudo vi /etc/postgresql/9.3/main/pg_hba.conf  Find the following line



local all all peer
hosts all all 127.0.0.1/32 md5  to:



local all all md5
hosts all all 127.0.0.1/32 md5  If you want to connect to the postgres database from your machine you need to add a new line to the Ipv4 part of this file: Example is for a network 192.168.1.0/24.

host all all 192.168.1.0/24 MD5  Install the required dependicies for ODOO



sudo apt-get install python-dateutil python-feedparser python-gdata python-ldap \
python-libxslt1 python-lxml python-mako python-openid python-psycopg2 \
python-pybabel python-pychart python-pydot python-pyparsing python-reportlab \
python-simplejson python-tz python-vatnumber python-vobject python-webdav \
python-werkzeug python-xlwt python-yaml python-zsi python-docutils \
python-psutil bzr git wget python-mock python-unittest2 python-jinja2 -y  Install latest gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list



wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.tar.gz
tar zxvf gdata-2.0.17.tar.gz
cd gdata-2.0.17/
sudo python setup.py install  Install ODOO 7.0 from Github



sudo su - odoo
git clone https://www.github.com/odoo/odoo --branch 7.0
chown -R odoo: *
exit  Configure the ODOO application



sudo cp /opt/odoo/odoo/install/openerp-server.conf /etc/odoo-server.conf
sudo chown odoo: /etc/odoo-server.conf
sudo chmod 640 /etc/odoo-server.conf  In the /etc/odoo-server.conf file you need to following lines.



sudo vi /etc/odoo-server.conf  change the line: (in vi use a to start editing)



db_user = openerp
db_password = false  with:


db_user = odoo
db_password = XXXXXX

(the password setup with the ALTER ROLE command)



addons_path = /opt/odoo/odoo/addons
logfile = /var/log/odoo/odoo-server.log  Save the file (ESC :w)
  
  Create a dir for the log file and give the correct permissions



sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo  Check if the server works



sudo su odoo
python /opt/odoo/server/openerp-server --config=/etc/odoo-server.conf  Check it using your brwoser and go to: http://[ip or dns name of server]:8069
You should see the login screen or database creation of ODOO
Press CTRL+C to stop the server and use exit to get out of the openerp user shell
  Installing a boot script (if you want a boot script)



sudo vi /etc/init.d/odoo-server  Use the follwing script: (first press the a to add lines and copy the script)



#!/bin/sh
### BEGIN INIT INFO
# Provides: odoo-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Business Applications
# Description: ODOO Business Applications.
### END INIT INFO
PATH=/bin:/sbin:/usr/bin
DAEMON=/opt/odoo/server/openerp-server
NAME=odoo-server
DESC=odoo-server

# Specify the user name (Default: openerp).
USER=odoo

# Specify an alternate config file (Default: /etc/odoo-server.conf).
CONFIGFILE="/etc/odoo-server.conf"

# pidfile
PIDFILE=/var/run/$NAME.pid

# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c $CONFIGFILE"
[ -x $DAEMON ] || exit 0
[ -f $CONFIGFILE ] || exit 0
checkpid() {
[ -f $PIDFILE ] || return 1
pid=`cat $PIDFILE`
[ -d /proc/$pid ] && return 0
return 1
}

case "${1}" in
start)
echo -n "Starting ${DESC}: "
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--chuid ${USER} --background --make-pidfile \
--exec ${DAEMON} -- ${DAEMON_OPTS}
echo "${NAME}."
;;
stop)
echo -n "Stopping ${DESC}: "
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
--oknodo
echo "${NAME}."
;;

restart|force-reload)
echo -n "Restarting ${DESC}: "
start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
--oknodo
sleep 1
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--chuid ${USER} --background --make-pidfile \
--exec ${DAEMON} -- ${DAEMON_OPTS}
echo "${NAME}."
;;
*)
N=/etc/init.d/${NAME}
echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
exit 1
;;

esac
exit 0  Save the file (ESC :w)
  Check if the server works



sudo chmod 755 /etc/init.d/odoo-serversudo chown root: /etc/init.d/odoo-server

sudo /etc/init.d/odoo-server start  You should now be able to view the logfile and see that the server has started



less /var/log/odoo/odoo-server.log  and check it using your brwoser and go to: http://[ip or dns name of server]:8069
You should see the login screen or database creation of OpenERP
Change the (super)admin password of openerp. Click on Manage Databases (perhaps you’re already here). Change the password.
It adds the password in plain text in the /etc/odoo-server.conf file, that’s why we changed the permissions on this file!
  Stop the server



sudo /etc/init.d/odoo-server stop  Automatic Startup and Shutdown



sudo update-rc.d odoo-server defaults  If you reboot the server everything should be working.



来源:    


来自为知笔记(Wiz)  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-52715-1-1.html 上篇帖子: Ubuntu 14.04 Server 上安装git源 mono 3.6.1 错误记录及成功步骤 下篇帖子: ubuntu GITLAB完全导入SVN(提交历史,用户)项目
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表