How to run cgi written in Perl in Apache environment

Source: Internet
Author: User
Tags perl interpreter
Article Title: how to run cgi written in Perl in Apache environment. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open-source and other basic classification runtime environments: Windows XP, WampServer, and Active Perl 5.6 after installation, use notepad to open httpd. conf file, 1. search cgi-bin and find ScriptAlias/cgi-bin/"d:/wamp/Apache2/cgi-bin/Delete the previous # number, which is the path for storing the cgi File 2. search AddHandler and find AddHandler cgi-script. cgi, which defines the executable cgi file extension. change cgi. pl or add ",. pl AddHandler cgi-script. pl,. cgi"Both suffixes can be used. 3. change the Options and Allow Override parameters to All. After the change, it will look like this :# # "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" shocould be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured .# AllowOverride all Options all Order allow, deny Allow from all 4. create the file test. pl with the following content: #! D:/Perl/bin/perl##Written! D:/Perl/bin/perl.exe can also be # Note: If no first line or error is found, apache cannot find the perl interpreter #, the 500 Internal Server will appear.Print "Content-type: text/html \ n"; print "CGI execution successful! "Create an html file in the www directory with the following content: CGI5. restart apache server and open the file in the browser, prompting "CGI execution successful !"
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.