{"id":971,"date":"2012-09-21T06:25:58","date_gmt":"2012-09-21T06:25:58","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=971"},"modified":"2012-09-21T06:25:58","modified_gmt":"2012-09-21T06:25:58","slug":"installing-apache2modperl-on-ubuntu-12-04","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2012\/09\/installing-apache2modperl-on-ubuntu-12-04\/","title":{"rendered":"Installing Apache2\/Modperl on Ubuntu 12.04"},"content":{"rendered":"<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\napt-get install apache2\r\napt-get install libapache2-mod-perl2\r\napt-get install perl-debug\r\napt-get install libapache2-mod-perl2-dev\r\napt-get install  libapache2-request-perl libdatetime-perl \r\n<\/pre>\n<p>Edit \/etc\/apache2\/sites-available\/default, add:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n        &lt;Location \/perl\/&gt;\r\n                SetHandler perl-script\r\n                PerlHandler ModPerl::PerlRun\r\n                Options ExecCGI\r\n                PerlSendHeader On\r\n                allow from all\r\n        &lt;\/Location&gt;\r\n<\/pre>\n<p>Install the CGI module:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncpan install CGI\r\n<\/pre>\n<p>Create a directory \/var\/www\/perl. Add a script, for example:<\/p>\n<pre class=\"brush: perl; title: ; notranslate\" title=\"\">\r\n#!\/usr\/bin\/perl\r\n\r\nuse CGI;                             # load CGI routines\r\n$q = CGI-&gt;new;                        # create new CGI object\r\nprint $q-&gt;header,                    # create the HTTP header\r\n      $q-&gt;start_html('hello world'), # start the HTML\r\n      $q-&gt;h1('hello world'),         # level 1 header\r\n      $q-&gt;end_html;                  # end the HTML\r\n<\/pre>\n<p>Call it something like hello.pl. Try to access http:\/\/server\/perl\/hello.pl, everything should work correctly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>apt-get install apache2 apt-get install libapache2-mod-perl2 apt-get install perl-debug apt-get install libapache2-mod-perl2-dev apt-get install libapache2-request-perl libdatetime-perl Edit \/etc\/apache2\/sites-available\/default, add: &lt;Location \/perl\/&gt; SetHandler perl-script PerlHandler ModPerl::PerlRun Options ExecCGI PerlSendHeader On allow from all &lt;\/Location&gt; Install the CGI module: cpan install CGI Create a directory \/var\/www\/perl. Add a script, for example: #!\/usr\/bin\/perl use CGI; # load CGI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-971","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-fF","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=971"}],"version-history":[{"count":1,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/971\/revisions"}],"predecessor-version":[{"id":972,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/971\/revisions\/972"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}