AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-346870

Jojo Coana's questions

Martin Hope
Jojo Coana
Asked: 2016-05-18 04:09:20 +0800 CST

Centos 尝试执行 hello.cgi 脚本失败

  • 0

我正在尝试在 html 目录中执行一个简单的 hello world cgi 脚本,但它失败了。

错误日志:

[Tue May 17 14:56:15.744954 2016] [cgi:error] [pid 29997] [client 192.168.1.1:16151] End of script output before headers: hello.cgi
[Tue May 17 15:00:12.474229 2016] [cgi:error] [pid 29998] [client 192.168.1.1:16597] AH01215: (2)No such file or directory: exec of '/var/www/html/hello.cgi' failed
[Tue May 17 15:00:12.475135 2016] [cgi:error] [pid 29998] [client 192.168.1.1:16597] End of script output before headers: hello.cgi
[Tue May 17 15:00:13.176640 2016] [cgi:error] [pid 29999] [client 192.168.1.1:16600] AH01215: (2)No such file or directory: exec of '/var/www/html/hello.cgi' failed
[Tue May 17 15:00:13.177591 2016] [cgi:error] [pid 29999] [client 192.168.1.1:16600] End of script output before headers: hello.cgi
[Tue May 17 15:00:13.640420 2016] [cgi:error] [pid 30000] [client 192.168.1.1:16603] AH01215: (2)No such file or directory: exec of '/var/www/html/hello.cgi' failed
[Tue May 17 15:00:13.641393 2016] [cgi:error] [pid 30000] [client 192.168.1.1:16603] End of script output before headers: hello.cgi

httpd 配置:

# Further relax access to the default document root:
<Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options -Indexes +FollowSymLinks +ExecCGI
    AddHandler cgi-script .cgi .pl

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

你好.cgi 文件:

#!/usr/bin/perl
print "Content-type: text/html\n\n"; # This is mandatory.
print "<h2>Hello world!</h2>";
cgi httpd
  • 1 个回答
  • 1990 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve