apache:cgi 链接导致“您已选择打开 foo.cgi”,尽管已设置 scriptalias
在 CentOS 5.2 上遵循本指南,第一次设置 nagios。主页显示得很好,但是当我尝试查看任何应该由 cgi 进程生成的页面时,firefox 会提示我保存 .cgi,所以 apache 显然不明白它需要运行 cgi 和从中获取一些 html。
但奇怪的是,据我所知,apache应该将这些文件作为 cgi 运行。 nagios.conf:
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.
ScriptAlias /nagios/cgi-bin/ "/usr/lib/nagios/cgi/"
# SSLRequireSSL
Options +ExecCGI
AddHandler cgi-script .cgi
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-user
Alias /nagios "/usr/share/nagios/"
# SSLRequireSSL
DirectoryIndex index.php
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-use
ScriptAlias 指令或 ExecCGI 选项应该触发此操作,但它们似乎都没有任何效果。
这个配置文件正在被apache解析,因为如果我将它移出conf.d,/nagios会给出404。.cgi
文件确实在/nagios/cgi-bin/目录中,所以我没有指定错误的目录。
搜索似乎只为那些权限有困难的人提供,这不是这里的问题。在我看来,这是一个非常基本的事情,但即使有优秀的 apache 文档,我还是有点不知所措(最近使用 cherokee 太多了:))。
Following this guide on CentOS 5.2, just getting nagios set up for the first time. The main page shows up just fine, but when I try to view any of the pages that should be generated by a cgi process, firefox prompts me to save the .cgi instead, so apache's obviously not understanding that it needs to run the cgi and get back some html from it.
The odd thing is, though, that, as far as I can tell, apache should be running these files as cgi. nagios.conf:
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.
ScriptAlias /nagios/cgi-bin/ "/usr/lib/nagios/cgi/"
# SSLRequireSSL
Options +ExecCGI
AddHandler cgi-script .cgi
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-user
Alias /nagios "/usr/share/nagios/"
# SSLRequireSSL
DirectoryIndex index.php
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-use
Either the ScriptAlias directive or ExecCGI option should be triggering this, but neither of them seems to have any effect.
This config file is being parsed by apache, because if I move it out of conf.d, /nagios gives a 404.
The .cgi files are indeed in the /nagios/cgi-bin/ directory, so I didn't specify the incorrect directory.
Searching seemed to only provide people who had difficulty with permissions, which is not the issue here. This seems to me to be a pretty basic thing, but even with the excellent apache documentation, I'm at a bit of a loss (been using cherokee too much lately :) ).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
验证它被设置为可执行文件(我相信)并且apache有权执行,并且知道如何正确处理CGI。
另外,你的别名正确吗? /usr/share/nagios 以及 /usr/lib/nagios/cgi/ 上有什么东西吗? (只是不是我做事的方式)
verify it is set as executable (i do believe) and that apache has permission to exec, AND, knows how to handle CGI's properly.
also, are your alias's correct? is there something at /usr/share/nagios, as well as at /usr/lib/nagios/cgi/? (just not how i do things)