Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.