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

來源:互聯網
上載者:User
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";
    
 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.