建立openerp用户
sudo su – postgres
createuser –createdb –no-createrole –pwprompt openerp
— Shall the new role be a superuser? (y/n) y
— password: *****
安装依赖包
sudo apt-get install python-lxml sudo apt-get install python-mako sudo apt-get install python-egenix-mxdatetime sudo apt-get install python-dateutil sudo apt-get install python-psycopg2 sudo apt-get install python-pychart sudo apt-get install python-pydot sudo apt-get install python-tz sudo apt-get install python-reportlab sudo apt-get install python-yaml sudo apt-get install python-vobject
下载和安装
wget http://www.openerp.com/download/stable/source/openerp-server-6.0.1.tar.gz tar xvfz openerp-server-6.0.1.tar.gz
建立执行脚本
#!/bin/sh cd /userdir/openerp/openerp-server-6.0.1/bin exec /usr/bin/python ./openerp-server.py $@
建立配置文件
# /etc/openerp-server.conf(5) - configuration file for openerp-server(1) [options] # Enable the debugging mode (default False). verbose = False debug_mode = False # The file where the server pid will be stored (default False). #pidfile = /var/run/openerp.pid # The file where the server log will be stored (default False). logfile = /var/log/openerp-server.log # The unix account on behalf openerp is running. process_user = zg # The IP address on which the server will bind. # If empty, it will bind on all interfaces (default empty). interface = # The TCP port on which the server will listen (default 8069). #port = 8070 # Enable debug mode (default False). debug_mode = False # Launch server over https instead of http (default False). secure = False # Specify the SMTP server for sending email (default localhost). smtp_server = localhost # Specify the SMTP user for sending email (default False). smtp_user = False # Specify the SMTP password for sending email (default False). smtp_password = False # Specify the database name. db_name = # Specify the database user name (default None). db_user = openerp # Specify the database password for db_user (default None). db_password = ****** # Specify the database host (default localhost). db_host = localhost # Specify the database port (default None). db_port = 5432 # Specify the price accuracy. #price_accuracy =
建立启动脚本
#!/bin/sh # # Open ERP server 启动脚本,by zhuge 2011-3-25 # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin DAEMON=/home/zg/openerp/openerp-server CONFIGFILE=/home/zg/openerp/openerp-server.cfg NAME=openerp-server DESC=openerp-server USER=zg test -x ${DAEMON} || exit 0 set -e case "${1}" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \ --chuid ${USER} --background --make-pidfile \ --exec ${DAEMON} -- --config=${CONFIGFILE} echo "${NAME}." ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid \ --oknodo echo "${NAME}." ;; restart|force-reload) echo -n "Restarting ${DESC}: " start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid \ --oknodo sleep 1 start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \ --chuid ${USER} --background --make-pidfile \ --exec ${DAEMON} -- --config=${CONFIGFILE} echo "${NAME}." ;; *) N=/etc/init.d/${NAME} echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0