How to install and configure openerp on Ubuntu 10.10 setp by step instructions

Summary: Installation of OpenERP v6.x.x on Ubuntu server 10.10 MAVERAK
Manual installation of the openerp-server and the openerp-web server (OpenERP v6.x.x) on the same
server machine, with a fresh installed Ubuntu 10.10 server (64 bit).

Install only the openssh server,make no server system updates after the server installation.
The result of this installation is an automatic boot-up of the OpenERP servers (application and webserver).

Step-1:- The Ubuntu login user must have root rights.
Step-2:- Installation of dependencies and postgresql

sudo addgroup openerp
sudo adduser –ingroup openerp openerp

# password = openerp@1233

Step-3: Install Postgres if not installed already.

sudo apt-get install postgresql (installs postgresql 8.4)

Step-4:Login to postgres and create database and user for openerp

sudo su – postgres
createuser –createdb –no-createrole –pwprompt openerp
#password openerp@123
Shall the new role be a superuser? (y/n) y
exit from postgresql command: \q

Step-5: Install dependencies for OpenErp Server

sudo apt-get install python-psycopg2 python-reportlab python-imaging python-egenix-mxdatetime python-tz python-pychart python-pydot python-lxml python-vobject python-yaml python-profiler python-setuptools python-mako graphviz python-dev build-essential

Step-6: Install Python module Yaml for installation process to start

sudo easy_install PyYaml

Step-6: Installation of Openerp-server

cd /home/openerp
sudo wget http://www.openerp.com/download/stable/source/openerp-server-6.0.1.tar.gz
sudo tar zxvf openerp-server-6.0.1.tar.gz
cd /home/openerp/openerp-server-6.0.1
sudo python setup.py install
su openerp

Step-7: Set your control to the ERP server and start the server

cd /home/openerp/openerp-server-6.0.1
openerp-server -s

(This starts up the server and also creates a configuration file “.openerp_serverrc” in the directory /home/openerp)
You must see something like this:

[2011-01-29 18:25:21,645][?] INFO:server:OpenERP version – 6.0.1
[2011-01-29 18:25:21,646][?] INFO:server:addons_path – /usr/local/lib/python2.6/dist-packages/openerp-server/addons
[2011-01-29 18:25:21,646][?] INFO:server:database hostname – localhost
[2011-01-29 18:25:21,646][?] INFO:server:database port – 5432
[2011-01-29 18:25:21,646][?] INFO:server:database user – openerp
[2011-01-29 18:25:21,646][?] INFO:server:initialising distributed objects services
[2011-01-29 18:25:21,829][?] INFO:web-services:starting HTTP service at 0.0.0.0 port 8069
[2011-01-29 18:25:21,830][?] INFO:web-services:starting HTTPS service at 0.0.0.0 port 8071
[2011-01-29 18:25:21,830][?] INFO:web-services:Registered XML-RPC over HTTP
[2011-01-29 18:25:21,831][?] INFO:web-services:starting NET-RPC service at 0.0.0.0 port 8070
[2011-01-29 18:25:21,831][?] INFO:server:Starting 3 services
[2011-01-29 18:25:21,833][?] INFO:server:OpenERP server is running, waiting for connections…

Step-8:- Control C (to shut down the openerp-server)
exit
Step-9:- Installation of the Openerp-server daemon (create a new file)

sudo vi /etc/init.d/openerp-server

#! /bin/sh
### BEGIN INIT INFO
# Provides: openerp-server
# Required-Start: $syslog

# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenERP Server – the server
# Description: OpenERP is a complete ERP and CRM software
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC=openerp-server
NAME=openerp-server
DAEMON=/usr/local/bin/openerp-server
# Specify the user name (Default: openerp).
USER=”openerp”
# Specifty an alternate config file (Default: ~/.openerp_serverrc)
CONFIGFILE=”/home/openerp/.openerp_serverrc”
# pidfile
PIDFILE=/var/run/$NAME.pid
# Additional options that are passed to the Daemon
DAEMON_OPTS=”-c $CONFIGFILE”
# Exit if the package is not installed
[ -x “$DAEMON” ] || exit 0
[ -f $CONFIGFILE ] || exit 0
checkpid() {
[ -f $PIDFILE ] || return 1
pid=`cat $PIDFILE`
[ -d /proc/$pid ] && return 0
return 1
}
# function that starts the daemon/service
if [ -f /lib/lsb/init-functions ] || [ -f /etc/gentoo-release ] ; then
do_start() {
start-stop-daemon –start –quiet –pidfile $PIDFILE \
–chuid $USER –background –make-pidfile \
–exec $DAEMON — $DAEMON_OPTS
RETVAL=$?
sleep 5 # wait for few seconds
return $RETVAL
}
# Function that stops the daemon/service
do_stop() {
start-stop-daemon –stop –quiet –pidfile $PIDFILE –oknodo
RETVAL=$?
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile
return $RETVAL
}
do_restart() {
start-stop-daemon –stop –quiet –pidfile $PIDFILE –oknodo
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile
start-stop-daemon –start –quiet –pidfile $PIDFILE \
–chuid $USER –background –make-pidfile \
–exec $DAEMON — $DAEMON_OPTS
RETVAL=$?
sleep 5 # wait for few seconds
return $RETVAL
}
else
do_start() {
$DAEMON $DAEMON_OPTS > /dev/null 2>&1 &

RETVAL=$?
sleep 5 # wait for few seconds
echo $! > $PIDFILE # create pidfile
return $RETVAL
}
do_stop() {
pid=`cat $PIDFILE`
kill -15 $pid
RETVAL=$?
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile
return $RETVAL
}
do_restart() {
if [ -f $PIDFILE ]; then
do_stop
fi
do_start
return $?
}
fi
start_daemon() {
if [ -f $PIDFILE ]; then
echo “pidfile already exists: $PIDFILE”
exit 1
fi
echo -n “Starting $DESC: ”
do_start
checkpid
if [ $? -eq 1 ]; then
rm -f $PIDFILE
echo “failed.”
exit 1
fi
echo “done.”
}
stop_daemon() {
checkpid
if [ $? -eq 1 ]; then
exit 0
fi
echo -n “Stopping $DESC: ”
do_stop
if [ $? -eq 1 ]; then
echo “failed.”
exit 1
fi
echo “done.”
}
restart_daemon() {
echo -n “Reloading $DESC: ”
do_restart
checkpid
if [ $? -eq 1 ]; then
rm -f $PIDFILE
echo “failed.”
exit 1
fi
echo “done.”
}
status_daemon() {

echo -n “Checking $DESC: ”
checkpid
if [ $? -eq 1 ]; then
echo “stopped.”
else
echo “running.”
fi
}
case “$1” in
start) start_daemon ;;
stop) stop_daemon ;;
restart|force-reload) restart_daemon ;;
status) status_daemon ;;
*)
N=/etc/init.d/$NAME
echo “Usage: $N {start|stop|restart|force-reload|status}” >&2
exit 1
;;
esac
exit 0
# vim: sts=4 st=4 et

Step-10: Make the file executable to run as a service

sudo chmod +x /etc/init.d/openerp-server

Step-11: Create a log file directory and file

sudo mkdir /var/log/openerp
sudo touch /var/log/openerp/openerp-server.log
sudo chown -R openerp:openerp /var/log/openerp/
sudo update-rc.d openerp-server defaults
su openerp

Step-12: Do proper changes in the server file.

cd /home/openerp
vim .openerp_serverrc

Change: do the following changes in this file # set the value according to your requirements

[options]
without_demo = False
smtp_port = 25
db_password = False #openerp@123
xmlrpcs_interface =
syslog = False
logrotate = True
xmlrpcs_port = 8071
test_report_directory = False
list_db = True
xmlrpc_interface =
timezone = False
cache_timeout = 100000
smtp_password = False
secure_pkey_file = server.pkey
xmlrpc_port = 8069
log_level = info
test_disable = False
admin_passwd = admin
assert_exit_level = error
smtp_server = localhost
static_http_url_prefix = None
test_commit = False
xmlrpcs = True
demo = {}
login_message = False
import_partial =
pidfile = None
db_maxconn = 64
stop_after_init = False
test_file = False
reportgz = False
xmlrpc = True
netrpc_port = 8070
db_port = False #5432
db_name = False
debug_mode = False
netrpc = True
secure_cert_file = server.cert
logfile = none #/var/log/openerp/openerp-server.log
csv_internal_sep = ,
pg_path = None
static_http_enable = False
translate_modules = [‘all’]
smtp_ssl = False
root_path = /usr/local/lib/python2.6/dist-packages/openerp-server
netrpc_interface =
smtp_user = False
db_user = “openerp”
db_host = False #localhost
email_from = False
addons_path = /usr/local/lib/python2.6/dist-packages/openerp-server/addons
static_http_document_root = None
exit

Step-13:

sudo chmod 777 /usr/local/lib/python2.6/dist-packages/openerp-server/addons

Step-14:

sudo /etc/init.d/openerp-server start

Step-15:

sudo /etc/init.d/openerp-server status (it must say: running)

Step-16: Installing Openerp-web

cd /home/openerp

Step-17:

sudo wget http://www.openerp.com/download/stable/source/openerp-web-6.0.1.tar.gz

Step-18:

sudo tar zxvf openerp-web-6.0.1.tar.gz

Step-19:

cd /home/openerp/openerp-web-6.0.1

Step-20:

sudo python setup.py install (this installation takes a while)

Step-21:

./openerp-web.py (start server for testing)

You must see something like this:

[29/Jan/2011:19:37:37] ENGINE Bus STARTING
[29/Jan/2011:19:37:37] ENGINE Started monitor thread ‘_TimeoutMonitor’.
[29/Jan/2011:19:37:37] ENGINE Started monitor thread ‘Autoreloader’.
[29/Jan/2011:19:37:37] ENGINE Serving on 0.0.0.0:8080
[29/Jan/2011:19:37:37] ENGINE Bus STARTED
Control C (to shut down the openerp-web server).

Step-22: Installation of the Openerp-web daemon

sudo mkdir /usr/local/bin/openerp

Step-23:

sudo vim /usr/local/bin/openerp/openerp-web

paste the two line shown below and save, exit.

#!/bin/sh

Step-24:

cd /home/openerp/openerp-web-6.0.1
exec /usr/bin/python ./openerp-web.py $@

Step-25:

sudo chmod +x /usr/local/bin/openerp/openerp-web

Step-26:

sudo vim /etc/init.d/openerp-web (create a new file)

Paste the below scrip to the file

#!/bin/sh
### BEGIN INIT INFO
# Provides:
openerp-web
# Required-Start:
$syslog
# Required-Stop:
$syslog
# Should-Start:
$network
# Should-Stop:
$network
# Default-Start:
2345
# Default-Stop:
016
# Short-Description: OpenERP Web – the Web Client of the OpenERP
# Description:
OpenERP is a complete ERP and CRM software.
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin/openerp
DAEMON=/usr/local/bin/openerp/openerp-web
NAME=openerp-web
DESC=openerp-web
# Specify the user name (Default: openerp).
USER=”openerp”
# Specify an alternate config file (Default: /etc/openerp-web.cfg).
CONFIGFILE=”/etc/openerp-web.cfg”
# pidfile
PIDFILE=/var/run/$NAME.pid
# Additional options that are passed to the Daemon
DAEMON_OPTS=”-c $CONFIGFILE”
# Exit if the package is not installed
[ -x “$DAEMON” ] || exit 0
[ -f $CONFIGFILE ] || exit 0
checkpid() {
[ -f $PIDFILE ] || return 1
pid=`cat $PIDFILE`
[ -d /proc/$pid ] && return 0
return 1
}
# function that starts the daemon/service
#
if [ -f /lib/lsb/init-functions ] || [ -f /etc/gentoo-release ] ; then
do_start() {
start-stop-daemon –start –quiet –pidfile $PIDFILE \
–chuid $USER –background –make-pidfile \
–exec $DAEMON — $DAEMON_OPTS
RETVAL=$?
sleep 5 # wait for few seconds
return $RETVAL
}
#
# Function that stops the daemon/service
do_stop() {
start-stop-daemon –stop –quiet –pidfile $PIDFILE –oknodo
RETVAL=$?
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile
return $RETVAL
}
do_restart() {
start-stop-daemon –stop –quiet –pidfile $PIDFILE –oknodo
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile
start-stop-daemon –start –quiet –pidfile $PIDFILE \
–chuid $USER –background –make-pidfile \
–exec $DAEMON — $DAEMON_OPTS

RETVAL=$?
sleep 5 # wait for few seconds
return $RETVAL
}
else
do_start() {
$DAEMON $DAEMON_OPTS > /dev/null 2>&1 &
RETVAL=$?
sleep 5 # wait for few seconds
echo $! > $PIDFILE # create pidfile
return $RETVAL
}
do_stop() {
pid=`cat $PIDFILE`
kill -15 $pid
RETVAL=$?
sleep 2 # wait for few seconds
rm -f $PIDFILE # remove pidfile
return $RETVAL
}
do_restart() {
if [ -f $PIDFILE ]; then
do_stop
fi
do_start
return $?
}
fi
start_daemon() {
if [ -f $PIDFILE ]; then
echo “pidfile already exists: $PIDFILE”
exit 1
fi
echo -n “Starting $DESC: ”
do_start
checkpid
if [ $? -eq 1 ]; then
rm -f $PIDFILE
echo “failed.”
exit 1
fi
echo “done.”
}
stop_daemon() {
checkpid
if [ $? -eq 1 ]; then
exit 0
fi
echo -n “Stopping $DESC: ”
do_stop
if [ $? -eq 1 ]; then
echo “failed.”
exit 1
fi
echo “done.”
}
restart_daemon() {
echo -n “Reloading $DESC: ”
do_restart
checkpid
if [ $? -eq 1 ]; then

rm -f $PIDFILE
echo “failed.”
exit 1
fi
echo “done.”
}
status_daemon() {
echo -n “Checking $DESC: ”
checkpid
if [ $? -eq 1 ]; then
echo “stopped.”
else
echo “running.”
fi
}
case “$1” in
start) start_daemon ;;
stop) stop_daemon ;;
restart|force-reload) restart_daemon ;;
status) status_daemon ;;
*)
N=/etc/init.d/$NAME
echo “Usage: $N {start|stop|restart|force-reload|status}” >&2
exit 1
;;
esac
exit 0
# vim: sts=4 st=4 et

Step-27:

sudo chmod +x /etc/init.d/openerp-web

Step-28:

sudo chmod 777 /home/openerp/openerp-web-6.0.1/addons

Step-29:

sudo cp /usr/local/lib/python2.6/dist-packages/openerp_web-6.0.1-py2.6.egg/doc/openerp-web.cfg /etc/

Step-30:

sudo vi /etc/openerp-web.cfg

Change:

log.access_file = “/var/log/openerp-web/access.log”
log.error_file = “/var/log/openerp-web/error.log”

save and exit
Step-31:

sudo mkdir -p /var/log/openerp-web

Step-32:

sudo touch /var/log/openerp-web/access.log

Step-33:

sudo touch /var/log/openerp-web/error.log

Step-34:

sudo chown -R openerp:openerp /var/log/openerp-web/

Step-35:

sudo update-rc.d openerp-web defaults

Step-36:

sudo /etc/init.d/openerp-web start

Browser interface
Type in your browser:

http://ipaddressserver:8080 or http://localhost:8080

You must see a login screen; create first a database.

if you find the error of does not connect to server or database can not be create, super admin bad password then go vim /etc/init.d/openerp-server and do the proper changes of your db_passwd: your postgresql openerp user password:
reboot you openerp server and openerp-web , refresh your browser this time you be happy to see you can add database.!!!!!
And EnJoY using the OpEnErP

*Hope This Help You And Save Your Time*

Comments
  1. 3 years ago
  2. 10 months ago

Leave a Reply

Your email address will not be published. Required fields are marked *