禁止 403 您无权访问此资源。(mod_wsgi, wamp, apache2.4, django) on Windows



我已经正确安装了所有内容并浏览了与此主题相关的所有解决方案,但仍然存在错误,我是 Django 的新手,非常感谢您的帮助

我在错误日志文件中收到此错误:

[2020 年 2 月 14 日星期五 21:52:16.916422] [authz_core:错误] [PID 4288:TID 1252] [客户端 ::1:51391] AH01630:客户端被服务器配置拒绝:E:/AppSource/eCommerce/src/ecommerce/wsgi_windows.py

当我尝试达到 127.0.0.1:80 时,我得到:禁止 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。

最新更新