python-Django与Apache整合wsgi模块

1.安装wsgi模块

yum search mod_wsgi

yum install -y mod_wsgi

2.会在httpd下有配置文件

cd /etc/httpd/conf.d/wsgi.conf

vim /etc/httpd/conf.d/django.conf

<VirtualHost *:80>
    WSGIDaemonProcess simplecmdb_mysql_pickle python-path=/usr/local/test/Python-Test/Django_test/simplecmdb_mysql_pickle:/usr/lib/python2.6/site-packages/
     WSGIProcessGroup simplecmdb_mysql_pickle
     WSGIScripAlias  / /usr/local/test/Python-Test/Django_test/simplecmdb_mysql_pickle/simplecmdb/wsgi.py
     Alias /static /usr/lib/python2.6/site-packages/django/contrib/admin/static/
</VirtualHost>

<Directory /usr/local/test/Python-Test/Django_test/simplecmdb_mysql_pickle/simplecmdb>
     Order allow,deny
     Allow from all
</Directory>
WSGISocketPrefix /var/run/wsgi
原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/5711056.html