![](/img/trans.png)
[英]Apache2.4 mod_wsgi error: Forbidden You don't have permission to access / on this server
[英]Forbidden 403 You don't have permission to access this resource. (mod_wsgi, wamp, apache2.4, django) on windows
我已經正確安裝了所有內容並完成了與此主題相關的所有解決方案,但仍然存在錯誤,我是 Django 的新手,我非常感謝您的幫助
我在錯誤日志文件中收到此錯誤:
[Fri Feb 14 21:52:16.916422 2020] [authz_core:error] [pid 4288:tid 1252] [client ::1:51391] AH01630:客戶端被服務器配置拒絕:E:/AppSource/eCommerce/src/ecommerce/ wsgi_windows.py
當我嘗試達到 127.0.0.1:80 時,我得到: Forbidden 403
這是我的 wsgi_windows.py 配置:
activate_this = 'CE:/AppSource/eCommerce/Scripts/activate_this.py'
exec(open(activate_this).read(),dict(__file__=activate_this))
import os
import sys
import site
from django.core.wsgi import get_wsgi_application
site.addsitedir("C:/Python37/Lib/site-packages")
sys.path.append('E:/AppSource/eCommerce')
sys.path.append('E:/AppSource/eCommerce/src')
sys.path.append('E:/AppSource/eCommerce/src/ecommerce')
os.environ['DJANGO_SETTINGS_MODULE'] = 'ecommerce.settings'
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ecommerce.settings")
application = get_wsgi_application()
這是 hhtpd-vhosts.conf 配置:
<VirtualHost *:80>
ServerName localhost
WSGIPassAuthorization On
ErrorLog "E:/appSource/eCommerce/eCommerce.error.log"
CustomLog "E:/appSource/eCommerce/eCommerce.access.log" combined
WSGIScriptAlias / "E:/appSource/eCommerce/src/ecommerce/wsgi_windows.py"
<Directory "E:/appSource/eCommerc/src/ecommerce/">
<Files wsgi_windows.py>
Require all granted
</Files>
</Directory>
Alias /static "E:/appSource/eCommerce/static_cdn/static_root"
<Directory "E:/appSource/eCommerce/static_cdn/static_root">
Require all granted
</Directory>
Alias /media "E:/appSource/eCommerce/static_cdn/media_root"
<Directory "E:/appSource/eCommerce/static_cdn/media_root">
Require all granted
</Directory>
</VirtualHost>
我已經嘗試了我所知道的一切請幫助解決這個問題謝謝
我認為實現目標的最簡單方法是更改apache的端口號並再次啟動apache。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.