apache:cgi 链接导致“您已选择打开 foo.cgi”,尽管已设置 scriptalias

发布于 2024-08-09 04:44:16 字数 1521 浏览 5 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

两相知 2024-08-16 04:44:16

验证它被设置为可执行文件(我相信)并且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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文