Apache2 mod_wsgi django 命名虚拟服务器

Apache2 mod_wsgi django 命名虚拟服务器

我正在尝试使用 apache 上的 mod_wsgi 设置两个独立的 django 站点。第一个站点运行良好,但第二个站点 cupaday.dyndns.biz 给出 403: [Tue Feb 07 22:32:57 2012] [error] [client 68.48.6.208] (13)Permission denied: access to / denied 有人看到哪里出错了吗??我读过有关部署多个虚拟服务器的文章,大多数人都指出要确保有一个允许所有人访问的目录指令。我尝试将其设置为我的应用程序的路径、wsgi 目录和实际的 .wsgi。就像我说的,第一个站点 snaganitem 运行良好。有人知道我该如何修复它吗??或者有没有办法查看 403 错误的详细版本?谢谢。

NameVirtualHost *:80
<VirtualHost *:80>
  ServerAdmin [email protected]
  ServerName snaganitem.com
  ServerAlias www.snaganitem.com

  LogLevel warn
  ErrorLog /var/log/httpd/error.log
  CustomLog /var/log/httpd/access.log combined

  WSGIScriptAlias / /home/snaganitem/hackpages/apache2/django.wsgi

  <Location "/static">
    SetHandler None
  </Location>
  <Directory /home/snaganitem/hackpages/apache2>
    Order allow,deny
    Allow from all
  </Directory>

  Alias /static /home/snaganitem/hackpages/static
  Alias /google927b622c2314fdec.html /home/snaganitem/static_html/google927b622c2314fdec.html

</VirtualHost>
<VirtualHost *:80>
  ServerAdmin [email protected]
  ServerName cupaday.dyndns.biz

  LogLevel warn
  ErrorLog /var/log/httpd/error.log
  CustomLog /var/log/httpd/access.log combined

  WSGIScriptAlias / /home/cupaday/cup_a_day/wsgi/django.wsgi

  <Location "/static">
    SetHandler None
  </Location>
  <Directory /home/cupaday/cup_a_day/wsgi>
    Order deny,allow
    Allow from all
  </Directory>
  Alias /static /home/cupaday/cup_a_day/static

</VirtualHost>

答案1

正如问题评论中指出的那样,最有可能的问题是 Apache 用户的文件系统权限无法读取 WSGI 脚本文件的位置或读取 WSGI 脚本文件本身。

演示文稿中描述了此特定错误:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations

相关内容