How to Add Perl CGI Script Support to Your Apache Server on Windows

5 篇文章 0 订阅
There are two good links about this topic:
http://www.thesitewizard.com/archive/addcgitoapache.shtml    http://www.thescripts.com/serveradministration/webservers/apache/virtual-hosting/app/Install_Apache_Web_Server_Perl_PHP_MySQL_on_Windows.html


Steps:
1. Installation of Apache + PHP is skipped there.

2. Download ActivePerl-5.8.8.820-MSWin32-x86-274739.msi from ActiveState website. Install step by step. It's recommended to install the ActivePerl into foler like C:/usr if you want to share the same perl code on Windows and Linux/Unix. Because you don't have to change the header of the perl file "#!/usr/bin/perl".

3. Configure Apache to support Perl CGI

    If you don't want to be restricted to running CGI scripts within the ScriptAlias directory in your domain, and want CGI scripts to run anywhere in your domain, add the following line to your "httpd.conf" file.
    AddHandler cgi-script .cgi
    
    You can add it yourself manually, but since the default httpd.conf file that is supplied by Apache already comes with that line commented out, the simplest thing would be to search for that string in your existing file, and remove the preceding comment character, that is, remove the "#".
    
    If you want the .pl extension recognised as a CGI script as well, simply append the extension to the list, as follows:
    AddHandler cgi-script .cgi .pl
    
    Next, search for the line that says "<Directory /> in the file. It should look something like this:
    <Directory />
      Options FollowSymLinks
      AllowOverride None
    </Directory>
    
    Add "+ExecCGI" to the options list. The line now looks like this:
    Options FollowSymLinks +ExecCGI
    
4. Create a test perl page

    #!/usr/bin/perl
    print "Content-type: text/html/n/n";
    
    print "Hello Perl/n";
    
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值