Installing openERP 6 on Ubuntu 10.04 server

Create the OpenERP user

#  adduser –system –home=/opt/openerp –group openerp

Install and configure PostgreSQL

# apt-get install postgresql
# su – postgres
# createuser –createdb –username postgres –no-createrole –pwprompt openerp
Enter password for new role: <– ********
Enter it again: <– ********
Shall the new role be a superuser? (y/n) <– y
# exit

Install Python libraries

apt-get install python python-psycopg2 python-reportlab \
python-egenix-mxdatetime python-tz python-pychart python-mako \
python-pydot python-lxml python-vobject python-yaml python-dateutil \
python-pychart python-pydot python-webdav \
python-cherrypy3 python-formencode python-pybabel \
python-simplejson python-pyparsing

Install OpenERP server and web client

Download source code at home Directory

# wget http://www.openerp.com/download/stable/source/openerp-server-6.0.4.tar.gz
# wget http://www.openerp.com/download/stable/source/openerp-web-6.0.4.tar.gz

install the code at “/opt/openerp/” directory

# cd /opt/openerp
# tar xvf ~/openERP/openerp-server-6.0.4.tar.gz
# tar xvf ~/openERP/openerp-web-6.0.4.tar.gz
# chown -R openerp: *
# cp  -a  openerp-server-6.0.4   server
# cp  -a  openerp-web-6.0.4   web

copy  “/opt/openerp/server/doc/openerp-server.conf” at /etc/

#  cp /opt/openerp/server/doc/openerp-server.conf  /etc/

now edit this new file

# nano /etc/openerp-server.conf

and change the line db_password = FALSE to

db_password = paassword_your entered_openerp user_postgres

apply security changing ownership and access

# chown openerp:root  /etc/openerp-server.conf
# chmod 640  /etc/openerp-server.conf

creating the boot script

# nano  /etc/init.d/openerp-server

paste

#!/bin/sh### BEGIN INIT INFO
# Provides:             openerp-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:    Enterprise Resource Management software
# Description:          Open ERP is a complete ERP and CRM software.
### END INIT INFOPATH=/bin:/sbin:/usr/bin
DAEMON=/opt/openerp/server/bin/openerp-server.py
NAME=openerp-server
DESC=openerp-server# Specify the user name (Default: openerp).
USER=openerp# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE=”/etc/openerp-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 0checkpid() {
    [ -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

owned by root and make it executable

# chown root: /etc/init.d/openerp-server
# chmod 755 /etc/init.d/openerp-server

set log directory

# mkdir /var/log/openerp
# chown openerp:root /var/log/openerp

automating OpenERP startup and shutdown

# update-rc.d openerp-server defaults

set web client

# cp  /opt/openerp/web/doc/openerp-web.cfg   /etc/openerp-web.conf
# chown  openerp:root  /etc/openerp-web.conf
# chmod  640  /etc/openerp-web.conf

creating web client boot script

# nano  /etc/init.d/openerp-web

paste

#!/bin/sh### BEGIN INIT INFO
# Provides:             openerp-web
# 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:    OpenERP Web – the Web Client of the OpenERP
# Description:          Open ERP is a complete ERP and CRM software.
### END INIT INFOPATH=”/sbin:/bin:/usr/sbin:/usr/bin”
DAEMON=”/opt/openerp/web/openerp-web.py”
NAME=”openerp-web”
DESC=”openerp-web”# Specify the user name (Default: openerp).
USER=openerp# Specify an alternate config file (Default: /etc/openerp-web.conf).
CONFIGFILE=”/etc/openerp-web.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

changing owner and permissions of execution

# chown root: /etc/init.d/openerp-web
# chmod 755 /etc/init.d/openerp-web

set to start and stop automatically

# update-rc.d openerp-web defaults

finally starts server and web client openERP

# service openerp-server start
# service openerp-web start

now you can access to the server from any browser

http://you_IP_server:8080