[mplspm]: Fwd: Mason as CGI and problems with autohandlers

John Erjavec V john.erjavec at intel.com
Wed Feb 13 21:32:46 CST 2002


All-

I sent this off to the Mason mailing list, but got no response.  If there 
is anyone here that uses Mason, and has any idea what is going on (and 
would be willing to share that info with me), that would be great.  Thanks 
a bunch.

-JEV
--
John Erjavec V  ##  spammers-will-be-reported at jevonline.com
                 ##  http://www.jevonline.com/jev/index.html

Men are from Earth, women are from Earth. Deal with it.

>Date: Mon, 11 Feb 2002 20:35:44 -0500
>To: mason-users at lists.sourceforge.net
>From: John Erjavec V <jev at pconline.com>
>Subject: Mason as CGI and problems with autohandlers
>
>All-
>
>I'm running into a weird problem here.  No matter what I do, I get an 
>error in the error_log saying:  'handler "html-mason" not found for: 
><page>'.  If I put a page together and have <% 2+2 %> in it, the page 
>renders as '4', but I still get the error.  When I try to start using an 
>autohandler, the page doesn't render at all, and I get a bunch of errors 
>in the log.  The errors are here:
>
>======================= error_log errors 
>==================================
>[Sun Feb 10 23:23:43 2002] [warn] [client 192.168.10.6] handler 
>"html-mason" not found for: /home/httpd/html/mason_test/index2.html
>error while executing /mason_test/autohandler:
>could not find component for path 'comp/metatags'
>         HTML::Mason::Interp::__ANON__('could not find component for path 
> \'comp/metatags\'^J') called at 
> /usr/lib/perl5/site_perl/5.005/HTML/Mason/Request.pm line 596
> 
>HTML::Mason::Request::comp('HTML::Mason::Request=HASH(0x832dc50)', 
>'comp/metatags') called at /home/httpd/mason/obj/mason_test/autohandler 
>line 16
>         HTML::Mason::Commands::__ANON__() called at 
> /usr/lib/perl5/site_perl/5.005/HTML/Mason/Component.pm line 131
> 
>HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x81dc4f0)') 
>called at /usr/lib/perl5/site_perl/5.005/HTML/Mason/Request.pm line 653
>         eval {...} called at 
> /usr/lib/perl5/site_perl/5.005/HTML/Mason/Request.pm line 653
> 
>HTML::Mason::Request::comp('HTML::Mason::Request=HASH(0x832dc50)', 
>'HASH(0x835beec)', 'HTML::Mason::Component::FileBased=HASH(0x81dc4f0)') 
>called at /usr/lib/perl5/site_perl/5.005/HTML/Mason/Request.pm line 159
>         eval {...} called at 
> /usr/lib/perl5/site_perl/5.005/HTML/Mason/Request.pm line 159
> 
>HTML::Mason::Request::exec('HTML::Mason::Request=HASH(0x832dc50)', 
>'/mason_test/index2.html') called at 
>/usr/lib/perl5/site_perl/5.005/HTML/Mason/Interp.pm line 243
>         HTML::Mason::Interp::exec('HTML::Mason::Interp=HASH(0x832dc5c)', 
> '/mason_test/index2.html') called at /home/httpd/cgi-bin/handler.cgi line 
> 17
>======================= error_log errors 
>==================================
>
>My httpd.conf file contains:
>
>DocumentRoot /home/httpd/html
>ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
>Action html-mason /home/httpd/cgi-bin/handler.cgi
>
><Directory /home/httpd/html>
>         SetHandler html-mason
></Directory>
>
>and I have a handler.cgi script in /home/httpd/cgi-bin/ that is included 
>below:
>
>======================= handler.cgi ==================================
>#!/usr/bin/perl -w
>use CGI;
>use HTML::Mason;
>use HTML::Mason::Utils qw(cgi_request_args);
>
>my $interp = new HTML::Mason::Interp (comp_root=>'/home/httpd/html',
>                                       data_dir=>'/home/httpd/mason');
>
>my $q = new CGI;
>my $comp = $ENV{'PATH_TRANSLATED'};
>my $root = $interp->comp_root;
>$comp =~ s/^$root//
>     or die "Requested file '$comp' is outside component root '$root'";
>my %args = cgi_request_args($q, $q->request_method);
>print $q->header;
>
>$interp->exec($comp, %args);
>======================= handler.cgi ==================================
>
>I have all my comps in a directory called 'comp' off of /home/httpd/html, 
>and I call them a 'comp/metatags' and such.  (I also tried having them 
>right in the comp root, and that didn't work either.)
>
>Any ideas on what is going on here?  It seems like I don't have something 
>quite right here, but I can't see what it is.  Any help 
>appreciated.  Thanks.
>
>-JEV



--------------------------------------------------
Minneapolis Perl Mongers mailing list

To unsubscribe, send mail to majordomo at pm.org
with "unsubscribe mpls" in the body of the message.



More information about the Mpls-pm mailing list