Apache 2.4 with mod_wsgi:403禁止,没有访问此服务器上的/calbase的权限 [英] Apache 2.4 with mod_wsgi: 403 Forbidden, don't have permission to access /calbase on this server
问题描述
因此,我正在尝试使用apache 2.4和mod_wsgi和pythong 3.4将django项目部署在Windows服务器上.在配置httpd.conf并尝试安装了mod-wsgi的情况下启动apache之前,它可以工作并向我显示它可以工作"页面.然后我在httpd.conf中进行了以下配置:
So I am trying to deploy my django project on a windows server, using apache 2.4 with mod_wsgi and pythong 3.4. Before I configure httpd.conf and just try start apache with mod-wsgi installed, it works and show me that "it works" page. then I did the following configuration in httpd.conf:
# Change Python path used by the server.
WSGIPythonPath "/EquipmentCalibration"
# Make calls to http://localhost/ refer to the Python/WSGI-script located at the specified location.
WSGIScriptAlias / /EquipmentCalibration/equipcal/wsgi.py
# Make calls to http://localhost/static refer to the specified folder.
Alias /static/ /EquipmentCalibration/static
Alias /media/ /EquipmentCalibration/media
<Directory /EquipmentCalibration/static>
Require all granted
</Directory>
<Directory /EquipmentCalibration/media>
Require all granted
</Directory>
<Directory /EquipmentCalibration/equipcale>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
然后尝试转到localhost:8080(我将端口从80更改为8080),出现此错误:
And then try to go to localhost:8080 (I changed the port from 80 to 8080), I got this error saying:
禁止
您无权访问此服务器上的/.
You don't have permission to access / on this server.
以下是相关的error.log.
And below is the relevant error.log.
[Thu Sep 29 15:05:25.171920 2016] [mpm_winnt:notice] [pid 7756:tid 528] AH00456: Apache Lounge VC10 Server built: Jul 9 2016 11:59:00
[Thu Sep 29 15:05:25.171920 2016] [core:notice] [pid 7756:tid 528] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Thu Sep 29 15:05:25.171920 2016] [mpm_winnt:notice] [pid 7756:tid 528] AH00418: Parent: Created child process 7524
[Thu Sep 29 15:05:25.500078 2016] [wsgi:warn] [pid 7524:tid 456] mod_wsgi: Compiled for Python/3.4.2.
[Thu Sep 29 15:05:25.500078 2016] [wsgi:warn] [pid 7524:tid 456] mod_wsgi: Runtime using Python/3.4.3.
[Thu Sep 29 15:05:26.171978 2016] [mpm_winnt:notice] [pid 7524:tid 456] AH00354: Child: Starting 64 worker threads.
[Thu Sep 29 15:05:27.174429 2016] [mpm_winnt:notice] [pid 7636:tid 456] AH00364: Child: All worker threads have exited.
[Thu Sep 29 15:05:29.923754 2016] [authz_core:error] [pid 7524:tid 1108] [client ::1:55483] AH01630: client denied by server configuration: C:/EquipmentCalibration/equipcal/wsgi.py
有人可以帮忙吗? TIA.
Could somebody please help? TIA.
推荐答案
该部分:
<Directory /EquipmentCalibration/equipcale>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
具有与WSGIScriptAlias
指令中使用的目录名称匹配的目录名称.一个使用equipcal
,另一个使用equipcale
.他们需要匹配该细分受众群名称.
has a directory name which does match what is used in the WSGIScriptAlias
directive. One uses equipcal
and the other equipcale
. They need to match in that segment name.
这篇关于Apache 2.4 with mod_wsgi:403禁止,没有访问此服务器上的/calbase的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!