Re: the deprecation of Apache-request in mp2

2003-03-28 Thread Andrew Ho
Hello,

NTI sure hope not! I second John Siracusa's post on this. Keep the HTML
NTgeneration well away from request parsing, please!

I personally am 100% in the camp of keeping HTML generation separate from
quest parsing, but I do recognize the advantage of having API level
compatibility between Apache::Request and CGI, so that you could switch
from one to another easily. I think this would be a big win for mod_perl
overall from the port your scripts quickly point of view.

I think a good compromise would be to keep the HTML generation code in an
entirely separate module, like Apache::Request::HTML or something. That
class could augment Apache::Request with new methods. (This is somewhat
similar to how Apache::File and Apache::Log augment the Apache class with
new methods.)

This seems to satisfy both sides, and accomplish the laudable goal of
making CGI and Apache::Request API compatible without bloating up the
normal use of Apache::Request.

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer1-800-555-TELL  Voice 650-930-9062
Tellme Networks, Inc. Fax 650-930-9101
--



AuthDBI logoff

2003-03-28 Thread Todd White
i'm seeking a means by which i can allow my web users to logoff after
authenticating for access to restricted web space.  i realize that users
can just close their browser, but i'm seeking a solution that allows the
browser to remain open.  essentially, i want a button that a user can
click that causes the web browser to drop the credentials for the realm.

i'm considering writing an Apache handler and returning an
Apache::Constants constant.  but i'm wondering if anyone would have other
suggestions.

btw, Apache 1.3 / mod_perl 1




Re: mod_perl.pm and Apache 2

2003-03-28 Thread Geoffrey Young


Chris Majewski wrote:
OK, I've resolved the mod_perl.pm dependency by reinstalling
mod_perl-1.99_08 (from src). But now I get this when trying to install
Apache::Cookie
Can't locate Apache/MyConfig.pm in @INC (@INC contains: 
/usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib 
/usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 
/usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int 
/usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at Makefile.PL line 54.
BEGIN failed--compilation aborted at Makefile.PL line 54.
Apache::Cookie has not (yet) been ported over to mod_perl 2.0.

what you want is:
  Apache 1.3.27  (http://www.apache.org/dist/httpd/apache_1.3.27.tar.gz)
  mod_perl 1.27 (http://perl.apache.org/dist/mod_perl-1.27.tar.gz)
good luck.

--Geoff





[Question] Handler executing twice!?!

2003-03-28 Thread Vince Veselosky
I'm hoping someone can explain this one to me. I have a virtual host set 
up like so:
VHOST

# This declares Apache::Webquills::InitSession::handler
PerlRequire /var/www/html/webquills/offline/wq_startup.pl
VirtualHost *
ServerName www.example.com
ServerAlias example.com
ServerPath /test
DocumentRoot /var/www/html/test
PerlHeaderParserHandler Apache::Webquills::InitSession

Directory /var/www/html/test
AllowOverride All
Options Indexes FollowSymLinks MultiViews ExecCGI
Order allow,deny
Allow from all

SetHandler perl-script
PerlHandler Apache::Registry
/Directory
/VirtualHost
VHOST
Now here is the thing. The PerlHeaderParserHandler executes TWICE for 
every request. The second time through is apparently a different Apache 
object from the first, as when I write to $r-notes, only the values 
from the second execution are visible to the content handler.

Now, if I comment out the PerlHeaderParserHandler line in the conf file, 
the handler never executes at all (which is expected), so it isn't 
getting pushed onto handlers from somewhere else.

The handler code looks something like this:
CODE
use vars qw( $stupid );
my $DEBUG =1;
sub handler
{
# Always call 'instance' so as not to clobber params.
my ($r) = Apache::Request-instance(shift);

# Insane bug I cannot track causes this handler to execute twice
# for each request. It's driving me nuts.
if ( $stupid++ ) {
$r-log_error($r-current_callback .  executed twice! Argh!);
$r-notes(HAND2 = HAND2);
$r-pnotes(HAND2 = HAND2);
} else {
$r-log_error($r-current_callback .  executed once.);
$r-notes(HAND1 = HAND1);
$r-pnotes(HAND1 = HAND1);
return DECLINED;
}#END if

## SNIP -- Some standard Apache::Session stuff happens here.
## This Log Handler actually unties and closes the session.
## It executes just fine.
$r-push_handlers('PerlLogHandler', \closer);
if ( $DEBUG ) {
$r-log_error($$: . $r-current_callback);
$r-log_error($$: . $r-is_main ? is main : not main);
$r-log_error($$: . $r-is_initial_req ? is initial : not 
initial);
}#END if
return OK;
}
CODE

The log messages get me this:
LOG
[Fri Mar 28 17:27:06 2003] [error] PerlHeaderParserHandler executed once.
[Fri Mar 28 17:27:06 2003] [error] PerlHeaderParserHandler executed 
twice! Argh!
[Fri Mar 28 17:27:06 2003] [error] 19914: PerlHeaderParserHandler
[Fri Mar 28 17:27:06 2003] [error] is main
[Fri Mar 28 17:27:06 2003] [error] is initial

LOG

And the content handler sees values for HAND2 but not for HAND1.

Why is this thing running twice, and how can I make it stop??? I hope 
someone can hit me over the head with a clue-stick, because this thing 
is driving me completely bananas!

All help is greatly appreciated,
Vince Veselosky
http://ice.control-escape.com






gaining access to config directives of other modules

2003-03-28 Thread dorian
i know Apache::Module can get at all the installed modules and their
directives, and even the spec of those directives, but what about the
actual values of those directives? i notice Apache::Module is old, but
i don't see anything else out there that looks like it will come close
to doing the job.

insight is welcome.

.dorian


informing per Lel Bruce Peto on current newsflash:

2003-03-28 Thread info
informing per Lel Bruce Peto on current newsflash:

The battle is on to put out fires at Iraqi oil wells 
Oil prices have marched higher and key share indexes have fallen, as the 
war in Iraq continues to dominate world markets. 
The North Sea's Brent oil - a benchmark for world oil prices - gained 
$1.53 to $26.82, while US-grade oil rose by nearly two dollars to $30.37.




Problem with Apache::Authen::Program V 0.92 under WinXP

2003-03-28 Thread Ron Savage
(1) I've patch the source slightly:
--- Program.pm  Sat Mar 29 14:32:24 2003
+++ /perl/site/lib/Apache/Authen/Program.pm Sat Mar 29 14:43:10
2003
@@ -11,5 +11,5 @@

 use strict;
-use Apache::Constants ':common';
+use Apache::Constants qw(SERVER_ERROR AUTH_REQUIRED OK);
 use File::Temp q(tempfile);

(2) Some other time I'll use these new constants:
http://perl.apache.org/docs/2.0/user/compat/compat.html#Deprecated_Con
stants

(3) startup.pl:
use Apache2 ();
use ModPerl::Util ();
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();
use Apache::Server ();
use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();
use Apache::Const -compile = ':common';
use APR::Const -compile = ':common';
use APR::Table ();
use Apache::compat ();
use ModPerl::Registry ();
use CGI ();
#use DBI ();
#use DBD::mysql ();

1;

(4) httpd.conf:
Directory C:/Apache2/sweep
AuthName SWEEP Authentication
AuthType Basic
PerlSerVar AuthenProgram /usr/bin/perl /Apache2/authen/authen.pl
PerlSetVar AuthenProgramSuccess Ok
PerlSetVar AuthenProgramPassword File
PerlAuthenHandler Apache::Authen::Program
require valid-user
/Directory

(5) What happens is that Apache does not start. It stops within 1
second. There is nothing in error.log.

(6) If I comment out 1 line in httpd.conf:
#   PerlSerVar AuthenProgram /usr/bin/perl /Apache2/authen/authen.pl
Apache starts.

(7) I've also tried:
PerlSerVar AuthenProgram /Apache2/authen/authen.bat
and
PerlSerVar AuthenProgram /Apache2/authen/authen.bat
in case quotes or a single token (no spaces) made any difference, but
no. authen.bat is just:
perl /Apache2/authen/authen.pl

--
Cheers
Ron Savage, [EMAIL PROTECTED] on 29/03/2003
http://savage.net.au/index.html