Apache2.x configure perlCGI-Linux Enterprise Application-Linux server application information. For more information, see. 1. First modify the configuration file of apache2, open/etc/apache2/apache2.conf, and find
# AddHandler cgi-script. cgi
Line, and change
AddHandler cig-script. cgi. pl
2 install the libapache2-mod-perl2 package
3. After installation, you can set the CGI script path as follows:
ScriptAlias/cgi // home/shappen/perl/cgi-bin/
Options + ExecCGI
AddHandler cgi-script. cgi. pl
In this way, access the cgi directory under the root directory in the browser and redirect to the/home/shappen/perl/cgi-bin/directory.
4. After the installation is successful, you can place a test file in the cgi directory for testing (note that there are two line breaks ):
Cat test. pl
#! /Usr/bin/perl
Print "Content-type: text/html \ n ";
Print "This is a test! ";
Chmod a + x test. pl
5 restart apache2/etc/init. d/apache2 restart
Access http: // localhost/cgi/test. pl
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