cgi脚本作为纯文本而不是mac上的网页运行

时间:2016-06-04 19:26:44

标签: macos apache perl cgi

我已按照这篇文章运行test.pl文件:

 http://editrocket.com/articles/perl_apache_mac.html

我还在httpd.conf文件中做了一些配置,这里是我所做的快照:

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Allow from all
</Directory>

.....
#
# "/Library/WebServer/CGI-Executables" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/Library/WebServer/CGI-Executables">
AllowOverride None
Options None
Require all granted
</Directory>
...
    #
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi .pl

就像运行http://localhost时运行的apache服务器一样,我得到了“它有效!”页。我还应该做些什么才能让.cgi运行?

1 个答案:

答案 0 :(得分:1)

所以..我深入挖掘并重新访问了更多的堆栈溢出帖子。转而我需要取消注释配置文件中的行:

  LoadModule cgi_module libexec/apache2/mod_cgi.so

我在后面的教程中没有提到。感谢以前的所有评论

相关问题