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 LTS server (64 bit).
The result of this installation is an automatic boot-up of the OpenERP servers (application and web-server).
1:The Ubuntu user must have root rights.
Installation of dependencies and postgresql .
# sudo addgroup openerp
# sudo adduser --ingroup openerp openerp
# password = test1234
# sudo apt-get install postgresql (installs postgresql 8.4)
# sudo su – postgres
# createuser --createdb --no-createrole --pwprompt openerp
# password test1234
Shall the new role be a superuser? (y/n) n
exit
Now install the python and different essential for python
#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
#sudo easy_install PyYaml
Installation of Openerp-server
create a directory with the name of openerp in /home/
1: # 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
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)
Control C (to shut down the openerp-server)
exit
2:Installation of the Openerp-server daemon
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
sudo vim /etc/init.d/openerp-server (create a new file)
paste all this lines below there in the file,
#! /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 &
22/33
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() {
23/33
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
now do the following steps one by one
1: #sudo chmod +x /etc/init.d/openerp-server
2: #sudo mkdir /var/log/openerp
3: #sudo touch /var/log/openerp/openerp-server.log
4: #sudo chown -R openerp:openerp /var/log/openerp/
5: #sudo update-rc.d openerp-server defaults
6: #su openerp
7: $ cd /home/openerp
8: $vim .openerp_serverrc
do the following changes in the file .openerp_serverrc
Change:
[options]
without_demo = False
smtp_port = 25
db_password = False
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 #test1234
stop_after_init = False
test_file = False
reportgz = False
xmlrpc = True
netrpc_port = 8070
db_port = False # add port 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 #add localhost
email_from = False
addons_path = /usr/local/lib/python2.6/dist-packages/openerp-server/addons
static_http_document_root = None
save and exit
now do the following steps
1: #sudo chmod 777 /usr/local/lib/python2.6/dist-packages/openerp-server/addons
2: #sudo /etc/init.d/openerp-server start
3: #sudo /etc/init.d/openerp-server status (it must say: running)
now install the openerp-web to access the openerpserver through web.
Installing Openerp-web
1: # cd /home/openerp
2: # sudo wget http://www.openerp.com/download/stable/source/openerp-web-6.0.1.tar.gz
sudo tar zxvf openerp-web-6.0.1.tar.gz
3: # cd /home/openerp/openerp-web-6.0.1
4: # sudo vim setup.py and change the value of line 9 from >= to == and exit from there.
5: # sudo python setup.py install (this installation takes a while)
./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).
Installation of the Openerp-web daemon
6: # sudo mkdir /usr/local/bin/openerp
sudo vim /usr/local/bin/openerp/openerp-web
paste:
#!/bin/sh exit
7: cd /home/openerp/openerp-web-6.0.1
8: exec /usr/bin/python ./openerp-web.py $@
9: sudo chmod +x /usr/local/bin/openerp/openerp-web
10: sudo vim /etc/init.d/openerp-web (create a new file)Paste:
#!/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 27/33 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
***********************************************************************************
12: sudo chmod +x /etc/init.d/openerp-web
13: sudo chmod 777 /home/openerp/openerp-web-6.0.1/addons
14: sudo cp /usr/local/lib/python2.6/dist-packages/openerp_web-6.0.1-py2.6.egg/doc/openerp-web.cfg /etc/
15: sudo vim /etc/openerp-web.cfg
copy and past the lines below :
Change:
log.access_file = "/var/log/openerp-web/access.log" log.error_file = "/var/log/openerp-web/error.log"
16: sudo mkdir -p /var/log/openerp-web
17: sudo touch /var/log/openerp-web/access.log
18: sudo touch /var/log/openerp-web/error.log
19: sudo chown -R openerp:openerp /var/log/openerp-web/
20: sudo update-rc.d openerp-web defaults
21: sudo /etc/init.d/openerp-web start
Browser interface
Type in your browser:
http://ipaddressserver:8080
You must see a login screen; create a database first .
Post created By Imran Ullah (shahmeer_IT@yahoo.com)