Re: Building mod-perl 2 for cygwin
I have cygwin (for the tools), but haven't looked into compiling Apache/mod_perl with it. From what I understand, cygwin provides a C library (a dll) to get a unix-style API; this is to be contrasted with MinGW, which produces programs that don't rely on 3rd party dlls. cygwin, as well as having the usual .a (static) and .dll libs, does have a .dll.a type of lib, which is an import library. So having such a lib isn't unusual - whether that should be done here is another question ... OK, hopefully someone with try cygwin soonish and help Steve resolve the problems. It should definitely compile the threaded modperl. we will look at resolving the MULTIPLICITY alone, later. __ Stas BekmanJAm_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
Re: Program received signal SIGBUS, Bus error. 0x80b2953 in ap_unescape_url()
Stas Bekman wrote: Richard Clarke wrote: Stas, Doesn't seem like an apreq problem. It happens in the modperl function. Any chance you can rebuild mod_perl with debug mode enabled (PERL_DEBUG=1), so we can see the arguments and file/linenumbers? See: http://perl.apache.org/docs/1.0/guide/debug.html#PERL_DEBUG_1_Build_Option Program received signal SIGBUS, Bus error. 0x80b445b in ap_unescape_url (url=0x8162e89 "") at util.c:1609 1609url[x] = '\0'; (gdb) bt #0 0x80b445b in ap_unescape_url (url=0x8162e89 "") at util.c:1609 #1 0x8085c20 in XS_Apache_unescape_url (cv=0x8227b0c) at Apache.c:931 Richard, attached is the real fix, which will be committed shortly. The problem is in the way perl's default typemap translates undefs into char *. It wasn't allocating any strings. The following does the right thing. I've tested that undefs are now happily accepted and you get a proper warnings under -w. Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.125 diff -u -r1.125 Apache.xs --- src/modules/perl/Apache.xs 6 Jul 2001 20:33:35 - 1.125 +++ src/modules/perl/Apache.xs 20 Feb 2003 05:11:36 - @@ -655,8 +655,11 @@ Apache r char * -unescape_url(string) -char *string +unescape_url(sv) +SV *sv + +INIT: +char *string = SvPV_force(sv, PL_na); CODE: unescape_url(string); __ Stas BekmanJAm_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
Re: [mp2] $r->server()->server_hostname compatibility?
Nick Tonkin wrote: On Thu, 20 Feb 2003, Stas Bekman wrote: Nick Tonkin wrote: On Thu, 20 Feb 2003, Stas Bekman wrote: Nick Tonkin wrote: server_hostname is not documented on the list. Anyone know the equivalent please? it hasn't changes from 1.0. I thought we have been through this already, just yesterday. We did. The list is resending mail. Or maybe the mail was trying to get through? weird It's not quite the same: it's $r->get_server_name or $r->server->server_name in mp2 versus $r->server->server_hostname in mp1. No, it's exactly the same in mp1 and mp2: $r->server->server_hostname Confusing. The docs mention server_name() at http://perl.apache.org/docs/2.0/api/Apache/RequestUtil.html#METHODS fixed. I actually prefer to get rid of the get_ part, but it indicates that you can't change it. -- __ Stas BekmanJAm_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
Re: [mp2] $r->server()->server_hostname compatibility?
On Thu, 20 Feb 2003, Stas Bekman wrote: > Nick Tonkin wrote: > > > > On Thu, 20 Feb 2003, Stas Bekman wrote: > > > > > >>Nick Tonkin wrote: > >> > >>>server_hostname is not documented on the list. Anyone know the equivalent > >>>please? > >> > >>it hasn't changes from 1.0. I thought we have been through this already, just > >>yesterday. > > > > > > We did. The list is resending mail. Or maybe the mail was trying to get > > through? > > weird > > > It's not quite the same: it's $r->get_server_name or > > $r->server->server_name in mp2 versus $r->server->server_hostname in mp1. > > No, it's exactly the same in mp1 and mp2: $r->server->server_hostname Confusing. The docs mention server_name() at http://perl.apache.org/docs/2.0/api/Apache/RequestUtil.html#METHODS > > there is no such a thing as $r->server->server_name > plus there is $r->get_server_name in 2.0 That's what I'm using for convenience anyway. - nick -- Nick Tonkin {|8^)>
Re: [mp2] warnings
Nick Tonkin wrote: On Thu, 20 Feb 2003, Stas Bekman wrote: Nick Tonkin wrote: Is it possible to combine the recommended syntax: use warnings FATAL => 'all', NONFATAL => 'redefine'; with the ability to turn warnings on in httpd.conf with PerlSwitches -w? -w is the same as: use warnings 'all'; then you can override things in your code using the warnings pragma. Though I should add a note that NONFATAL was introduced only in 5.8, so you probably don't want to use it. I think that is already clear in the docs at http://perl.apache.org/docs/2.0/user/coding/coding.html#Auto_Reloading_Modified_Modules_with_Apache__Reload I've added a warning, just in case. and removed the use of NONFATAL in examples, so people won't copy-n-paste it. I just wanted to know if it was possible to get the same effect somehow using PerlSwitches in httpd.conf -- I guess not. If I put the 'use warnings;' pragma in startup.pl it will be server-wide, though, won't it? no. all pragmas have work without a scope they are defined in. That's why you should use '-w' in httpd.conf __ Stas BekmanJAm_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
Re: [mp2] $r->server()->server_hostname compatibility?
Nick Tonkin wrote: On Thu, 20 Feb 2003, Stas Bekman wrote: Nick Tonkin wrote: server_hostname is not documented on the list. Anyone know the equivalent please? it hasn't changes from 1.0. I thought we have been through this already, just yesterday. We did. The list is resending mail. Or maybe the mail was trying to get through? weird It's not quite the same: it's $r->get_server_name or $r->server->server_name in mp2 versus $r->server->server_hostname in mp1. No, it's exactly the same in mp1 and mp2: $r->server->server_hostname there is no such a thing as $r->server->server_name plus there is $r->get_server_name in 2.0 __ Stas BekmanJAm_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
Re: [mp2] handler running twice for one request
On Thu, 20 Feb 2003, Stas Bekman wrote: > Nick Tonkin wrote: > > Hi all, > > > > I my httpd.conf I have: > > > > > > AddType text/html .html > > PerlAccessHandler WM::Auth::Access > > > > > > And in my handler I have: > > > > package WM::Auth::Access; > > > > use strict; > > use warnings; > > > > use Time::HiRes qw(gettimeofday); > > > > sub handler { > > my $r = shift; > > my $s = $r->server; > > > > $s->warn( "[$$] beginning at " . gettimeofday . " with [" . $r->uri . "]" ); > > > > if (! $r->is_initial_req) { > > $s->warn( "[$$] \$r->is_initial_req false; declining at " . gettimeofday ); > > return Apache::DECLINED; > > } elsif ($r->lookup_uri($r->uri)->content_type =~ /image/) { > > $s->warn( "[$$] image requested; declining at " . gettimeofday ); > > return Apache::DECLINED; > > } > > [ ... ] > > > > When I request /img/logo.gif, I get: > > > > [warn] [1168] beginning at 1045540634.07781 with [/img/logo.gif] > > [warn] [1168] beginning at 1045540634.07883 with [/img/logo.gif] > > [warn] [1168] $r->is_initial_req false; declining at 1045540634.07908 > > [warn] [1168] image requested; declining at 1045540634.07941 > > > > > > So, my quesstions are: > > > > 1) Why two times through the handler? > > 2) Why does the second time through start before the first one apparently > > gets to the conditional? > > 3) Why is a simple request like that not the is_initial_req > > 4) If the first time through it reurns DECLINED because it's "not an > > initial req", how come it goes through again? > > 5) What the heck is going on here? > > do you have mod_dir configured? but then you aren't requisting / I do. But you're right, I'm not. > > Run with the tracing enabled and you will be able to debug it easily: > http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_ Heh. I am going to make a new debugging installation to keep around permanently!!! - nick -- Nick Tonkin {|8^)>
Re: [mp2] warnings
On Thu, 20 Feb 2003, Stas Bekman wrote: > Nick Tonkin wrote: > > Is it possible to combine the recommended syntax: > > > > use warnings FATAL => 'all', NONFATAL => 'redefine'; > > > > with the ability to turn warnings on in httpd.conf with PerlSwitches -w? > > -w is the same as: > >use warnings 'all'; > > then you can override things in your code using the warnings pragma. > > Though I should add a note that NONFATAL was introduced only in 5.8, so you > probably don't want to use it. I think that is already clear in the docs at http://perl.apache.org/docs/2.0/user/coding/coding.html#Auto_Reloading_Modified_Modules_with_Apache__Reload I just wanted to know if it was possible to get the same effect somehow using PerlSwitches in httpd.conf -- I guess not. If I put the 'use warnings;' pragma in startup.pl it will be server-wide, though, won't it? - nick -- Nick Tonkin {|8^)>
Re: [mp2] $r->server()->server_hostname compatibility?
On Thu, 20 Feb 2003, Stas Bekman wrote: > Nick Tonkin wrote: > > server_hostname is not documented on the list. Anyone know the equivalent > > please? > > it hasn't changes from 1.0. I thought we have been through this already, just > yesterday. We did. The list is resending mail. Or maybe the mail was trying to get through? It's not quite the same: it's $r->get_server_name or $r->server->server_name in mp2 versus $r->server->server_hostname in mp1. - nick -- Nick Tonkin {|8^)>
Re: [mp2] handler running twice for one request
Nick Tonkin wrote: Hi all, I my httpd.conf I have: AddType text/html .html PerlAccessHandler WM::Auth::Access And in my handler I have: package WM::Auth::Access; use strict; use warnings; use Time::HiRes qw(gettimeofday); sub handler { my $r = shift; my $s = $r->server; $s->warn( "[$$] beginning at " . gettimeofday . " with [" . $r->uri . "]" ); if (! $r->is_initial_req) { $s->warn( "[$$] \$r->is_initial_req false; declining at " . gettimeofday ); return Apache::DECLINED; } elsif ($r->lookup_uri($r->uri)->content_type =~ /image/) { $s->warn( "[$$] image requested; declining at " . gettimeofday ); return Apache::DECLINED; } [ ... ] When I request /img/logo.gif, I get: [warn] [1168] beginning at 1045540634.07781 with [/img/logo.gif] [warn] [1168] beginning at 1045540634.07883 with [/img/logo.gif] [warn] [1168] $r->is_initial_req false; declining at 1045540634.07908 [warn] [1168] image requested; declining at 1045540634.07941 So, my quesstions are: 1) Why two times through the handler? 2) Why does the second time through start before the first one apparently gets to the conditional? 3) Why is a simple request like that not the is_initial_req 4) If the first time through it reurns DECLINED because it's "not an initial req", how come it goes through again? 5) What the heck is going on here? do you have mod_dir configured? but then you aren't requisting / Run with the tracing enabled and you will be able to debug it easily: http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_ __ Stas BekmanJAm_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
Re: [mp2] warnings
Nick Tonkin wrote: Is it possible to combine the recommended syntax: use warnings FATAL => 'all', NONFATAL => 'redefine'; with the ability to turn warnings on in httpd.conf with PerlSwitches -w? -w is the same as: use warnings 'all'; then you can override things in your code using the warnings pragma. Though I should add a note that NONFATAL was introduced only in 5.8, so you probably don't want to use it. Instead use: use warnings FATAL => 'all'; no warnings 'redefine'; __ Stas BekmanJAm_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
Re: [mp2] $r->server()->server_hostname compatibility?
Nick Tonkin wrote: server_hostname is not documented on the list. Anyone know the equivalent please? it hasn't changes from 1.0. I thought we have been through this already, just yesterday. __ Stas BekmanJAm_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
Re: [mp2] $mod_perl::VERSION not defined
User NICKNick Tonkin wrote: Following the docs at http://perl.apache.org/docs/2.0/devel/porting/porting.html#Adjusting_Modules_to_Work_with_1_0_and_2_0_ I am trying to test $mod_perl::VERSION but it is undef. Any clues? use mod_perl; ? __ Stas BekmanJAm_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
Re: Building mod-perl 2 for cygwin
On Thu, 20 Feb 2003, Stas Bekman wrote: > Steve Baldwin wrote: > > Unfortunately, I get the same (as far as I can see) result. Here's my > > latest perl -V ... > > You mean, you get a bunch of unresolved symbols, right? > > from your previous report: > > Now, make (of mod-perl) gives the following errors ... > modperl_env.lo(.text+0x89e):modperl_env.c: variable '_PL_vtbl_env' can't > be auto-imported. Please read the documentation for ld's > --enable-auto-import for details. > : > Creating library file: libmod_perl.dll.a > mod_perl.lo(.text+0x2f9):mod_perl.c: undefined reference to > `_apr_pool_cleanup_null' > mod_perl.lo(.text+0x2fe):mod_perl.c: undefined reference to > `_apr_pool_cleanup_register' > mod_perl.lo(.text+0x4e9):mod_perl.c: undefined reference to > `_ap_log_error' > mod_perl.lo(.text+0x52b):mod_perl.c: undefined reference to > `_ap_mpm_query' > > > What looks weird is: > Creating library file: libmod_perl.dll.a > > I'm not a win32 user, but it looks strange to me that dll.a > thing. Is that a valid thing? I understand that cygwin is unix > over win32. Though it still builds native win32 dlls, no? So > may be the problem is that the mod_perl build > decides to go with unix build when it should really do the win32 build? > > Any developers on cygwin that can help us here? Hopefully Per > Einar is around and can help. I have cygwin (for the tools), but haven't looked into compiling Apache/mod_perl with it. From what I understand, cygwin provides a C library (a dll) to get a unix-style API; this is to be contrasted with MinGW, which produces programs that don't rely on 3rd party dlls. cygwin, as well as having the usual .a (static) and .dll libs, does have a .dll.a type of lib, which is an import library. So having such a lib isn't unusual - whether that should be done here is another question ... -- best regards, randy kobes
[mp2] handler running twice for one request
Hi all, I my httpd.conf I have: AddType text/html .html PerlAccessHandler WM::Auth::Access And in my handler I have: package WM::Auth::Access; use strict; use warnings; use Time::HiRes qw(gettimeofday); sub handler { my $r = shift; my $s = $r->server; $s->warn( "[$$] beginning at " . gettimeofday . " with [" . $r->uri . "]" ); if (! $r->is_initial_req) { $s->warn( "[$$] \$r->is_initial_req false; declining at " . gettimeofday ); return Apache::DECLINED; } elsif ($r->lookup_uri($r->uri)->content_type =~ /image/) { $s->warn( "[$$] image requested; declining at " . gettimeofday ); return Apache::DECLINED; } [ ... ] When I request /img/logo.gif, I get: [warn] [1168] beginning at 1045540634.07781 with [/img/logo.gif] [warn] [1168] beginning at 1045540634.07883 with [/img/logo.gif] [warn] [1168] $r->is_initial_req false; declining at 1045540634.07908 [warn] [1168] image requested; declining at 1045540634.07941 So, my quesstions are: 1) Why two times through the handler? 2) Why does the second time through start before the first one apparently gets to the conditional? 3) Why is a simple request like that not the is_initial_req 4) If the first time through it reurns DECLINED because it's "not an initial req", how come it goes through again? 5) What the heck is going on here? Thanks, - nick Nick Tonkin {|8^)>
[mp2] warnings
Is it possible to combine the recommended syntax: use warnings FATAL => 'all', NONFATAL => 'redefine'; with the ability to turn warnings on in httpd.conf with PerlSwitches -w? - nick Nick Tonkin {|8^)>
[mp2] $r->server()->server_hostname compatibility?
server_hostname is not documented on the list. Anyone know the equivalent please? - nick
[mp2] $mod_perl::VERSION not defined
Following the docs at http://perl.apache.org/docs/2.0/devel/porting/porting.html#Adjusting_Modules_to_Work_with_1_0_and_2_0_ I am trying to test $mod_perl::VERSION but it is undef. Any clues? Thanks, - nick
Re: [mp2] send_http_header() can't be called before the responsephase
On Thu, 20 Feb 2003, Stas Bekman wrote: > Stas Bekman wrote: > > Nick Tonkin wrote: > [...] > >> send_http_header() can't be called before the response phase > > Nick, I've just committed a better solution. Please verify that it works for you. I'll have a go as soon as poss. - nick -- Nick Tonkin {|8^)>
Re: mod_perl 2 apache::session and "or die"
Perrin Harkins wrote: Chris Faust wrote: All works well except when there is any kind of problem in the script where the condition will die.. [...] When this happens everything to do with that script is unresponsive - I know that is a little vague but that is the best way I can describe it. What happens is the error comes up (standard server error) and that is the last thing that is logged, if you try to go back and refresh the hourglass will go for hours and nothing happens and nothing is ever logged It sounds like a locking problem to me. I'm guessing that mod_perl 2 is not calling the right hooks when it traps a die() to trigger the DESTROY method in Apache::Session which releases all locks. You can find out exactly what's going on if you run it in the debugger (Apache::DB) or throw some debug logging into Apache::Session to find out where it gets stuck. This is the beauty of having the source code. I've noticed that there are several issues with END blocks with the current cvs, when the used perl is threaded. Could be that DESTROY misbehaves too. I've planned to investigate these issues, but didn't have a chance to yet. Hopefully someone will beat me to it. __ Stas BekmanJAm_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
Re: [OT?] Win32 permissions puzzler
Alessandro Forghieri wrote: Alessandro Forghieri wrote: [...] use Bar qw($foo); if($foo) { ... Global symbol "$foo" requires explicit package name at use vars qw($foo); use Bar qw($foo); [...] Not sure I am following you here. $foo is in the @EXPORT_OK list of module Bar, which is, in turn,an Exporter. It is my understanding that this should work (as it does after the impersonated user has been given Admin powers). You have to declare variables as globals before using them. Even the imported ones. That's a pure perl issue. Please proceed to the perl lists/groups/monks for further discussion. __ Stas BekmanJAm_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
Re: [mp2] send_http_header() can't be called before the responsephase
Stas Bekman wrote: Nick Tonkin wrote: [...] send_http_header() can't be called before the response phase Nick, I've just committed a better solution. Please verify that it works for you. __ Stas BekmanJAm_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
Re: help with Apache::DB
Perrin Harkins wrote: On Tue, 2003-02-18 at 08:07, giorgos zervas wrote: i am using Apache::DB to debug my mod_perl handlers and altough the debugger seems to be working fine it won't display the source code next to the current line being debugged. That's because you are compiling that code before you activate the debugger, so it doesn't get to put in the debugging symbols. Look at the "init" method in the Apache::DB documentation. Thanks Perrin, now I recall that ;) and it's even documented: http://perl.apache.org/docs/1.0/guide/debug.html#Interactive_mod_perl_Debugging __ Stas BekmanJAm_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
Re: Building mod-perl 2 for cygwin
Steve Baldwin wrote: Unfortunately, I get the same (as far as I can see) result. Here's my latest perl -V ... You mean, you get a bunch of unresolved symbols, right? from your previous report: Now, make (of mod-perl) gives the following errors ... modperl_env.lo(.text+0x89e):modperl_env.c: variable '_PL_vtbl_env' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details. : Creating library file: libmod_perl.dll.a mod_perl.lo(.text+0x2f9):mod_perl.c: undefined reference to `_apr_pool_cleanup_null' mod_perl.lo(.text+0x2fe):mod_perl.c: undefined reference to `_apr_pool_cleanup_register' mod_perl.lo(.text+0x4e9):mod_perl.c: undefined reference to `_ap_log_error' mod_perl.lo(.text+0x52b):mod_perl.c: undefined reference to `_ap_mpm_query' What looks weird is: Creating library file: libmod_perl.dll.a I'm not a win32 user, but it looks strange to me that dll.a thing. Is that a valid thing? I understand that cygwin is unix over win32. Though it still builds native win32 dlls, no? So may be the problem is that the mod_perl build decides to go with unix build when it should really do the win32 build? Any developers on cygwin that can help us here? Hopefully Per Einar is around and can help. __ Stas BekmanJAm_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
Re: Building mod-perl 2 for cygwin: taint cleanup
[splitting the thread in two] Stas Bekman wrote: Steve Baldwin wrote: I've got Apache2 installed and as far as I can tell, it is functional. I'm trying to build mod-perl from source (as I couldn't find any binaries for cygwin). When I initially ran the command : perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 I got errors telling me it couldn't find "cygdb-3.1.dll", which I eventually tracked down to Apache::TextConfig::open_cmd. I commented out the line : local @ENV{ qw(PATH IFS CDPATH ENV BASH_ENV) }; and the errors went away (it was clearing $ENV{PATH} which I think was causing the error). We need to explicitly set $ENV{PATH} to be able to start a process under -T (see perlsec). We could hardcode the path of the value, but that would be different for each platform. What the normal value of PATH on your system? Is this something standard that other cygwin users can rely on? this issue needs to be resolved as well. can you follow up on this? __ Stas BekmanJAm_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
[mp2] Cookie behavior discrepancy in Auth* handlers ?
Hi all, Cookies driving me nuts as usual but I think the problem appears to be related to which handler phase we are in. Basically, the same call to read the cookies works in the PerlHandler but not in the PerlAccessHandler. in Access.pm I have : use CGI; use CGI::Cookie; sub handler { my $r = shift; warn $r->as_string; my $cookies = fetch CGI::Cookie; warn "Access Dumping Cookies:\n" . Dumper($cookies); return Apache::DECLINED if $r->uri =~ m|/authenticate| Access.pm is called thus: AddType text/html .html AddHandler server-parsed .html Options +Includes PerlSetVar WM_Auth_Domain wm.tonkinresolutions.com PerlAccessHandler WM::Auth::Access in Auth.pm I have : use CGI; use CGI::Cookie; sub handler { my $r = shift; warn $r->as_string; my $cookies = fetch CGI::Cookie; warn "Auth Dumping Cookies:\n" . Dumper($cookies); Auth.pm is called thus: ErrorDocument 403 /authenticate sethandler perl-script PerlHandler WM::Auth::Auth I request /authenticate when I already have an 'auth' cookie on the browser, and I get this: Access Dumping Headers: GET /authenticate?foo HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Host: wm.tonkinresolutions.com Connection: Keep-Alive Cookie: foo=bar; remembered_uri=https%3A%2F%2Fwm.tonkinresolutions.com%2Findex.html; auth=hash&6032ccbfd909f951dcfbd804441163bc&group_name&root&session&580a5fc6a0215f2eaecde2e6d5554b07&user&nick&_time&1045689878&expires&60 INCLUDED (null) Access Dumping Cookies: $VAR1 = undef; Auth Dumping Headers: GET /authenticate?foo HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Host: wm.tonkinresolutions.com Connection: Keep-Alive Cookie: foo=bar; remembered_uri=https%3A%2F%2Fwm.tonkinresolutions.com%2Findex.html; auth=hash&6032ccbfd909f951dcfbd804441163bc&group_name&root&session&580a5fc6a0215f2eaecde2e6d5554b07&user&nick&_time&1045689878&expires&60 HTTP/1.1 (null) Auth Dumping Cookies: $VAR1 = { 'auth' => bless( { 'value' => [ 'hash', '6032ccbfd909f951dcfbd804441163bc', 'group_name', 'root', 'session', '580a5fc6a0215f2eaecde2e6d5554b07', 'user', 'nick', '_time', '1045689878', 'expires', '60' ], 'name' => 'auth', 'path' => '/' }, 'CGI::Cookie' ), 'foo' => bless( { 'value' => [ 'bar' ], 'name' => 'foo', 'path' => '/' }, 'CGI::Cookie' ), 'remembered_uri' => bless( { 'value' => [ 'https://wm.tonkinresolutions.com/index.html' ], 'name' => 'remembered_uri', 'path' => '/' }, 'CGI::Cookie' ) }; Can anyone offer a clue? Thanks, - nick -- Nick Tonkin {|8^)>
Re: convert file
Hi, This is an FAQ in the perl beginners mailing list, [EMAIL PROTECTED] Look up Win32::OLE module from CPAN. Alfred, koudjo ametepe wrote: > hi everybbody > I have a problem about coinverting files. > I wanna convert a file in MSword (binary format) to text file > so that i can view it with a browser such iexplore netscape. > i found something called "antiword" but i really don't know how to use this > for solving my problem > Thank you for ideas !! > koudjo > > _ > MSN Messenger : discutez en direct avec vos amis ! > http://www.msn.fr/msger/default.asp begin:vcard n:Vahau;Alfred K. tel;work:675 3267 277 x-mozilla-html:FALSE org:University Of Papua New Guinea;Information Resources Centre version:2.1 email;internet:[EMAIL PROTECTED] title:Director, Information Technology Services adr;quoted-printable:;;PO Box 320=0D=0AUniversity PO=0D=0ANCD 134=0D=0APapua New Guinea fn:Alfred K. Vahau end:vcard
Web Application Developer needed, Denver CO USA
Summit Communication Design has an immediate opening for a Web Application Developer in our South Denver office. This is a full-time, on-site position (no telecommuting). We do not offer relocation. Job focus is e-commerce applications written with Perl, Apache and MySQL. Proficiency with Perl is a must, preferably including mod_perl and object-oriented techniques. We also use Template Toolkit and other Open Source tools, running on FreeBSD and Linux. We offer a relaxed and enjoyable work environment with full benefits. To apply, please send resume (with work examples/links that demonstrate your proficiencies) to: [EMAIL PROTECTED] Please, no phone calls and no agents.
Apologize
Hi there, You may have received a message untitled "A call against war". I apologize to everyone who feels personally criticized by its content. This was of course not intended. In this time of political agitation, I felt that this message expressed an interesting point of view, so I took upon myself to (blindly and automagically) forward it to my whole address-book, including technical mailing lists. Please forgive my boldness. Anyone is welcome to express any comment back. But I would suggest than one remain reasonably polite when doing so. Democratic ideas should be able to be discussed, argued upon, and of course opposed diplomatically. Regards, Dr. Franck Porcher, Ph.D
Re: mod_perl 2.0 question about $r->connection->auth_type
I've just about got the Apache::AuthCookieDBI to work with Apache 2.0.44 & mod_perl 1.99_09-dev, but I ran into a problem with the $r->connection object not having "auth_type" or "user" defined. The $r->auth_type work just fine. Are these the same reference? What should I look for, or use? [snip] Geoff is working on the proper fix for your original problem. When that's done please check that test again. (see the dev list for developments) the fix has been committed, so you should be good to go based on the discussions we had over on dev@. remember, we added a new method, so you'll have to build mod_perl from CVS and make realclean before building if you want to pick up the new method. lemme know how it goes. --Geoff
Re: mod_perl 2 apache::session and "or die"
Chris Faust wrote: All works well except when there is any kind of problem in the script where the condition will die.. [...] When this happens everything to do with that script is unresponsive - I know that is a little vague but that is the best way I can describe it. What happens is the error comes up (standard server error) and that is the last thing that is logged, if you try to go back and refresh the hourglass will go for hours and nothing happens and nothing is ever logged It sounds like a locking problem to me. I'm guessing that mod_perl 2 is not calling the right hooks when it traps a die() to trigger the DESTROY method in Apache::Session which releases all locks. You can find out exactly what's going on if you run it in the debugger (Apache::DB) or throw some debug logging into Apache::Session to find out where it gets stuck. This is the beauty of having the source code. - Perrin
Urgent: DBI::Auth configuration problem
This is the last piece in my implementation. If anyone can help with how to debug this or what is wrong with my configuration, I'd really appreciate it! I'm trying DBI::Auth against a Postgresql database for authentication. It's not working. My postgres debug log shows no activity as well as this error regarding my configuration. I don't know how to debug this. Anyone able to help? Error Log from Apache shows: [Tue Feb 18 16:13:53 2003] [notice] Apache/1.3.27 (Unix) Embperl/2.0b8 mod_perl/1.27 configured -- resuming normal operations [Tue Feb 18 16:13:53 2003] [notice] Accept mutex: sysvsem (Default: sysvsem) [Tue Feb 18 16:14:03 2003] [error] [client 192.168.0.121] client denied by server configuration: /www/htdocs/tester/index.html Steps I went through to install the web server (RedHat 7.3 install from source): installed Apache::AuthDBI off CPAN. Recompiled mod_perl and apache: perl Makefile.PL DO_HTTPD=1 USE_APACI=1 APACHE_PREFIX=/www PERL_AUTHEN=1 PERL_AUTHZ=1 PERL_CLEANUP=1 PERL_STACKED_HANDLERS=1 make/make install worked great. Web server works. I can access Posgresql just fine using Perl DBI. The .htaccess file in /www/htdocs/tester: AuthType Basic AuthName DBI require user scott Here's the relevant entries in my httpd.conf file: Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Deny from all PerlModule Embperl PerlSetEnv EMBPERL_SESSION_HANDLER_CLASS no PerlSetEnv EMBPERL_DEBUG 10477 PerlSetEnv EMBPERL_DEBUG 0x7fff PerlSetEnv EMBPERL_VIRTLOG /embperl/log PerlSetEnv EMBPERL_OPTIONS 8208 # optRawInput = 16 # optAllFormData = 8192 PerlModule Embperl::Object PerlModule Apache::DBI # PerlModule MD5 SetHandler perl-script PerlHandler HTML::Embperl Options ExecCGI PerlSetEnv EMBPERL_APPNAME my_embperl_app PerlSetEnv EMBPERL_OBJECT_BASE base.epl PerlSetEnv EMBPERL_ESCMODE 0 # PerlSetEnv EMBPERL_FILESMATCH "\.htm.?|\.epl$" PerlSetEnv EMBPERL_FILESMATCH "\.epl$" SetHandler perl-script PerlHandler Embperl::Object # PerlHandler HTML::Embperl Options ExecCGI AddType text/html .epl AllowOverride AuthConfig Options ExecCGI PerlModule Apache::AuthDBI PerlAuthzHandler Apache::AuthDBI::authz PerlAuthenHandler Apache::AuthDBI::authen PerlSetVar Auth_DBI_data_source dbi:Pg:dbname=webautomation PerlSetVar Auth_DBI_username webuser PerlSetVar Auth_DBI_password password PerlSetVar Auth_DBI_pwd_table users PerlSetVar Auth_DBI_uid_field username PerlSetVar Auth_DBI_pwd_field password PerlSetVar Auth_DBI_grp_table groups PerlSetVar Auth_DBI_grp_field groupname PerlSetVar Auth_DBI_encrypted off Thanks! Scott
mod_perl 2 apache::session and "or die"
I'm having a problem since installing Apache::Session All works well except when there is any kind of problem in the script where the condition will die.. For example: $db->execute() or die... open yadda or die.. $db->prepare() or die... etc. When this happens everything to do with that script is unresponsive - I know that is a little vague but that is the best way I can describe it. What happens is the error comes up (standard server error) and that is the last thing that is logged, if you try to go back and refresh the hourglass will go for hours and nothing happens and nothing is ever logged - if you close all windows and try again then the same thing just happens, it goes forever and nothing happens or is logged. It doesn't seem to matter where the die is, if I'm using another module (for example) HTML::Template and it dies on bad params because I didn't define something some temple var then that is it.. I can't get to that script again until I reload Apache. This only happens when I'm using Apache::Session::MySQL and I'm not doing anything strange with it, I grab the cookie if its there and authenticate them. There is nothing I'm doing in the session that relates to the errors so I don't understand why everything just dies as it does. This happens on my RH7.3/1.3 install and on my RH8/2.0 install. One other thing I should mention, when this happens it only kills the script in that specific location that is defined in the httpd.conf, in otherword something running in /cgi-bin1/ has died and crashed, I can't get to it or do anything with it - during this time everything running in /cgi-bin2/ is running along just fine without a issue (although what is in /cgi-bin2/ isn't using Apache::Session but it is using the same mySql DB). Any ideas? Thanks -Chris
Re: help with Apache::DB
On Tue, 2003-02-18 at 08:07, giorgos zervas wrote: > i am using Apache::DB to debug my mod_perl handlers and altough the > debugger seems to be working fine it won't display the source code next > to the current line being debugged. That's because you are compiling that code before you activate the debugger, so it doesn't get to put in the debugging symbols. Look at the "init" method in the Apache::DB documentation. - Perrin
Re: convert file
On Wed, 19 Feb 2003 12:01:02 + (GMT) Ged Haywood <[EMAIL PROTECTED]> wrote: > Hello again, > > On Wed, 19 Feb 2003, koudjo ametepe wrote: > > > I wanna convert a file in MSword (binary format) to text file > > This kind of post is not welcome on the mod_perl mailing List. > > I have already asked you to read the email-etiquette document. > Please read it before you post any more messages. I'm sure that he will read the document for next time! ;-) But now, in order to solve the problem, he can use the wvWare toolkit (http://www.wvware.com/). Perhaps he would want to write a custom mod_perl trans-handler to transform DOC document to HTML on the fly. It would be interesting... by - Enrico
ANNOUNCE: CGI::Application::Generator 1.0
Version 1.0 of CGI::Application::Generator is now available via CPAN! Download site for CGI::Application::Generator: http://search.cpan.org/search?dist=CGI-Application-Generator CHANGES SINCE VERSION 0.01: - First release version of CGI::Application::Generator, a module intended to allow the creation of CGI::Application modules dynamically. - Implemented an Object-Oriented interface to specify the functionality of your intended CGI::Application, used to build the structure automatically using a (configurable) template file. CGI::Application::Generator provides a means by which a CGI::Application module can be created from code, as opposed to being written by hand. The goal of this module is two-fold: 1. To ease the creation of new CGI::Application modules. 2. To allow standardization of CGI::Application coding styles to be more uniformly applied. It is also the hope of this module that Computer Assisted Software Engineering (CASE) tools will eventually emerge which will allow the development process for web-based applications to be greatly improved. These CASE tools could more easily convert visual notation (such as UML state-transition diagrams) into method calls to this module, thereby creating actual code. What This Module Does Not Do CGI::Application::Generator is intended to create a shell of an application module based on the specification you provide. It will not output a completely functional application without additional coding. It will, however, handle the creation of all the structural parts of your application common to all CGI::Application-based modules. CGI::Application::Generator is not a system for HTML templates. If you're looking for a Perl module which will allow you to separate Perl from HTML then I recommend you download and install HTML::Template. SUPPORT MAILING LIST If you have any questions, comments, bug reports or feature suggestions, post them to the support mailing list! To join the mailing list, simply send a blank message to "[EMAIL PROTECTED]". -- Jesse Erlbaum The Erlbaum Group [EMAIL PROTECTED] Phone: 212-684-6161 Fax: 212-684-6226
Re: help with Apache::DB
hi stas, thanks for you help. i tried debugging one my non modperl scripts from the command line and it seems to be working as expected. the debugger commands 'w' and 'l' display the source code as expected and i also always see the current line being executed by the debugger. so the problem must be Apache::DB specific. still i am clueless as to what it could be... regards, giorgos On Tue, 2003-02-18 at 23:14, Stas Bekman wrote: > giorgos zervas wrote: > > hi all, > > > > i am using Apache::DB to debug my mod_perl handlers and altough the > > debugger seems to be working fine it won't display the source code next > > to the current line being debugged. for example: > > > > DB<10> r > > scalar context return from CODE(0x8d7101c): -> undef > > Apache::DB::CODE(0x8d7101c)(/usr/local/lib/perl/5.6.1/Apache/DB.pm:35): > > 35: > > > > next to the line starting with "35:" the 35th line of source code should > > be displayed. however this doesn't happen either with my modules or the > > ones from CPAN. > > > > i even thought it might me a font problem and tried to use different > > terminals and font combinations but none of them worked for me. > > > > has anyone else encountered a similar problem? > > I haven't seen such a thing, but do you see a similar problem if you debug > from the command line (certainly something similar but that doesn't require > mod_perl). > http://perl.apache.org/docs/1.0/guide/debug.html#Introduction_to_the_Perl_Debugger > > __ > Stas BekmanJAm_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 -- giorgos <[EMAIL PROTECTED]>
Re: convert file
Hello again, On Wed, 19 Feb 2003, koudjo ametepe wrote: > I wanna convert a file in MSword (binary format) to text file This kind of post is not welcome on the mod_perl mailing List. I have already asked you to read the email-etiquette document. Please read it before you post any more messages. 73, Ged. -- >From [EMAIL PROTECTED] Wed Feb 19 11:57:34 2003 Date: Mon, 27 Jan 2003 13:46:12 + (GMT) From: Ged Haywood <[EMAIL PROTECTED]> To: koudjo ametepe <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: Re: sftp Hello there, On Mon, 27 Jan 2003, koudjo ametepe wrote: > Do someone know how to connect to a distant host with perl (via sftp Please read http://perl.apache.org/maillist/email-etiquette.html 73, Ged.
convert file
hi everybbody I have a problem about coinverting files. I wanna convert a file in MSword (binary format) to text file so that i can view it with a browser such iexplore netscape. i found something called "antiword" but i really don't know how to use this for solving my problem Thank you for ideas !! koudjo _ MSN Messenger : discutez en direct avec vos amis ! http://www.msn.fr/msger/default.asp
Re: [OT?] Win32 permissions puzzler
Greetings. >Alessandro Forghieri wrote: >[...] > >>use Bar qw($foo); >> >>if($foo) { >>... >>Global symbol "$foo" requires explicit package name at > >use vars qw($foo); >use Bar qw($foo); [...] Not sure I am following you here. $foo is in the @EXPORT_OK list of module Bar, which is, in turn,an Exporter. It is my understanding that this should work (as it does after the impersonated user has been given Admin powers). Cheers, alf -- __ Stas BekmanJAm_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
RE: Building mod-perl 2 for cygwin
Unfortunately, I get the same (as far as I can see) result. Here's my latest perl -V ... [perl-5.8.0]$ perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=cygwin, osvers=1.3.19(0.7132), archname=cygwin-thread-multi-64int uname='cygwin_nt-5.1 au-stb-mobile 1.3.19(0.7132) 2003-01-23 21:31 i686 unkn own unknown cygwin ' config_args='-Duse64bitint -Doptimize=-O2 -Dman3ext=3pm -Dusemultiplicity -D usethreads -Duselargefiles' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=de fine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=undef uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing', optimize='-O2', cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing' ccversion='', gccversion='3.2 20020927 (prerelease)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lsee ksize=4 alignbytes=8, prototype=define Linker and Libraries: ld='ld2', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /usr/lib /lib libs=-lgdbm -ldb -lcrypt -lutil perllibs=-lcrypt -lutil libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under cygwin Compiled at Feb 19 2003 20:16:49 %ENV: CYGWIN="" @INC: /cygdrive/d/perldev /usr/local/lib/perl5/5.8.0/cygwin-thread-multi-64int /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/cygwin-thread-multi-64int /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl . -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 19 February 2003 10:07 AM To: Steve Baldwin Cc: [EMAIL PROTECTED] Subject: Re: Building mod-perl 2 for cygwin Steve Baldwin wrote: > OK, I've rebuilt my perl using the following options ... > > ./Configure -de -Duse64bitint -Doptimize=-O2 -Dman3ext=3pm > > (to try to keep as similar as possible to packaged perl, but without > the threads stuff). I also tried with simply > > ./Configure -des > > With exactly the same result. and if you build with -Dusethreads?