1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Rep Power

    Trying to get mod_perl to work

    I'm trying to set up mod_perl on an Apache server of mine. This is part of my httpd.conf:
    <Directory /srv/http/testing>
    SetHandler perl-script
    Options ExecCGI
    PerlSendHeader On
    allow from all
    And this is the file I'm trying to serve (perltest.pl):
    my $response = shift;
    $response->print("It worked!");
    However, Apache just serves the file as plain text. Attempts to use a PerlModule just fail, either the server does not start or it gives a HTTP 500 when trying to serve the page.

    The operating system is Arch Linux ARM, the server is Apache 2.2.23 and Perl is version 5.16.2. In /usr/lib/perl5/vendor_perl/ModPerl there are the following modules: BuildMM.pm, CScan.pm, MethodLookup.pm, RegistryBB.pm, StructureMap.pm, WrapXS.pm,
    BuildOptions.pm, FunctionMap.pm, MM.pm, RegistryCooker.pm, TestReport.pm, Code.pm, Global.pm, ParseSource.pm, RegistryLoader.pm, TestRun.pm, Config.pm, Manifest.pm, PerlRun.pm, Registry.pm, TypeMap.pm, Const.pm, MapUtil.pm, PerlRunPrefork.pm, RegistryPrefork.pm, Util.pm

    I've seen lots of mod_perl tutorials and they all seem to tell me different things. I want to learn Perl and try some alternatives to PHP. Am I making a bad choice with mod_perl? I'm open to any suggestions.

  2. #2
  3. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Reno, NV
    Rep Power
    mod_perl can be difficult to set up, and I don't know of a good tutorial for your OS, though one might exist.

    It's also possible that there is a repository for your OS that contains a version of Apache and mod_perl already configured for your machine.

    If you are just trying to learn perl, the CGI method is usually already pre-configured for most webservers, so you can just put your code in the cgi-bin directory and go. But if you want something more modern, Plack is the currently supported middleware solution based on the Ruby Rack interface.

IMN logo majestic logo threadwatch logo seochat tools logo