首先个人服务器已有python2.7的环境python
你能够经过执行 python 命令查看python版本如未按照还需参考其余文档进行安装linux
而后是安装django apache
yum install python-setuptools
安装完以后安装django
easy_install django
咱们查看是否安装成功django
[root@solar django]# python Python 2.7.3 (default, May 15 2014, 14:49:08) [GCC 4.8.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.VERSION (1, 6, 5, 'final', 0) >>>
显示版本号说明安装好了服务器
而后apache须要安装wsgi模块python2.7
能够去这里下载http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi网站
下好后解压获得mod_wsgi.so文件ui
而后上传到Apache根目录下的modules文件夹下spa
而后修改Apache配置文件httpd.confcode
添加 以下代码
LoadModule wsgi_module modules/mod_wsgi.so
而后修改网站的VirtualHost配置文件
<VirtualHost *:80>
ServerName service.xiaofany.com
ServerAlias service.xiaofany.com
ServerAdmin xiaofan0313@163.com
WSGIScriptAlias / /www/wwwroot/service.xiaofany.com/qsy/wsgi.py
WSGIDaemonProcess service.xiaofany.com python-path=/www/wwwroot/service.xiaofany.com
WSGIProcessGroup service.xiaofany.com
<Directory /www/wwwroot/service.xiaofany.com/qsy>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
将域名路径等替换成你的
重启apache 访问网站试试 是否是出现了