FW: Changes to BOF schedule..!
FYI... -Original Message- From: Rodent of Unusual Size [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 6:59 PM To: BOF submitters Subject: Re: Changes to BOF schedule..! Rodent of Unusual Size wrote: Due to a bit of confusion, the BOF schedule next week requires some serious revamping. The space we were going to use on Wednesday will not be available until Thursday, and some of the BOFs on Thursday and Friday need to be moved around to avoid space collisions as well. {sigh} More confusion, fortunately undoing some of the earlier concerns. We *do* have a BOF room for Wednesday, and we *do* have at least one BOF room (and sometimes two) on Thursday and Friday. More info as it comes available.. -- #kenP-)} Ken Coarhttp://Golux.Com/coar/ Apache Software Foundation http://www.apache.org/ "Apache Server for Dummies" http://Apache-Server.Com/ "Apache Server Unleashed" http://ApacheUnleashed.Com/ ApacheCon 2001! Four tracks with over 70+ sessions. Free admission to exhibits and special events - keynote presentations by John 'maddog' Hall and David Brin. Special thanks to our Platinum Sponsors IBM and Covalent, Gold Sponsor Thawte, and Silver Sponsor Compaq. Attend the only Apache event designed and fully supported by the members of the ASF. See more information and register at http://ApacheCon.Com/! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Long waits on SQL Stored Procs. Should I use chained contenthandlers?
At 2:06 PM + 4/2/01, [EMAIL PROTECTED] wrote: I need to run some stored procedures that take upwards of a minute to generate result sets. Ok, thats grand but I dont want the browser to sit there and twiddle. I'd like to display an animated gif. Simple. Right? I hope. I'm looking into chained handlers in my mod_perl code, but I'm not sure if this is what I need. 0) Request page and report. 1) Push 'Waiting...' animated gif 2) Process report, Perl waits for result set 3) Perl pushes the report html to the browser as if it opened in a target = _blank window. IE: That same window... Stumped (or rather - RTFMing), Any ideas? I cant, for the life of me, figure out how this would work with http redirects, and thought there might be something with mod_perl that would help this. Fork() maybe. I'm trying a few ideas. It's probably out of date, but the CGI::Push module does exactly what you want. The doc isn't real clear, but I've used this once to do exactly what you're doing. Unfortunatly, I can no longer find the code I wrote... Basically, CGI::Push sends a multipart mime message to the browser. The first part of that is an HTML document, which the browser renders immediatly. The second part is the confirmation HTML, which the browser also renders in place of the original document. The basic syntax is use CGI::Push qw/:standard/; do_push(-next_page = \header); sleep 30; do_push(-next_page = \body); do_page(-next_page = sub { return undef; }); header and body both return a FULL html document, including the headers. Returning undef terminates the connection with the browser. Good luck, Rob -- As soon as you make something foolproof, someone will create a better fool.
Re: Long waits on SQL Stored Procs. Should I use chained contenthandlers?
Robert Landrum wrote: At 2:06 PM + 4/2/01, [EMAIL PROTECTED] wrote: Any ideas? I cant, for the life of me, figure out how this would work with http redirects, and thought there might be something with mod_perl that would help this. Fork() maybe. I'm trying a few ideas. It's probably out of date, but the CGI::Push module does exactly what you want. The doc isn't real clear, but I've used this once to do exactly what you're doing. Unfortunatly, I can no longer find the code I wrote... Basically, CGI::Push sends a multipart mime message to the browser. The first part of that is an HTML document, which the browser renders immediatly. The second part is the confirmation HTML, which the browser also renders in place of the original document. Does this work with non-Netscape browsers, such as IE? I was going to suggest this multipart MIME trick, but I thought I read in the CGI.pm book that server push only worked with Netscape browsers. -- Regards, Wim Kerkhoff
RE: internal_redirect
I'm trying to handle an exception using an internal_redirect. I can get it to work by redirecting to a static page, but when I try to redirect to a modperl handler, I'm run into problems. Here are the two versions of code (BTW, the handler works fine when I access it directly via the browser). ## ver. 1 print STDERR "$@"; require Apache; my $r = Apache-request; $r-internal_redirect("/DBConnectError.cgi"); ## ver. 2 print STDERR "$@"; require Apache; my $r = Apache-request; $r-internal_redirect("/errordocs/503.html"); When I run the modperl handler, the browser prompts me and asks if I want to save the output of the cgi script that raised the error, but it never displays the content from the handler. The static file version works great and the browser displays it's content. Hmm... First of all, the Guide (and experience :-) sez that IMMEDIATELY after running $r-internal_redirect(blah); one should return OK; Secondly, I would suggest doing it differently: tell the request object that the handler returned code 503, and in httpd.conf: ErrorDocument 503 /DBConnectError.cgi I just wrote this handler in 2 minutes, that demonstrates: = package Stat::Testfail; use strict; sub handler { my $r = shift; $r-status(503); return 503; } 1; = with the following httpd.conf entry: Location /testonly SetHandler perl-script PerlHandler +Stat::Testfail /Location and it works like I've described: # telnet localhost 80 GET /testonly HTTP/1.0 HTTP/1.1 503 Service Temporarily Unavailable Date: Tue, 03 Apr 2001 18:01:28 GMT Server: Apache/1.3.9 (Unix) (Red Hat/Linux) mod_perl/1.25 Connection: close Content-Type: text/html HTML HEADTITLEAn Error Occurred/TITLE/HEAD BODY H1An Error Occurred/h1 503 Service Temporarily Unavailable /BODY /HTML (Naturally this would have been different if i'd set an ErrorDocument 503). HTH! L8r, Rob
Apache::Filter doesn't filter right
I'm having a problem with Apache::Filter (and Apache::OutputChain) which I don't think is related to Apache::Filter itself, but I can't seem to track the problem down. I wrote a content handler which outputs XML, which I want to then be processed by AxKit. So, I did: SetHandler perl-script PerlSetVar Filter On PerlHandler HTTPFilter AxKit The output that I get is the combination of HTTPFilter's output, and AxKit's output (one right before the other). So, it seems that HTTPFilter's output is successfully making it into AxKit (otherwise it wouldn't process its output correctly), but is still making its way to the browser. Any ideas? --man Michael A. Nachbaur "Lead me not into temptation... I can find it myself."
Re: internal_redirect
Rob, thanks for pointing me in the right direction. Your advise helped me find a solution that works for my situation. I'm working on an API that sits between an Oracle DB and bunch of web application programmers. Unfortunately, the programmers run their apps under a variety of perl-handlers (Apache::Registry, Apache::RegistryNG, Apache::RegistryFilter, etc). None of the programmers follow any sort of standard method for handling exceptions, so I can't assume that 'return OK;' will ever be called (in fact I'm pretty sure, it will never be called). What I've been trying to do is kind of 'take over' the request, whenever a programmer fails to connect to the DB and redirect the browser to a handler that can put up a custom 503 page for each application. I finally settled on putting the following in conf file for the web sites: ErrorDocument 503 "HTMLHEADMETA http-equiv="refresh" content="0;URL=/DBConnectError.cgi"/HEAD/HTML Files DBConnectError.cgi SetHandler perl-script PerlHandler Tec::Api::DBConnectError /Files It seems to work for just about every perl handler the programmers are using, as long as they doesn't use Carp::fatalsToBrowser, which raises a whole new set of problems. If you see any issues with my solution, please chime in. Thanks again for you help. -Jim Rob Bloodgood muttered: I'm trying to handle an exception using an internal_redirect. I can get it to work by redirecting to a static page, but when I try to redirect to a modperl handler, I'm run into problems. Here are the two versions of code (BTW, the handler works fine when I access it directly via the browser). ## ver. 1 print STDERR "$@"; require Apache; my $r = Apache-request; $r-internal_redirect("/DBConnectError.cgi"); ## ver. 2 print STDERR "$@"; require Apache; my $r = Apache-request; $r-internal_redirect("/errordocs/503.html"); When I run the modperl handler, the browser prompts me and asks if I want to save the output of the cgi script that raised the error, but it never displays the content from the handler. The static file version works great and the browser displays it's content. Hmm... First of all, the Guide (and experience :-) sez that IMMEDIATELY after running $r-internal_redirect(blah); one should return OK; Secondly, I would suggest doing it differently: tell the request object that the handler returned code 503, and in httpd.conf: ErrorDocument 503 /DBConnectError.cgi I just wrote this handler in 2 minutes, that demonstrates: = package Stat::Testfail; use strict; sub handler { my $r = shift; $r-status(503); return 503; } 1; = with the following httpd.conf entry: Location /testonly SetHandler perl-script PerlHandler +Stat::Testfail /Location and it works like I've described: # telnet localhost 80 GET /testonly HTTP/1.0 HTTP/1.1 503 Service Temporarily Unavailable Date: Tue, 03 Apr 2001 18:01:28 GMT Server: Apache/1.3.9 (Unix) (Red Hat/Linux) mod_perl/1.25 Connection: close Content-Type: text/html HTML HEADTITLEAn Error Occurred/TITLE/HEAD BODY H1An Error Occurred/h1 503 Service Temporarily Unavailable /BODY /HTML (Naturally this would have been different if i'd set an ErrorDocument 503). HTH! L8r, Rob -- [EMAIL PROTECTED] (Replace Z's with E's to reply) Okay, I got Linux installed. So where's the free beer. -Anonymous PGP signature
RE: internal_redirect
Rob, thanks for pointing me in the right direction. Your advise helped me find a solution that works for my situation. You're welcome! I'm working on an API that sits between an Oracle DB and bunch of web application programmers. Unfortunately, the programmers run their apps under a variety of perl-handlers (Apache::Registry, Apache::RegistryNG, Apache::RegistryFilter, etc). None of the programmers follow any sort of standard method for handling exceptions, so I can't assume that 'return OK;' will ever be called (in fact I'm pretty sure, it will never be called). What I've been trying to do is kind of 'take over' the request, whenever a programmer fails to connect to the DB and redirect the browser to a handler that can put up a custom 503 page for each application. OK 1: none of the example environments you listed that your programmers are in include straight mod_perl... in fact they are all CGI emulation layers of varying degrees of protection/dirtiness. Do I read you correctly? I finally settled on putting the following in conf file for the web sites: ErrorDocument 503 "HTMLHEADMETA http-equiv="refresh" content="0;URL=/DBConnectError.cgi"/HEAD/HTML Files DBConnectError.cgi SetHandler perl-script PerlHandler Tec::Api::DBConnectError /Files Well, this is all fine except for one important detail: HOW, and I mean, if you can't answer this you haven't solved the problem, but HOW do you know that your programmers' programs are going to fire a 503 if there is a database error It seems to work for just about every perl handler the programmers are using, as long as they doesn't use Carp::fatalsToBrowser, which raises a whole new set of problems. (you could always chmod 000 `find /usr/lib/perl5 -name fatalsToBrowser.pm` :-) If you see any issues with my solution, please chime in. Well as far as I can see, you're trying to ensure that the programmers are correctly connected to the database. It *looks* like /DBConnectError.cgi is a reconnect setup. Presumably, this has an API that your programmers are using to get DB handles (DBI?). But the only way for this setup to work is if the PROGRAMMERS know that if a database call fails, to throw 503: my $dbh = DBI-connect(Local::get_connect_args) or print "Status: 503\n\n", exit; Otherwise, all of this fancy footwork you're doing will be pointless. Is there something I'm missing?
RE: Apache::AuthCookieDBI forgets its config [UPDATE]
HOWEVER, whenever the module is actually invoked, %SECRET_KEYS is empty! Here's the BEGIN{} block: BEGIN { my @keyfile_vars = grep { $_ =~ /DBI_SecretKeyFile$/ } keys %{ Apache-server-dir_config() }; foreach my $keyfile_var ( @keyfile_vars ) { my $keyfile = Apache-server-dir_config( $keyfile_var ); my $auth_name = $keyfile_var; $auth_name =~ s/DBI_SecretKeyFile$//; unless ( open( KEY, "$keyfile" ) ) { Apache::log_error( "Could not open keyfile for $auth_name in file $keyfile" ); } else { $SECRET_KEYS{ $auth_name } = KEY; close KEY; } } } OK, more examination reveals that: At the time this BEGIN block is running, this call: my @keyfile_vars = grep { $_ =~ /DBI_SecretKeyFile$/ } keys %{ Apache-server-dir_config() }; is returning EMPTY. Meaning it's evaling too early to see the dir_config??? Or what? PerlModule Apache::AuthCookieDBI PerlSetVar AdminPath /admin PerlSetVar AdminLoginScript /scripts/adminlogin.pl #PerlSetVar AdminLoginScript /error/adminlogin.html # Optional, to share tickets between servers. #PerlSetVar AdminDomain .domain.com # These must be set PerlSetVar AdminDBI_DSN "dbi:Oracle:STATS" PerlSetVar AdminDBI_SecretKeyFile /etc/httpd/conf/admin.secret.key # etc. Ideas? L8r, Rob #!/usr/bin/perl -w use Disclaimer qw/:standard/;
Apachecon folks
Anyone here want to get together? I'm in room 945 and bored. I think matt Sergeant is here too but I couldn't find him at the bar. -dave /*== www.urth.org We await the New Sun ==*/
Re: Apachecon folks
At 09:30 PM 4/3/01 -0500, Dave Rolsky wrote: Anyone here want to get together? I'm in room 945 and bored. I think matt Sergeant is here too but I couldn't find him at the bar. Did you check under the bar...? I'm here... and I think Stas, Eric Cholet, and others were interested in doing dinner around 7 or 8. They'll probably check their mail soon? Up until an hour ago, I didn't realize how beat I'm still feeling from Jetlag (normally I'm 15 hours ahead of California time), so I'm turning in early... John Groenveld posted to the BOF schedule thread about wanting to go out though.. Maybe everyone who wants to should just go down to the bar and chill out as people gather? Later, Gunther
Postprocess subrequest content
Hi. If I want to postprocess content from a subrequest before sending it to the client, I can't my $subr = $r-lookup_uri($uri); $subr-header_in("Content-length" = "0"); $subr-run; because this will send the content to the client. What can I do to get the content myself? Thanx, Joachim -- "... ein Geschlecht erfinderischer Zwerge, die fuer alles gemietet werden koennen."- Bertolt Brecht - Leben des Galilei
cvs commit: modperl-2.0/t/response/TestApache conftree.pm
dougm 01/04/03 10:01:48 Added: t/response/TestApache conftree.pm Log: add some tests for ap_conftree Revision ChangesPath 1.1 modperl-2.0/t/response/TestApache/conftree.pm Index: conftree.pm === package TestApache::conftree; use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestConfig (); use Apache::Directive (); sub handler { my $r = shift; my $cfg = Apache::TestConfig-thaw; plan $r, tests = 7; ok $cfg; my $vars = $cfg-{vars}; ok $vars; my $tree = Apache::Directive-conftree; ok $tree; my $port = find_config_val($tree, 'Listen'); ok $port; ok $port == $vars-{port}; my $serverroot = find_config_val($tree, 'ServerRoot'); ok $serverroot; ok $serverroot eq qq("$vars-{serverroot}"); 0; } sub find_config_val { my($tree, $directive) = @_; while ($tree) { if ($directive eq $tree-directive) { return $tree-args; } if (my $kid = $tree-first_child) { $tree = $kid; } elsif (my $next = $tree-next) { $tree = $next; } else { if (my $parent = $tree-parent) { $tree = $parent-next; } else { $tree = undef; } } } } 1;
cvs commit: modperl-2.0/lib/Apache Build.pm
dougm 01/04/03 22:27:59 Modified:.Makefile.PL lib/Apache Build.pm Log: do a better job of finding ap_release.h to parse the server version and give more diagnostics if it fails Revision ChangesPath 1.31 +6 -0 modperl-2.0/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Makefile.PL 2001/04/02 09:17:40 1.30 +++ Makefile.PL 2001/04/04 05:27:59 1.31 @@ -52,6 +52,12 @@ } my $httpd_version = $build-httpd_version; +unless ($httpd_version) { +$build-phat_warn(EOF); +Unable to determine server version, attempting to continue.. +EOF +$httpd_version = 'unknown'; +} printf "Configuring Apache/%s mod_perl/%s Perl/v%vd\n", $httpd_version, $VERSION, $^V; 1.40 +11 -9 modperl-2.0/lib/Apache/Build.pm Index: Build.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- Build.pm 2001/04/02 07:37:36 1.39 +++ Build.pm 2001/04/04 05:27:59 1.40 @@ -418,11 +418,13 @@ } } -unless ($dir and -d $dir) { -for (@INC) { -last if -d ($dir = "$_/auto/Apache/include"); -} -} +# we not longer install Apache headers, so dont bother looking in @INC +# might end up finding 1.x headers anyhow +#unless ($dir and -d $dir) { +#for (@INC) { +#last if -d ($dir = "$_/auto/Apache/include"); +#} +#} return $self-{dir} = $dir; } @@ -450,16 +452,16 @@ sub ap_includedir { my($self, $d) = @_; -$d ||= $self-dir; - return $self-{ap_includedir} if $self-{ap_includedir} and -d $self-{ap_includedir}; + +$d ||= $self-apxs('-q' = 'INCLUDEDIR') || $self-dir; -if (-e "$d/include/httpd.h") { +if (-e "$d/include/ap_release.h") { return $self-{ap_includedir} = "$d/include"; } -$self-{ap_includedir} = $self-apxs('-q' = 'INCLUDEDIR'); +$self-{ap_includedir} = $d; } #--- parsing apache *.h files ---
cvs commit: modperl-2.0/pod modperl_dev.pod
dougm 01/04/03 22:41:07 Modified:lib/ModPerl BuildOptions.pm MM.pm pod modperl_dev.pod Log: build extensions dynamic by default Revision ChangesPath 1.7 +1 -1 modperl-2.0/lib/ModPerl/BuildOptions.pm Index: BuildOptions.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildOptions.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- BuildOptions.pm 2001/03/26 16:17:06 1.6 +++ BuildOptions.pm 2001/04/04 05:41:06 1.7 @@ -143,7 +143,7 @@ INST_APACHE2 Install *.pm relative to Apache2/ directory PROMPT_DEFAULT Accept default value for all would-be prompts OPTIONS_FILE Read options from given file -DYNAMIC Build Apache::*.xs as dynamic extensions +STATIC_EXTS Build Apache::*.xs as static extensions APXSPath to apxs XS_GLUE_DIR Directories containing extension glue INCLUDE_DIR Add directories to search for header files 1.8 +1 -1 modperl-2.0/lib/ModPerl/MM.pm Index: MM.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- MM.pm 2001/03/04 18:43:09 1.7 +++ MM.pm 2001/04/04 05:41:06 1.8 @@ -98,7 +98,7 @@ #they are, unlike 1.xx where *.xs live in src/modules/perl #and are copied to subdir/ if DYNAMIC=1 -unless ($build-{MP_DYNAMIC}) { +if ($build-{MP_STATIC_EXTS}) { #skip .xs - .so if we are linking static my $name = $self-{NAME}; unless ($always_dynamic{$name}) { 1.12 +2 -2 modperl-2.0/pod/modperl_dev.pod Index: modperl_dev.pod === RCS file: /home/cvs/modperl-2.0/pod/modperl_dev.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- modperl_dev.pod 2001/04/04 04:11:44 1.11 +++ modperl_dev.pod 2001/04/04 05:41:07 1.12 @@ -55,9 +55,9 @@ Build mod_perl as a DSO -=item MP_DYNAMIC +=item MP_STATIC_EXTS -Build Apache::*.xs as dynamic extensions +Build Apache::*.xs as static extensions =item MP_USE_GTOP