I'm trying to set up mod_perl on a Ubuntu 9.04 box. I think that I have mod_per installed correctly, but I am having trouble configuring the system to use mod_perl.
Efforts so far:
1) apt-get install of
libapache2-mod-perl2, libapache2-mod-perl2-dev, libapache2-mod-perl2-doc, perl-doc.
2) Not knowing where and what documentation came with my libapache2-mod-perl2-doc I did some searching. I found a helpful looking file name at /usr/share/doc/libapache2-mod-perl2-doc/api/ModPerl/PerlRun.pod. I don't know for sure if this is where I should be, but by running "
perldoc PerlRun" in this directory I got a helpful looking display.
3) Useful looking info from the perldoc:
# httpd.conf
PerlModule ModPerl::PerlRun
Alias /perl-run/ /home/httpd/perl/
<Location /perl-run>
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
PerlOptions _ParseHeaders
Options +ExecCGI
</Location>
My system has an empty /etc/apache2/httpd.conf but it is using apache2.conf. Thus, I used
apache2.conf. Also, my perl code (code that runs well on another mod_perl machine) is at /var/www/perl. Thus, what I added to apache2.conf was
PerlModule ModPerl::PerlRun
Alias /perl/ /var/www/perl/
<Location /perl>
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
PerlOptions _ParseHeaders
Options +ExecCGI
</Location>
Reset server via "/etc/init.d/apache2 reset".
Attempts to access the script from a browser yielded a "
is of type text/x-perl, and SeaMonkey does not know how to handle this file type" message. I can use one of the options to view my script file. Thus, my URL is hitting the correct file but Apache returning the text of the script rather than executing it.
4) Attempting to do something useful I attempt to get status information using the browser and the URL http://127.0.0.1/perl/perl-status. I got a "Not Found" error message with a page footer of "Apache/2.2.11 (Ubuntu)
mod_perl/2.0.4 Perl/v5.10.0 Server at 127.0.0.1 Port 80". Thus, I think mod_perl is installed correctly but Apache configuration files are not set up to use it. (I don't know why perl-status didn't work as shown in my book.)
5) I changed the ownership and group of the perl directory and it's contents to www-data. I also changed permissions so Owner, Group and All can execute the file and the directory. Reset Apache server. Same "text returned" issue.
I have done some Googling but I find many different and sometimes "conflicting sounding" bits of configuration advice.
Any suggestions? It seems like there should be a simple step-by-step document for setting up mod_perl, but so far the only one I found doesn't seem to be good enough.
Thanks,
Bruce