The configuration method of running CGI mode under Apache _linux

Source: Internet
Author: User
Tags apache download perl interpreter perl script

1, Apache download address: http://www.apache.org, the following to 2.0.63 as an example to run the configuration of CGI programs.

2, download the Perl interpreter ActivePerl under Windows, official website: http://www.activestate.com/, the latest version ActivePerl-5.10.0.1003, assuming the installation path is C:\Perl.

3, modify the Apache configuration file httpd.conf:

Copy Code code as follows:

<directory "D:/apache Group/apache2/cgi-bin" >
AllowOverride None
Options None
Order Allow,deny
Allow from all
</Directory>
#AddHandler Cgi-script. CGI

To
Copy Code code as follows:

<directory "D:/apache Group/apache2/cgi-bin" >
AllowOverride None
Options execcgi
Order Allow,deny
Allow from all
</Directory>
AddHandler cgi-script. cgi. pl

4. Write Perl script program hello.pl

Copy Code code as follows:

#! C:\Perl\bin\perl.exe
Print "content-type:text/html", "\ n";
Print "<HTML>", "\ n";
Print "<HEAD>", "\ n";
Print "<TITLE>Perl</TITLE>", "\ n";
Print "</HEAD>", "\ n";
Print "<BODY>", "\ n";
Print "Print "</BODY>", "\ n";
Print "</HTML>", "\ n";

Copy the program to the Apache installation directory under the Cgi-bin folder

5, start the Apache server, open the browser, input http://localhost/cgi-bin/hello.pl
The results show that Hello world

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.