【问题标题】:What ELSE can cause Apache to display a CGI instead of it's output?什么 ELSE 可以导致 Apache 显示 CGI 而不是它的输出?
【发布时间】:2023-11-23 03:40:01
【问题描述】:

我有一个新配置的 Apache 2.4.7 网络服务器 (AIX7)。它显示的是我的 CGI 的内容,而不是它们的输出。

我的 conf 文件中有这个:

LoadModule cgi_module /opt/freeware/lib64/httpd/modules/mod_cgi.so

AddHandler cgi-script .cgi .pl

ScriptAlias /cgi-bin      "/var/www/cgi-bin"
<Directory "/var/www/cgi-bin">
    Options +FollowSymLinks +Includes -Indexes +ExecCGI
    Order allow,deny
    Allow from all
</Directory>

如果从 CLI 运行,我的 CGI 会按预期运行。它们是世界可读和世界可执行的。 shebang线是正确的。 error_log 中没有相关消息。

还有什么 ELSE 会导致服务器不执行 CGI?

【问题讨论】:

    标签: apache configuration webserver cgi


    【解决方案1】:

    好的,我想通了。我有两个不同的 conf 目录。 Apache 正在查看具有默认值的不同位置的配置。

    经验教训:如果 Apache 似乎忽略了您的配置文件,请确保您查看的是正确的文件。

    【讨论】: