配置Apache支持CGI

安装ActivePerl

修改配置文件,配置Apache使用ActivePerl来解释CGI文件

<Directory “D:/Dkits/Apache2.2/htdocs”>
#
# 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.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks ExecCGI

#
# 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 All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

#
# Tell Apache to use Perl to execute .cgi
#
ScriptInterpreterSource Registry-Strict

[attach]29[/attach]

配置Apache,是Apache能处理以.cgi结尾的后缀名

DirectoryIndex index.html index.cgi

[attach]30[/attach]

In order for ScriptInterpreterSource Registry-Strict to work, you also need to add an entry to the Registry so Apache will use Perl to execute .cgi files.

In command line environment, type regedit to open Microsoft Registory Editor GUI. In Microsoft Registory Editor, create a key HKEY_CLASSES_ROOT.cgi\Shell\ExecCGI\Command with the default value of the full path of perl.exe with a -t (or -T to be safer) parameter. For example C:\Perl\bin\perl.exe -t