0

I am attempting to enable mod_perl on a fresh install of Lucid Lynx (ubuntu 10.04).

I have the libapache2-mod-perl2 installed, but I can't seem to get the .pl file to run instead of being downloaded.

-Perl 5.10.1

-Apache 2

I installed the "LAMP" configuration on install.

Paul Nathan
  • 285
  • 5
  • 12

1 Answers1

3

mod_perl may not be what you are looking for. Is the perl script designed to be run with mod_perl or is it a cgi script?

First, lets consider that it is a cgi script and not really meant to be run as mod_perl. If that was the case, in your block of your config, you could put:

<Directory /path/to/webroot/>
Options +ExecCGI
AddHandler cgi-script .pl
</Directory>

If the script had a proper #!/usr/bin/perl line at the top, and was able to be executed, apache should then serve it as a CGI script.

However, if you really do want to use mod_perl, you generally need to write a handler inside your VirtualHost config like:

<Location /virtualpath>
SetHandler modperl
PerlResponseHandler modulename::Function
</Location>

you might also need to put:

PerlRequire /path/to/startupscript.pl

to do your environment fixups. Generally, mod_perl handlers are .pm files and are packages rather than .pl files.

karmawhore
  • 3,865
  • 18
  • 9