簡體   English   中英

Django新安裝,Apache> 2.4,禁止使用403

[英]Django New Install, Apache >2.4, 403 Forbidden

在網上看了很多,並得到了一些相互矛盾的幫助。 django.wsgi不再是最新版本,對嗎? 它被wsgi.py取代了嗎?

這是我的虛擬主機條目:

<VirtualHost myip:80>
  ServerAdmin admin@example.com
  ServerName  mydomain
  WSGIScriptAlias / /home/django/djcode/emailer/emailer/wsgi.py
<Directory /home/django/djcode/emailer/emailer>
<Files wsgi.py>
  Order deny,allow
  Allow from all
</Files>
</Directory>
</VirtualHost>

沒有啟動http錯誤,訪問頁面后,這是apache錯誤日志:

[Thu Apr 03 19:16:49 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_python/3.3.1 Python/2.6.6 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_wsgi/3.2 configured -- resuming normal operations
[Thu Apr 03 19:17:10 2014] [error] [client myip] (13)Permission denied: access to / denied
[Thu Apr 03 19:17:11 2014] [error] [client myip] (13)Permission denied: access to /favicon.ico denied

在這個問題上已經停留了一個多小時,所以以為我終於要問了。

謝謝!

您的問題之一是Apache 2.4中不再使用Order deny,allowAllow from all 您需要將其更改為Require all granted 有關更多信息,請參見此Apache 2.2-> 2.4升級文章

另外,您的錯誤日志中顯示的是Apache 2.2.15,而不是Apache 2.15,因此您確定Apache 2.4安裝/升級有效嗎? 如果您仍使用Apache 2.2.15,則我的答案不適用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM