{"id":4139,"date":"2012-10-31T00:13:14","date_gmt":"2012-10-30T16:13:14","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4139"},"modified":"2023-04-28T09:48:58","modified_gmt":"2023-04-28T09:48:58","slug":"how-to-enable-mod_perl-on-linux-centos-6-3","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-enable-mod_perl-on-linux-centos-6-3\/","title":{"rendered":"How to Enable mod_perl on Linux CentOS 6.3"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignleft size-thumbnail wp-image-4140 lazyload\" title=\"apache-logo\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/10\/apache-logo-150x120.jpg\" alt=\"\" width=\"150\" height=\"120\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/120;\" \/>The 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.3. This will make Perl script be fast and increase the performance.<\/p>\n<p><strong>Prerequisites:<\/strong><br \/>\n<a href=\"https:\/\/webhostinggeeks.com\/howto\/how-to-install-httpd-on-centos-6-3\/\">How to Install Httpd on CentOS 6.3<\/a><\/p>\n<h2>1. To Enable mod_perl, simply run the following command :<\/h2>\n<pre>[root@centos63 ~]# yum install mod_perl -y\nLoaded plugins: fastestmirror, presto, priorities\nLoading mirror speeds from cached hostfile\n * base: centos.ipserverone.com\n * extras: centos.ipserverone.com\n * updates: centos.ipserverone.com\nSetting up Install Process\nResolving Dependencies\n--&gt; Running transaction check\n---&gt; Package mod_perl.i686 0:2.0.4-10.el6 will be installed\n--&gt; Processing Dependency: perl(BSD::Resource) for package: mod_perl-2.0.4-10.el6.i686\n--&gt; Running transaction check\n---&gt; Package perl-BSD-Resource.i686 0:1.29.03-3.el6 will be installed\n--&gt; Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package                       Arch             Version                      Repository        Size\n====================================================================================================\nInstalling:\n mod_perl                      i686             2.0.4-10.el6                 base             3.2 M\nInstalling for dependencies:\n perl-BSD-Resource             i686             1.29.03-3.el6                base              35 k\n\nTransaction Summary\n====================================================================================================\nInstall       2 Package(s)\n\nTotal download size: 3.2 M\nInstalled size: 6.0 M\nDownloading Packages:\nSetting up and reading Presto delta metadata\nProcessing delta metadata\nPackage(s) data still to download: 3.2 M\n(1\/2): mod_perl-2.0.4-10.el6.i686.rpm                                        | 3.2 MB     00:27\n(2\/2): perl-BSD-Resource-1.29.03-3.el6.i686.rpm                              |  35 kB     00:00\n----------------------------------------------------------------------------------------------------\nTotal                                                               117 kB\/s | 3.2 MB     00:27\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing : perl-BSD-Resource-1.29.03-3.el6.i686                                             1\/2\n  Installing : mod_perl-2.0.4-10.el6.i686                                                       2\/2\n  Verifying  : mod_perl-2.0.4-10.el6.i686                                                       1\/2\n  Verifying  : perl-BSD-Resource-1.29.03-3.el6.i686                                             2\/2\n\nInstalled:\n  mod_perl.i686 0:2.0.4-10.el6\n\nDependency Installed:\n  perl-BSD-Resource.i686 0:1.29.03-3.el6\n\nComplete!<\/pre>\n<h2>2. Configure PerlRun mode :<\/h2>\n<pre>[root@centos63 ~]# vi \/etc\/httpd\/conf.d\/perl.conf<\/pre>\n<p>a) Original :<\/p>\n<pre>#PerlSwitches -w<\/pre>\n<p>Uncomment or change to :<\/p>\n<pre>PerlSwitches -w<\/pre>\n<p>b) Original :<\/p>\n<pre>#PerlSwitches -T<\/pre>\n<p>Uncomment or change to :<\/p>\n<pre>PerlSwitches -T<\/pre>\n<p>c) Original :<\/p>\n<pre>#Alias \/perl \/var\/www\/perl\n#&lt;Directory \/var\/www\/perl&gt;\n#    SetHandler perl-script\n#    PerlResponseHandler ModPerl::Registry\n#    PerlOptions +ParseHeaders\n#    Options +ExecCGI\n#&lt;\/Directory&gt;<\/pre>\n<p>Uncomment or change to :<\/p>\n<pre>Alias \/perl \/var\/www\/perl\n&lt;Directory \/var\/www\/perl&gt;\n    SetHandler perl-script\n#   AddHandler perl-script .cgi\n#   PerlResponseHandler ModPerl::Registry\n    PerlResponseHandler ModPerl::PerlRun\n    PerlOptions +ParseHeaders\n    Options +ExecCGI\n&lt;\/Directory&gt;<\/pre>\n<p>d) Original :<\/p>\n<pre>#&lt;Location \/perl-status&gt;\n#    SetHandler perl-script\n#    PerlResponseHandler Apache2::Status\n#    Order deny,allow\n#    Deny from all\n#    Allow from .example.com\n#&lt;\/Location&gt;<\/pre>\n<p>Uncomment or change to :<\/p>\n<pre>&lt;Location \/perl-status&gt;\n    SetHandler perl-script\n    PerlResponseHandler Apache2::Status\n    Order deny,allow\n    Deny from all\n    Allow from 192.168.2.0\/24\n&lt;\/Location&gt;<\/pre>\n<h2>3. Restart Apache : <\/h2>\n<pre>[root@centos63 ~]# \/etc\/rc.d\/init.d\/httpd restart\nStopping httpd:                                            [  OK  ]\nStarting httpd:                                            [  OK  ]<\/pre>\n<h2>4. Make sure if it works normally :<\/h2>\n<p>Browse to http:\/\/192.168.2.54\/perl-status<\/p>\n<p><img decoding=\"async\" class=\"alignnone lazyload\" title=\"mod_perl\" data-src=\"http:\/\/2.bp.blogspot.com\/-mSMmSyVKdPg\/UI_7vaYvnrI\/AAAAAAAAFFU\/t1qTByaO9ew\/s1600\/mod_perl.png\" alt=\"mod_perl\" width=\"488\" height=\"259\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 488px; --smush-placeholder-aspect-ratio: 488\/259;\" \/><\/p>\n<h2>5. Configure Registry mode :<\/h2>\n<pre>\nAlias \/perl \/var\/www\/perl\n&lt;Directory \/var\/www\/perl&gt;\n    SetHandler perl-script\n# AddHandler perl-script .cgi\n    PerlResponseHandler ModPerl::Registry\n#  PerlResponseHandler ModPerl::PerlRun\n    PerlOptions +ParseHeaders\n    Options +ExecCGI\n&lt;\/Directory&gt;\n<\/pre>\n<h2>6. Restart Apache : <\/h2>\n<pre>[root@centos63 ~]# \/etc\/rc.d\/init.d\/httpd restart\nStopping httpd:                                            [  OK  ]\nStarting httpd:                                            [  OK  ]<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The 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&#8230;<\/p>\n","protected":false},"author":6,"featured_media":4140,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1103],"tags":[1199,1244,1254,1473,1975,1536,1575],"class_list":["post-4139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-apache","tag-centos","tag-centos-6-3","tag-httpd","tag-install","tag-linux","tag-mod_perl-2"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4139"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4139\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/4140"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}