Monday, August 29, 2011

How to Enable mod_perl


1) #yum -y install mod_perl
 Installation of Perl Module

2) #vim /etc/httpd/conf.d/perl.conf
   perl configuration file
  Go to line 17: uncomment

     PerlSwitches -w
  Go to line 26: uncomment
     PerlSwitches -T
  Go to 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>
 Go to line 45-51: 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 192.168.1.2 # IP address you permit
   </Location>


3) #service httpd restart
Restarting httpd services

4) Testing
 Open web browser
Http://hostname.com/perl-status




No comments:

Post a Comment