【发布时间】:2014-07-16 22:10:24
【问题描述】:
我正在尝试使用 apache (http://wiki.openstreetmap.org/wiki/Overpass_API/install) 将 overpass api 安装为 Web 服务器
这是我的 000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ExtFilterDefine gzip mode=output cmd=/bin/gzip
DocumentRoot /root/osm-3s_v0.7.4/html
# This directive indicates that whenever someone types http://www.mydomain.com/api/
# Apache2 should refer to what is in the local directory [YOUR_EXEC_DIR]/cgi-bin/
ScriptAlias /api/ /srv/osm3s/cgi-bin/
# This specifies some directives specific to the directory: [YOUR_EXEC_DIR]/cgi-bin/
<Directory "/srv/osm3s/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
#SetOutputFilter gzip
#Header set Content-Encoding gzip
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg
LogLevel warn
CustomLog /var/log/apache2/access.log combined
但是当我尝试运行命令时:
http://175.33.148.57/api/interpreter?data=%3Cprint%20mode=%22body%22/%3E
我收到 403 Forbidden 错误。
我已经做了
chmod 777 /srv/osm3s/cgi-bin/
但似乎没有任何效果。
请帮忙,我已经坚持了 3 天了!提前致谢。
【问题讨论】:
-
状态错误代码
403forbidden不是文件系统访问冲突。这是违反授权的。请检查您的目录是否有.htaccess文件。 -
DocumentRoot和Directory不应该是同一个文件夹吗? -
我认为它没有 .htaccess 文件,我还没有看到位于服务器上的文件。它应该在哪里/它看起来像什么声音?我认为文件目录不需要与我要访问的静态 html 相同,它是位于 /srv/osm3s/cgi-bin/ 中的名为“解释器”的文件
-
interpreter文件是否可读可执行?selinux是否处于强制模式?如果selinux正在强制执行,请确保允许apache 访问该文件夹并允许读取和执行interpreter文件。 -
看来你需要
SetHandler。SetHandler cgi-script
标签: apache ubuntu http-status-code-403