以root用户进行部署,python源也可以使用
修改系统
更改SElinux的配置文件 /etc/selinux/config,SELINUX=disabled
ssh-keygen
~/.ssh/authorized_keys 写入 id_rsa.pub
安装Python 2.7.9
yum -y update
wget
tar zxvf Python-2.7.9.tgz
./configure --enable-shared
make install
安装pip
wget
python ez_setup.py
easy_install -i pip
配置默认 pip 源
vim ~/.pip/pip.conf
[global]
index-url =
trusted-host = pypi.douban.com
设置虚拟目录
#pip install requests[security]
pip install virtualenv
virtualenv .env
source .env/bin/activate
部署代码
git clone horizon.git
安装 Horizon需要的python packages
yum -y install libffi-devel python-devel openssl-devel httpd-devel
pip install –r requirements.txt
测试 Horizon启动
cd horizon
./manage.py runserver
部署apache
yum install httpd mod_ssl mod_wsgi
export APXS=/usr/local/apache2/bin/apxs
pip install mod_wsgi
cp …/site-packages/mod_wsgi/server/mod_wsgi-py27.so /usr/lib64/httpd/modules/
/etc/httpd/conf/httpd.conf 中添加 LoadModule wsgi_module modules/mod_wsgi.so