Last active
December 14, 2018 08:00
-
-
Save hanovo/64fdd608bb3380656dab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum -y install postgresql93 postgresql93-server postgresql93-devel postgresql93-libs | |
yum install -y python27-devel python27 python27-libs python27-setuptools python27-pip python27-virtualenv | |
#安装一些编译依赖 | |
yum -y install gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libffi-devel libxslt libxslt-devel libxml2 libxml2-devel openldap-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel git libpng libXext libz.so.1 xorg-x11-fonts-Type1 curl cabextract | |
安装 wkhtmltopdf | |
rpm -ivh http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-centos6-amd64.rpm | |
service postgresql-9.3 start | |
export PATH=/usr/pgsql-9.3/bin:$PATH | |
su - postgres -c "createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo" | |
开始建立python虚拟环境 | |
adduser odoo | |
DIR="/var/run/odoo /var/log/odoo /opt/odoo /opt/andromeda-addons" | |
for NAME in $DIR | |
do | |
if [ ! -d $NAME ]; then | |
mkdir $NAME | |
chown odoo.odoo $NAME | |
fi | |
done | |
su - odoo | |
virtualenv-2.7 odoo | |
source odoo/bin/activate | |
(下次需要维护这个python运行环境的时候,也需要执行此命令,执行后会出现(odoo)[odoo@host ~]$ | |
此时执行命令如pip list都是在隔离环境中) | |
export PATH=/usr/pgsql-9.3/bin:$PATH | |
pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz | |
pip install babel | |
pip install docutils | |
pip install feedparser | |
pip install gdata | |
pip install Jinja2 | |
pip install mako | |
pip install mock | |
pip install psutil | |
pip install psycopg2 | |
pip install pydot | |
pip install python-dateutil | |
pip install python-openid | |
pip install pytz | |
pip install pywebdav | |
pip install pyyaml | |
pip install reportlab | |
pip install simplejson | |
pip install unittest2 | |
pip install vatnumber | |
pip install vobject | |
pip install werkzeug | |
pip install xlwt | |
pip install pyopenssl | |
pip install lxml | |
pip install python-ldap | |
pip install decorator | |
pip install requests | |
pip install pillow | |
pip install pyPdf | |
pip install passlib | |
pip install gengo | |
cd /opt | |
git clone https://github.com/odoo/odoo.git --branch 8.0 | |
chown -R odoo.odoo odoo | |
exit | |
结束以odoo用户运行, | |
现在用root运行 | |
cat > /etc/odoo-server.conf << EOF | |
[options] | |
; This is the password that allows database operations: | |
admin_passwd = admin | |
; DATABASE OPTIONS | |
db_host = localhost | |
db_port = 5432 | |
db_user = odoo | |
db_password = odoo | |
; MISC SETTINGS | |
addons_path = /opt/odoo/addons | |
load = web | |
timezone = Asia/Shanghai | |
without-demo=all | |
no-xmlrpc = True | |
no-xmlrpcs = True | |
no-netrpc = True | |
; LOG SETTINGS | |
logfile = /var/log/odoo/odoo-server.log | |
log_handler = werkzeug:WARNING | |
log_level = warn | |
no-logrotate = True | |
EOF | |
chown root.odoo /etc/odoo-server.conf | |
chmod 640 /etc/odoo-server.conf | |
cat > /etc/logrotate.d/odoo-server << EOF | |
/var/log/odoo/*.log { | |
copytruncate | |
missingok | |
notifempty | |
} | |
EOF | |
wget -O /etc/init.d/odoo https://raw.githubusercontent.com/Johnzero/OE7/master/install/openerp-server.init | |
sed -i "s/openerp/odoo/g" /etc/init.d/odoo | |
sed -i "s/OpenERP/Odoo/g" /etc/init.d/odoo | |
sed -i "s/\/usr\/bin\/setsid \/usr\/bin\/odoo-server/~\/odoo\/bin\/python \/opt\/odoo\/openerp-server/" /etc/init.d/odoo | |
chmod +x /etc/init.d/odoo | |
/sbin/chkconfig --level 35 odoo on | |
运行 | |
service odoo start | |
默认的sessions filestore addons 保存在 /home/odoo/.local/share/Odoo/文件夹中,如果要自定义,则在 | |
/etc/odoo-server.conf 里定义加上 data_dir = /opt/odoo/data | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
incase above pycharm not works, snippetbucket.com
pip install https://download-cf.jetbrains.com/python/pycharm-community-2018.3.1.tar.gz