博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何在Windows Server 2003的IIS 6上安装Perl
阅读量:2520 次
发布时间:2019-05-11

本文共 4437 字,大约阅读时间需要 14 分钟。

Perl is a very popular scripting language which is used to develop a wide variety of tools. One of it’s well know uses is web based CGI (Common Gateway Interface) applications which allow Perl scripts to be executed from a web server. With a little configuration, you can configure IIS 6 on your Windows Server 2003 system to serve Perl scripts via CGI.

Perl是一种非常流行的脚本语言,可用于开发各种工具。 众所周知的用途之一是基于Web的CGI(通用网关接口)应用程序,该应用程序允许从Web服务器执行Perl脚本。 只需进行一些配置,就可以在Windows Server 2003系统上配置IIS 6,以通过CGI服务Perl脚本。

复制Perl二进制文件 (Copying the Perl Binaries)

Before any IIS setup can be done, the Perl binary files must be extracted to your system. Download the ActiveState Perl distribution package (get the AS zip file and not the installer) and extract them to a folder on your server (i.e. ‘C:perl’). We will map IIS to use the files located in this directory.

在完成任何IIS设置之前,必须将Perl二进制文件提取到系统中。 下载ActiveState Perl分发软件包(获取AS zip文件而不是安装程序),然后将其解压缩到服务器上的文件夹(即“ C:perl”)。 我们将映射IIS以使用此目录中的文件。

image

配置IIS 6以运行Perl脚本 (Configuring IIS 6 to Run Perl Scripts)

Open Internet Information Services Manager to the Web Service Extensions and select the option to add a new extension.

打开Internet信息服务管理器以访问Web服务扩展,然后选择添加新扩展的选项。

image

Set the following properties:

设置以下属性:

  • Extension name: Perl CGI

    扩展名:Perl CGI
  • Required files: C:perlbinperl.exe “%s” %s (assuming you extracted the files to ‘C:perl’)

    所需文件:C:perlbinperl.exe“%s”%s(假设您将文件解压缩到“ C:perl”)
  • Status set to allowed

    状态设置为允许

Once finished, apply your changes.

完成后,应用您的更改。

image

You should see the new extension in the Web Service Extension list with the status set to allowed.

您应该在Web服务扩展列表中看到新的扩展,其状态设置为允许。

image

With the service extension installed, we have to create the Perl script file type mappings.

安装了服务扩展后,我们必须创建Perl脚本文件类型映射。

Right click on the Web Sites folder and go to the Properties dialog.

右键单击“网站”文件夹,然后转到“属性”对话框。

image_thumb16

On the Home Directory tab, open the Configuration dialog.

在“主目录”选项卡上,打开“配置”对话框。

image_thumb26

To allow IIS to execute Perl script files (.pl), add an extension mapping with the following properties:

要允许IIS执行Perl脚本文件(.pl),请添加具有以下属性的扩展名映射:

  • Executable: same as the “Required files” entered when creating the “Perl CGI” extension above

    可执行文件:与在上面创建“ Perl CGI”扩展名时输入的“必需文件”相同
  • Extension: .pl

    扩展名:.pl
  • Verbs: GET,HEAD,POST

    动词:GET,HEAD,POST
  • Check the box for script engine

    选中脚本引擎框

Once finished apply your changes.

完成后,应用您的更改。

image

Additionally, if Perl scripts will be deployed as CGI files (.cgi), an extension mapping will need to be configured for this file type as well:

此外,如果将Perl脚本部署为CGI文件(.cgi),则也需要为此文件类型配置扩展名映射:

  • Executable: same as the “Required files” entered when creating the “Perl CGI” extension above

    可执行文件:与在上面创建“ Perl CGI”扩展名时输入的“必需文件”相同
  • Extension: .cgi

    扩展名:.cgi
  • Verbs: GET,HEAD,POST

    动词:GET,HEAD,POST
  • Check the box for script engine

    选中脚本引擎框

Once finished apply your changes.

完成后,应用您的更改。

image

After making the required configuration changes to IIS, run the “iisreset” command from the command prompt to ensure the changes are pushed through and active.

对IIS进行所需的配置更改后,从命令提示符处运行“ iisreset”命令,以确保更改已通过并处于活动状态。

image_thumb24

At this point, IIS 6 should be able to successfully serve Perl scripts.

此时,IIS 6应该能够成功提供Perl脚本。

测试Perl (Testing Perl)

At this point, your server is ready to go, but just to be sure we can confirm your Perl setup through IIS pretty easily. Create a couple of text files in the directory ‘C:Inetpubwwwroot’ named ‘test.pl’ and ‘test.cgi’ both containing the following:

此时,您的服务器已准备就绪,但是请确保我们可以通过IIS轻松确认您的Perl设置。 在目录“ C:Inetpubwwwroot”中创建几个文本文件,名称分别为“ test.pl”和“ test.cgi”,其中都包含以下内容:

#!c:perlbinperl.exe

#!c:perlbinperl.exe

use strict; use CGI; my $test = new CGI;

使用严格 使用CGI; 我的$ test =新的CGI;

print $test->header(“text/html”),$test->start_html(“Perl Test”); print $test->h1(“Perl is working!”); print $test->end_html;

打印$ test-> header(“ text / html”),$ test-> start_html(“ Perl Test”); 打印$ test-> h1(“ Perl正在运行!”); 打印$ test-> end_html;

Finally, browse to the addresses: ‘http://localhost/test.pl’ and ‘http://localhost/test.cgi’ on your server and you should see a message stating that Perl is working. If the page loads successfully, Perl is now up and running on your machine.

最后,浏览到服务器上的地址:“ http://localhost/test.pl”和“ http://localhost/test.cgi”,您应该看到一条消息,指出Perl正在运行。 如果页面成功加载,则Perl现在已启动并在您的计算机上运行。

image

结论 (Conclusion)

Once you have Perl up and running on your Windows system, you can deploy or develop your own Perl CGI applications.

一旦在Windows系统上启动并运行了Perl,就可以部署或开发自己的Perl CGI应用程序。

链接 (Links)

(AS Zip Package)

(AS压缩包)

翻译自:

转载地址:http://fsjwd.baihongyu.com/

你可能感兴趣的文章
转自 zera php中extends和implements的区别
查看>>
Array.of使用实例
查看>>
【Luogu】P2498拯救小云公主(spfa)
查看>>
如何获取网站icon
查看>>
几种排序写法
查看>>
java 多线程的应用场景
查看>>
dell support
查看>>
转:Maven项目编译后classes文件中没有dao的xml文件以及没有resources中的配置文件的问题解决...
查看>>
MTK android 设置里 "关于手机" 信息参数修改
查看>>
单变量微积分笔记6——线性近似和二阶近似
查看>>
补几天前的读书笔记
查看>>
HDU 1829/POJ 2492 A Bug's Life
查看>>
CKplayer:视频推荐和分享插件设置
查看>>
CentOS系统将UTC时间修改为CST时间
查看>>
redis常见面试题
查看>>
导航控制器的出栈
查看>>
玩转CSS3,嗨翻WEB前端,CSS3伪类元素详解/深入浅出[原创][5+3时代]
查看>>
iOS 9音频应用播放音频之播放控制暂停停止前进后退的设置
查看>>
Delphi消息小记
查看>>
HNOI2016
查看>>