【发布时间】:2021-04-03 06:43:19
【问题描述】:
我正在尝试在 apache 上执行 python 脚本,但出现此错误:Forbidden You don't have permission to access this resource; 在问这个问题之前,我在谷歌上搜索了几个小时,我找到了“csrf token”,但它没有用;我找到了我在下面发布的配置,它们也不起作用...... 我不知道是什么导致它不起作用。
这是我的 Python 脚本:
print ('Content-type: text/html')
print
print ('<html><head>')
print ('</head><body>')
print ('Hello.')
print ('</body></html>')
这些是我添加的 httpd.conf 配置:
<Directory />
Options Indexes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi .py
AllowOverride none
Require all granted
</Directory>
AddHandler cgi-script .py
ScriptInterpreterSource Registry-Strict
这些是我的 default.conf 配置:
<VirtualHost _default_:80>
DocumentRoot "C:\Users\User\Web\default"
<Directory "C:\Users\User\Web\default">
AllowOverride None
Options FollowSymLinks
Require all granted #i tried also with denied
</Directory>
</VirtualHost>
【问题讨论】:
标签: python html apache server httpd.conf