Re: set auth_type, after subrequest it lost - bug or not ?
On 06/14/07 16:14, Sergij Borodych wrote: Hi ALL, I need some help I set auth_type (like $r-auth_type('MyType')) in PerlAuthenHandler if request go in / (root) it generate subrequest for lookup index.html file name after this in subrequest I lost auth_type (but I ignore subrequests) but even in PerlLogHandler I can't determine it this is bug or not ? becouse in documentation: auth_type Get/set the type of authorization required for _this request_ I may try workaround with use pnotes, but I want desirably less as possibly a superfluous code As I undestand second(subrequest) call of PerlAuthenHandler destroy(remove) my auth_type set(even for main request), so I fix it set $r-auth_type('MyType'); before return OK unless $r-is_initial_req(); so even in subrequest I set auth_type But I have suspicion - is the bug ? (I about PerlLogHandler without defined auth_type) How do you think ? -- Sergij Borodych http://bor.org.ua
set auth_type, after subrequest it lost - bug or not ?
Hi ALL, I need some help I set auth_type (like $r-auth_type('MyType')) in PerlAuthenHandler if request go in / (root) it generate subrequest for lookup index.html file name after this in subrequest I lost auth_type (but I ignore subrequests) but even in PerlLogHandler I can't determine it this is bug or not ? becouse in documentation: auth_type Get/set the type of authorization required for _this request_ I may try workaround with use pnotes, but I want desirably less as possibly a superfluous code -- Sergij Borodych http://bor.org.ua
Detect auth errors: user not found or password mismatch ?
Hi ALL, I try detect auth errors with use basic auth I have 2 error type in httpd log [error] [client 192.168.0.2] user test1: authentication failure for /: Password Mismatch [error] [client 192.168.0.2] user test2 not found: / How I can determine it under both mod_perl (12) ? I use $r-status to detect 401 status $r-user() return always test1 and test2 $r-get_basic_auth_pw() return always OK and sent passwords -- Sergij Borodych http://bor.org.ua
Re: $r-handler and $r-set_handlers on all files
On 04/19/07 15:19, Perrin Harkins wrote: On 4/19/07, Sergij Borodych [EMAIL PROTECTED] wrote: I check virtual hosts conf and not found difference. The httpd.conf files on the machine that works and the one that doesn't are completely identical? Make sure you are really looking at the correct files. Which apache directives can affect ? Most of them: Location, Directory, Files, etc. thank for advice fixed I found in updir configuration AddHandler server-parsed .html after comment it all works fine mod_perl not might replace this handler :( After I change it to AddOutputFilter Includes html like other servers and now all ok I will be more careful in future -- Sergij Borodych http://bor.org.ua
Re: $r-handler and $r-set_handlers on all files
Perrin Harkins пишет: On 4/18/07, Sergij Borodych [EMAIL PROTECTED] wrote: I try at another servers with Debian Etch apache2 2.2.3-4 libapache2-mod-perl2 2.0.2-2.4 FreeBSD 6.2-STABLE apache-2.0.59 mod_perl2-2.0.3_1,3 and here all works fine maybe its Gentoo specific bug ? More likely it's a problem in your httpd.conf. Compare the httpd.conf files and see what's different. You might have something declared further down that is causing a different response handler to be used. I check virtual hosts conf and not found difference. Which apache directives can affect ? How I can more debug this situation ? -- Sergij Borodych http://bor.org.ua
Re: $r-handler and $r-set_handlers on all files
On 04/19/07 15:19, Perrin Harkins wrote: On 4/19/07, Sergij Borodych [EMAIL PROTECTED] wrote: I check virtual hosts conf and not found difference. The httpd.conf files on the machine that works and the one that doesn't are completely identical? Make sure you are really looking at the correct files. Which apache directives can affect ? Most of them: Location, Directory, Files, etc. As I say virtual hosts conf are identical and httpd.conf are most default(distrib) with only contain Directory / Options FollowSymLinks AllowOverride None /Directory what affect to this I check list of modules - its seems to equal I try discover this problem code $r-warn('HANDLERS: '.join(',',@{ $r-get_handlers('PerlResponseHandler') || [] })); at start [Thu Apr 19 17:00:42 2007] [warn] HANDLERS: after set_handlers [Thu Apr 19 17:00:42 2007] [warn] HANDLERS: CODE(0x987005c) at PerlFixupHandler MyModule::test phase (add for test only) [Thu Apr 19 17:00:42 2007] [warn] HANDLERS: CODE(0x987005c) so set_handlers work after I found directive PerlTrace and try set PerlTrace h (see attach) I can't found here string like: modperl_callback_run_handlers: running 1 PerlResponseHandler handlers nothing about PerlResponseHandler :( The main difference is that I run worker mpm On other server - prefork mpm Also I try set PerlInterpScope handler (and other) not help :( maybe i try recompile apache with prefork mpm and test tomorrow -- Sergij Borodych http://bor.org.ua modperl_ptr2obj: sv_setref_pv(Apache2::RequestRec, 0x8c046d0) modperl_callback_run_handlers: [10151/3067767696] running 1 PerlAuthzHandler handlers MpHandler flags dump (MyModule::authorize): Anon Off Autoload Off Dynamic Off Fake Off Method Off Object Off Parsed On modperl_handler_new: [10151/3067767696] new handler MyModule::here_some_func_that_need_to_run modperl_callback_run_handlers: callback 'MyModule::authorize' returned 0 modperl_callback_run_handlers: no PerlTypeHandler handlers configured (/test.html) modperl_callback_run_handlers: no PerlFixupHandler handlers configured (/test.html) modperl_filter_add_request: no OutputFilter handlers configured (/test.html) modperl_filter_add_request: no InputFilter handlers configured (/test.html) modperl_ptr2obj: sv_setref_pv(Apache2::RequestRec, 0x8c046d0) modperl_callback_run_handlers: [10151/3067767696] running 1 PerlLogHandler handlers MpHandler flags dump (MyModule::logger): Anon Off Autoload Off Dynamic Off Fake Off Method Off Object Off Parsed On modperl_callback_run_handlers: callback 'MyModule::logger' returned 0 modperl_callback_run_handlers: no PerlCleanupHandler handlers configured (/test.html)
Re: $r-handler and $r-set_handlers on all files
Sergij Borodych пишет: Hi, I have configuration: apache-2.0.59 mod_perl-2.0.3 Directory /somedir/htdocs PerlAuthzHandler MyModule::authorize and in authorize: if ... $r-handler('perl-script'); $r-set_handlers( (MP2 ? 'PerlResponseHandler' : 'PerlHandler') = \somefunc ); If url is / all ok - authorize and after somefunc is called But if I request all other files like /test.html authorize called and set handlers, but somefunc not called :( Also it called if request /test (try to resolve test.html I think) and for non existing url(files) it(somefunc) called too Where a problem? Is a way for fix it without redirect or add new Perl*Handler (PerlMapToStorageHandler,PerlFixupHandler?) ? I try at another servers with Debian Etch apache2 2.2.3-4 libapache2-mod-perl2 2.0.2-2.4 FreeBSD 6.2-STABLE apache-2.0.59 mod_perl2-2.0.3_1,3 and here all works fine maybe its Gentoo specific bug ? becouse problem exists only on Gentoo ~x86 apache-2.0.59-r2 mod_perl-2.0.3-r1 How I discover(investigate) it ? -- Sergij Borodych http://bor.org.ua
Re: $r-handler and $r-set_handlers on all files
Geoffrey Young пишет: Sergij Borodych wrote: Hi, I have configuration: apache-2.0.59 mod_perl-2.0.3 Directory /somedir/htdocs PerlAuthzHandler MyModule::authorize and in authorize: if ... $r-handler('perl-script'); $r-set_handlers( (MP2 ? 'PerlResponseHandler' : 'PerlHandler') = \somefunc ); why are you doing this? those same directives in httpd.conf are a cleaner way to go - if your PerlAuthzHandler returns FORBIDDEN they will never be executed. I know, but I need show custom html page (with custom error message) -- Sergij Borodych http://bor.org.ua
Re: $r-handler and $r-set_handlers on all files
Geoffrey Young пишет: Directory /somedir/htdocs PerlAuthzHandler MyModule::authorize and in authorize: if ... $r-handler('perl-script'); $r-set_handlers( (MP2 ? 'PerlResponseHandler' : 'PerlHandler') = \somefunc ); why are you doing this? those same directives in httpd.conf are a cleaner way to go - if your PerlAuthzHandler returns FORBIDDEN they will never be executed. I know, but I need show custom html page (with custom error message) you can pass anything you like from your authz handler to your content handler using $r-pnotes :) Yes I use it :) I pass error message to somefunc but problem in another thing please reread my first(and second) letter -- Sergij Borodych http://bor.org.ua
$r-handler and $r-set_handlers on all files
Hi, I have configuration: apache-2.0.59 mod_perl-2.0.3 Directory /somedir/htdocs PerlAuthzHandler MyModule::authorize and in authorize: if ... $r-handler('perl-script'); $r-set_handlers( (MP2 ? 'PerlResponseHandler' : 'PerlHandler') = \somefunc ); If url is / all ok - authorize and after somefunc is called But if I request all other files like /test.html authorize called and set handlers, but somefunc not called :( Also it called if request /test (try to resolve test.html I think) and for non existing url(files) it(somefunc) called too Where a problem? Is a way for fix it without redirect or add new Perl*Handler (PerlMapToStorageHandler,PerlFixupHandler?) ? -- Sergij Borodych http://bor.org.ua