【发布时间】:2016-12-02 15:47:31
【问题描述】:
您好,我需要帮助在 centos6 上集成 django 与 apache 和 mod_wsgi。 我每次都收到以下错误---“禁止您无权访问此服务器上的 /。” 我的 django 项目路径= /home/mchauras/esapp/eswebsite 我的 apache 版本是 2.2.15 我的 .conf 文件看起来像这样----
<VirtualHost *:80>
DocumentRoot /home/mchauras/esapp/eswebsite/
Alias /static /home/mchauras/esapp/eswebsite/esapp/static
<Directory /home/mchauras/esapp/eswebsite/esapp/static>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order deny,allow
Allow from all
</Directory>
<Directory /home/mchauras/esapp/eswebsite/eswebsite>
<Files wsgi.py>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order deny,allow
Allow from all
</Files>
</Directory>
WSGIDaemonProcess esapp python-path=/home/user/myproject:/home/mchauras/esapp/eswebsite/myvenv/lib/python3.5/site-packages/
WSGIProcessGroup esapp
WSGIScriptAlias / /home/mchauras/esapp/eswebsite/eswebsite/wsgi.py
ErrorLog /home/mchauras/esapp/eswebsite/error.log
CustomLog /home/mchauras/esapp/eswebsite/access.log combined
</VirtualHost>
我的wsgi.py文件是这样的---
import os
import sys
from django.core.wsgi import get_wsgi_application
sys.path.append('/home/mchauras/esapp/eswebsite')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eswebsite.settings")
application = get_wsgi_application()
【问题讨论】:
标签: django apache mod-wsgi centos6