在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
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以使用此目录中的文件。 配置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服务扩展,然后选择添加新扩展的选项。 Set the following properties: 设置以下属性:
Once finished, apply your changes. 完成后,应用您的更改。 You should see the new extension in the Web Service Extension list with the status set to allowed. 您应该在Web服务扩展列表中看到新的扩展,其状态设置为允许。 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. 右键单击“网站”文件夹,然后转到“属性”对话框。 On the Home Directory tab, open the Configuration dialog. 在“主目录”选项卡上,打开“配置”对话框。 To allow IIS to execute Perl script files (.pl), add an extension mapping with the following properties: 要允许IIS执行Perl脚本文件(.pl),请添加具有以下属性的扩展名映射:
Once finished apply your changes. 完成后,应用您的更改。 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),则也需要为此文件类型配置扩展名映射:
Once finished apply your changes. 完成后,应用您的更改。 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”命令,以确保更改已通过并处于活动状态。 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”,其中都包含以下内容:
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现在已启动并在您的计算机上运行。 结论 (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)Download ActivePerl from ActiveState (AS Zip Package) 从ActiveState下载ActivePerl (AS压缩包)
|
请发表评论