Avatar of Tao

by

OpenERP 7在Centos6.5下的安装脚本

April 3, 2014 in Topic

#!/bin/bash
#
# OpenERP Server Initialisation for CentOS 6.5
#
# Written by Eelco Plugge <eelco AT handedby <.> com> v1.0 (2013.04.09)

# Define shell variables (for root user) necessary for several packages to function
export LANG=C
export LC_CTYPE=C

# Download and run system update via Yum, install mandatory packages via Yum
yum -y update
yum -y install man wget vim libevent unzip

# Download additional prerequisites
cd /tmp
wget http://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz && tar -xvzf pyparsing-1.5.7.tar.gz && cd pyparsing-1.5.7 && python setup.py install
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.zip && unzip gdata-2.0.17.zip && cd gdata* && python setup.py install
rpm -Uvh http://pkgs.repoforge.org/tmux/tmux-1.6-1.el6.rf.x86_64.rpm
rpm -Uvh http://prdownloads.sourceforge.net/webadmin/webmin-1.620-1.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
wget https://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg && sh setuptools-0.6c11-py2.6.egg
easy_install openerp-client-lib

# Install core prerequisistes for OpenERP
yum -y install python-psycopg2 python-lxml PyXML python-setuptools libxslt-python pytz python-matplotlib python-babel python-mako python-dateutil python-psycopg2 pychart pydot python-reportlab python-devel python-imaging python-vobject hippo-canvas-python mx python-gdata python-ldap python-openid python-werkzeug python-vatnumber pygtk2 glade3 pydot python-dateutil python-matplotlib pygtk2 glade3 pydot python-dateutil python-matplotlib python python-devel python-psutil python-docutils make automake gcc gcc-c++ kernel-devel byacc flashplugin-nonfree poppler-utils pywebdav postgresql92-libs postgresql92-server postgresql92

# Add users for managment and OpenERP. Requires manual input of the password (set to “openerp”)
#useradd <name user>
#useradd -e yyyy-mm-dd <mane user>
su – postgres -c “createuser –createdb –username postgres –no-createrole –no-superuser –pwprompt openerp”
adduser openerp
DIR=”/var/run/openerp /var/log/openerp”
for NAME in $DIR
do
if [ ! -d $NAME ]; then
mkdir $NAME
chown openerp.openerp $NAME
fi
done
rm -rf openerp*

# Fetch and install OpenERP
cd /tmp
wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-20130408-232357.tar.gz && tar -xvzf openerp-7.0-20130408-232357.tar.gz –transform ‘s!^[^/]\+\($\|/\)!openerp\1!’ && cd openerp && python setup.py install
rm -rf /usr/local/bin/openerp-server
cp openerp-server /usr/local/bin
cp install/openerp-server.init /etc/init.d/openerp
cp install/openerp-server.conf /etc
chown openerp:openerp /etc/openerp-server.conf
chmod u+x /etc/init.d/openerp

# Initialise services
/etc/init.d/webmin start
service postgresql-9.2 initdb
chkconfig postgresql-9.2 on
service postgresql-9.2 start
chkconfig openerp on
service  openerp start

# Clear firewall, enabling access
iptables -F
iptables -F INPUT
iptables -A INPUT -p tcp –dport ssh -j ACCEPT
iptables -A INPUT -p tcp –dport 8069 -j ACCEPT
iptables -A INPUT -p tcp –dport 10000 -j ACCEPT
iptables -A INPUT -p icmp –icmp-type echo-request -j ACCEPT
iptables -A INPUT -m state –state ESTABLISHED -j ACCEPT
iptables -A INPUT -j LOG -m limit
iptables -P INPUT DROP

iptables -F OUTPUT
iptables -A OUTPUT -m state –state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -o lo –dport telnet -j ACCEPT
iptables -A OUTPUT -p tcp –dport telnet -j REJECT
iptables -P OUTPUT DROP

Likes(1)Dislikes(0)

2 responses to OpenERP 7在Centos6.5下的安装脚本

  1. 这么复杂?

    Likes(0)Dislikes(0)
  2. wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-20130408-232357.tar.gz && tar -xvzf openerp-7.0-20130408-232357.tar.gz –transform ‘s!^[^/]\+\($\|/\)!openerp\1!’ && cd openerp && python setup.py install
    这行要注意下。写死了版本......

    Likes(0)Dislikes(0)

Leave a reply

You must be logged in to post a comment.