Perhaps you could post/attach your .htaccess and masonhandler.pl for
review, as well as the full path to each. I'm not adept at Apache, so I
can't offer any great insight into best configuration or the nature of
specific error messages.

I highly recommend buying and reading through the mason book. Here's the
chapter on CGI:
http://www.masonbook.com/book/chapter-9.mhtml
I would go through the examples there, to ensure that you pick up on any
quirks in your particular system's implementation.

These are the steps I would proceed through in troubleshooting:
Can you run a CGI script?
Can you access mason via a CGI script?
Can you set up a handler rule using FilesMatch? (Try just using CGI)
Can you set up a handler that triggers your masonhandler.pl?
Can you abstract the mason interfacing element from your CGI into your
masonhandler? (based on basic example handler here:
http://www.masonhq.com/docs/manual/CGIHandler.html )
Can you access your mason components with your mason handler?

hth,
RJ

Benct Philip Jonsson wrote:
> I have tried to use your .htaccess and handler versions
> with a variety of location paths, but in every case when
> I point to an *.mhtml file I get this 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.
>
> RJ Herrick skrev:
>   
>> Might the problem be the location of your handler? AFAIK, the location needs 
>> to be given from the web root:
>>
>> Action html-mason /webroot/handler.pl
>>
>> As such, I use .pl and 404 requests for .pl documents. Anyone better
>> with apache know how I can locate this elsewhere?
>>
>> Here's the gist of my handler, hope that helps.
>>
>> RJ
>>
>>
>> #!/usr/bin/perl -T
>>
>> use warnings;
>>
>> #Untainting: Explicitly add programs as needed
>> $ENV{PATH} = undef;
>>
>> use strict;
>> use HTML::Mason::CGIHandler;
>> use CGI qw( escapeHTML );
>> use CGI::Carp qw/fatalsToBrowser/;
>> use Digest::SHA1;
>> use Cache::FileCache;
>>
>> use lib qw( /home/private/lib /home/private/lib/perl5/site_perl );
>>
>> #Turn on profiling
>> #use MasonX::Profiler;
>>
>> #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 Jonsson wrote:
>>
>>     
>>> Thanks, that was close but not quite...
>>>
>>> I get another error message:
>>>
>>> "The requested URL 
>>> /home/account/public_html/cgi-bin/mason_handler.cgi/test.mhtml was not 
>>> found on this server."
>>>
>>> What does your masonhandler.pl look like?
>>>
>>> RJ Herrick skrev:
>>>  
>>>
>>>       
>>>> I use FilesMatch in my .htaccess.
>>>>
>>>> [snip]
>>>>
>>>> #Define the html-mason handler (server root relative)
>>>> Action html-mason /somewhere/masonhandler.pl
>>>>
>>>> #Public
>>>> <FilesMatch "\.mhtml$">
>>>>  Options +ExecCGI
>>>>  SetHandler html-mason
>>>> </FilesMatch>
>>>>
>>>> #Private
>>>> <FilesMatch ".mas$">
>>>>   Order allow,deny
>>>>   Deny from all
>>>> </FilesMatch>
>>>>
>>>> [/snip]
>>>>
>>>> RJ
>>>>
>>>> BP Jonsson wrote:
>>>>
>>>>    
>>>>
>>>>         
>>>>> I have followed the instructions for setting up Mason
>>>>> in a CGI environment on a shared server found at
>>>>> <http://www.masonhq.com/docs/manual/CGIHandler.html>.
>>>>>
>>>>> However I get an error message:
>>>>>
>>>>> "[alert] [client xxx] /home/account/public_html/.htaccess: 
>>>>> <LocationMatch not allowed here"
>>>>>
>>>>> The host admin thinks it is a cgi-error, but I'm more inclined
>>>>> to think it has to do with what directives are allowed in
>>>>> .htaccess files as described at
>>>>> <http://httpd.apache.org/docs/1.3/howto/htaccess.html#what>
>>>>> It seems there should be an AllowOverride directive somewhere,
>>>>> but where? And what should it look like?  Can I fix this
>>>>> problem or do I have to have the host admin do it?
>>>>>
>>>>> I'm aware this may be primarily an Apache question.  I have
>>>>> unsuccessfully looked around for an answer, but I don't really
>>>>> know how to formulate the question, and this is obviously
>>>>> important in order to get Mason to run under cgi, so I ask
>>>>> your forgiveness and hope somebody has some advice.
>>>>>
>>>>> /BP
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Mason-users mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/mason-users
>>>>>
>>>>>
>>>>>
>>>>>      
>>>>>           
>>>>    
>>>>         
>>>  
>>>       
>>
>>
>>
>>
>>     
>
>
>   




_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to