Breaking News
Loading...
Wednesday, August 14, 2013

How to Enable mod_perl on Linux Server CentOS 6.4/RHEL

2:39 PM

1.Introduction
he default apache configuration installed without mod_perl. This can be a good idea in order to minimize the number of things that can go wrong. This post will covers the steps to enable mod_perl on linux CentOS 6.4. This will make Perl script be fast and increase the performance.
2. Install Mod Perl on Linux Server CentOS 6.4 
Step 1. To Enable mod_perl, simply run the following command :
[root@centos64 ~]# yum install mod_perl -y
 
Step 2. Configure PerlRun mode :
[root@centos64 ~]# vi /etc/httpd/conf.d/perl.conf
a) Original :
#PerlSwitches -w
Uncomment or change to :
PerlSwitches -w
 
b) Original :
#PerlSwitches -T
Uncomment or change to :
PerlSwitches -T
 
c) Original :
#Alias /perl /var/www/perl
#<Directory /var/www/perl>
#    SetHandler perl-script
#    PerlResponseHandler ModPerl::Registry
#    PerlOptions +ParseHeaders
#    Options +ExecCGI
#</Directory>
Uncomment or change to :
Alias /perl /var/www/perl
<Directory /var/www/perl>
    SetHandler perl-script
#   AddHandler perl-script .cgi
#   PerlResponseHandler ModPerl::Registry
    PerlResponseHandler ModPerl::PerlRun
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Directory>
 
d) Original :
#<Location /perl-status>
#    SetHandler perl-script
#    PerlResponseHandler Apache2::Status
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>
Uncomment or change to :
<Location /perl-status>
    SetHandler perl-script
    PerlResponseHandler Apache2::Status
    Order deny,allow
    Deny from all
    Allow from 192.168.1.0/24
</Location>
 
Step 3. Restart Apache :
[root@centos64 ~]# /etc/rc.d/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Step 4. Make sure if it works normally : Browse to http://192.168.1.34/perl-status

 Note: Disable IPtable Or open Port 80(httpd) on IPtable
 Good Luck For You!!

0 comments:

Post a Comment

 
Toggle Footer