in reply to Re: mod-perl configuration under Apache2
in thread mod-perl configuration under Apache2

I have modified my test program as shown:

#!/usr/bin/perl
use warnings;
use strict;
print "Content-type: text/plain\n\n";
print "\nTHIS IS A TEST\n";

I have modified the end of my /etc/apache2/apache2.conf file as shown:


Alias /perl/ /var/www/perl/

#PerlModule ModPerl::PerlRun
PerlModule ModPerl::Registry

<Location /perl/>
   SetHandler perl-script
   PerlHandler ModPerl::Registry
   #PerlHandler ModPerl::PerlRun
   Options +ExecCGI
   #PerlSendHeader On
</Location>

When I try to access (run) the perl program I still get the "Mozilla does not know how to handle this file type" box.

When I try to access something that does not exist I still get a "not found" screen with "Apache/2.0.55 (Ubuntu) mod_perl/2.0.2 Perl/v5.8.8 Server at 192.168.20.210 Port 80" at the bottom (note mod_perl is included).

Any more ideas?
Thanks,
Bruce
  • Comment on Re^2: mod-perl configuration under Apache2

Replies are listed 'Best First'.
Re^3: mod-perl configuration under Apache2
by asz (Pilgrim) on Mar 07, 2007 at 17:52 UTC

    how about cleaning up you Apache2 configuration file? replace this lines:

    PerlModule ModPerl::PerlRun #Alias /perl/ /var/www/perl/ ScriptAlias /cgi-bin /var/www/cgi-bin/ ScriptAlias /perl/ /var/www/perl/ <Location /perl> allow from all SetHandler perl-script AddHandler cgi-script .cgi .pl #PerlHandler Apache::Registry #PerlHandler Apache::PerlRun PerlResponseHandler ModPerl::PerlRun Options +ExecCGI PerlSendHeader On </Location> <Directory /var/www/perl> allow from all Options +ExecCGI #AddHandler cgi-script .pl #SetHandler perl-script PerlResponseHandler ModPerl::PerlRun </Directory>

    with only this:

    PerlModule ModPerl::Registry ScriptAlias /cgi-bin /var/www/cgi-bin/ <Location "/perl"> SetHandler perl-script PerlHandler ModPerl::Registry Options +ExecCGI </Location>

    as far as i can tell, the directive shown below is telling Apache to serve content from /var/www/perl as CGI using mod_cgi and because it's written before the mod_perl settings it takes precedence over those, ignoring them:

    ScriptAlias /perl/ /var/www/perl/

    also, may i suggest that you get in the good habbit of Debian/Ubuntu W.R.T. setting up Apache2 servers? that is create a file in /etc/apache2/sites-available with your settings and enable it using this command

    a2ensite myproject && /etc/init.d/apache2 restart

    that way you can exclude parts of your configuration in case you need to debug your Apache configuration. more info is in your /etc/apache2/README file.

    :)))))
      I made the suggested changes and still get "Mozilla does not know how to handle this file type".

      The /var/log/apache2/error.log file has only the restart notice at restart time. There are no errors logged during restart.

      The display at the bottom of a non existant page and the http://x.x.x.x/server-status pages include "mod_perl", so I still assume that my "apt-get install libapache2-mod-perl2" has worked successfully.
Re^3: mod-perl configuration under Apache2
by Bruce32903 (Scribe) on Mar 07, 2007 at 17:43 UTC
    I was so busy looking at the code I didn't even see the download tags in the response. Thanks for the extra effort. Sorry I didn't put it to good use.

    Bruce