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 |