December 21st, 2012, 05:01 PM
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:
And this is the file I'm trying to serve (perltest.pl):
allow from all
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.
my $response = shift;
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.
December 21st, 2012, 07:32 PM
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.