Re: $r-handler and $r-set_handlers on all files

2007-04-20 Thread Sergij Borodych

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

2007-04-19 Thread Sergij Borodych

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

2007-04-19 Thread Perrin Harkins

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.

- Perrin


Re: $r-handler and $r-set_handlers on all files

2007-04-19 Thread Sergij Borodych

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

2007-04-18 Thread Sergij Borodych

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

2007-04-18 Thread 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.

--Geoff


Re: $r-handler and $r-set_handlers on all files

2007-04-18 Thread Sergij Borodych

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

2007-04-18 Thread 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 :)

--Geoff


Re: $r-handler and $r-set_handlers on all files

2007-04-18 Thread Sergij Borodych
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


Re: $r-handler and $r-set_handlers on all files

2007-04-18 Thread 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.

- Perrin


$r-handler and $r-set_handlers on all files

2007-04-17 Thread 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?) ?


--
Sergij Borodych
http://bor.org.ua