Install OpenERP(Odoo) v7 from Github | Ubuntu 14.04 LTS

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 aptget 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 aptget install pythondateutil pythonfeedparser pythongdata pythonldap \
pythonlibxslt1 pythonlxml pythonmako pythonopenid pythonpsycopg2 \
pythonpybabel pythonpychart pythonpydot pythonpyparsing pythonreportlab \
pythonsimplejson pythontz pythonvatnumber pythonvobject pythonwebdav \
pythonwerkzeug pythonxlwt pythonyaml pythonzsi pythondocutils \
pythonpsutil bzr git wget pythonmock pythonunittest2 pythonjinja2 y

Install latest gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list

wget http://gdatapythonclient.googlecode.com/files/gdata2.0.17.tar.gz
tar zxvf gdata2.0.17.tar.gz
cd gdata2.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/openerpserver.conf /etc/odooserver.conf
sudo chown odoo: /etc/odooserver.conf
sudo chmod 640 /etc/odooserver.conf

In the /etc/odoo-server.conf file you need to following lines.

sudo vi /etc/odooserver.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/odooserver.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/openerpserver config=/etc/odooserver.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/odooserver

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/openerpserver
NAME=odooserver
DESC=odooserver
 
# 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}: “
startstopdaemon start quiet pidfile ${PIDFILE} \
chuid ${USER} background makepidfile \
exec ${DAEMON} ${DAEMON_OPTS}
echo “${NAME}.”
;;
stop)
echo n “Stopping ${DESC}: “
startstopdaemon stop quiet pidfile ${PIDFILE} \
oknodo
echo “${NAME}.”
;;
 
restart|forcereload)
echo n “Restarting ${DESC}: “
startstopdaemon stop quiet pidfile ${PIDFILE} \
oknodo
sleep 1
startstopdaemon start quiet pidfile ${PIDFILE} \
chuid ${USER} background makepidfile \
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/odooserversudo chown root: /etc/init.d/odooserver
 
sudo /etc/init.d/odooserver start

You should now be able to view the logfile and see that the server has started

less /var/log/odoo/odooserver.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/odooserver stop

Automatic Startup and Shutdown

sudo updaterc.d odooserver defaults

If you reboot the server everything should be working.

Related Posts

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注