Apache activates Mod_perl module to build Perl operating environment

Source: Internet
Author: User
Tags perl script

Execute the perl script by installing Mod_perl in the Apache-run environment.

Install Mod_perl

The code is as follows Copy Code

# yum-y Install Mod_perl

Use Perlrun mode to keep the Perl compiler resident in memory

The code is as follows Copy Code

# vi/etc/httpd/conf.d/perl.conf

Alias/perl/var/www
<Directory/var/www> #/var/www in the directory to perform Perl
All files in the #SetHandler perl-script # directory will be executed by Perl
AddHandler perl-script. pl # file format for PL when executing perl
#PerlResponseHandler Modperl::registry
Perlresponsehandler Modperl::P erlrun # Specify Perlrun mode
Perloptions +parseheaders
Options +execcgi
</Directory>

<Location/perl-status>
SetHandler Perl-script
Perlresponsehandler Apache2::status
Order Deny,allow
Deny from all
Allow from 10.10.8.5 # Access restrictions
</Location>

Restart Apache

The code is as follows Copy Code

# service httpd Restart # CentOS6
# systemctl Restart httpd # CentOS7

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.