首先個人服務器已有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 訪問網站試試 是否是出現了