Skip to content

Instantly share code, notes, and snippets.

@zhanghui9700
Last active September 13, 2016 13:47
Show Gist options
  • Save zhanghui9700/c0da330f2d0787fc2887f5ca5cac01dd to your computer and use it in GitHub Desktop.
Save zhanghui9700/c0da330f2d0787fc2887f5ca5cac01dd to your computer and use it in GitHub Desktop.

1. ubuntu 1404

2. centos 71

cat ./install.sh

#!/bin/sh
set -eu

cat >> /tmp/apache.conf << EOF

test...
test...

EOF
@zhanghui9700
Copy link
Author

zhanghui9700 commented Sep 4, 2016

centos71 commands

groupadd eoncloud
useradd eoncloud -g eoncloud -m -d /opt/eoncloud
mkdir /var/log/eoncloud
chown -R eoncloud:eoncloud /var/log/eoncloud/

yum install -y httpd mod_wsgi
systemctl enable httpd
systemctl start httpd

yum install -y git vim libffi libffi-devel
yum install -y mysql-devel openldap-devel cyrus-sasl-devel
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum -y install mysql-community-server
systemctl enable mysqld
systemctl start mysqld

mysql -uroot -e "create database cloud_web CHARACTER SET utf8;"
mysql -uroot -e "create user cloud_web;"
mysql -uroot -e "grant all privileges on cloud_web.* to 'cloud_web'@'%' identified by 'password' with grant option;"
mysql -uroot -e "grant all privileges on cloud_web.* to 'cloud_web'@'localhost' identified by 'password' with grant option;"
mysql -uroot -e "flush privileges;"

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && python get-pip.py
yum -y install python-virtualenv
cd /var/www/ && git clone https://github.com/zhanghui9700/dashboard.git && cd dashboard
git checkout -b feautre/cloud origin/feature/cloud
virtualenv .venv
echo "import sys" > .venv/lib/python2.7/site-packages/sitecustomize.py
echo "sys.setdefaultencoding('utf-8')" >> .venv/lib/python2.7/site-packages/sitecustomize.py
.venv/bin/pip install -r centos71_requirements.txt

cd eoncloud_web/

../.venv/bin/python manage.py migrate_settings
../.venv/bin/python manage.py migrate
../.venv/bin/python manage.py createsuperuser
../.venv/bin/python manage.py init_flavor
../.venv/bin/python manage.py create_workflow_approve_permission
../.venv/bin/python manage.py collectstatic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment