ModPerl list,
It looks like the problem here was that BeerBong had
the same subroutine name defined in multiple scripts,
and since by default all Apache::ASP are compiled into
the same package namespace, one script would call another's
subroutine, whichever was most recently compiled.
If you want to define the same sub name in different scripts,
you need to set the UniquePackages config, so that each
script will be compiled in its own namespace. Better I think
to have one common subroutine name defined in global.asa,
or an include that keys off the script filename in $0 or
File::Basename::basename($0) to determine its modified behavior.
This problem was made harder to figure out because "use strict"
errors work oddly under Apache::ASP to say the least mostly
likely requiring that you restart the dev web server after
getting a "use strict" compile error.
"use strict" errors used to go directly to the apache error log,
but I have trapped them so they will show up in the Apache::ASP
debug output (in my dev version of .18), to HTML if you have
debug set to 2 or -2, but this is only the first time the compile
is tried. I'm still trying to get scripts to try to recompile
after the first use strict error without success.
Anyone have any pointers here on "use strict" compilation errors?
BTW, I found you can trap their output by overriding $SIG{__WARN__}
--Joshua
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks >> free web link monitoring Huntington Beach, CA USA
http://www.nodeworks.com 1-714-625-4051
BeerBong wrote:
>
> Hello Joshua!
>
> I think, I catch new bug of Apache::ASP again, although may be Apache::ASP
> is innocent in this case.
>
> I have 2 Apache servers - simple/proxy and mod_perl and secured virtual site
> of management big Samara portal.
>
> Secured on simple Apache.
>
> ----------------------------------------------------------------------------
> ----
> <Macro auth_macro $realm $group>
> <IfDefine simple>
> <Directory /usr/web/$realm/data/>
> AuthType Basic
> AuthName $realm
> AuthUserFile /usr/web/users_file
> AuthGroupFile /usr/web/groups_file
> require group $group
> </Directory>
> </IfDefine>
> </Macro>
> ----------------------------------------------------------------------------
> ----
>
> This site is located at http://195.128.133.23:777 - here listen simple
> Apache, mod_perl Apache listen on http://195.128.133.23:778 address and I
> don't want that anyone can acces mod_perl Apache from outside the server
>
> Therefore, I have following handler.
>
> ----------------------------------------------------------------------------
> ----
> sub My::ProxyRemoteAddr ($)
> {
> my $r = shift;
>
> # we'll only look at the X-Forwarded-For header if the requests
> # comes from our proxy at localhost
> return FORBIDDEN unless ($r->connection->remote_ip =~ /^195.128.133/);
>
> if (my ($ip) = $r->header_in('X-Forwarded-For') =~ /([^,\s]+)$/)
> {
> $r->connection->remote_ip($ip);
> }
>
> return OK;
> }
> ----------------------------------------------------------------------------
> ----
>
> All worked just pretty fine until I try, for fun, connect to mod_perl
> directly...
>
> http://195.128.133.23:778/
>
> As I await - I got
>
> ----------------------------------------------------------------------------
> ----
> Forbidden
> You don't have permission to access / on this server.
>
> ----------------------------------------------------------------------------
> ----
> Apache/1.3.9 Server at www.samara.ru-editor Port 778
> ----------------------------------------------------------------------------
> ----
>
> Huh! It's cool! But...
> After it I return to 777 port and request
> http://195.128.133.23:777/index.shtml
> and got a error:
>
> ----------------------------------------------------------------------------
> ----
> Errors Output
>
> > Can't use string ("select level,rubric_id,parent_id") as a SCALAR ref
> while "strict refs" in use at (eval 13) line 14.
> , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1142
>
> Debug Output
>
>
> After some refreshes - I got another output, which is not done by
> index.shtml!
> As you can see in debug output 'Last 100 Bytes of Buffered Output' is not
> present in 'ASP to Perl Program' !
> Because 'Last 100 bytes' - code of another script - divisions.shtml ! And
> the same thing happens with all other scripts.
> divisions.shtml shows code of rubrics.shtml and etc.
>
> What you can say ?
> ----------------------------------------------
> Sergey Polyakov (BeerBong)
> Chief of Web Lab (http://www.mustdie.ru/~beerbong)