Theiling Online    Sitemap    Conlang Mailing List HQ   

TECH: Web server problem

From:Benct Philip Jonsson <bpjonsson@...>
Date:Wednesday, June 14, 2006, 13:48
I have a problem that I thought someone of you may know the
answer to.  I have asked about this in various public places
without getting any answer -- hopefully because it is a FAQ
and not because it is unanswerable, however if it is a FAQ I
can't find it anywhere, probably because I don't know how to
put the question...

I'm trying to use the Perl dynamic webpage generator
HTML::Mason under CGI -- since I'm on a shared server and it
is said to be a bad idea to run Mason under mod_perl on a
shared server.  Anyway this seems to be an Apache problem
rather than a Perl/CGI problem.

The setup instructions in the HTML::Mason::CGIHandler
manual turned out to be all wrong, so I was advised
to use the following:

I have an .htaccess file that looks like this:

     #Define the html-mason handler (server root relative)
     Action html-mason /home/account/masonhandler.pl

     #Public
     <FilesMatch "\.mhtml$">
       Options +ExecCGI
       SetHandler html-mason
     </FilesMatch>

     #Private
     <FilesMatch ".mas$">
        Order allow,deny
        Deny from all
     </FilesMatch>

But when I point to an *.mhtml file I get an error:

     "The requested URL
     /home/account/masonhandler.pl/test.mhtml was not found
     on this server."

It seems Apache thinks masonhandler.pl is a directory
rather than a script that should handle requests for
*.mhtml files.

FYI the masonhandler.pl looks like this:

     #!/usr/bin/perl -T

     use warnings;

     #Untainting: Explicitly add programs as needed
     $ENV{PATH} = undef;

     use strict;
     use HTML::Mason::CGIHandler;

     #Get a new Mason handler object
     my $h = HTML::Mason::CGIHandler->new
      (
       #preamble        => 'my $p = MasonX::Profiler->new($m, $r);',
     #MasonX::Profiler object
       allow_globals        => [qw( $ROOT $ThisUser )],      #globals
per child
       code_cache_max_size    => 0,                             #Turn off
     caching while testing
      );

     #Pass the request to the handler. Ta-da!
     $h->handle_request;

--


/BP 8^)>
--
Benct Philip Jonsson -- melroch at melroch dot se

    a shprakh iz a dialekt mit an armey un flot

                                 (Max Weinreich)

Reply

Mark J. Reed <markjreed@...>