Hi Stas - > -----Original Message----- > From: Stas Bekman [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 04, 2003 6:18 PM > To: Beau E. Cox > Cc: Modperl > Subject: Re: [mp2] apache/mod_perl starup failure using cvs 09 > > > Beau E. Cox wrote: > > -------------8<---------- Start Bug Report ------------8<---------- > > 1. Problem Description: > > > > Sorry - is this mason's problem? > > > > Apache does not start using latest mod_perl2 (cvs) when > > using a mason startup script. > > > > Failure matrix: > > > > mod_perl version mason version using startup.pl using > simple-mason.pl > > OK? > > > -------------------------------------------------------------------------- > > ---- > > 08-source 1.16 yes yes > > OK > > 08-source 1.19 yes yes > > OK > > 09-cvs 1.19 yes yes > > FAIL > > 09-cvs 1.16 yes yes > > FAIL > > 09-cvs 1.19 no-in httpd no mason > > OK > > 09-cvs 1.19 no-in httpd no-in httpd > > OK > > > > Apache startup console output: > > > > [Tue Mar 04 16:45:09 2003] [error] Global $r object is not > available. Set: > > PerlOptions +GlobalRequest > > in httpd.conf at > /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm > > line 573. > > Compilation failed in require at (eval 3) line 1. > > [...] > > > HTML::Mason::ApacheHandler revelant lines: > > > > my $allowed_params = $class->allowed_params(%defaults, %params); > > > > 573: if ( exists $allowed_params->{comp_root} and > > my $req = $r || Apache->request ) # DocumentRoot is only > available > > why does Mason needs $r at the server startup? There is no > request object at > the server startup, so it's only fair that mp reports the error. > > __________________________________________________________________ > Stas Bekman JAm_pH ------> Just Another mod_perl Hacker > http://stason.org/ mod_perl Guide ---> http://perl.apache.org > mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com > http://modperlbook.org http://apache.org http://ticketmaster.com > >
Good point. However, I seemed to have given you the code of mason's ApacheHandler out of context; the snip above is from the 'new' method which I use in setting up the mason handler routine: # Create ApacheHandler object at startup. my $ah = HTML::Mason::ApacheHandler->new ( args_method => "CGI", comp_root => "/srv/www/htdocs", data_dir => "/srv/www/mason", error_mode => 'output', ); In this trivial case it doesn't seem worthwhile to go to all that trouble, but, as in my production server, when working with a lot of (possible dynamic) vhosts, it works well. If the Apache->request (or a request passed as the last - odd - parameter to new) is defined, some further processing occurs; but at startup, the request is neither expected to be there nor needed. I guess (looking at my result matrix) that some change was made to mod_perl to prohibit even querying the presence of Apache->request at startup. So now I (and other mason folks) must find another way to instantiate handlers. Would you have and suggestions from the mod_perl perspective? I will take this query over to mason if you feel that is where it belongs - but I'll need some further insight into the mod_perl changes. Aloha => Beau;