How to add perl cgi script support to your Apache server on Windows

Source: Internet
Author: 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 wocould be to search for that string in your existing file, and remove the preceding comment character, that is, remove "#".

If you want the. pl extension recognized 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 shoshould 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 ";

Print "Hello PERL/N ";

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.