[users@httpd] Problem setting action handler for HTML::Mason::CGIHandler.pm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to use the Perl module HTML::Mason under
CGI.  The 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/melroch/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 I get an error:

    "The requested URL
    /home/melroch/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)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux