CentOS安装wsgi

第一步:编译安装 wsgi
1.wget https://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz
2.tar zxvf mod_wsgi-3.4.tar.gz
3. ./configure --with-apxs=/usr/sbin/apxs
4.make
5.make install
6.make clean
7.make distclean

第二步:设置路基
wsgi 设置
import sys
#sys.path.append('/var/www/html/gdnsplus_conf/')

path = '/usr/local/gdnsplus_conf/www'
if path not in sys.path:
sys.path.append(path)


import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")


第三步:HTTP的设置
httpd设置
ErrorLog /usr/local/gdnsplus_conf/var/log/httpd_err.log
CustomLog /usr/local/gdnsplus_conf/var/log/httpd_cust.log combined

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /var/www/html/gdnsplus_conf/wsgi.py
#WSGIPythonPath /var/www/html/gdnsplus_conf

<Directory /var/www/html/gdnsplus_conf>
#<Files wsgi.py>
Order deny,allow
Allow from all
#</Files>
</Directory>

posted @ 2013-05-10 17:03  lxgeek  阅读(1005)  评论(0编辑  收藏  举报