centos7 python2.7 django1.11 apache2.4部署

阅读更多

关闭防火墙

 

[root@www ~]# systemctl stop firewalld.service
[root@www ~]# systemctl disable firewalld.service
[root@www ~]# setenforce 0

 

升级pip

 

[root@www ~]# pip install -U setuptools
[root@www ~]# pip install -U wheel

 

 

如果提示pip命令不存在,其它系统可以参考http://sharadchhetri.com/2014/05/30/install-pip-centos-rhel-ubuntu-debian/

 

[root@www ~]# yum install epel-release
[root@www ~]# yum install -y python-pip

 

安装httpd

 

[root@www ~]# vi /etc/httpd/conf/httpd.conf
# line 95: change to your server's name
ServerName 
www.srv.world:80
# line 151: change
AllowOverride All
# line 164: add file name that it can access only with directory's name
DirectoryIndex index.html 
index.cgi index.php
# add follows to the end
# server's response header
ServerTokens Prod
# keepalive is ON
KeepAlive On
[root@www ~]# systemctl start httpd 
[root@www ~]# systemctl enable httpd 

 

安装mod_wsgi

 

[root@www ~]# yum -y install mod_wsgi
[root@www ~]# vi /etc/httpd/conf.d/django.conf

 

 

# create new
WSGIDaemonProcess testapp python-path=/home/pythonweb/yumi:/usr/lib/python2.7/site-packages
WSGIProcessGroup testapp
WSGIScriptAlias /science /home/pythonweb/yumi/yumi/wsgi.py
 
Require all granted
[root@www ~]# systemctl restart httpd 

  

 

 

 

 

 

 

 

 

你可能感兴趣的:(centos7 python2.7 django1.11 apache2.4部署)