Enable mod_perl2011/05/07 |
Enable mod_perl and makes Perl script be fast.
|
|
[1] | Configure PerlRun mode. |
[root@www ~]# yum -y install mod_perl [root@www ~]# vi /etc/httpd/conf.d/perl.conf # line 17: uncomment PerlSwitches -w # line 26: uncomment PerlSwitches -T # line 32-38: uncomment like follows Alias /perl /var/www/perl <Directory /var/www/perl> # directory for mod_perl environment SetHandler perl-script # looks all files as perl-scripts under this directory # AddHandler perl-script .cgi # if set specific files, use this line and make the line above comment # PerlResponseHandler ModPerl::Registry PerlResponseHandler ModPerl::PerlRun # set PerlRun mode PerlOptions +ParseHeaders Options +ExecCGI </Directory> # line 44-50: uncomment ( this is for the status of mod_perl ) <Location /perl-status> SetHandler perl-script PerlResponseHandler Apache2::Status Order deny,allow Deny from all Allow from 10.0.0.0/24 # IP address you allow </Location> [root@www ~]# /etc/rc.d/init.d/httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] |
[2] | Create a perl script and make sure if it works normally. Furthermore, it's possible to see the status of mod_perl at "http://(hostname or IP address)/perl-status". |
[3] | Configure Registry mode. This mode makes Perl script be more fast than PerlRun mode, but be careful to write scripts. |
[root@www ~]# vi /etc/httpd/conf.d/perl.conf Alias /perl /var/www/perl <Directory /var/www/perl> SetHandler perl-script # AddHandler perl-script .cgi PerlResponseHandler ModPerl::Registry # uncomment # PerlResponseHandler ModPerl::PerlRun # make it comment PerlOptions +ParseHeaders Options +ExecCGI </Directory> [root@www ~]# /etc/rc.d/init.d/httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] |
Sponsored Link |
|