RE: mod_perl v2 Forking

2003-09-16 Thread Eric Frazier
:) I think that makes sense. It was created in the child.  It seemed to be
fixed when I made the connection global. When I tried the connection in the
child again it might well have been a lucky transpireing of events that let
the child stay alive long enough for the query to get completed. So I should
keep it global I think. 

Thanks,

Eric 

At 04:24 PM 9/16/03 +0100, Stephen Hardisty wrote:
>Hi,
>is the database connection created in the child or before it?
>If it's created inside the child then it'll die ungracefully when the child
>dies, so put something nice and fluffy to close it before the exit.
>Otherwise, I don't know I'm afraid.
>
>-Original Message-
>From: Eric Frazier [mailto:[EMAIL PROTECTED]
>Sent: 16 September 2003 12:57
>To: Stephen Hardisty
>Cc: [EMAIL PROTECTED]
>Subject: RE: mod_perl v2 Forking
>
>
>Hi,
>
>Doing this "works" for me. But I am ending up with some errors that I didn't
>have before. Of course my bosses would get mad if I posted all of the code
>involed, but basicly a database connection that was working fine is now
>returning "mysql server has gone away", meaning that the connection got
>killed. What is weird/scary, is that if I change your $SIG{CHLD} = 'IGNORE';
>back to the handler I was using, the database error goes away, but I am back
>were I was. Fun huh? :) 
>
>Thanks,
>
>Eric 
>
>At 03:57 PM 9/16/03 +0100, Stephen Hardisty wrote:
>>Hi,
>>I had a problem with 5.8.1 and forking in that I was either getting zombies
>using the 5.6 examples or the parent was dying, depending on which example
>was used. The way round I found was to:
>>
>># ignore the child, good rule for life
>>$SIG{CHLD} = 'IGNORE';
>>
>># then sort out the socket
>>my $server = new IO::Socket::INET(LocalPort => $port,
>>  Type => SOCK_STREAM,
>>  Proto => "tcp",
>>  Listen => 5)
>>  or die "some error";
>>
>># wait for a connection
>>while(my $client = $server->accept())
>>{
>>  my $pid = fork;
>>  die "Error. Fork: $!\n" unless defined $pid;
>>
>>  if($pid == 0)
>>  {
>>  # all your child code here
>>
>>  # when it's done, kill the child:
>>  exit(0);
>>  }
>>}
>>
>>This seemes reasonably stable. If anybody has a better way, then I'm all ears.
>>
>>Cheers!
>>
>>-Original Message-
>>From: Eric Frazier [mailto:[EMAIL PROTECTED]
>>Sent: 16 September 2003 12:24
>>To: [EMAIL PROTECTED]
>>Cc: [EMAIL PROTECTED]
>>Subject: Re: mod_perl v2 Forking
>>
>>
>>Hi,
>>
>>I guess this is off topic for this list, since I would be doing this no
>>matter if I was running CGI or mod_perl or whatever. I am pretty desparate
>>to get this working, and if anyone wants to earn some cash helping me fix
>>things PLEASE call me at 250 655-9513. 
>>
>>I have been trying to accomplish the same thing as Cameron, but with the
>>detaching stuff it seemed a lot easier to make a server with IO::Select and
>>not actually start the server from mod_perl. The end result hopefully will
>>be a web user being able to start some things that take time, but not screw
>>things up by interrupting them. 
>>
>>But then I found I was using 5.8.. Thanks to a guy on comp.lang.perl.misc I
>>know that there is a change in how signals are handled, they call it
>>deferred signal handling because Perl now is suppose to wait until the
>>Interpeter is in a safe state. As I understand it this might avoid some
>>things like core dumps or other errors related to dieing while trying to do
>>something besides dieing. 
>>
>>The thing is somehow this ends up killing off my parent process, just like
>>in this post:
>>
>>http://www.mail-archive.com/[EMAIL PROTECTED]/msg43989.html
>>
>>So this is happening to me as well, however the guy in the above example had
>>his problem solved by using Errno and looking for EINTR if that error is
>>raised then catch it and move on, 
>>
>>I did get one maybe helpfull thing from my log:
>>
>>Erro was  %! 
>>./franken_socket.pl 8607: got - CHLD
>> at Tue Sep 16 02:17:42 2003
>>I got forked
>>./franken_socket.pl 8599: begat 8607 at Tue Sep 16 02:17:40 2003
>>begat 8607
>>./franken_socket.pl 8599: got - CHLD
>> at Tue Sep 16 02:17:54 2003
>>./franken_socket.pl 8599: main 860

RE: mod_perl v2 Forking

2003-09-16 Thread Eric Frazier
Hi,

Well, I am not sure if this is going to be the best solution long term, but
it works!

 while ( <$connection> ){

my $return_value = undef;

if(/quit|exit/i){ last;}
elsif (/closeme/i ) {$connection->close(); }
elsif (/date|time/i){ printf $connection "%s\n", scalar
localtime; exit(0);  }

that did call to a sub, and then connected to a database. I am wondering if
that connection object is better off being global. I changed the connect to
be global, restarted and did a test and it worked fine! I was all ready to
post back to here with the good news, when just to double check I went back
and made the db connect in the local sub like before. And it still worked?!
So it seems like I might be in better shape for now, but I might have some
long term problems with DB connections dieing, most likely related to this
child handling. I have to think that becase the query I am doing is VERY
well tested and never causes an issue. 

Thanks tremedously for everyone's help so far, I at the very least have some
directions to go in now.

I still would very much like to learn what the correct, put it in the book
solution should be.. 


Eric 




At 03:57 PM 9/16/03 +0100, Stephen Hardisty wrote:
>Hi,
>I had a problem with 5.8.1 and forking in that I was either getting zombies
using the 5.6 examples or the parent was dying, depending on which example
was used. The way round I found was to:
>
># ignore the child, good rule for life
>$SIG{CHLD} = 'IGNORE';
>
># then sort out the socket
>my $server = new IO::Socket::INET(LocalPort => $port,
>  Type => SOCK_STREAM,
>  Proto => "tcp",
>  Listen => 5)
>   or die "some error";
>
># wait for a connection
>while(my $client = $server->accept())
>{
>   my $pid = fork;
>   die "Error. Fork: $!\n" unless defined $pid;
>
>   if($pid == 0)
>   {
>   # all your child code here
>
>   # when it's done, kill the child:
>   exit(0);
>   }
>}
>
>This seemes reasonably stable. If anybody has a better way, then I'm all ears.
>
>Cheers!
>
>-Original Message-
>From: Eric Frazier [mailto:[EMAIL PROTECTED]
>Sent: 16 September 2003 12:24
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>Subject: Re: mod_perl v2 Forking
>
>
>Hi,
>
>I guess this is off topic for this list, since I would be doing this no
>matter if I was running CGI or mod_perl or whatever. I am pretty desparate
>to get this working, and if anyone wants to earn some cash helping me fix
>things PLEASE call me at 250 655-9513. 
>
>I have been trying to accomplish the same thing as Cameron, but with the
>detaching stuff it seemed a lot easier to make a server with IO::Select and
>not actually start the server from mod_perl. The end result hopefully will
>be a web user being able to start some things that take time, but not screw
>things up by interrupting them. 
>
>But then I found I was using 5.8.. Thanks to a guy on comp.lang.perl.misc I
>know that there is a change in how signals are handled, they call it
>deferred signal handling because Perl now is suppose to wait until the
>Interpeter is in a safe state. As I understand it this might avoid some
>things like core dumps or other errors related to dieing while trying to do
>something besides dieing. 
>
>The thing is somehow this ends up killing off my parent process, just like
>in this post:
>
>http://www.mail-archive.com/[EMAIL PROTECTED]/msg43989.html
>
>So this is happening to me as well, however the guy in the above example had
>his problem solved by using Errno and looking for EINTR if that error is
>raised then catch it and move on, 
>
>I did get one maybe helpfull thing from my log:
>
>Erro was  %! 
>./franken_socket.pl 8607: got - CHLD
> at Tue Sep 16 02:17:42 2003
>I got forked
>./franken_socket.pl 8599: begat 8607 at Tue Sep 16 02:17:40 2003
>begat 8607
>./franken_socket.pl 8599: got - CHLD
> at Tue Sep 16 02:17:54 2003
>./franken_socket.pl 8599: main 8607 -- reaped 1 at Tue Sep 16 02:17:54 2003
>reaped 1Erro was No child processes %! 
>
>So it looks like the parent got killed on that  error "No child process" 
>This code works just fine on 5.6 since it is about 150% from examples :) 
>The above is the result of connecting, doing a "who", and doing "dienow" to
>test the alarm. 
>
>I also found this: 
>
>http://archive.develooper.com/[EMAIL PROTECTED]/msg03022.html
>
>Which totaly describ

RE: mod_perl v2 Forking

2003-09-16 Thread Eric Frazier
Hi,

Doing this "works" for me. But I am ending up with some errors that I didn't
have before. Of course my bosses would get mad if I posted all of the code
involed, but basicly a database connection that was working fine is now
returning "mysql server has gone away", meaning that the connection got
killed. What is weird/scary, is that if I change your $SIG{CHLD} = 'IGNORE';
back to the handler I was using, the database error goes away, but I am back
were I was. Fun huh? :) 

Thanks,

Eric 

At 03:57 PM 9/16/03 +0100, Stephen Hardisty wrote:
>Hi,
>I had a problem with 5.8.1 and forking in that I was either getting zombies
using the 5.6 examples or the parent was dying, depending on which example
was used. The way round I found was to:
>
># ignore the child, good rule for life
>$SIG{CHLD} = 'IGNORE';
>
># then sort out the socket
>my $server = new IO::Socket::INET(LocalPort => $port,
>  Type => SOCK_STREAM,
>  Proto => "tcp",
>  Listen => 5)
>   or die "some error";
>
># wait for a connection
>while(my $client = $server->accept())
>{
>   my $pid = fork;
>   die "Error. Fork: $!\n" unless defined $pid;
>
>   if($pid == 0)
>   {
>   # all your child code here
>
>   # when it's done, kill the child:
>   exit(0);
>   }
>}
>
>This seemes reasonably stable. If anybody has a better way, then I'm all ears.
>
>Cheers!
>
>-Original Message-
>From: Eric Frazier [mailto:[EMAIL PROTECTED]
>Sent: 16 September 2003 12:24
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>Subject: Re: mod_perl v2 Forking
>
>
>Hi,
>
>I guess this is off topic for this list, since I would be doing this no
>matter if I was running CGI or mod_perl or whatever. I am pretty desparate
>to get this working, and if anyone wants to earn some cash helping me fix
>things PLEASE call me at 250 655-9513. 
>
>I have been trying to accomplish the same thing as Cameron, but with the
>detaching stuff it seemed a lot easier to make a server with IO::Select and
>not actually start the server from mod_perl. The end result hopefully will
>be a web user being able to start some things that take time, but not screw
>things up by interrupting them. 
>
>But then I found I was using 5.8.. Thanks to a guy on comp.lang.perl.misc I
>know that there is a change in how signals are handled, they call it
>deferred signal handling because Perl now is suppose to wait until the
>Interpeter is in a safe state. As I understand it this might avoid some
>things like core dumps or other errors related to dieing while trying to do
>something besides dieing. 
>
>The thing is somehow this ends up killing off my parent process, just like
>in this post:
>
>http://www.mail-archive.com/[EMAIL PROTECTED]/msg43989.html
>
>So this is happening to me as well, however the guy in the above example had
>his problem solved by using Errno and looking for EINTR if that error is
>raised then catch it and move on, 
>
>I did get one maybe helpfull thing from my log:
>
>Erro was  %! 
>./franken_socket.pl 8607: got - CHLD
> at Tue Sep 16 02:17:42 2003
>I got forked
>./franken_socket.pl 8599: begat 8607 at Tue Sep 16 02:17:40 2003
>begat 8607
>./franken_socket.pl 8599: got - CHLD
> at Tue Sep 16 02:17:54 2003
>./franken_socket.pl 8599: main 8607 -- reaped 1 at Tue Sep 16 02:17:54 2003
>reaped 1Erro was No child processes %! 
>
>So it looks like the parent got killed on that  error "No child process" 
>This code works just fine on 5.6 since it is about 150% from examples :) 
>The above is the result of connecting, doing a "who", and doing "dienow" to
>test the alarm. 
>
>I also found this: 
>
>http://archive.develooper.com/[EMAIL PROTECTED]/msg03022.html
>
>Which totaly describes my problem as well, but shows it happening with perl
>5.8.1.. 
>
>
>>I'd imagine that your accept() isn't being restarted.  How does it work
>>if you change the loop to look like this?
>
>>use Errno;
>
>>while (1) {
>>  my $client = $server->accept or do {
>>   next if $!{EINTR};
>>last;
>>  };
>>  spawn(\&function, "whatever");
>>}
>
>#!/usr/bin/perl -w
>
>## new frankenstein!
>
>  use strict;
>  use POSIX ();
>  use POSIX 'WNOHANG';
>  use Errno;
>  use IO::Socket;
>  use FindBin ();
>  use File::Basename ();
>  use File::Spec::Functions;
>  use Net::hostent;
>

Re: mod_perl v2 Forking

2003-09-16 Thread Eric Frazier
Hi,

That sound like one way to go, I want to be very careful with something like
this. You speak as if restoring 5.6 behaviour is the best or only way to go.
Do you see any other alternatives? 

Thanks,

Eric 

At 04:57 PM 9/16/03 +0200, Rafael Garcia-Suarez wrote:
>Eric Frazier wrote:
>...
>> But then I found I was using 5.8.. Thanks to a guy on comp.lang.perl.misc I
>> know that there is a change in how signals are handled, they call it
>> deferred signal handling because Perl now is suppose to wait until the
>> Interpeter is in a safe state. As I understand it this might avoid some
>> things like core dumps or other errors related to dieing while trying to do
>> something besides dieing. 
>
>Mostly, yes. Look at the perldelta manpage that is distributed with perl
>5.8.0, section "Safe Signals".

I did read that, it seems kind of misleading. The 5.8 IPC doc was more
helpful, but I still didn't get a clear idea how to handle this and the
examples are not updated yet.


>
>If you want to restore the 5.6-ish "unsafe" signal handling, this is not
>possible with 5.8.0 :(. But, as it has been acknowledged that this unsafe
>behaviour is desirable in some cases, it will be possible with perl
>5.8.1.
>
>You can grab a 5.8.1 release candidate 4 from CPAN :
>http://search.cpan.org/~jhi/
>(RC5 should be out in a few days)
>and see with it if using unsafe signal handlers solves your problem.
>You can enable them with the PERL_SIGNALS environment variable.
>Here's the relevant part of the perlrun manpage that comes with perl
>5.8.1 RC4 :
>
>=item PERL_SIGNALS
>
>In Perls 5.8.1 and later.  If set to C the pre-Perl-5.8.0
>signals behaviour (immediate but unsafe) is restored.  If set to
>C the safe (or deferred) signals are used.
>See L.
>
>HTH.
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 






Re: mod_perl v2 Forking

2003-09-16 Thread Eric Frazier
Hi,

I guess this is off topic for this list, since I would be doing this no
matter if I was running CGI or mod_perl or whatever. I am pretty desparate
to get this working, and if anyone wants to earn some cash helping me fix
things PLEASE call me at 250 655-9513. 

I have been trying to accomplish the same thing as Cameron, but with the
detaching stuff it seemed a lot easier to make a server with IO::Select and
not actually start the server from mod_perl. The end result hopefully will
be a web user being able to start some things that take time, but not screw
things up by interrupting them. 

But then I found I was using 5.8.. Thanks to a guy on comp.lang.perl.misc I
know that there is a change in how signals are handled, they call it
deferred signal handling because Perl now is suppose to wait until the
Interpeter is in a safe state. As I understand it this might avoid some
things like core dumps or other errors related to dieing while trying to do
something besides dieing. 

The thing is somehow this ends up killing off my parent process, just like
in this post:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg43989.html

So this is happening to me as well, however the guy in the above example had
his problem solved by using Errno and looking for EINTR if that error is
raised then catch it and move on, 

I did get one maybe helpfull thing from my log:

Erro was  %! 
./franken_socket.pl 8607: got - CHLD
 at Tue Sep 16 02:17:42 2003
I got forked
./franken_socket.pl 8599: begat 8607 at Tue Sep 16 02:17:40 2003
begat 8607
./franken_socket.pl 8599: got - CHLD
 at Tue Sep 16 02:17:54 2003
./franken_socket.pl 8599: main 8607 -- reaped 1 at Tue Sep 16 02:17:54 2003
reaped 1Erro was No child processes %! 

So it looks like the parent got killed on that  error "No child process" 
This code works just fine on 5.6 since it is about 150% from examples :) 
The above is the result of connecting, doing a "who", and doing "dienow" to
test the alarm. 

I also found this: 

http://archive.develooper.com/[EMAIL PROTECTED]/msg03022.html

Which totaly describes my problem as well, but shows it happening with perl
5.8.1.. 


>I'd imagine that your accept() isn't being restarted.  How does it work
>if you change the loop to look like this?

>use Errno;

>while (1) {
>  my $client = $server->accept or do {
>   next if $!{EINTR};
>last;
>  };
>  spawn(\&function, "whatever");
>}

#!/usr/bin/perl -w

## new frankenstein!

  use strict;
  use POSIX ();
  use POSIX 'WNOHANG';
  use Errno;
  use IO::Socket;
  use FindBin ();
  use File::Basename ();
  use File::Spec::Functions;
  use Net::hostent;
  use Carp;
 

  $|=1;
  my $pid;

open (DIED, ">>/var/log/daemon_log") or warn "$!";
sub logmsg { print DIED "$0 $$: @_ at ", scalar localtime, "\n" }

my $listen_socket = IO::Socket::INET->new(LocalPort => 1081,
LocalAddr => '127.0.0.1',
Proto => 'tcp',
Listen=> SOMAXCONN,
Reuse => 1 )
or die "can make a tcp server on port 1080 $!";


  # make the daemon cross-platform, so exec always calls the script
  # itself with the right path, no matter how the script was invoked.
  my $script = File::Basename::basename($0);
  my $SELF = catfile $FindBin::Bin, $script;
  # POSIX unmasks the sigprocmask properly
  my $sigset = POSIX::SigSet->new();
  my $action = POSIX::SigAction->new('sigHUP_handler',
 $sigset,
 &POSIX::SA_NODEFER);
  my $action_alrm = POSIX::SigAction->new('sigALRM_handler',
 $sigset,
 &POSIX::SA_NODEFER);


  POSIX::sigaction(&POSIX::SIGHUP, $action);
 POSIX::sigaction(&POSIX::SIGALRM, $action_alrm);

  sub sigHUP_handler {
  print "got SIGHUP\n";
  exec($SELF, @ARGV) or die "Couldn't restart: $!\n";
  }
  sub sigALRM_handler {
  print "got ALARM timeout\n";

  }

  $SIG{CHLD} = \&REAPER_NEW;

  sub REAPER {
$SIG{CHLD} = \&REAPER;  # loathe sysV
my $waitedpid = wait;
logmsg "reaped $waitedpid" . ($? ? " with exit $?" : '');
}

sub REAPER_NEW {
logmsg "got - @_\n";
my $wpid = undef;
while ($wpid = waitpid(-1,WNOHANG)>0) {

logmsg "main $pid -- reaped $wpid" . ($? ? " with exit $?" : '')
;
print DIED "reaped $wpid" . ($? ? " with exit $?" : '');

}
}


   print "PID: $$\n";
   print "ARGV: @ARGV\n";
   print "[Server $0 accepting clients]\n";

#while (my $connection = $listen_socket->accept()) {
while (1) {
  my $connection = $listen_socket->accept() or do {
next if $!{EINTR};
last;
  };

print DIED "Erro was $! %! \n";
$connection->autoflush(1); ## missing seemed to cause client problem, but
not telnet

if (

Re: Apache::Session permissions problem

2003-09-15 Thread Eric Schwartz
On Saturday, Sep 13, 2003, at 09:22 America/Denver, Perrin Harkins 
wrote:
I found a pretty useful article at
http://www.linuxjournal.com/article.php?sid=4143 on how to use
Apache::Session with Mason.
I'm afraid that is not a very good article.  It's out of date, and 
shows
poor error handling.  If you want to use sessions with Mason, you 
should
be using the session handler that Mason provides.  That is available on
CPAN and is supported on the Mason list.
Beggars can't be choosers, and all that, but would you mind telling me 
what handler you're talking about?  I looked around for session 
handling and Mason, and that article was the best one I found in terms 
of explaining how it worked and how to use it.

Apache::Session::DBI (which is what the article refers to) is ancient 
and
should not be used.
How can I know this?  The documentation for Apache::Session::DBIStore 
(which A::S::DBI refers to) doesn't say anything about being obsolete 
or deprecated.  Is there an archive of received wisdom somewhere I 
should be checking to validate articles like the one I found?

You shouldn't use the IPC locking in Apache::Session.  You didn't 
mention
which database you're using, but most of them have alternative ways of
doing locking.  In my opinion, the locking approach taken in
Apache::Session is not a good one for the average web site and you 
should
simply turn it off by using the NullLocker.
How?  I never asked for IPC locking; it somehow snuck in.  It's not 
particularly obvious from the documentation I can find that it's going 
to be used, or how to select alternative methods.  I installed 
Apache::Session from CPAN, and the docs refer to PosixFileLocker 
SysVSemaphoreLocker and NullLocker, but no perldocs for those modules 
are on my system.  I'm honestly trying to figure out how I can draw 
those conclusions for myself, so I'm not stuck asking this list about 
them.

Suggestions are more than welcome; I'm not quite sure how
Session::SysVSempaphoreLocker got involved in the first place, since I
don't explicitly reference it.
Apache::Session::DBI uses it for locking.
'perldoc Apache::Session::DBI' says it uses A::S::PosixFileLocker, not 
A::S::SysVSemaphoreLocker.  Are the docs wrong, or the code?

-=Eric



Apache::Session permissions problem

2003-09-12 Thread Eric Schwartz
I found a pretty useful article at 
http://www.linuxjournal.com/article.php?sid=4143 on how to use 
Apache::Session with Mason.  I followed the article, more or less, and 
ended up with this bit of code in my handler.pl to tie() my $session 
variable to an Apache::Session class:

  eval {
tie %HTML::Mason::Commands::session, 'Apache::Session::DBI',
  ($cookies{$session_cookie_name} ? 
$cookies{$session_cookie_name}->value() : undef),
{
 DataSource => $dbsource,
 UserName => $dbuser,
 Password => $dbpass
};
  };

All the database variables are correct; I use them elsewhere with no 
problem.  The problem is that the session seems to be intermittent-- 
some pages seem to recognize it, others don't.  This smelled a lot like 
a problem where the session was getting set in one Apache instance and 
not others, so I wondered if the session was getting stored in the 
database correctly; after the previous eval, all I ever get in $@ is:

Permission denied at 
/Library/Perl/Apache/Session/SysVSemaphoreLocker.pm line 46.

Which seems to indicate it isn't.  I STFW, and found several people who 
seem to have had the same problem I have, but the solutions proffered 
involve ipcs and ipcrm, which don't exist on my Mac OS X 10.2.6 system. 
 Suggestions are more than welcome; I'm not quite sure how 
Session::SysVSempaphoreLocker got involved in the first place, since I 
don't explicitly reference it.

Mightily confused,

-=Eric



Re: Apache::AuthCookie causing strange "Use of uninitialized value."

2003-09-12 Thread Per Eric Rosén
Thanks for your response!

> You have to subclass Apache::AuthCookie. This should be something like:
> PerlFixupHandler Your::Sublass->recognize_user

Well, I do. I just pasted the wrong text (from the 2002 mail).
The actual configuration snippet is:


AuthType TAS::Cookie
AuthName TAS
PerlFixupHandler TAS::Cookie->recognize_user


Another observation: It does only appear when no cookie is received.
When users are logged in, everything is fine. And, yes, I checked
recognize_user and put in a defined() around the cookie check. No result.
Even a bad cookie (manually deleting the session) makes it quiet.

/Per Eric
--
^): Per Eric Rosén http://rosnix.nu/~per/
/   [EMAIL PROTECTED]  GPG 7A7A BD68 ADC0 01E1 F560 79FD 33D1 1EC3 1EBB 7311


Apache::AuthCookie causing strange-"Use of uninitialized value."

2003-09-12 Thread Per Eric Rosén
I use Apache::AuthCookie 3.04, which seems to be the latest version, under
Apache/1.3.26 Ben-SSL/1.48 (Unix) Debian GNU/Linux PHP/4.1.2 mod_perl/1.26.

When I use "PerlFixupHandler Apache::AuthCookie->recognize_user", Apache
writes "Use of uninitialized value." in errorlog for each request and
subrequest. I have tried editing AuthCookie.pm, checking everything with
defined(), even substituting recognize_user with a stub function.

Still it is there. I am not sure it comes from perl, because perl use to
say "at line X" too. But from what else?

This has been up before, but no one answered it then:
http://www.jsw4.net/info/list-archives/mod_perl/02-08/msg00591.html

/Per Eric
--
^): Per Eric Rosén http://rosnix.nu/~per/
/   [EMAIL PROTECTED]  GPG 7A7A BD68 ADC0 01E1 F560 79FD 33D1 1EC3 1EBB 7311


Re: Possible Apache::AuthenSmb Mod?

2003-09-10 Thread Shannon Eric Peevey
Peter Hartzler wrote:

Hello,

We're looking into using your Apache::AuthenSmb module to allow us to
migrate our intranet to GNU/Linux/Apache.  One issue we have is that we
have two NT domains.  I have a couple of different ideas for how to modify
the code to allow this scenario, and am wondering if you have any thoughts
on this, or would be interested in a patch, or have a patch, or this is
already possible and somehow I've missed it...
There are a couple of obvious considerations, such as the possibility of 
userid duplication in the two domains (we don't do that), the need to not 
break existing/legacy configurations, and perhaps the desirability of 
passing the user's domain to the script (not sure about that one).

Anyhow, thanks for the very useful code, and do feel welcome to jump in if 
anything moves you!

Best Regards,

Pete.

 

Hi!

I think that Apache-AuthenNTLM may fit the bill for you.  Check it out at:

http://search.cpan.org/author/SPEEVES/Apache-AuthenNTLM-2.04/AuthenNTLM.pm

You are able to create mappings for more than one domain.

Also, please include the modperl mailing list in your replies.  (This 
email may have information that will help others in the future :) )

thanks,
speeves
cws


Re: apache2, mod_perl: problem with CGI

2003-09-06 Thread Shannon Eric Peevey
Stas Bekman wrote:

speeves wrote:

Stas Bekman wrote:

Thanks that did it.




Great.

It would be nice though if the minimum rev level of the CGI.pm 
could be
mentioned in the doc.
Or maybe it is there somewhere and I skimmed over it.




It's a a CGI.pm problem, really. We can't go and support all 
possible modules that may or may not run under mod_perl 2.0. However 
we do have this section:
http://perl.apache.org/products/apache-modules.html#Porting_CPAN_modules_to_mod_perl_2_0_Status 

We probably should specify the version number of each of these 
modules. Can somebody please lookup those modules and send me a 
patch with the version number which starts to support mod_perl 2.0?

No need for Apache::Peek, CGI and CGI::Cookie since I know these 
versions already.

I'm CC'ing Shannon, since he has ported most of the auth modules.


Sorry, I wasn't following the thread, so don't know what the patch is 
for. :(  But, here is a listing of the version numbers for the auth 
mods that are stable, and work with mod_perl2:

Apache-AuthenNIS-0.11
Apache-AuthenNTLM-2.04
Apache-AuthenPasswd-0.12
Apache-AuthenSmb-0.70
Apache-AuthExpire-0.38
Apache-AuthNetLDAP-0.25
Apache-AuthPerLDAP-2.01
Apache-AuthzNetLDAP-0.07
Apache-AuthzNIS-0.11
Apache-AuthzPasswd-0.11


Thanks, speeves

So these are the versions required to run properly with mod_perl 2.0? 
Here is an updated table:

  Module Name Required Dist Package
  -
  Apache::AuthExpire Apache-AuthExpire-0.38
  Apache::AuthNetLDAPApache-AuthNetLDAP-0.25
  Apache::AuthPerLDAPApache-AuthPerLDAP-2.01
  Apache::AuthenNIS  Apache-AuthenNIS-0.11
  Apache::AuthenPasswd   Apache-AuthenPasswd-0.12
  Apache::AuthenSmb  Apache-AuthenSmb-0.70
  Apache::AuthzNIS   Apache-AuthzNIS-0.11
  Apache::AuthzNetLDAP   Apache-AuthzNetLDAP-0.07
  Apache::AuthzPasswdApache-AuthzPasswd-0.11
  Apache::Clean  Apache-Clean-2.00_4 (not released)
  Apache::Peek   Apache-Peek-1.01
  CGICGI.pm-2.93
  CGI::CookieCGI.pm-2.93 (comes in the CGI dist)
I can't see Apache-AuthenNTLM-2.04 being ported yet, though. Here is 
the list of modules that are being in progress of being ported:
Hi!

Apache-AuthenNTLM-2.04 is indeed ported, I guess I just didn't make a 
formal announcement.   People can download it from the CPAN site under 
my name.

speeves
cws


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: AuthenNTLM

2003-08-27 Thread Shannon Eric Peevey
Brett Hales wrote:

I am having problems with Apache-AuthenNTLM-0.23. In apache's error.log
I am getting the following errors reported.
AuthenNTLM: timed out while waiting for lock (key = 23754)

This also seems to cause the web server to go _very_ slow. I have looked
through the AuthenNTLM.pm and found the section where this is evaluated.
There is a comment above it.
# smb aborts any connection that where no user is looged on as soon as somebody
# tries to open another one. So we have to make sure two request, do not start
# two auth cycles at the same time. To avoid a hang of the whole server
we wrap it with
# a small timeout
Maybe this is actually happening and I am getting two auth cycles.

Does anybody have an idea why this is happening?

Thanks,

 

It's possible, but seems unlikely.  Is this happening constantly? 

Also, try messing with the "PerlSetVar ntlmsemkey" and "PerlSetVar 
ntlmsemtimout" values.   "ntlmsemkey" turns serialization on/off, and 
"ntlmsemtimout" sets the timeout for the Apache server to wait for the 
semaphore, (which serializes the requests to the SMB server). 

speeves
cws


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Apache::AuthenNTLM module with HP/Apache

2003-08-14 Thread Shannon Eric Peevey
Antony Batten wrote:

Hi,

Sorry to direct email you, but I am desperate, and was hoping the solution
to the problem below would be a quick one from the people who wrote the
module ;)
Thanks,
Antony.
Appologies if this is no longer your domain, but 

[posted to comp.infosystems.www.servers.unix & comp.lang.perl.modules]

We are trying to use the Apache::AuthenNTLM perl module with HP/Apache and
mod_perl. We have prevented mod_perl from running our cgi-perl scripts (by
using Apache directives to only use mod_perl for *PL files), as we want to
use 5.8 for this, and the HP-supplied mod_perl is tied to 5.6.1
Everything installs ok & the server starts ok. However, we get the following
errors in the errorlog:
[Fri Aug 08 13:39:47 2003] [error] failed to resolve handler
`Apache::AuthenNTLM' [Fri Aug 08 13:39:47 2003] [error] [client
30.254.43.59] Can't find 'boot_Authen__Smb' symbol in
/opt/perl5.8/lib/site_perl/5.8.0/ PA-RISC1.1/auto/Authen/Smb/Smb.sl
Compilation failed in require at
/opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 29.
BEGIN failed--compilation aborted at
/opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 29.
Compilation failed in require at (eval 5) line 3.
Looks an odd error, as the symbol seems to be there (I am no programmer
though :)
[EMAIL PROTECTED] $ nm
/opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/auto/Authen/Smb/Smb.sl | grep
boot
boot_Authen__Smb |30816|extern|entry |
boot_Authen__Smb |30936|extern|code |$CODE$
Does anyone know what is causing the problem? 
We are really stumped here and I am up against a deadline to get this stuff
working. All help greatly appreciated 

perl version 5.8.0
mod_perl version 5.6.1
Apache::AuthenNTLM version 2.04
Server version: HP Apache-based Web Server/2.0.43 

 

Can you give us the correct version of mod_perl?  (It should be 1.2x or 
1.99x)

thanks,
speeves
cws



Re: Apache::AuthenNTLM module with HP/Apache

2003-08-14 Thread Shannon Eric Peevey
Antony Batten wrote:

Randy,

OK thanks, I'll give that a try. I think we can compile the module against
5.6.1  It's just that we can't change the 5.6.1 install as it would
break our support agreement with HP (so I am told) ... I presume we just
have to 'install' the module in a different place after compiling it...
Thanks v. much to all for helping me with this.

Rgds,
Antony
-Original Message-
From: Randy Kobes [mailto:[EMAIL PROTECTED] 
Sent: 14 August 2003 07:23
To: Antony Batten
Cc: 'Shannon Eric Peevey'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Apache::AuthenNTLM module with HP/Apache

On Wed, 13 Aug 2003, Antony Batten wrote:

 

Shannon,

Thanks very much for the quick response. Here's the info you wanted (I
hope):
HP-UX_Apache-based_Web_Server/2.0.46 (Unix) mod_perl/1.99_09 
Perl/v5.6.1 DAV/2 configured

Can my career be saved? ;0)

Thanks again,
Antony.
-Original Message-
From: Shannon Eric Peevey [mailto:[EMAIL PROTECTED]
Sent: 13 August 2003 14:41
To: Antony Batten
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Apache::AuthenNTLM module with HP/Apache
Antony Batten wrote:
   

[ .. ]
 

We are trying to use the Apache::AuthenNTLM perl module with 
HP/Apache and mod_perl. We have prevented mod_perl from running our 
cgi-perl scripts (by using Apache directives to only use mod_perl for 
*PL files), as we want to use 5.8 for this, and the HP-supplied 
mod_perl is tied to 5.6.1

Everything installs ok & the server starts ok. However, we get the 
following errors in the errorlog:

[Fri Aug 08 13:39:47 2003] [error] failed to resolve handler 
`Apache::AuthenNTLM' [Fri Aug 08 13:39:47 2003] [error] [client 
30.254.43.59] Can't find 'boot_Authen__Smb' symbol in 
/opt/perl5.8/lib/site_perl/5.8.0/ PA-RISC1.1/auto/Authen/Smb/Smb.sl 
Compilation failed in require at 
/opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 
29. BEGIN failed--compilation aborted at 
/opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 
29. Compilation failed in require at (eval 5) line 3.
 

I'm not sure I'm following your setup - is the mod_perl
you're trying to use here compiled under Perl 5.6.1? And Apache::AuthenNTLM
was compiled under Perl 5.8.0? That combination probably won't work in
principle, as 5.6.1 and 5.8.0 are binary incompatible. If you're tied to
mod_perl compiled under 5.6.1, try compiling and using an Apache::AuthenNTLM
compiled under 5.6.1.
 

Thanks, Randy!  (I just woke up in the middle of the night with the same 
answer :)) )

Yes, use the perl binary that points to 5.6.1 when you run 
"/path/to/perl5.6.1 Makefile.PL".  (Running the rest of the install as 
normal, of course ;) )  This will place the module in the appropriate 
location for your mod_perl, that apache is using, to find it.

speeves
cws



Apache-AuthPerLDAP beta port uploaded

2003-08-04 Thread Shannon Eric Peevey
Hi!

I just wanted to see of Henrik Strom was on this list   (I have 
ported your Apache-AuthPerLDAP, and wonder how you want to integrate the 
changes into your existing module.)

Also, I have ported Apache-AuthPerLDAP to work with both versions of 
mod_perl, but am running out of time to set up the test environment.   
If some of you could test the new module, and send documentation of any 
problems with either mod_perl 1 or 2 to me, that would be greatly 
appreciated :)  I have uploaded the ported module to CPAN, and you 
should be able to find it at:

http://search.cpan.org/author/SPEEVES/

later today.

Thanks for your help!!!

speeves
cws
The uploaded file

   Apache-AuthPerLDAP-2.01.tar.gz

has entered CPAN as

 file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthPerLDAP-2.01.tar.gz
 size: 4442 bytes
  md5: 1be5678c357fc98723e60374b47932c1




[MP1 and MP2] Apache::AuthzNIS ported

2003-08-01 Thread Shannon Eric Peevey
The uploaded file

   Apache-AuthzNIS-0.11.tar.gz

has entered CPAN as

 file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthzNIS-0.11.tar.gz
 size: 4305 bytes
  md5: 37bbbdc320c6bba7318d817e854bc8e1
Apache::AuthzNIS - mod_perl NIS Group Authorization module has been ported to work with both versions of modperl.

thanks,
speeves




[MP1 and MP2] Apache-AuthenNIS ported

2003-08-01 Thread Shannon Eric Peevey
The uploaded file

   Apache-AuthenNIS-0.11.tar.gz

has entered CPAN as

 file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenNIS-0.11.tar.gz
 size: 4095 bytes
  md5: cac172a46c5b05034842fad5eed6b9be
Apache::AuthenNIS - mod_perl NIS Authentication module has been ported to work with both versions of modperl.

thanks,
speeves
cws





Re: [OT] About XML and Petal (was Re: templating system opinions (axkit?))

2003-07-30 Thread Eric Cholet
Le lundi, 28 juil 2003, à 21:27 Europe/Paris, Jean-Michel Hiver a écrit 
:

Also, with TT you have to use the filter 'html' to XML encode your
variables. Petal does it by default, and you need to use the TALES
'structure' keyword to NOT encode.
You don't *have* to use the 'html' filter in TT. I wrote a subclass of
Template which does this automatically for me, and as with Petal I can
also not encode by using a specific method.
--
Eric Cholet


[MP1 and MP2] Apache-AuthenSmb ported

2003-07-28 Thread Shannon Eric Peevey
Hi!

The uploaded file

   Apache-AuthenSmb-0.70.tar.gz

has entered CPAN as

 file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenSmb-0.70.tar.gz
 size: 4004 bytes
  md5: ac1b1a29f5070f81efb9f1362b5815dc
Apache::AuthenSMB - mod_perl NT Authentication module has now been ported to work with both versions of modperl.  I have just uploaded it, so should be available from CPAN in a few hours.

thanks,
speeves
cws




re: AuthenNTLM - help

2003-07-25 Thread Shannon Eric Peevey
Shannon,
i put it working on Solaris, mod_perl, NTLM and mod_jk2 (to comunicate 
with Tomcat), but unfortunatily, it just works when i access from 
windows 9x and Linux. When i access by NT/2000/XP, it just doesn't work 
at all (no validation). So, i decide, for a while, make it work on 
Linux! I am using Conectiva 8, and it is working fine.
Thanks.

Shannon Eric Peevey escreveu:

Francisco de Assis Tristão wrote:

Shannon,
i got it configured with apache-1.3.27/mod_ssl/2.8.12 OpenSSL/0.9.6g 
mod_perl/1.25", all by hand,
but it only works fine when i use just http - when i access the pages 
with https, apache doesn't ask for the user...
Have you any idea about what is wrong?
The version of apache with mod_ssl i took from sunfreeware, mod_perl 
and ApacheAuthenNTLM i compiled by myself.


Sorry, I don't know why this might be happening...  Are you running 
through a proxy server?  I have seen a lot of problems when ntlm 
authentication through a proxy server...

speeves
cws
I am forwarding this to the modperl list...  Please include the list in 
your replies.

thanks,
speeves
cws


Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?

2003-07-25 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon Eric Peevey wrote:
[...]
*handler = MP2 ? \&handler2 : \&handler1;

I am leaving the MP2 code in both of the subroutines, as I don't know 
if there is a prettier way to do this...  (I will remove it, if there 
is not)

Although this hasn't been tested extensively, it should be working 
fine now.

thanks for the help!
speeves
cws
PS  It did complain about "Prototype mismatch: sub 
Apache::AuthenNTLM::handler vs ($$) at 
/usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm" until I added the 
code into both subroutines. 


I've added a new section to the porting tutorial that shows examples 
of how to handle this situation:
http://perl.apache.org/docs/2.0/user/porting/porting.html#Method_Handlers

I changed the code for Apache-AuthenNTLM-2.04 to reflect your example, 
and it works great! 
Thanks for the pointer :)

speeves
cws




Re: Application design patterns

2003-07-24 Thread Eric Sammer
Perrin Harkins wrote:
On Thu, 2003-07-24 at 02:18, Eric Sammer wrote:

where did you (Perrin) keep 
objects like your database handle (assuming DBI, but please correct 
otherwise) and any objects that could be reused (TT, XML parser objects, 
et al)?
People seem to ask about this frequently, but I don't think we did
anything especially interesting there.  We just had a simple class full
of accessors for these resources that would call factory methods the
first time and then cache the result as appropriate.
Sorry to be so cliche / predictable. ;)

This is what I'm sure will wind up happening. I think what I'm looking 
for will require this kind of framework.

This caches the database handle for the rest of the request (one
Apache::DBI ping per request should be enough).
Maybe a stupid question, but what would be the functional difference 
between dumping the object after each request like you say and using the 
same method as you describe for the TT object below? I ask because I'm 
currently treating both objects the same way in two or three of my 
larger applications. I would assume this is to catch premature database 
shutdown or network trouble between an app server and database (cluster) 
on a request by request basis? Is this a performance related choice or 
an Apache::DBI best practices thing?

For the Template Toolkit object we want to cache it for the life of the
process, so it would be something like this:
Right. This is what I currently do.

I see a reference to a utility style class (ESR::Util, IIRC), but after 
rereading a number of articles and design pattern books, I'm reluctant 
to go with a "handle holder" object as I've done in the past.
Gang of Four got you spooked?  If you have something that works and
doesn't cause problems elsewhere in your code, don't fret about it.
Quite true. I think when starting any new large application, as I am 
now, I like to reevaluate my current design methods and look at anything 
I might have been able to do better and do it - a bad (or good) habit.

He who feels he got it right in the past never looks for a better way to 
do it in the future and, thus, stunts all learning and growth... or some 
 such idealistic babble. ;)

That said, I think what I'm learning here is that the uncomfortability 
with this design method is more in my head than tangible.

What I'd like is to have my model (as in MVC) objects reuse the 
process or maybe even server shared objects without doing any of these:

1. Using a singleton utility class
2. Needing to pass objects to model objects' new() in teh controllers
3. Instantiating the objects in the model classes themselves
All of those sound legit to me, as long as you don't duplicate code
between the objects.  I would choose #1, personally.
Yea... that seems to be the ticket, so to speak.

I guess I could use a class to just act as a namespace to hold the 
objects and create them at server startup time and use a module like 
IPC::MM, File::Cache, or Cache::Mmap but that feels kludgy and offers no 
encapsulation for the objects themselves.
No, you can't share things like this between processes.  Things with XS
code, open sockets, filehandles, etc. are not shareable.
And now that you mention it, it seems so obvious. $Deity only knows what 
I was thinking...

Perrin - Have you ever considered revealing more about the Etoys project 
or just the concepts as you applied them? It would be nice to peek at 
some of the details. Or, is this an NDA situation or some such thing? 
Well, I don't have permission to go posting big chunks of code, but in
terms of the generally applicable ideas, I think the article covered
most of it.  The rest has to do with database work and patterns for
building model objects, and I hope to cover that in the article version
of the talk I gave about object-relational mapping tools at this year's
Perl Conference.
Is this past tense and if so, is the article up somewhere? Just curious...

The biggest thing the article didn't cover is the ideas used by the guys
coding the more interactive parts of the application to express the
state machine implemented by each of their modules in a declarative data
structure.  This was largely invented by Adam Sussman, who is at
TicketMaster now.  It was similar to what you see in CGI::Application
and some of the other frameworks.
Hm... that is interesting as well. I've been poking at the internals of 
  a lot of the "frameworks" out there and there are some fantastic 
concepts (Chris Winters' OI comes to mind). Or, there is the distinct 
possibility that I'm overly obsessed with architecture; that shouldn't 
be dismissed either... ;)

Thanks for all your input and the great article(s).
--
Eric Sammer
[EMAIL PROTECTED]
http://www.ineoconcepts.com


Re: Application design patterns

2003-07-24 Thread Eric Sammer
Aaron Ross wrote:
Hi Eric,

class. What I'd like is to have my model (as in MVC) objects reuse the 
process or maybe even server shared objects without doing any of these:

1. Using a singleton utility class
2. Needing to pass objects to model objects' new() in teh controllers
3. Instantiating the objects in the model classes themselves
I'm not sure if this violates 3 (the models classes have to know what
resources they need, so i am not sure what wouldn't), but could you use
a singleton for the resource and a factory to access it? The model
classes call a "static" factory method that handles the configuration,
cache, etc...
This is what I'm thinking I'll do. It seems to be the most "natural" in 
this case. I was reading this paper by Andy Wardly 
http://www.template-toolkit.org/tpc5/camelot/index.html which has a 
collection of resource classes that seem to act in a similar method at 
some level (providing a resource with a class that could be implemented 
as a singleton).

This solves the problem of having configuration and resource allocation
code in your model objects. It does mean that you have to write factory
classes for your resources, but they ought to be quite simple. 
Writing factory methods compared to littering code with instantiation of 
objects all objects are going to need lends itself to an easy and 
obvious first choice. ...For me, at least. ;)

I've done a fair amount of Objective-C (Mac OS X Cocoa and Openstep) and 
there's a number of classes that work in a similar fashion - simple, 
clean, and functional. The reason I like it is because I don't need to 
worry about passing stuff around - just get a static instance and go to 
town. (For those interested or in the know, I'm talking about 
NSNotificationCenter, NSFileManager, and other similar classes).

Thanks for the input!

--
Eric Sammer
[EMAIL PROTECTED]
http://www.ineoconcepts.com


Re: Application design patterns

2003-07-23 Thread Eric Sammer
Perrin Harkins wrote:
There are tutorials on the Template Toolkit site, a recent perl.com
article about TT and Class::DBI, and my article:
http://perl.apache.org/docs/tutorials/apps/scale_etoys/etoys.html
I read Perrin's case study awhile ago and it was excellent. Out of 
curiosity (and since most of my code written prior to reading said 
article looks identical in structure) where did you (Perrin) keep 
objects like your database handle (assuming DBI, but please correct 
otherwise) and any objects that could be reused (TT, XML parser objects, 
et al)?

I see a reference to a utility style class (ESR::Util, IIRC), but after 
rereading a number of articles and design pattern books, I'm reluctant 
to go with a "handle holder" object as I've done in the past. I use a 
configuration object that parses and holds all site config info (DBI 
dsn, user, pass, TT paths, etc.), when apache starts - a singleton style 
class. What I'd like is to have my model (as in MVC) objects reuse the 
process or maybe even server shared objects without doing any of these:

1. Using a singleton utility class
2. Needing to pass objects to model objects' new() in teh controllers
3. Instantiating the objects in the model classes themselves
I guess I could use a class to just act as a namespace to hold the 
objects and create them at server startup time and use a module like 
IPC::MM, File::Cache, or Cache::Mmap but that feels kludgy and offers no 
encapsulation for the objects themselves.

I'm sure I'm either overcomplicating the situation to some great 
extentent or the utility class is the way to go (combined with some 
caching / shared mem module). Is there some obvious pattern I've missed 
or should I just KISS?

Perrin - Have you ever considered revealing more about the Etoys project 
or just the concepts as you applied them? It would be nice to peek at 
some of the details. Or, is this an NDA situation or some such thing? 
Either way, great article.

Thanks in advance.
--
Eric Sammer
[EMAIL PROTECTED]
http://www.ineoconcepts.com


Re: AW: AW: Apache:AuthenNTLM 2.01 with modperl 1.26

2003-07-23 Thread Shannon Eric Peevey
Tresp, Wilfried wrote:

Hi Shannon Eric,

forget my last mail. It is simply to late. After changing PerlModule to
PerlResponseHandler in httpd.conf everything works now. Great!
Only little problem is that I see many error_log entries like the following:

[12163] the $self->{smbhandle} is 903424

ntlmdebug is set to 0

Maybe the line 198 of AuthenNTLM.pm is the reason for this:

   print STDERR "[$$] the \$self->{smbhandle} is $self->{smbhandle}\n";

Regards,	Wilfried

 

Hi!

Glad that it's working now :)  The entries in the error log are just my 
debugging crap that I was using when I was porting.  I will clean up the 
code a little more and upload a new version tomorrow.

Thanks for all of your input!!!
speeves
cws



Re: AW: AW: Apache:AuthenNTLM 2.01 with modperl 1.26

2003-07-23 Thread Shannon Eric Peevey
Tresp, Wilfried wrote:

Hi Shannon Eric,

fine it's already there. I try to run the module with Apache 2.0.47 but it
didn't work here. There seems to be problems with my @INC variable but I can
not figure out how to fix it. When I try to start the daemon I see only the
following error message:
# /usr/local/apache2/bin/apachectl start
[Thu Jul 24 01:27:30 2003] [error] Can't locate Apache/AuthenSmb.pm in @INC
(@INC contains: /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Apache2
./Apache2 /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
/usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .
/usr/local/apache2/ /usr/local/apache2/lib/perl) at (eval 4) line 3.
[Thu Jul 24 01:27:30 2003] [error] Can't load Perl module Apache::AuthenSmb
for server netweb.de.kworld.kpmg.com:8000, exiting...
The module AuthenSmb.pm doesn't exist but I can not locate the problem. Do
you have any hints for me?
 

Hi!

Looks to me like you are trying to load Michael Parker's 
Apache::AuthenSmb module...  I don't believe that that mod is ported to 
mp2.   The Authen::Smb module is included with the Apache::AuthenNTLM 
module, so should have been installed when you ran the script.  If you 
change the module that you are trying to load Apache::AuthenNTLM, does 
that help?

speeves
cws
PS  Can you reply to the modperl mailing list?  Thanks :)

 

 




Re: AW: Apache:AuthenNTLM 2.01 with modperl 1.26

2003-07-23 Thread Shannon Eric Peevey
Tresp, Wilfried wrote:

Hi,

works now, thanks, next I'll try it with Apache2. AuthenNTLM was the only reason I have not tried it yet :)

Regards,	Wilfried

-Ursprüngliche Nachricht-
Von: Shannon Eric Peevey [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 23. Juli 2003 20:50
An: Tresp, Wilfried
Betreff: Re: Apache:AuthenNTLM 2.01 with modperl 1.26
Tresp, Wilfried wrote:

 

Hello Shannon Eric,

as far as I understood the changes between Apache::AuthenNTLM 2.01 and the
older 0.23 from Gerald Richter your enhancements should make it possible to
use the modul with modperl 1.26 and modperl 2 also, is this right?
I tried to install your version with Apache 1.26, mod_perl 1.27 running
Solaris 8 with Perl 5.6.1 but every time a page is called which requires
authentication I get an internal Server Error and the error_log shows the
following entry:
[Wed Jul 23 20:12:36 2003] [error] Can't locate object method "log" via
package "Apache" (perhaps you forgot to load "Apac
he"?) at
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Apache/AuthenNTLM.pm line
598.
Do you know what happens?  

Regards,

Wilfried Tresp

   

Hi!

Try this file.  Just replace your AuthenNTLM.pm file that the install 
placed in your perl modules directory with this one.  It seems that 
there was a problem here:

if ($type == 1)
   {
597 --># my $log = $r->log;
   my $nonce = $self -> get_nonce ($r) ;
in the first handler subroutine at line 597...  I have commented out the 
line, and it should work now.

Thanks for the heads-up :)

speeves
cws
 

Great!!!  I will upload a fixed version to CPAN, and it should be 
available after a few hours.

speeves
cws



Re: Templating system opinions (CGI::Application in connection with either HTML::Template or Template::Toolkit)

2003-07-23 Thread Eric
Hi,

That was really interesting to look at. OpenInteract is really impressive. 
I guess there is always a cost to having a big
do it all type of system. That is what made me avoid Mason, it just blew my 
head off for complexity. Now it is true, I am looking for a bit more than 
what CGI::Application offers out of the box, but it may well end up being 
worthwhile to just extend rather than convert. I really appreciate the 
simple philosophy that HTML::Template and CGI::Application follow.

One question, how do you judge that OpenInteract is more established? Is 
does look like it is actively developed, but I never heard of it before, 
and I couldn't find much indication of how popular it is.



Thanks,

Eric

At 09:23 AM 2003-07-23, Randal L. Schwartz wrote:
>>>>> "Dave" == Dave Baker <[EMAIL PROTECTED]> writes:

Dave> I'm curious as to why the combination of CGI::Application and
Dave> HTML::Template hasn't taken off ... CGI::Application seems to allow a
Dave> software developer to create an entire CGI app that can be stored and
Dave> distributed as a module on CPAN, but only a couple such app/modules
Dave> have been so added.
Maybe because it competes with OpenInteract, which is far more established.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Lead Programmer
D.M. Contact Management
250.383.0836


Re: AuthenNTLM - Help

2003-07-22 Thread Shannon Eric Peevey
Francisco de Assis Tristão wrote:

Shannon,
i got it configured with apache-1.3.27/mod_ssl/2.8.12 OpenSSL/0.9.6g 
mod_perl/1.25", all by hand,
but it only works fine when i use just http - when i access the pages 
with https, apache doesn't ask for the user...
Have you any idea about what is wrong?
The version of apache with mod_ssl i took from sunfreeware, mod_perl 
and ApacheAuthenNTLM i compiled by myself.
Sorry, I don't know why this might be happening...  Are you running 
through a proxy server?  I have seen a lot of problems when ntlm 
authentication through a proxy server...

speeves
cws







[mp2] beta of Apache-AuthenNTLM uploaded

2003-07-22 Thread Shannon Eric Peevey
The uploaded file

   Apache-AuthenNTLM-2.01.tar.gz

has entered CPAN as

 file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenNTLM-2.01.tar.gz
 size: 50644 bytes
  md5: f175a98ea668e81df9cc8d6db629facf
The purpose of this module is to perform a user authentication via Mircosoft's
NTLM protocol.  (This module also implements Basic Authentication for all other 
browsers ).
You may download this beta version of Apache-AuthenNTLM from CPAN.  It is not a replacement for the existing version on CPAN, but instead will work with either version of modperl.  Please, feel free to download it and send me any bug reports... :)

thanks,
speeves
cws




Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]

2003-07-22 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon Eric Peevey wrote:



use constant MP2 => ($mod_perl::VERSION >= 1.99);

# test for the version of mod_perl, and use the appropriate libraries
BEGIN {
   if (MP2) {
   require Apache::Const;
   require Apache::Access;
   require Apache::Connection;
   require Apache::Log;
   require Apache::RequestRec;
   require Apache::RequestUtil;
   apache::Const->import(-compile =>
  


 ^
This might be a typo, but if you change that to Apache::Const
(upper case 'A'), does that help?
 

Fantastic!!!  I have been staring at all of the wrong code for way 
too long... :P

Thanks for taking the time to find my error :)

I should have a working version by the beginning of next week.


I think that this still won't work. The reason:

 Apache::Const->import(-compile => 
'HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK'); 

only compiles the constants, it doesn't import them. Drop the 
'-compile =>' part, and then they will be imported. -compile tell 
Apache::Const to not import the constants but to compile them.

It did work, in fact.  (I was just snoozing on the job... :P )  

Thanks, Randy!

speeves
cws



Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?

2003-07-22 Thread Shannon Eric Peevey


Though I seem to be chasing it down to a possible problem with the 
method handler:

sub handler ($$)

But even with a change to:

sub handler : method


This is an interesting one. How to make the two coexist in the same 
code base. Ideally you want to do this:

sub handler1 ($$) {}
sub handler2 : method {}
*handler = MP2 ? \&handler2 : \&handler1;

But probably it'll complain about different prototypes. Or it might 
just work. Give it a try.


Hi!

Looks like your example will work, though, it is kind of messy, 
(probably because I don't completely follow the example).  I basically 
added the handler code into the subroutines as defined:

sub handler1 ($$) {  
   my ($class, $r) = @_ ;
   my $type ;
   my $nonce = '' ;
   my $self ;
   ...
}

sub handler2 : method
  {
   my ($class, $r) = @_ ;
   my $type ;
   my $nonce = '' ;
   ...
}
*handler = MP2 ? \&handler2 : \&handler1;

I am leaving the MP2 code in both of the subroutines, as I don't know if 
there is a prettier way to do this...  (I will remove it, if there is not)

Although this hasn't been tested extensively, it should be working fine now.

thanks for the help!
speeves
cws
PS  It did complain about "Prototype mismatch: sub 
Apache::AuthenNTLM::handler vs ($$) at 
/usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm" until I added the code 
into both subroutines.  




Re: Values of an array..

2003-07-21 Thread Eric Wong
On Mon, Jul 21, 2003 at 02:38:20PM -0700, Andrew Hurst wrote:
> At 01:22 PM 7/21/2003 -0800, Dennis Stout wrote:
> >> >"Dennis Stout"  wrote ...
> >> > my %user_list = get_users($where);
> >> >
> >> > foreach (keys %user_list) {
> >> > my $user = $_;
> >> > foreach (@{$user_list{$user}{DOMAIN}}) {
> >> > $user_list{$user}{DOMAINS} .=
> >> >"$user_list{$user}{DOMAIN}[$_],";
> >> > }
> >> > chop($user_list{$user}{DOMAINS});
> >> >...
> >>
> >> >$user_list{$user}{DOMAINS} .= "$user_list{$user}{DOMAIN}[$_],";
> >>
> >> That line is the culprit.  $_ contains each domain name as a text
> >> string.  Which evaluates to 0 when used as an integer, which then gives 
> >the
> >> first entry in the array.  Thus you get the first entry in the array as
> >> many times as you have entries in the array.  Try changing that to a
> >> regular (indexed) for loop and that should fix it.
> >
> >Good eye, I was too busy thinking of hashes and things.
> >
> >I hate array's.
> >
> >Should just be $user_list{$user}{DOMAINS} .= "$_,"; huh?
> 
> Yep.  After I sent the last email I realized that suggesting an indexed
> for loop was more effort than just deleting part of the string already
> there, like you just suggested.

This would be a good place for a join (perldoc -f join):

$user_list{$user}{DOMAINS} = join ',', @{$user_list{$user}{DOMAIN}};

which lets you do away with the trailing chop() as well.

Since this has nothing to do with mod_perl, if you must reply, please
do it off-list.

Eric


small doc typo...

2003-07-21 Thread Shannon Eric Peevey
Hi!

Just perusing:

http://perl.apache.org/docs/2.0/devel/core/apache_integration.html#The_Link_Between_mod_perl_and_httpd

and found a small typo.

"STANDARD20_MODULE_STUFF is a standard macro defined in 
httpd-2.0/include/http_config.h. Currently its main use *if* for 
attaching Apache version magic numbers,"

Probably mean, "Currently its main use *is *for..."

thanks,
speeves
cws


Calling a mod_perl method from whithin a CGI script

2003-07-20 Thread Eric Ricardo Anton
	I have started using Apache::AuthCookie, which runs under mod_perl, for 
authentication. The problem is that the whole website I’m working on is 
based on mod_cgi. I need the CGI scripts to call a mod_perl method in 
order to recognize the user that is logged in.

	Since I can't port the scripts from mod_cgi to mod_perl, how can I make 
a CGI script call a mod_perl method?

	Thanks for any help.

	Eric




Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]

2003-07-17 Thread Shannon Eric Peevey


use constant MP2 => ($mod_perl::VERSION >= 1.99);

# test for the version of mod_perl, and use the appropriate libraries
BEGIN {
   if (MP2) {
   require Apache::Const;
   require Apache::Access;
   require Apache::Connection;
   require Apache::Log;
   require Apache::RequestRec;
   require Apache::RequestUtil;
   apache::Const->import(-compile =>
   

 ^
This might be a typo, but if you change that to Apache::Const
(upper case 'A'), does that help?
 

Fantastic!!!  I have been staring at all of the wrong code for way too 
long... :P

Thanks for taking the time to find my error :)

I should have a working version by the beginning of next week.

speeves
cws


Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]

2003-07-17 Thread Shannon Eric Peevey
Have you imported them?

use Apache::Const compile ->qw(Apache::HTTP_FORBIDDEN);

All the available Apache:: constants are listed here:

http://perl.apache.org/docs/2.0/api/Apache/Const.html



Hi!

I have included the bare minimum of the code from the module, 
(Apache::AuthenNTLM).  It is still  acting as if I have not imported the 
modules, but I have changed "require" to "use", moved the "use" 
statements into various places of the module to see if they would catch 
it, and nothing doing...  I am at the end of my wits.  If someone would 
have a minute to see if they can see why the Constants within the "sub 
handler" would not be found, (though they are imported), that would be a 
great thanks and help :)  I am running apache 2.0.46 and mod_perl 
1.99_09, perl 5.6.1 on a Debian machine.

Thanks in advance,
speeves
cws
package Apache::AuthenNTLM ;

use strict ;
use vars qw{$cache $VERSION %msgflags1 %msgflags2 %msgflags3 %invflags1 
%invflags2 %invflags3 $debug} ;
use warnings ;
no warnings 'redefine';

$VERSION = 0.24 ;

$debug = 0 ;

$cache = undef ;

use MIME::Base64 () ;
use Authen::Smb 0.95 ;
use Socket ;

# here is where we start the new code

use mod_perl ;
# use Apache::Constants qw(:common);
# setting the constants to help identify which version of mod_perl
# is installed
use constant MP2 => ($mod_perl::VERSION >= 1.99);
# test for the version of mod_perl, and use the appropriate libraries
BEGIN {
   if (MP2) {
   require Apache::Const;
   require Apache::Access;
   require Apache::Connection;
   require Apache::Log;
   require Apache::RequestRec;
   require Apache::RequestUtil;
   apache::Const->import(-compile => 
'HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK');
   } else {
   require Apache::Constants;
   
Apache::Constants->import('HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK');
   }
}
# end modperl code ##



sub handler : method # ($$)
   {
   my ($class, $r) = @_ ;
   my $type ;
   my $nonce = '' ;
   my $self ;
   my $conn = $r -> connection ;
   my $connhdr =  $r -> header_in ('Connection') ;
   my $fh = select (STDERR) ;
   $| = 1 ;
   select ($fh) ;
   my ($addr, $port) = sockaddr_in ($conn -> remote_addr) ;

   print STDERR "[$$] AuthenNTLM: Start NTLM Authen handler pid = $$, 
connection = $$conn conn_http_hdr = $connhdr  main = " . ($r -> main) . 
" cuser = " . $conn -> user .
   ' remote_ip = ' . $conn -> remote_ip . " remote_port 
= " . unpack('n', $port) . ' remote_host = <' . $conn -> remote_host . 
"> version = $VERSION\n" if ($debug) ;

   # we cannot attach our object to the connection record. Since in
   # Apache 1.3 there is only one connection at a time per process
   # we can cache our object and check if the connection has changed.
   # The check is done by slightly changing the remote_host member, which
   # persists as long as the connection does
   # This has to be reworked to work with Apache 2.0
   if (ref ($cache) ne $class || $$conn != $cache -> {connectionid} || 
$conn -> remote_host ne $cache->{remote_host})
   {
   $conn -> remote_host ($conn -> remote_host . ' ') ;
   $self = {connectionid => $$conn, remote_host => $conn -> 
remote_host} ;
   bless $self, $class ;
   $cache = $self ;
   print STDERR "[$$] AuthenNTLM: Setup new object\n" if ($debug) ;
   }
   else
   {
   $self = $cache ;
   print STDERR "[$$] AuthenNTLM: Object exists user = 
$self->{userdomain}\\$self->{username}\n" if ($debug) ;

   if ($self -> {ok})
   {
   $conn -> user($self->{mappedusername}) ;
   # we accept the user because we are on the same connection
   $type = $self -> get_msg ($r);
   my $content_len = $r -> header_in('content-length') ;
   my $method  = $r -> method ;
   print STDERR "[$$] AuthenNTLM: Same connection pid = $$, 
connection = $$conn cuser = " .
   $conn -> user . ' ip = ' . $conn -> 
remote_ip . ' method = ' . $method . ' Content-Length = ' .
   $content_len . ' type = ' . $type . "\n" 
if ($debug) ;

   # IE (5.5, 6.0, probably others) can send a type 1 message
   # after authenticating on the same connection.  This is a
   # problem for POST messages, because IE also sends a
   # "Content-length: 0" with no POST data.
   if ($method eq 'GET' || $method eq 'HEAD' || $method eq 
'OPTION' || $method eq 'DELETE' ||
   $content_len > 0 || $type == 3)
   {
   print STDERR "[$$] AuthenNTLM: OK because same 
connection\n" if ($debug) ;
   return MP2 ? Apache::OK : Apache::Constants::OK ;
  

Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?

2003-07-17 Thread Shannon Eric Peevey
Stas Bekman wrote:

speeves wrote:

Hi!

Just wondering if Apache::HTTP_FORBIDDEN and 
Apache::HTTP_INTERNAL_SERVER_ERROR have been implemented?  I have 
been trying to port Apache::AuthenNTLM, and keep getting:

[Tue Jul 15 16:46:08 2003] [error] failed to resolve handler 
`Apache::AuthenNTLM'
[Tue Jul 15 16:46:08 2003] [error] [client 192.168.1.2] Bareword 
"Apache::HTTP_FORBIDDEN" not allowed while "strict subs" in u
se at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 593.
Bareword "Apache::HTTP_INTERNAL_SERVER_ERROR" not allowed while 
"strict subs" in use at /usr/local/lib/perl/5.6.1/Apache/Authe
nNTLM.pm line 597.
Bareword "Apache::HTTP_INTERNAL_SERVER_ERROR" not allowed while 
"strict subs" in use at /usr/local/lib/perl/5.6.1/Apache/Authe
nNTLM.pm line 632.
BEGIN not safe after errors--compilation aborted at 
/usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 671.
Compilation failed in require at (eval 10) line 3.

in the error_log.  I have other constants that are imported from 
Apache::Const, so do not think that it is a problem with scope...  
Here is the code:

line 593 --  return $self->{ntlmauthoritative} ? (defined($nonce) ? 
(MP2 ? Apache::HTTP_FORBIDDEN : Apache::Constants::HTTP_
FORBIDDEN) : (MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : 
Apache::Constants::HTTP_INTERNAL_SERVER_ERROR)) : (MP2 ? Apache::DE
CLINED : Apache::Constants::DECLINED) ;

and

line 632 --- # return MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : 
Apache::Constants::HTTP_INTERNAL_SERVER_ERROR ;

If you need more, let me know.


Have you imported them?

use Apache::Const compile ->qw(Apache::HTTP_FORBIDDEN);

All the available Apache:: constants are listed here:

http://perl.apache.org/docs/2.0/api/Apache/Const.html

Yeah, unfortunately... :(   Though I seem to be chasing it down to a 
possible problem with the method handler:

sub handler ($$)

But even with a change to:

sub handler : method

I'm still not able to access the imported CONSTANTS 
This is definitely the most complex port that I've done, so is taking me 
a little while to find all of the buggies...   Will keep you posted :)

speeves
cws


Re: informational notice in Makefile.PL

2003-07-15 Thread Shannon Eric Peevey
Randy Kobes wrote:

On Mon, 14 Jul 2003, Stas Bekman wrote:

[ ... ]
 

Are you talking about the dependencies list? by 'the current
state of affairs with mod_perl 2.0', you mean that it's not
indexed by PAUSE. It's available from CPAN.
Actually, once it gets indexed by CPAN it'll break all the
other modules which specify mod_perl (1.0) as a dependency and
won't work with 2.0.
   

Perhaps it might be an idea, at this stage, to recommend to
module authors that, if their package is for mod_perl 1 only, to
use a module like Apache::Constants in their PREREQ_PM (ie,
something available only within mod_perl 1), and if it's for
mod_perl 2 only, use something like Apache::Const, or something
available only with mod_perl 2. This won't help existing
packages, but it would at least alert people that a problem is on
the horizon.
To help in this, perhaps it would be worthwhile to promote the
use of Module::Install? A package (Module::Install::mod_perl?)
could be made which would make available a function to test for
the mod_perl version a user has, and then decide if this is
appropriate for the package about to be installed. If the
required mod_perl version isn't present, one could either offer
to add the required version to PREREQ_PM, or else just die, as
automated installs of mod_perl can be tricky. A lot of the code
for this could be extracted from Apache::Test; Stas, you've also
worked through this logic in making packages that include
different versions for different mod_perl versions.  Only the
package author need have Module::Install::* when constructing the
Makefile.PL - the necessary stuff for the added functionality is
added to the distribution, making it transparent to the user.
 

Here is an example of my Makefile.PL using ModUtils::AutoInstall:

   # ExtUtils::AutoInstall Bootstrap Code, version 7.
   BEGIN{my$p='ExtUtils::AutoInstall';my$v=0.52;$p->VERSION||0>=$v
   or+eval"use $p $v;1"or+do{my$e=$ENV{PERL_EXTUTILS_AUTOINSTALL};
   (!defined($e)||$e!~m/--(?:default|skip|testonly)/and-t STDIN or
   eval"use ExtUtils::MakeMaker;WriteMakefile(PREREQ_PM=>{'$p',$v}
   );1"and exit)and print"==> $p $v required. Install it from CP".
   "AN? [Y/n] "and!~/^n/i and print"*** Installing $p\n"and
   do{if (eval '$>' and lc(`sudo -V`) =~ /version/){system('sudo',
   $^X,"-MCPANPLUS","-e","CPANPLUS::install $p");eval"use $p $v;1"
   ||system('sudo', $^X, "-MCPAN", "-e", "CPAN::install $p")}eval{
   require CPANPLUS;CPANPLUS::install$p};eval"use $p $v;1"or eval{
   require CPAN;CPAN::install$p};eval"use $p $v;1"||die"*** Please
   manually install $p $v from cpan.org first...\n"}}}
   # notify the user about mod_perl 2
   BEGIN { print q{
    NOTICE *
   If you are planning to use mod_perl2 and Apache2, please, do not
   answer yes when prompted to install mod_perl.  You will need to
   download mod_perl2 manually from
   http://perl.apache.org/download/index.html
   *
   } }
   # optional pre-install handler; takes $module_name and $version
   # sub MY::preinstall  { return 1; } # return false to skip install
   # optional post-install handler; takes $module_name, $version, $success
   # sub MY::postinstall { return; }   # the return value doesn't matter
   # the above handlers must be declared before the 'use' statement
   use ExtUtils::AutoInstall (
   -version=> '0.40',  # required AutoInstall version
   # usually 0.40 is sufficient
   -config => {
   make_args   => '--hello',   # option(s) for CPAN::Config
   force   => 1,   # pseudo-option to force install
   do_once => 1,   # skip previously failed modules
   },
   -core   => [
   Convert::ASN1 => '',
   Net::LDAP => '',
   mod_perl => '',
   ],  # core modules; may also be 'all'
   );
   WriteMakefile(
   AUTHOR  => 'Mark Wilcox ([EMAIL PROTECTED]) and 
Shannon Eric Peevey ([EMAIL PROTECTED])',
   ABSTRACT=> 'Apache::AuthNetLDAP -- Perl module which 
authenticates users via LDAP using the Net::LDAP module.'
,
   NAME=> 'Apache::AuthNetLDAP',
   VERSION_FROM=> 'AuthNetLDAP.pm',
   DISTNAME=> 'Apache-AuthNetLDAP',
   );

I then add the necessary code inside of the .pm file to check the 
version of  mod_perl on the machine and perform appropriately. (I 
hope... ;) )  This allows a module to live in both worlds, and removes 
the necessity of supporting two code bases.  I think that this type of 
porting will help authors to go ahead and port their modules, expanding 
the mp2 module base, and alleviate fears of jumping off of a cliff and 
leaving mp1 behind.

Just my .02...
speeves
cws



Re: AuthenNTLM - Help

2003-07-15 Thread Shannon Eric Peevey
Stas Bekman wrote:

Francisco de Assis Tristão wrote:

Frank,
please, i am trying to configure AuthenNTLM on a solaris 2.8 (SPARC)
machine. But i did not find any sample about how to configure
httpd.conf. May you help me? I had compiled apache 2 version 2.0.46 with
ssl suport (i am configuring it with mod_jk and Tomcat too). Do i need
to have mod_perl installed?


You certainly need to have mod_perl installed. This and other 
questions are answered at http://perl.apache.org/.

However I'm not sure whether this module has been ported to mod_perl 
2.0. Therefore you probably need to either port it, or use mod_perl 
1.0, in case it wasn't ported yet.



__
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
I am in the process of porting it now.  Will hopefully have a working 
version in the next couple of days. 

Francisco, check out the documentation using perldoc:

perldoc Apache::AuthenNTLM

There is an example for the httpd.conf configuration in there.

I'll keep you posted on the port, and will announce when and where I 
have a working version.  The author is only excepting patches for the 
mod, so will probably take a little time for him to get my changes 
implemented into the indexed version.  (Will also keep you posted on 
that... :) )

speeves
cws


Re: mod_perl 1.0 and 2.0

2003-07-15 Thread Shannon Eric Peevey
Chris Faust wrote:

There is a 0.92 version of Apache::DBI is mp2 aware (there may even be 
a later version at this point).
We started with mp1 and do to problems we decided to goto mp2 (which 
turned out to be non mod_perl and apache related), there wasn't any 
major performance increase or anything like that and I don't remember 
anything major coming up during the switch (outside of cookies - which 
always seem to be a problem).
I use a bunch of the popular modules like HTML::Template, 
Image::Magick, DBI, Parse/WriteExcel, Date::Manip etc and I haven't 
had any problems.
Like Sreeji said, its really about your requirements - but the above 
is my experience, for what its worth.
-Chris

- Original Message -
*From:* Jamie Krasnoo 
*To:* [EMAIL PROTECTED] 
*Sent:* Wednesday, July 09, 2003 3:49 PM
*Subject:* mod_perl 1.0 and 2.0
Hi all,

I’m currently working on a personal project to get myself back in
mod_perl programming order. However I’m more used to using
mod_perl 1.0 with Apache 1.3.x. I’m going through the
documentation for mod_perl 2.0 but I’m worried that most of the
modules I need won’t work with mod_perl 2.0. I’ve been looking for
what modules will and will not work with 2.0 (like Apache::DBI for
pooling connections with MySQL). Would it be a better benefit to
me to switch over to 2.0?
Thanks,

Jamie

We need more help in porting more mods to go with mp2... too ;) Come 
join the fray :)

speeves
cws


Re: module ported and doc addition...

2003-07-15 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon Eric Peevey wrote:
[...]
Also, you don't realy have to do that. The old ala mp1 style works 
just fine.

use Apache::Const qw(OK DECLINED)

sub handler {

   return OK;
} 


Well...  I must have been smoking crack, 'cause I seem to remember a 
simple:

return  MP2 ? Apache::OK : OK

throwing an error, hence, the change to:

MP2 ? Apache::OK : Apache::Constants::OK

Now that I test it, though, there doesn't seem to be a problem...  :P


May be you haven't been importing the constant. These two aren't the 
same:

use Apache::Const qw(OK DECLINED);
use Apache::Const -compile => qw(OK DECLINED);
the latter only compiles the constants, the former compiles and 
imports it.

[...]

Just started working on Apache-AuthNTLM and came across the cross 
reference that you posted awhile back.  This might be where I got it:

 sub handler {
 # ...
 return MP2 ? Apache::OK : Apache::Constants::OK;
 }
 1;
in the "mod_perl 1.0 and 2.0 Constants Coexistence" section of:

http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Constants_

speeves
cws


Re: module ported and doc addition...

2003-07-15 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon Eric Peevey wrote:
[...]
Also, you don't realy have to do that. The old ala mp1 style works 
just fine.

use Apache::Const qw(OK DECLINED)

sub handler {

   return OK;
} 


Well...  I must have been smoking crack, 'cause I seem to remember a 
simple:

return  MP2 ? Apache::OK : OK

throwing an error, hence, the change to:

MP2 ? Apache::OK : Apache::Constants::OK

Now that I test it, though, there doesn't seem to be a problem...  :P


May be you haven't been importing the constant. These two aren't the 
same:

use Apache::Const qw(OK DECLINED);
use Apache::Const -compile => qw(OK DECLINED);
the latter only compiles the constants, the former compiles and 
imports it.

[...] 
Here is the code:

BEGIN {
   if (MP2) {
   require Apache::Const;
   require Apache::Access;
   require Apache::Connection;
   require Apache::Log;
   require Apache::RequestRec;
   require Apache::RequestUtil;
   Apache::Const->import(-compile => 'HTTP_UNAUTHORIZED','OK');
   } else {
   require Apache::Constants;
   Apache::Constants->import('HTTP_UNAUTHORIZED','OK');
   }
}
(Or, variations upon it...)  As I've said, though, my code is dying with 
an error on Apache::Constants anymore  If I hit it again, I will 
post the error message that I was getting.

thanks,
speeves
cws


Re: informational notice in Makefile.PL

2003-07-14 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon, can you please post this follow up to the list?
Sorry, thought I got...



 Eric Peevey wrote:

Stas Bekman wrote:

Shannon Eric Peevey wrote:

Hi!

In an attempt to simplify the install process for dependencies with 
my modules, I have been using the ExtUtils::AutoInstall module.  
(Great module, BTW :) )  But, with the current state of affairs 
with mod_perl and its availability from CPAN, I wanted to through 
an information notice to the effect of, "if you are planning to use 
mod_perl2 and apache2, you will have to answer no here, and 
manually download it from perl.apache.org..."  I contacted Autrijus 
Tang, the maintainer of ExtUtils::AutoInstall, and asked him if it 
was possible, (I didn't see it documented), and he answered with this:

   # notify the user about mod_perl 2
   BEGIN { print q{
    NOTICE *
   If you are planning to use mod_perl2 and Apache2, please, do 
not
   answer yes when prompted to install mod_perl.  You will need to
   download mod_perl2 manually from
   http://perl.apache.org/download/index.html
   *
   } }

I placed it after the first BEGIN block and voila! I am 
communicating :)




Are you talking about the dependencies list? by 'the current state 
of affairs with mod_perl 2.0', you mean that it's not indexed by 
PAUSE. It's available from CPAN.

Actually, once it gets indexed by CPAN it'll break all the other 
modules which specify mod_perl (1.0) as a dependency and won't work 
with 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


Hi!

Since I am automating the download for the dependencies in the 
Makefile.PL, I need to let the people know that they cannot 
automatically download mod_perl 2 using my makefile.  They will 
instead need to download it from the appropriate site and install it 
manually.   That is why I am putting a notice in the Makefile.PL. 
speeves
cws







Re: module ported and doc addition...

2003-07-14 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon Eric Peevey wrote:

Shannon Eric Peevey wrote:

Hi!

Just wanted to let everyone know that I have just finished porting 
the Apache-AuthExpire module to work with both modperl1 and 2.  It 
is a: #   Small mod_perl handler to provide 
Authentication phase time outs for
#   sensitive areas, per realm.
There are some issues with konqueror, mozilla and netscape, but 
should be a simple fix if someone is watching the headers

Great, I've updated the online list of ported modules.
Thanks :)


Possible documentation inclusion...?:  When using a ternary 
conditional in conjunction with a conditional operator, I needed to 
enclose the statement with parentheses to force the ternary 
conditional to be executed first.  For example:

   my ($res, $sent_pw) = $r->get_basic_auth_pw;
   return $res if $res !=  (MP2 ? Apache::OK : 
Apache::Constants::OK);  # return not OK status if not OK

well, this is not a mod_perl issue. '=~' has a higher precedence than 
'?:'
http://www.perldoc.com/perl5.8.0/pod/perlop.html#SYNOPSIS

Also, you don't realy have to do that. The old ala mp1 style works 
just fine.

use Apache::Const qw(OK DECLINED)

sub handler {

   return OK;
} 
Well...  I must have been smoking crack, 'cause I seem to remember a simple:

return  MP2 ? Apache::OK : OK

throwing an error, hence, the change to:

MP2 ? Apache::OK : Apache::Constants::OK

Now that I test it, though, there doesn't seem to be a problem...  :P



Took me a while to catch that... :P

speeves
cws
Is J. J. Horner on this list?  (Are you out there...? :)) ) If so, 
can you contact me about getting permissions to upload the 
Apache-AuthExpire mod that I have ported?  (So it can be indexed by 
PAUSE.)

Also, Stas, is there a way that I can get around having to wait for 
an author to upload a ported module?  I am not adding any 
functionality except making it work with both versions of modperl, 
and making additions that the CPAN testers have requested.  I have a 
clear window for now, and would like to keep on porting mods while I 
have a little extra time...


You can always upload a module, however it won't be indexed and then 
it's going to be a pain to reindex, since you will have to ask Andreas 
to do that. So I'd get the permissions resolved first. If you can't 
reach the original author you should email [EMAIL PROTECTED] explaining 
the situation and asking to give you the right perms (nowadays CPAN 
supports co-owners of namespaces).

Meanwhile upload it somewhere online and post the link here, I'll link 
to it from:  /http://perl.apache.org/products/apache-modules.html 
Thanks.  I have received that permission from Mr. Horner since I have 
written this email.  I have contacted the [EMAIL PROTECTED] gang, but 
they haven't responded yet.  (No problems, as I am about to start on 
Apache-AuthNTLM.)  I will upload another version to CPAN when they give 
me authorization. :)

Also, I have ported:

Apache-AuthenPasswd
Apache-AuthzPasswd
with notices as to the limitations of these modules.  (I inherited these 
with the AuthenNIS mods...  Haven't had a chance to port those yet, 
though.)  They have been uploaded and indexed on CPAN.

Also need to get excited about getting the authperlldap mod done as 
well... :)

thanks,
speeves
cws






compile issue: conflicting types for getline

2003-07-10 Thread Stewart, Eric
Apologies for duplication - I've discovered some unexpected behavior with the 
pasting into a W2K session of VPC 6 on Mac 10.2.6 - and then got a little clicky and 
clicked on the wrong thing. :(

On RedHat Linux 9.0, with Apache 1.3.27, PHP 4.3.2, and mod_perl 1.28, I'm getting 
a compile error.  These, near as I know, are the latest "stable" versions of 
everything - which is why I suspect I'm running into this problem:

make[2]: Entering directory `/usr/local/src/apache_1.3.27/src/support'
gcc -c  -I../os/unix -I../include   -DLINUX=22 -D_REENTRANT -D_GNU_SOURCE 
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm  
-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE  `../apaci` htpasswd.c
htpasswd.c:145: conflicting types for `getline'
/usr/include/stdio.h:473: previous declaration of `getline'
make[2]: *** [htpasswd.o] Error 1
make[2]: Leaving directory `/usr/local/src/apache_1.3.27/src/support'
make[1]: *** [build-support] Error 1
make[1]: Leaving directory `/usr/local/src/apache_1.3.27'
make: *** [build] Error 2

I've seen posts that point the finger at mod_perl.  This may be the case as I've 
managed to compile another Apache server without mod_perl on a different system (RH 9 
with PHP).  However, I'm thinking it's more along the lines of a compiler (IOW, 
RedHat's use of gcc 3.2.2) issue.
What I could really use is a solution to get past this point - I'd rather like to 
avoid "downgrading" either my OS or compiler.  I also kind of need the support tools 
including htpasswd, so skipping them in the compile is highly undesired.  ./configure 
options or even Makefile modifications are preferred.  Code patches are acceptable, 
even to some extent expected, but I'm a lazy systems admin, not a programmer ...
Of course, any assistance at all (as repeated and varied searches on groups.google 
and www.google only verify the problem's existence and have yet to provide a solution) 
is welcome and appreciated.

Eric Stewart - Network Admin - USF Tampa Library - [EMAIL PROTECTED]
SCUBA Diver: 220 Dives  Most Recent: 05/10/03 Chankanaab Park, Cozumel
GeoCacher:58 Found  Most Recent: 07/04/03 GCGBHE - Fun in the Sun
http://www.scubadiving.com/talk/ and http://www.geocaching.com/


Compile issue: conflicting typesfinger at mod_perl. This may be the case as I've managed to compile another Apache server without mod_perl on a different system (RH 9 with PHP). However, I'm thinking it's more along the lines of a compiler (IOW, RedHat'

2003-07-10 Thread Stewart, Eric
On RedHat Linux 9.0, with Apache 1.3.27, PHP 4.3.2, and mod_perl 1.28, I'm getting 
a compile error.  These, near as I know, are the latest "stable" versions of 
everything - which is why I suspect I'm running into this problem:

make[2]: Entering directory `/usr/local/src/apache_1.3.27/src/support'
gcc -c  -I../os/unix -I../include   -DLINUX=22 -D_REENTRANT -D_GNU_SOURCE 
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm  
-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE  `../apaci` htpasswd.c
htpasswd.c:145: conflicting types for `getline'
/usr/include/stdio.h:473: previous declaration of `getline'
make[2]: *** [htpasswd.o] Error 1
make[2]: Leaving directory `/usr/local/src/apache_1.3.27/src/support'
make[1]: *** [build-support] Error 1
make[1]: Leaving directory `/usr/local/src/apache_1.3.27'
make: *** [build] Error 2

I've seen pWhat

Eric Stewart - Network Admin - USF Tampa Library - [EMAIL PROTECTED]
SCUBA Diver: 220 Dives  Most Recent: 05/10/03 Chankanaab Park, Cozumel
GeoCacher:58 Found  Most Recent: 07/04/03 GCGBHE - Fun in the Sun
http://www.scubadiving.com/talk/ and http://www.geocaching.com/


Re: Apache::AuthenNTLM problems

2003-06-29 Thread Shannon Eric Peevey
Brett Hales wrote:

On Fri, 2003-06-13 at 01:53, Luiz Carlos (Paulista) wrote:
 

Hi,

 I´m trying to install Apache in a Linux Machine, with mod_perl and AuthenNTLM. I want to authenticate users from a Windows 2000 domain. I don´t want them to be prompted for their username and password. These are the softwares I have installed: Red Hat Linux 8.0, Samba -2.2.8(use winbind for authentication), Apache 2.0.45, mod_perl-1.99_09, Apache-AuthenNTLM-023. My test directory is configured like this: 
		Alias /ntlm/ "/home/httpd/ntlm/"
		
		 PerlAuthenHandler Apache::AuthenNTLM
		 AuthType  ntlm,basic
		 AuthName  NTLM-AREA
		 Require valid-user
		 PerlAddVar ntdomain "sede  BATUTAS"
		 PerlSetVar defaultdomain sede
		 PerlSetVar ntlmdebug 1
		
Also I have included in httpd.conf the following statements for mod_perl
		LoadModule perl_module  modules/mod_perl.so
		PerlRequire /home/httpd/perl/startup.pl
		PerlSwitches -wT

I am not expert neither in Linux nor in Perl and I would apreciate any sugestions.

 

I have this successfully working with Mod_Perl 1.27

When you get this working can you please test something for me, change
your Windows password to include a : (colon). I believe that there is a
bug in the AuthenNTLM module and would like somebody else to verify
this.
 

Thanks,
Luiz Carlos
-8<-- Start Bug Report 8<--
1. Problem Description:
When I try to access the URL the following error is received by IE 6.0 browser:
Internal Server Error
The server encountered an internal error or misconfiguration and was 
unable to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform 
them of the time the error occurred, and anything you might have done that may have 
caused the error.
More information about this error may be available in the server error 
log.
Apache/2.0.45 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.45 
OpenSSL/0.9.6b Server at catapulta Port 80
The error loged in error_log is:
Use of uninitialized value.
[Fri May 30 07:24:37 2003] [error] [client 192.168.1.73] Can't call method 
"connection" on an undefined value at 
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/AuthenNTLM.pm line 480.
Line 480 in AuthenNTLM.p is the following:
sub handler ($$)
{
my ($class, $r) = @_ ;
my $type ;
my $nonce = '' ;
my $self ;
my $conn = $r -> connection ;
my $connhdr = $r -> header_in ('Connection') ;   (LINE 480 
REPORTED IN THE BROWSWER)
my $fh = select (STDERR) ;
$| = 1 ;
select ($fh) ;
I have also noticed that the handle module AuthenNTLM.pm (line 32) was trying to use Apache::Constants. This module does not exist. So, I changed it to Apache::Const. After that I have been faced to the error in line 480.
 

2. Used Components and their Configuration:

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
 MP_AP_PREFIX   => /usr/local/apache2
 MP_COMPAT_1X   => 1
 MP_GENERATE_XS => 1
 MP_LIBNAME => mod_perl
 MP_USE_DSO => 1
 MP_USE_STATIC  => 1
*** /usr/local/apache2/bin/httpd -V
Server version: Apache/2.0.46
Server built:   Jun  2 2003 11:21:42
Server's Module Magic Number: 20020903:3
Architecture:   32-bit
Server compiled with
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/usr/local/apache2"
-D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
 Platform:
   osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi> 
   uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux '
   config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr'
   hint=recommended, useposix=true, d_sigaction=define
   usethreads=define use5005threads=undef useithreads=def

Re: Stupid question of the day...

2003-06-29 Thread Shannon Eric Peevey
Randy Kobes wrote:

On Wed, 25 Jun 2003 [EMAIL PROTECTED] wrote:

 

I've built and installed a new Apache (2.0.46) with mod_ssl and
mod_perl... My goal is authentication via NIS, so I have the
following in an .htaccess file:
AuthName TEST
AuthType Basic
PerlAuthenHandler Apache::AuthenNIS;
require valid-user
My efforts, however, have been thwarted by the following error message:

Wed Jun 25 15:44:54 2003] [error] failed to resolve handler
`Apache::AuthenNIS;' [Wed Jun 25 15:44:55 2003] [error] [client
xxx.xxx.xxx.xxx] Can't locate object method "boot" via package
"mod_perl::boot" at /opt/apache/lib/perl/Apache/Constants.pm
line 8. Compilation failed in require at
/opt/apache/lib/perl/Apache/AuthenNIS.pm line 4. BEGIN
failed--compilation aborted at
/opt/apache/lib/perl/Apache/AuthenNIS.pm line 4. Compilation
failed in require at (eval 6) line 1.
   

Apache::Constants is a mod_perl 1 package, whereas you're using
mod_perl 2 (for Apache 2). If use of Apache::compat isn't enough
to get this working, some porting of the module may be required -
see the discussion of porting Apache Perl modules from mod_perl 1
to 2 at http://perl.apache.org/.
 

Feel free to contact me, as well.  I have contacted the author about 
porting the module, and if I can use you as a test environment, I can 
this ported rather quickly :)  (I don't have a NIS environment for me to 
test on, but I can make the changes, and you can test the install for 
me, and then we can get this mod to work for both versions of modperl...)

Anyone have an installation of apache 1 that is using NIS for 
authentication?  (I will need to be able to test the ported mod for 
compatibility with modperl 1, as well.)

speeves
cws
PS  We should probably attack Apache::AuthzNIS at the same time...  It 
isn't much more work :)



informational notice in Makefile.PL

2003-06-22 Thread Shannon Eric Peevey
Hi!

In an attempt to simplify the install process for dependencies with my 
modules, I have been using the ExtUtils::AutoInstall module.  (Great 
module, BTW :) )  But, with the current state of affairs with mod_perl 
and its availability from CPAN, I wanted to through an information 
notice to the effect of, "if you are planning to use mod_perl2 and 
apache2, you will have to answer no here, and manually download it from 
perl.apache.org..."  I contacted Autrijus Tang, the maintainer of 
ExtUtils::AutoInstall, and asked him if it was possible, (I didn't see 
it documented), and he answered with this:

   # notify the user about mod_perl 2
   BEGIN { print q{
    NOTICE *
   If you are planning to use mod_perl2 and Apache2, please, do not
   answer yes when prompted to install mod_perl.  You will need to
   download mod_perl2 manually from
   http://perl.apache.org/download/index.html
   *
   } }
I placed it after the first BEGIN block and voila! I am communicating :)

Hope this helps someone.

speeves
cws


Re: module ported and doc addition...

2003-06-19 Thread Shannon Eric Peevey
Shannon Eric Peevey wrote:

Hi!

Just wanted to let everyone know that I have just finished porting the 
Apache-AuthExpire module to work with both modperl1 and 2.  It is a: 
#   Small mod_perl handler to provide Authentication phase 
time outs for
#   sensitive areas, per realm.
There are some issues with konqueror, mozilla and netscape, but should 
be a simple fix if someone is watching the headers

Possible documentation inclusion...?:  When using a ternary 
conditional in conjunction with a conditional operator, I needed to 
enclose the statement with parentheses to force the ternary 
conditional to be executed first.  For example:

   my ($res, $sent_pw) = $r->get_basic_auth_pw;
   return $res if $res !=  (MP2 ? Apache::OK : 
Apache::Constants::OK);  # return not OK status if not OK

Took me a while to catch that... :P

speeves
cws
Is J. J. Horner on this list?  (Are you out there...? :)) )  

If so, can you contact me about getting permissions to upload the 
Apache-AuthExpire mod that I have ported?  (So it can be indexed by PAUSE.)

Also, Stas, is there a way that I can get around having to wait for an 
author to upload a ported module?  I am not adding any functionality 
except making it work with both versions of modperl, and making 
additions that the CPAN testers have requested.  I have a clear window 
for now, and would like to keep on porting mods while I have a little 
extra time...

Thanks!

speeves
cws



module ported and doc addition...

2003-06-19 Thread Shannon Eric Peevey
Hi!

Just wanted to let everyone know that I have just finished porting the 
Apache-AuthExpire module to work with both modperl1 and 2.  It is a:  

#   Small mod_perl handler to provide Authentication phase 
time outs for
#   sensitive areas, per realm. 

There are some issues with konqueror, mozilla and netscape, but should 
be a simple fix if someone is watching the headers

Possible documentation inclusion...?:  When using a ternary conditional 
in conjunction with a conditional operator, I needed to enclose the 
statement with parentheses to force the ternary conditional to be 
executed first.  For example:

   my ($res, $sent_pw) = $r->get_basic_auth_pw;
   return $res if $res !=  (MP2 ? Apache::OK : Apache::Constants::OK);  
# return not OK status if not OK

Took me a while to catch that... :P

speeves
cws



Re: Few Important Questions

2003-06-19 Thread Eric Cholet


Mustafa Tan wrote:

Hi Everybody,
mod_perl is a great software. Thanks for everybody who
spent time on it and make it available. When you send
a reply to this, can you also describe how we can
help, as an individiual, to support mod_perl and
people behind it financially.
Mustafa, one way to provide financial support is
a donation:
http://www.apache.org/foundation/contributing.html

There's a paypal button on that page, and an address
for sending checks. The ASF is a non profit org which
makes donations tax deductible.
mod_perl relies on the ASF infrastructure for its
CVS server, mailing lists and web sites.
Donations help fund these infrastructure expenses.
Thanks!

--
Eric Cholet


doc discrepancy?

2003-06-18 Thread Shannon Eric Peevey
Hi!

Just doing some late night reading, and found something in the second 
paragraph under the PerlAuthenHandler heading in the following webpage:

http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlAuthenHandler



According to:

http://perl.apache.org/docs/2.0/user/porting/compat.html#Deprecated_Constants

AUTH_REQUIRED is depracated in favor of HTTP_UNAUTHORIZED.

Is Apache actually returning AUTH_REQUIRED, which is then aliased behind 
the scenes?  (I have been using HTTP_UNAUTHORIZED successfully in 
conjunction with both versions of modperl...)

thanks,
speeves
cws





Apache::Auth*LDAP modules going bye-bye...?

2003-06-17 Thread Shannon Eric Peevey
Hi!

I have installed Apache::AuthenLDAP into my apache 1.3 test machine, and 
found that version 0.61 does not work with perl-ldap 0.28 (aka 
Net::LDAP)  Since there has not been an update to this module since July 
12, 2001, I think that it is safe to say that there is no interest in 
continuing to support this module.  (BTW, I found the same offending 
code in Apache::AuthzLDAP.)

I have compared the functionality of these two module to 
Apache::AuthNetLDAP and Apache::AuthzNetLDAP, and found that the latter 
two modules contain all of the functionality of the Bodnar/Gilmore 
modules, plus some.  (NOTE:  Apache::AuthzLDAP does have a NestedGroups 
functionality that will allow recursive searching through... nested 
groups ;)  Is this useful for anyone?  If so, then we can add it into 
Apache::AuthzNetLDAP.)  Therefore, I have come to the conclusion that we 
will not need to port these modules to modperl2...  Any dissenters?

Also, after perusing the code in both Apache::AuthPerLDAP and 
Apache::AuthLDAP, both of which have not been updated in over 4 years, I 
see that all functionality is also available in Apache::AuthNetLDAP.   I 
also think that I will bypass porting these modules as well.  Again, any 
dissenters?

speeves
cws


Re: list of ported modules?

2003-06-17 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon Eric Peevey wrote:

Hi!

Is there a list of CPAN modules that have already been ported to work 
with mod_perl2?


Not at the moment, but it's a great idea. Where should we add it? I 
suppose that this should be a short-life document and eventually it 
will be removed. So we can put it anywhere.

there is: http://perl.apache.org/products/apache-modules.html
we could put a section there.
That looks like a great place to me :)  (BTW, should we make it 
dynamically updateable, to encourage participation in the list?)

What do we have now:

Already ported:
---
CGI
CGI::Cookie
Apache::Peek 
Apache::AuthNetLDAP
Apache::AuthzNetLDAP


In the process:

Module   Porters

Apache::MP3  Stas Bekman/Clemens Schrimpe <[EMAIL PROTECTED]>
Apache::Scoreboard   Stas Bekman
Apache::VMonitor Stas Bekman
Apache::AuthPerLDAP  Shannon Eric Peevey <[EMAIL PROTECTED]>

Anything else I have missed? If you have ported a module or in the 
middle of porting please tell us. the latter should list the email of 
the porter so the interested parties can help with the porting.

> If so, can I add my two modules to it?
> (Apache::AuthNetLDAP and Apache::AuthzNetLDAP).
are they on CPAN already? 
Yes :)  I uploaded Apache::AuthzNetLDAP yesterday.

speeves
cws


list of ported modules?

2003-06-16 Thread Shannon Eric Peevey
Hi!

Is there a list of CPAN modules that have already been ported to work 
with mod_perl2?  If so, can I add my two modules to it? 
(Apache::AuthNetLDAP and Apache::AuthzNetLDAP).

thanks,
speeves
cws


Re: How practical is that Practical mod_perl?

2003-06-16 Thread Eric Cholet
Stas Bekman wrote:

[...]
BTW, Eric is working on creating a new site for http://modperlbook.org/
which will include the source code, errata and other useful information.
We will let you know when this work has been completed.
I've just put it online.

Enjoy,

--
Eric Cholet


Maintainers of Apache::*LDAP packages...?

2003-06-14 Thread Shannon Eric Peevey
Hi!

I have just finished porting Apache::AuthNetLDAP to work with both modperl 1 
and 2.  I have been looking at some of the other packages that are lurking in 
this same arena, (ie Apache::AuthPerLDAP, Apache::AuthzLDAP, 
Apache::AuthzNetLDAP, Apache::AuthenLDAP, etc.), and was wondering what the 
general thoughts were about porting these as well...?  Or, since they are all 
similar, should I focus on subsuming all of the modules into the more 
appropriately named Apache::AuthenLDAP and Apache::AuthzLDAP?

Thanks,
-- 
Shannon Eric Peevey - "speeves"
Computer Systems Manager
UNT - Central Web Support
(940)369-8876


-
This mail sent through IMP: http://horde.org/imp/


Re: Simple DAV Server?

2003-06-11 Thread Shannon Eric Peevey
Trevor Phillips wrote:

On Wednesday 11 June 2003 05:13, you wrote:
 

Trevor Phillips wrote:
   

I'm quite suprised at the limited amount of custom DAV server uses. I
mean, here's a protocol for editing content over HTTP, which to me
screams as an ideal solution for, say, editing full HTML content within a
DB/CMS.
 

I think the problem with webDAV, as a protocol through which to
manipulate web pages, lies in the fact that it is difficult to
manipulate dynamic content without sending the rendered content to the
client, instead of the true source. (Phew!!  That was long winded... :P
)  The only way that I have found to do it, is to either break the web
server, (ie publish to a web server that doesn't have the dynamic
language engine installed), or... (I don't know of another solution that
works... :( )
   

I'm aware of the issue, but don't see it as a show-stopper. You could use an 
alternate URL to direct DAV handling to a different handler. 
ie; 
 To view: /path/to/content/
 To edit: /dav/path/to/content/
... where the module associated with /dav/ knows how to retrieve the raw 
content (be it files, or a map to DB-stored content) of the normal path.

When viewing the content, you could provide links to the "edit" version of the 
URL.

 

This is probably not the appropriate venue for a discussion on webDAV, 
but I feel that this type of work-around, which I use, is not 
appropriate.  I think that there will need to be an addition to HTTP, 
which will define the difference between a GET for viewing content, and 
a GET for publishing...  Since webDAV is a standard, it should be 
possible to argue the need for such a device.  If we can get that device 
introduced into HTTP, then after a time, client applications will be 
altered to work thus, and voila!!

Until then, I find this approach to be less than satisfactory

speeves
cws



Re: Simple DAV Server?

2003-06-10 Thread Shannon Eric Peevey
Trevor Phillips wrote:

I'm quite suprised at the limited amount of custom DAV server uses. I mean, 
here's a protocol for editing content over HTTP, which to me screams as an 
ideal solution for, say, editing full HTML content within a DB/CMS.
 

I think the problem with webDAV, as a protocol through which to 
manipulate web pages, lies in the fact that it is difficult to 
manipulate dynamic content without sending the rendered content to the 
client, instead of the true source. (Phew!!  That was long winded... :P 
)  The only way that I have found to do it, is to either break the web 
server, (ie publish to a web server that doesn't have the dynamic 
language engine installed), or... (I don't know of another solution that 
works... :( )

See this URL for more info:

http://www.webdav.org/mod_dav/install.html#complex

speeves
cws


Re: modules that work with both modperl1 and 2

2003-06-10 Thread Shannon Eric Peevey
Stas Bekman wrote:

speeves wrote:

Stas Bekman wrote:
[...]

http://search.cpan.org/src/STAS/Apache-Peek-1.01/t/response/TestApachePeek/basic.pm 


This source code was the saving grace for me.  If we could add the link 
to:  

http://search.cpan.org/src/STAS/Apache-Peek-1.01/t/response/TestApachePeek/basic.pm 

into the documentation, that would be great.


hat did it!!!  Thank you so much for your patience and help with all 
that I am working on here.  After I test these changes on modperl 1 
tomorrow, I should be able to upload it to CPAN, and it will be ready 
for prime-time...  (fingers crossed ;) )


Based on your porting experience if you have additions/corrections to 
these two documents:
http://perl.apache.org/docs/2.0/user/porting/porting.html
http://perl.apache.org/docs/2.0/user/porting/compat.html
please submit those here.

BTW, I have updated the info on the constants:
http://perl.apache.org/docs/2.0/user/porting/compat.html#mod_perl_1_0_and_2_0_Constants_Coexistence 

__
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
Also, it would probably be nice to have a link from:

http://perl.apache.org/docs/2.0/user/porting/porting.html#Making_Code_Conditional_on_Running_mod_perl_Version 

to

http://perl.apache.org/docs/2.0/user/porting/compat.html#mod_perl_1_0_and_2_0_Constants_Coexistence

that would help the "porter" to understand the overall picture of what 
needs to be done to allow the single code-base to work with both 
mod_perls...

Finally, I found that the PAUSE server did not recognize the $VERSION 
number, (returned as undef), until I placed it above the BEGIN {} block 
as following:

package Apache::AuthNetLDAP;

use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use Net::LDAP;
use mod_perl;
require Exporter;

@ISA = qw(Exporter AutoLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(
);
$VERSION = '0.21';
# setting the constants to help identify which version of mod_perl
# is installed
use constant MP2 => ($mod_perl::VERSION >= 1.99);
# test for the version of mod_perl, and use the appropriate libraries
BEGIN {
   if (MP2) {
   require Apache::Const;
   require Apache::Access;
   require Apache::Connection;
   require Apache::Log;
   require Apache::RequestRec;
   require Apache::RequestUtil;
   Apache::Const->import(-compile => 'HTTP_UNAUTHORIZED','OK');
   } else {
   require Apache::Constants;
   Apache::Constants->import('HTTP_UNAUTHORIZED','OK');
   }
}
# Preloaded methods go here.

#handles Apache requests
sub handler {
   ...
}
Thanks again for all of your help!  If you know of any modules that need 
porting in a like manner, feel free to contact me and I would be happy 
to help out.

speeves
cws


Re: modules that work with both modperl1 and 2

2003-06-09 Thread Shannon Eric Peevey
Perrin Harkins wrote:

On Mon, 2003-06-09 at 13:57, Shannon Eric Peevey wrote:
 

Yeah, I've been messing with that, but it seems to me that I need 
something similar to a preprocessor directive, where I can load the 
appropriate "use MODULE" lines into the module bases upon which version 
of modperl they have installed.  Is it possible to use the BEGIN {} 
subroutine as this?
   

You don't need a preprocessor.  You can call require inside an if/else
conditional, unlike use() statements which run at compile time and skip
the conditional logic.
For example:

if ($mod_perl::VERSION >= 1.99) {
 require Apache2::Module;
 import Apache2::Module;
} else {
 require Apache1::Module;
 import Apache1::Module;
}
You can put that whole construct in a BEGIN block if you want to.  That
will make it run before the rest of the code in the current package.
- Perrin

Ok, I'm back... :(  Here is the code, modified to use "require":

use mod_perl;

# setting the constants to help identify which version of mod_perl
# is installed
use constant MP2 => ($mod_perl::VERSION >= 1.99);
# test for the version of mod_perl, and use the appropriate libraries
# if (!MP2) { use Apache::Constants qw(:common); }
if (MP2) {
   require Apache::Const;
   import Apache::Access;
   require Apache::Access;
   import Apache::Access;
   require Apache::Connection;
   import Apache::Connection;
   require Apache::Log;
   import Apache::Log;
   require Apache::RequestRec;
   import Apache::RequestRec;
   require Apache::RequestUtil;
   import Apache::RequestUtil;
}
Here is the code that is coughing up the error:

 102   #Look for user based on UIDAttr
   103
   104my $attrs = ['dn'];
   105   $mesg = $ldap->search(
   106   base => $basedn,
   107   scope => 'sub',
   108   filter => "($uidattr=$user)",
   109   attrs => $attrs
   110  );
   111
   112 if (my $error = $mesg->code())
   113{
   114 $r->note_basic_auth_failure;
   115 MP2 ? $r->log_error("user $user: LDAP Connection Failed: 
$error",$r->uri) : $r->log_reason("us
er $user: LDAP Connection Failed: $error",$r->uri);
   116 MP2 ? return Apache::Log->HTTP_UNAUTHORIZED : return 
Apache::Constants->HTTP_UNAUTHORIZED;
   117}
   118
   119unless ($mesg->count())
   120{
   121 $r->note_basic_auth_failure;
   122 MP2 ? $r->log_error("user $user: user entry not found 
for filter: $uidattr=$user",$r->uri) : $
r->log_reason("user $user: user entry not found for filter: 
$uidattr=$user",$r->uri);
   123 MP2 ? return Apache::Log->HTTP_UNAUTHORIZED : return 
Apache::Constants->HTTP_UNAUTHORIZED;
   124}

And, here is the error that I am getting in the Apache2 logs, (using 
mod_perl 1.99_09)

[Mon Jun 09 13:45:30 2003] [error] user asdf: user entry not found for 
filter: uid=asdf/
[Mon Jun 09 13:45:30 2003] [error] [client 127.0.0.1] Can't locate 
object method "HTTP_UNAUTHORIZED" via package "Apache::Log" (perhaps you 
forgot to load "Apache::Log"?) at 
/usr/local/share/perl/5.6.1/Apache/AuthNetLDAP.pm line 123.

As you can see, it is running everything up to the HTTP_UNAUTHORIZED 
constant...

If you have any ideas, I would greatly appreciate it. :)

Thanks,
speeves
cws
PS.  As a matter of fact, I get the same error when using "use" 
instead...  (Possibly a screwed perl or mod_perl installation?  I'm 
running debian woody, apache 2.0.46, perl 5.6.1, mod_perl 1.99_09.)





Re: modules that work with both modperl1 and 2

2003-06-09 Thread Shannon Eric Peevey
Perrin Harkins wrote:

On Mon, 2003-06-09 at 12:12, Shannon Eric Peevey wrote:
 

PS Am having problems with the compile time loading of modules depending 
on the existence of either modperl1 or 2...  "use" dies and "require" is 
not importing the symbols correctly at runtime...
   

If you read the docs for "use" (perldoc -f use), you will see that "use"
is just like:
BEGIN { require Module; import Module LIST; }

If you want to import things correctly when using require, you have to
call import yourself.
- Perrin
 

Yeah, I've been messing with that, but it seems to me that I need 
something similar to a preprocessor directive, where I can load the 
appropriate "use MODULE" lines into the module bases upon which version 
of modperl they have installed.  Is it possible to use the BEGIN {} 
subroutine as this?

speeves
cws



modules that work with both modperl1 and 2

2003-06-09 Thread Shannon Eric Peevey
Hi!

Just wondering if anyone knows of a perl module that is coded to work 
with modperl1 and 2?  I am hitting a wall in getting my module to do 
that, and want to cheat a little off of someone who already has... ;)

thanks,
speeves
cws
PS Am having problems with the compile time loading of modules depending 
on the existence of either modperl1 or 2...  "use" dies and "require" is 
not importing the symbols correctly at runtime...  My bad for not 
completely understanding how to use "require".  (Am trying to work this 
out as we speak.)  Thanks again!



Re: [mp2] make test fails to start httpd

2003-06-05 Thread Eric Schwartz
On Wednesday, Jun 4, 2003, at 11:52 America/Denver, Dave wrote:
I am having the exact same test failure results on openbsd, and the
archives show that some people have had similar problems, with no
resolution that I have seen.
what happens if you manually run

/usr/local/apache2/bin/httpd -X -d ./t -f cont/httpd.conf

from within the toplevel mod_perl-1.99_09 directory?
It segfaults, just as you suspected.  The trace appears to be in 
libperl.so as well:

(gdb) bt
#0  0x005de974 in Perl_hv_store_flags ()
#1  0x005e1274 in Perl_hv_fetch ()
#2  0x0058e300 in Perl_gv_fetchpv ()
#3  0x005a1d24 in S_pending_ident ()
#4  0x00592418 in Perl_yylex ()
#5  0x005ad3d4 in Perl_yyparse ()
#6  0x00614f4c in S_doeval ()
#7  0x00616550 in Perl_pp_require ()
#8  0x005e49a8 in Perl_runops_standard ()
#9  0x00588910 in Perl_call_sv ()
#10 0x0058c448 in S_call_list_body ()
#11 0x0058bfcc in Perl_call_list ()
#12 0x005b9fb8 in Perl_newATTRSUB ()
#13 0x005b4e5c in Perl_utilize ()
#14 0x005ae000 in Perl_yyparse ()
#15 0x00614f4c in S_doeval ()
#16 0x00616550 in Perl_pp_require ()
#17 0x005e49a8 in Perl_runops_standard ()
#18 0x00588910 in Perl_call_sv ()
#19 0x0058c448 in S_call_list_body ()
#20 0x0058bfcc in Perl_call_list ()
#21 0x005b9fb8 in Perl_newATTRSUB ()
#22 0x005b4e5c in Perl_utilize ()
#23 0x005ae000 in Perl_yyparse ()
#24 0x00614f4c in S_doeval ()
#25 0x00616550 in Perl_pp_require ()
#26 0x005e49a8 in Perl_runops_standard ()
#27 0x00588910 in Perl_call_sv ()
#28 0x0058c448 in S_call_list_body ()
#29 0x0058bfcc in Perl_call_list ()
#30 0x005b9fb8 in Perl_newATTRSUB ()
#31 0x005b4e5c in Perl_utilize ()
#32 0x005ae000 in Perl_yyparse ()
#33 0x00614f4c in S_doeval ()
#34 0x00616550 in Perl_pp_require ()
#35 0x005e49a8 in Perl_runops_standard ()
#36 0x00588e2c in Perl_eval_sv ()
#37 0x0058916c in Perl_require_pv ()
#38 0x00458a1c in modperl_require_file ()
#39 0x004549fc in modperl_config_apply_PerlRequire ()
#40 0x00452864 in modperl_startup ()
#41 0x00452eb8 in modperl_hook_init ()
#42 0x00455bbc in modperl_cmd_load_module ()
#43 0x000363a4 in invoke_cmd (cmd=0x46a9dc, parms=0xbb30, 
mconfig=0x343708, args=0x34e220 "TestDirective::perlloadmodule") at 
config.c:828
#44 0x00036a64 in ap_walk_config_sub (current=0x34e200, 
parms=0xbb30, section_vector=0x3020a8) at config.c:1082
#45 0x00036b04 in ap_walk_config (current=0x34e200, parms=0xbb30, 
section_vector=0x3020a8) at config.c:1121
#46 0x00037678 in ap_process_config_tree (s=0x300c58, 
conftree=0x3439c8, p=0x2fe548, ptemp=0x33e058) at config.c:1594
#47 0x00023f98 in main (argc=6, argv=0xbccc) at main.c:638
#48 0x28bc in _start (argc=6, argv=0xbccc, envp=0xbce8) at 
/SourceCache/Csu/Csu-45/crt.c:267
#49 0x273c in start ()

-=Eric



[mp2] make test fails to start httpd

2003-06-04 Thread Eric Schwartz
1. Problem Description:

  'make' test fails to start httpd:

$ make test
cd "src/modules/perl" && make -f Makefile.modperl
make[1]: Nothing to be done for `all'.
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
APACHE_USER= APACHE_GROUP= APACHE_PORT= APACHE= APXS= \
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose=0
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -verbose=0
/usr/local/apache2/bin/httpd  -d /usr/local/src/mod_perl-1.99_09/t -f 
/usr/local/src/mod_perl-1.99_09/t/conf/httpd.conf -DAPACHE2
using Apache/2.0.46 (prefork MPM)

waiting for server to start: ..[Wed Jun 04 00:11:21 2003] [info] 19 
Apache:: modules loaded
[Wed Jun 04 00:11:21 2003] [info] 3 APR:: modules loaded
[Wed Jun 04 00:11:21 2003] [info] base server + 8 vhosts ready to run 
tests

waiting for server to start: giving up after 61 secs
!!! server failed to start! (please examine t/logs/error_log)
make: *** [run_tests] Error 1

So I examine t/logs/error_log as it suggests:

$ cat t/logs/error_log
END in modperl_extra.pl, pid=19220
modperl_extra.pl doesn't yield any obvious other places to look for 
help, so I'm stumped.

2. Used Components and their Configuration:

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX   => /usr/local/apache2
  MP_COMPAT_1X   => 1
  MP_GENERATE_XS => 1
  MP_LIBNAME => mod_perl
  MP_USE_DSO => 1
  MP_USE_STATIC  => 1
*** /usr/local/apache2/bin/httpd -V
Server version: Apache/2.0.46
Server built:   Jun  3 2003 23:00:54
Server's Module Magic Number: 20020903:3
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_MMAP
 -D APR_USE_POSIXSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local/apache2"
 -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
osname=darwin, osvers=6.6, archname=darwin
uname='darwin eric-schwartzs-computer.local. 6.6 darwin kernel 
version 6.6: thu may 1 21:48:54 pdt 2003; 
root:xnuxnu-344.34.obj~1release_ppc power macintosh powerpc '
config_args='-de -Dprefix=/usr [EMAIL PROTECTED] 
[EMAIL PROTECTED]'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-pipe -fno-common -no-cpp-precomp 
-fno-strict-aliasing',
optimize='-O3',
cppflags='-no-cpp-precomp -pipe -fno-common -no-cpp-precomp 
-fno-strict-aliasing -pipe -fno-common -no-cpp-precomp 
-fno-strict-aliasing'
ccversion='', gccversion='3.1 20020420 (prerelease)', 
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
alignbytes=8, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -flat_namespace'
libpth=/usr/lib
libs=-lm -lc
perllibs=-lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, 
libperl=libperl.dylib
gnulibc_version=''
  Dynamic Linking:
dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -flat_namespace -bundle -undefined 
suppress'

Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under darwin
  Compiled at Jun  1 2003 13:20:13
  %ENV:
PERL5LIB="/sw/lib/perl5"
PERL_LWP_USE_HTTP_10="1"
  @INC:
/sw/lib/perl5/darwin
/sw/lib/perl5
/Library/Perl/darwin
/Library/Perl
/Library/Perl/darwin
/Library/Perl
/Library/Perl
/Network/Library/Perl/darwin
/Network/Library/Perl
/Network/Library/Perl
.
This report was generated by -e on Wed Jun  4 06:10:09 2003 GMT.



[mp2.0] Can't locate object method "push_handlers" via package"Apache::RequestRec"

2003-02-23 Thread Eric A. Zarko
I am a little rusty (switched to telecomm ... just doing some web work on
the side now), but my script "looks" okay to me.  The archive and many
hours to trying different things do not seem to be helping.  Has anyone
seen this before, or can you see a problem with it?  TIA

System Info
===
# uname -a
Linux localhost.localdomain 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686
i686 i386 GNU/Linux
# rpm -q mod_perl
mod_perl-1.99_05-3
# rpm -q httpd
httpd-2.0.40-8

Conf snippet


# This mod_perl Output filter wraps html output in the standard template
PerlOutputFilterHandler InfoMart::TemplateOutputFilter
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all



PerlFixupHandler InfoMart::SessionFixupHandler


SessionFixupHandler.pm
==
#!/usr/bin/perl

package InfoMart::SessionFixupHandler;

use strict vars;
use warnings;

use Apache2 ();

use Apache::RequestRec ();
use Apache::RequestIO ();

use APR::Table ();

use Apache::Const -compile => 'OK';

use CGI::Cookie;
#use Apache::Session::Postgres;

sub handler {
  my $r = shift;

  my $table = $r->headers_in();
  my $cookies = parse CGI::Cookie($table->get("Cookie"));

  my $sessionID = ($cookies && $cookies->{'sessionID'} ?
$cookies->{'sessionID'}->value : undef);

#TODO: validate the sessionID.  set $sessionID to undef if invalid

  if (!defined($sessionID)) {
$r->handler('modperl');
$r->push_handlers(PerlResponseHandler => sub {set_cookie});
  } else {
$r->notes->set(sessionID => "$sessionID");
#my %session;
#tie %session, Apache::Session::Postgres, $sessionID, {
#  DataSource => 'dbi:Pg:dbname=sessions',
#  Commit => 1
#};
#$session{"foo"}="bar";
#$r->notes->set('session' => \%session);
  }

  return Apache::OK;
}

sub set_cookie {
  my $r = shift;

#  my %session;
#  tie %session, Apache::Session::Postgres, undef, {
#DataSource => 'dbi:Pg:dbname=sessions',
#Commit => 1
#  };
  my $sessionID = 'foo';
#  my $sessionID = $session{_session_id};
  my $cookie = CGI::cookie(-name=>"sessionID",
   -value=>$sessionID,
   -expires=>"+1h",
   -path=>"/",
   -domain=>"www.miabusinc.com",
  );
  $r->err_headers_out->add('Set-Cookie' => $cookie);
  $r->headers_out->set(Location => 
"http://www.miabusinc.com/cgi-bin/cookie_check.cgi?src=";.($r->uri));
  $r->status(302);
  $r->send_http_header;

  return Apache::OK;
}

1;


Error
=
[Sun Feb 23 21:26:07 2003] [error] [client 12.236.181.139] Can't locate
object method "push_handlers" via package "Apache::RequestRec" at
/usr/lib/perl5/site_perl/5.8.0/InfoMart/SessionFixupHandler.pm line 33.



Re: Apache::Cookie - weird values returned...

2003-02-10 Thread Eric Sammer
Rob Lambden wrote:


I've had problems with scripts and mod_perl code before where I
inadvertently create 
keys in a hash when I'm testing to see if they exist.  I now always use
something
Like:

i always use either defined or exists as appropriate to avoid these 
errors. i've gotten bitten in the bottom by the same things many times 
in the past... i learned my lesson. ;)

> If the
key did not exist previously it may be created by this process.  The key
can exist but 
hold an undefined value.

again, in this case, the key is an Apache::Cookie object which couldn't 
accidentally be created as a "simple" type like a string key can.

Is this an internal redirect, or a redirect sent from the browser ?  

the logout handler expires the cookie, sets the Location header, and 
returns REDIRECT. in other words, it's not internal nor a subrequest 
(unless a returned REDIRECT with a Location header is still considered a 
subrequest - that would be a surprise to me).

If
it's internal then 
the cookie will still exist unless you deleted the key yourself, and if
you run the request
As a sub-request it can pick up the submitted cookie again even if you
have deleted the key
on your parent request object.


yea... unfortunately, that's not the case here... the browser regains 
control enough to handle the Set-Cookie (again, unless my 
perl/mod_perl/cgi books are all out of date)... ;)

If it's coming back from the browser are you sure that the browser isn't
sending you an empty
Cookie?


the cookie is a real cookie (in the headers) with the absence of the 
value. specifically, the return value of the Apache::Cookie->value() method.

Maybe some users have broken browsers ?


with the current state of things, i'm sure that's part of it. :)

that said, there's always a limited set of options on that front. most 
of my (personal) testing is with mozilla on linux built from source 
(gentoo portage, actually) but similar behavior is seen on my mac os x 
boxes.

You might also want to check hoe the cookie gets expired.  What is the
expiry date that is set
on the Set-cookie: header that goes back to the client, and what is the
date on that machine?


the expire *i'm* specifying is just a relative '-1D' to cause the 
browser to drop it. if there's a better way, i'm certainly open to 
suggestions.

Could you make do with per-session cookies (which have no expory date,
but are only valid for 
the duration of that browser session) ?


actually, all of these cookies are per-session which is why this isn't a 
"hey, the building is on fire!" sort of problem. the logout is one of 
those superfulous things that might be needed should the non-tech staff 
force us to add the dreaded "save my username/password" feature to the 
site. either way, i'd rather try and get the problem out of the way 
prior to such escalation.

Although it's helpful to get to the bottom of any issue, you might be
more at peace if you
just checked to see if the value of the cookie was valid.  

yea... i suppose that's an option (and it *was* like that). i just get 
scared when something isn't working exactly as i understand it to be. 
it's that age old developer mantra of "unpredictable working code is 
worse than predictable broken code."

After all,
who's to say that the
cookie they're sending you is actually the same as the one you sent them
in the first place ;)



damn browsers... damn cookies. i'm still waiting (and will be for a long 
time to come) for two things: working stateful web development and 
flying cars... something tells me the latter is a more attainable goal. ;)

(Just for the record I don't actually use Apache::Cookie myself I look
in and set the headers)



i used to do that all the time too. i've always felt that abstraction 
prevents errors in the long run (or at least makes them easier to find). 
being wrong sucks.

thanks for the response... i'll give some of these ideas a shot (again, 
where applicable).

--
Eric Sammer
[EMAIL PROTECTED]
http://www.linuxstep.org



Apache::Cookie - weird values returned...

2003-02-07 Thread Eric Sammer
All:

I've got a strange Apache::Cookie issue that seems to have recently 
snuck up on me, although I've seen similar behavior in the past.

I have a PerlAccessHandler called GroupAccess that handles all access to 
a site**. If there's a user_id cookie, it pulls urls allowed to that 
user from a db, otherwise, an "anonymous" set of urls that are allowed - 
certainly not rocket science. The problem is that the logout handler 
(which expires the user_id cookie) kills the cookie and redirects to / 
ok, but when the GroupAccess handler checks if the cookie exists (during 
the / request), $cookies->{user_id}* is defined, but the value seems to 
be an empty string ala "". This really makes things difficult. What is 
weird is that the Apache::Cookie object DOES exist, it's just the value 
that's all wacked out or just plain missing. Could it be bug in 
Apache::Cookie that only shows up during internal redirects (and when 
I'm not looking)? This problem is incredibly difficult to reproduce as 
it only happens about 1 out of ever 30 - 40 times... That said, when it 
does happen, users complain and that's not cool at all.

* $cookies is a hash ref with cookie names as keys and Apache::Cookie 
objects as values.

** The site in question: http://www.bluemonkeystuff.com

Thanks in advance!

--
Eric Sammer
[EMAIL PROTECTED]
http://www.linuxstep.org



name space problem

2003-01-21 Thread eric
Okay,

So I may be a fool for asking this question, but I hope you will all 
forgive me. I am fairly new to Perl and really really new to mod_perl. I am 
working to convert my site to use mod_perl and am having problems with two 
require statements that exist in most of my scripts. 

Basically, the require statements point to two other scripts that are back 
end handler scripts. They are comprised of a couple of subroutines each. 

Everything works great if I don't run the site through mod_perl as you can 
imagine. When I do run the site through mod_perl I get internal server 
errors reported from apache.

The errors in the error_log report: ModPerl::Registry: Undefined subroutine 
&ModPerl::ROOT::ModPerl::Registry::var_www_test_home::doSession called 
at /var/www/test/home line 48.

The line in the home script is: 
my ($user_id,$session_key) = &doSession
($page_number,$command,$secure,$page_name);

with the require line reading: 

require "/var/www/test/session_key.pl";

I'm still reading the numerous web sites that refer to this problem, am 
hoping to find a quick fix/good explanation of this problem.

Thank you,

Eric









Re: [mp2] e-Commerce

2003-01-21 Thread Eric Frazier
Hi,

You know I was all ready on my dev box to start messing around with apache2,
when we had a major evil thing happen on our fancy server. So my dev box had
to become our server. And because I have not had any personal experence with
apache 2, I converted everthing back to 1.x on the dev box.  

But you are right of course, I should not just assume because of hearsay
that Apache2 will be faster. But between the threading, and the file cache
module I *hope* it is faster :) 

Here is one kind of old thing I found on google:
http://www.zend.com/lists/php-dev/200202/msg01675.html

They are focused on PHP, but it seems like there might be some problems with
the DSO only stuff. Weird that it is not easier to find stuf, I would have
expected millions of hits on google for this.  I will definatly will work on
a better test with static and mod_perl  once we get our fancy server back
and post it to the list.  But I can't believe someone on this list hasn't
done that already. 

Thanks,


Eric 

At 06:09 PM 1/21/03 +1100, Stas Bekman wrote:
>Perrin Harkins wrote:
>> Eric Frazier wrote:
>> 
>>> On that note, how about just using Apache2 for the proxy front end, and
>>> mod_perl /apache 1.x for the back end? I have wanted to try to avoid the
>>> thttpd stuff for images and from what I have heard about apache2 it can
>>> handle static pages a lot faster than the 1.x did.
>> 
>> 
>> You really should be able to get more than enough performance out of 1.x 
>> for static files, unless you are using very old hardware.  We used a 
>> slim 1.x build with mod_proxy, mod_ssl, and mod_rewrite for all of our 
>> static files at eToys and it ran like a champ.  It's true that both 
>> thttpd and apache 2 have better performance,
>
>Where did you see the benchmarks showing that Apache 2.0 has a better 
>performance than 1.3? Apache 2.0 should scale better when threads are used (on 
>platforms where threads are faster than processes) and it's definitely a must 
>for win32, but I haven't seen any numbers other than some reports to the 
>httpd-dev list, so I don't know. Also Apache 2.0 provides features like 
>filters, which were almost impossible with 1.3, though how things get slowed 
>down when these are used is a question. Please notice that I'm not saying that 
>2.0 is slower, I'm just asking to see the numbers ;)
>
>__
>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
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: [mp2] e-Commerce

2003-01-20 Thread Eric Frazier
Hi,

On that note, how about just using Apache2 for the proxy front end, and
mod_perl /apache 1.x for the back end? I have wanted to try to avoid the
thttpd stuff for images and from what I have heard about apache2 it can
handle static pages a lot faster than the 1.x did. 


Thanks,

Eric 

At 04:07 PM 1/21/03 +1100, Stas Bekman wrote:
>Ged Haywood wrote:
>
>>>modperl 2 with apache 2 thread is stable enought for start one big 
>>>project of ecommerce?
>> 
>> 
>> If it were my decision I'd say not yet, use mod_perl 1.27 with Apache 1.3.27.
>
>It depends on your needs. The majority of the features is there and should 
>work just fine. The stability can be ensured only when more people will start 
>using it and see that things are stable. So it's a chicken and egg problem.
>
>__
>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
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







web link broken when access cgi-bin

2002-12-21 Thread eric lin
Dear mod_perl reader or user:

  Is the other webiste's link to access mysite's file or photo(jpg), 
not by hypertext but by cgi perl call(that function will show jpg pic)
http://www.mycomapny.com/cgi-bin/showphoto.pl";>

  but it turn out cannot access(I also try /usr/bin/perl 
/usr/lib/cgi-bin/showphot.pl  , it turn out is a dump kind's output, 
then I > mytest.jpg
then at netscape 7 URL, I type /home/enduser/mytest.jpg
it showed:

The image "file:///home/enduser/mytest.jpg" cannot be displayed, because 
it contains errors

) related to mod_perl did not configure or load well?(the locataion of 
picture suppose to be showed redcrss in IE6, or square white in mozilla)

I am using apache 1.3.26 and perl 5.8
please help

--
Sincere Eric
www.linuxspice.com
linux pc for sale



Re: We need help from mod_perl users with technical expertise in non-mainstream OSs

2002-12-19 Thread Eric Frazier
Hi,

I have to say that was the nicest "rant" I have read in some time. I wish I
knew something about those other OS's :( 



Eric 


At 10:35 AM 12/17/02 +0800, Stas Bekman wrote:
>Here at the list we have a rather sucky trend in the last year or so. Those 
>folks who report problems that they have on platforms that aren't *BSD, Linux 
>and Win32 mostly get unasnwered. Doug, who seems to know about everything, 
>used to respond to those souls, but nowadays he's too busy with real work. We 
>have plenty of folks who are kind enough to help others with Linux, BSD 
>flavors and Win32. So we are all dandy on these platforms.
>
>So, my big request is to all the folks on the other platforms, whose users 
>don't get their problems resolved here. If somebody posts a problem that 
>happens on the platform that you use, please try to help that person, even if 
>you don't consider yourself an expert. Many times a participation in the 
>person's quest helps him to find the way on its own. What bugs most people is 
>the silence. Also if you know somebody who may know the answer but not on the 
>list, please take the initiative and try to kindly ask that person to help. 
>And who knows may be he will enjoy to help and do that in the future as well.
>
>Please, stop lurking in the shades, but try to help when you see that nobody 
>else does. Especially if you were helped here before. Remember that you have 
>to give back, if everybody becomes a leech there will be no "blood" left. Also 
>remember that helping others is addictive, you just need to start doing that.
>
>Also remember that we all do mistakes. And we aren't experts in all fields. So 
>if your answer is incorrect, it's not a big problem, since surprisingly, 
>someone, who ignores the original question in first place, immediately posts 
>to correct you. Don't feel bad about that, since you've just learned 
>something. On the opposite feel good about your follow-up, because you tried 
>to help.
>
>So, if my rant wakes anybody out there on SunOS, can you please try to figure 
>out what the problem is with Kenny Smith's report:
>http://mathforum.org/epigone/modperl/sleikrigroo
>
>There are many earlier questions that went unanswered, just go to 
>http://mathforum.org/epigone/modperl and see which posts have no followup, and 
>try to help. It's better late, then never.
>
>__
>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
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







in window, mod perl 1, how to get time?

2002-12-15 Thread eric
since I untar mod perl 2 of apache, I did not have anything in perl's
directory in my C:/Apache2

I have 2 line in my conf/httpd.conf
 
LoadFile "C:/Perl/bin/perl56.dll"
LoadModule perl_module modules/mod_perl.so
 
so my /perl is created my download from perl 1.exe file

so how can I get the time display?

in my .pl file, two lines as
-

 my @time = time;
print "Right now, the elements of the time are: @time";
-
Please help on this
sincere Eric
www.linuxspice.com
linux pc for sale




RE: use http-equiv to refresh the page

2002-11-06 Thread Eric L. Brine

> I just wanted to mention that the meta tag as well as its http-equiv
> attribute are both official parts of the HTML standard and have been for
> quite some time.

Yes and no.

HTML 4.0 has a section on META and http-requiv. In it, it mentions that
"Some user agents support the use of META to refresh the current page after
a specified number of seconds, with the option of replacing it by a
different URI." and proceeds with an example. That sounds more advisory than
part of the standard. But for the sake of argument, let's say it's part of
the standard, and check what HTML 4.01 has to say.

HTML 4.01 also has a section on META and http-requiv. However, the only
reference to "refresh" is: "Note. Some user agents support the use of META
to refresh the current page after a specified number of seconds, with the
option of replacing it by a different URI. Authors should __not__ use this
technique to forward users to different pages, as this makes the page
inaccessible to some users. Instead, automatic page forwarding should be
done using server-side redirects."

I'm guessing this is because http-equiv is designed to hold an HTTP header,
but there is no such thing as an "Refresh" header in HTTP.

So http-equiv="refresh" is no longer standard. Of course, this is all
theoretical. In practice, too many people are not easily swayed by a measily
thing such as a standard.

--
Eric L. Brine   | ICQ: 4629314
[EMAIL PROTECTED] | MSN: [EMAIL PROTECTED]
http://www.adaelis.com/ | AIM: ikegamiii




Re: repost: [mp1.0] recurring segfaults on mod_perl-1.27/apache-1.3.26

2002-10-18 Thread Eric van Oorschot
I experienced the same segfaults after building/installing mod_perl 
1.27, apache_1.3.27.
At first I built  mod_perl inside the apache tree (USE_DSO=1), this 
resulted in 'make test' without any errors, but segfaults as soon as i 
tried to contact the apache server if got errors (Segmentation fault 
(11) in the error.log).
Finally I built mod_perl outside the apache tree, using APXS (the last 
paragraph in README.apaci), copied libperl.so into apache/libexec, and 
now it runs.
(I don't know why, but it works !!)

Eric


[EMAIL PROTECTED] wrote:

Thanks for the reply Ed. Hardware is definitely not at fault. Our site 
proxies requests off to several backend servers and they all segfault 
in the same way. I believe that there's a problem with libapreq or 
with mod_perl itself. Unfortunately I'm not skilled enough in C 
programming (yet) to find the problem.

Thanks anyway Ed, I was wondering if my messages were making it to the 
list at all.





Ed wrote:

Daniel,

Could be bad hardware.  Search google for Signal 11.

Probably your memory (usual cause I've seen).

good luck.

Ed

On Tue, Oct 08, 2002 at 09:46:16AM -0700, [EMAIL PROTECTED] wrote:


Sorry for the repost, but no responses so far, and I need some help 
with this one.

I've managed to get a couple of backtraces on a segfault problem we've
been having for months now. The segfaults occur pretty rarely on the
whole, but once a client triggers one on a particular page, they do not
stop. The length and content of the request are key in making the
segfaults happen. Modifying the cookie or adding characters to the
request line causes the segfaults to stop.

example (word wrapped):


This request will produce a segfault (backtrace in attached gdb1.txt)
and about 1/3 of the expected page :


nc 192.168.1.20 84
GET /perl/section/entcmpt/ HTTP/1.1
User-Agent: Mozilla/5.0 (compatible; Konqueror/3; Linux 2.4.18-5)
Pragma: no-cache
Cache-control: no-cache
Accept: text/*, image/jpeg, image/png, image/*, */*
Accept-Encoding: x-gzip, gzip, identity
Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5
Accept-Language: en
Host: 192.168.1.20:84
Cookie:
mxstsn=1033666066:19573.19579.19572.19574.19577.19580.19576.19558.19560.19559.19557.19567.19566.19568.19544.19553.19545.19551.19554.19546.19548.19547.19532.19535.19533.19538.19534:0; 

Apache=192.168.2.1.124921033666065714


Adding a bunch of zeroes to the URI (which does not change the code
functionality) causes the page to work correctly:


nc 192.168.1.20 84
GET
/perl/section/entcmpt/? 

HTTP/1.1
User-Agent: Mozilla/5.0 (compatible; Konqueror/3; Linux 2.4.18-5)
Pragma: no-cache
Cache-control: no-cache
Accept: text/*, image/jpeg, image/png, image/*, */*
Accept-Encoding: x-gzip, gzip, identity
Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5
Accept-Language: en
Host: 192.168.1.20:84
Cookie:
mxstsn=1033666066:19573.19579.19572.19574.19577.19580.19576.19558.19560.19559.19557.19567.19566.19568.19544.19553.19545.19551.19554.19546.19548.19547.19532.19535.19533.19538.19534:0; 

Apache=192.168.2.1.124921033666065714




Some info:
/usr/apache-perl/bin/httpd -l
Compiled-in modules:
  http_core.c
  mod_env.c
  mod_log_config.c
  mod_mime.c
  mod_negotiation.c
  mod_status.c
  mod_include.c
  mod_autoindex.c
  mod_dir.c
  mod_cgi.c
  mod_asis.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_access.c
  mod_auth.c
  mod_so.c
  mod_setenvif.c
  mod_php4.c
  mod_perl.c



Please forgive any obvious missing info (i'm not a c programmer). The
first backtrace shows the segfault happening in mod_perl_sent_header(),
and the second shows it happening in  the ap_make_array() which was 
from
Apache::Cookie. I don't have one handy now, but I've also seen it 
happen
in ap_soft_timeout() after an XS_Apache_print (r->server was out of 
bounds).

I've added a third backtrace where r->content_encoding contains the
above 'mxstsn' cookie name.




Any help would be greatly appreciated.

--
--
Daniel Bohling
NewsFactor Network




[root@proxy dumps]# gdb  /usr/apache-perl/bin/httpd core.12510
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and 
you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for 
details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `/usr/apache-perl/bin/httpd'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libpam.so.0...done.
Loaded symbols for /lib/libpam.so.0
Reading symbols from /usr/lib/libmysqlclient.so.10...done.
Loaded symbols for /usr/lib/libmysqlclient.so.10
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Re

Re: [OT] Perl vs. PHP..... but where is mod_perl?

2002-10-18 Thread Eric
Hi,

I am always happy to join into some PHP bashing. :)  I feel the same way as 
you. I even tried to like PHP for a while. What really bugs me is the 
situation that I learned about when I first came to work at this job. They 
needed to use PHP to do a POST and the programmer here had chosen CURL. But 
he didn't have any possible way to use CURL without the admin at the 
hosting company recompileing PHP to be able to use it. Sure, it might not 
be the easiest thing in the world to do, but I
have used LWP on local /home/user/lib directories even a local user CPAN 
install isn't all that hard. And then wow! You have the power of a root guy 
all to yourself.

But the other issue I think has more to do with users than the PHP lang 
itself.  It seems like there are LOTS of scripts and comercial products 
written in PHP, most of the ones I have seen make use of the horrible 
including of files all over the place. It is a total nightmare to change or 
debug code like that. I know the guy who was here before me did that, and 
he had good intentions, but it ended up just making a bigger mess than if 
he had just used one big PHP script.


Eric

At 12:23 PM 2002-10-18 -0500, [EMAIL PROTECTED] wrote:






I thought that was rather odd as well. I started in on PHP for a bit
during the summer and eventually dropped it after discovering that OO-PHP
is deprecated by those Zend folks (supposedly it's "slow" and there are no
destructor methods). I also didn't want to deal with their useless use of
sigils and the weird namespacing. If you completely left CPAN out of the
picture then just as a language and syntax it isn't all that nice anyway.
*shrugs* I've yet to understand what the appeal is.

Josh




Cory 'G' Watson <[EMAIL PROTECTED]>
10/18/2002 11:37 AM


To: [EMAIL PROTECTED]
cc:
Subject:Re: [OT] Perl vs. PHP. but where is mod_perl?


Randal L. Schwartz wrote:
> Dzuy> What do you expect from (PHP) amateurs?  Apparently Perl is too
> Dzuy> complicated for them to comprehend,
> Dzuy> never mind mod_perl.
>
> And according to my thread at use.perl
> <http://use.perl.org/~merlyn/journal/8445>, the article just got pulled!

The article says PHP is syntactically similar to C++.  What PHP are they
using?  I picked up PHP in no time because it was nearly indentical to
Perl.  Sure, it's similar to C and C++, but, uhmm, $variable?  Also
mentions Perl has had OO bolted on.  How do they view PHP's OO?  I'm not
bashing PHP, quite the contrary.  But damn, that's just an ignorant
article.  I do wonder what sparked them pulling it out.

--
Cory 'G' Watson





Re: evil scripts kill the server...

2002-10-17 Thread Eric Cholet



--On Wednesday, October 16, 2002 19:48:33 +0100 Ged Haywood 
<[EMAIL PROTECTED]> wrote:

> Hi there,
>
> On Wed, 16 Oct 2002, Joerg Plate wrote:
>
>> >> Is it true that you can kill the whole server, not just the
>> >> script if you do something wrong with mod_perl?
>>
>> > Yes, I'm afraid it is.
>>
>> How?
>
> For example by swallowing all the memory, by consuming all the CPU,
> and of course by making root access available to the world through
> careless programming practice...
>
> Need I continue?

Yes, please explain how careless programming practice can make root
access available to the world. Apache by default runs under the
unpriviliged user 'nobody', seems to me that giving root access to
the world would require running Apache as root, not something which
can be achieved only by careless programming. Am I missing something?

--
Eric Cholet




Re: Apache::DBI and CGI::Application with lots of modules.

2002-10-15 Thread Eric Frazier

Hi,

I had to read that over a few times to get it. And now I see that I do
indeed have that situation, there are a number of times when I call
my $holdstatus = new Holds(); from within a module that also has a new
method. What I don't understand is how does my code work at all? 


Thanks,


Eric 

At 07:13 PM 10/14/02 +0200, Rafiq Ismail wrote:
>On Mon, 14 Oct 2002, Eric Frazier wrote:
>> >That looks like voodoo code copied from a man page.  If you call this as
>> >Holds->new(), you don't need that junk about ref.  (And most people
>> >recommend against the "new Holds" syntax.)
>>
>> I wanted the DBH to be global since just about every sub in Holds does a
>> query of some sort. I guess it doesn't matter either way if I do the connect
>> in the new() vs  up top outside of a sub.
>
>Boredom break:
>
>As for your dbh, stick it whereever its scope applies, however I don't
>like declaring globals, so I've found that if I make the dbh accessible
>via an object, usually together with Apache::DBI in the background, I can
>often do clean up stuff, such as closing the handle (incase Apache::DBI
>isn't in place with a particular invokation of the package), last system
>logging updates/inserts, or whatever the job requires in a DESTROY method.
>
>> What is the problem with the my $holdcheck = new Holds() type of syntax?
>> I never read anything about that either way.
>It's in the book which I think should be called, 'the guy in the silly hat
>book,' ie. Damien's OO book, pretty much saying that,
>
>"The indirect object syntax does, however, suffer from the same type of
>ambiguity problems that sometime befuddles print 
>
>   my $cd3 = new get_classname() (@data) #Compilation Error
>
>...
>
>   
>   Assuming you have $cd="MyPackage" and:
>   get_name $cd;
>
>   This is usually equivalent to:
>   $cd->get_name;
>
>   However, let's say that you have a method in the invoking script
>named 'get_name', then:
>
>   get_name $cd;
>
>   Gets interpreted as:
>
>   get_name("MyPackage")
>
>   Which is not what you're after.
>   
>" - from the guy in the silly hat book
>
>-- 
>Senior Programmer
>Bookings.nl
>--
>Me::[EMAIL PROTECTED]||www.dreamthought.com
>Budget hosting on my 10Mbit/backbone::[EMAIL PROTECTED]
>
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: [cgiapp] Re: Apache::DBI and CGI::Application with lots of modules.

2002-10-15 Thread Eric Frazier

Hi,

I am learning lots of new things, but still working on the problem itself.
It seems to be the case that even when I am running under ./httpd -X 
I have trouble getting the search  query to get stuck. If I do something
from the mysql monitor like set an order on hold directly with a query, then
the search results won't show the updated status of the order. Yet if from
the web interface, I set the order on hold, then reload, the correct status
is shown. If I restart apache, then the correct status shows. 

Thanks for your advice, I am thinking besides the general advice I have
received, Apache::DB will be my next most helpfull item.

Eric 

At 02:33 PM 10/14/02 -0400, William McKee wrote:
>On 14 Oct 2002 at 9:12, Eric Frazier wrote:
>> That I am not so sure of. I will do some more investigation. It seems like
>> the only variables that could be causing this are the result set from the
>> query and the scalar which holds the html template.  I feel like I know
>> absolutly nothing now :(   I installed Apache::DB but don't yet know what
>> to make of it. 
>
>Hey Eric,
>
>I empathize with you! Getting myself up-to-speed with mod_perl development 
>has been a demanding task. At the moment, my apps have stabilized but I'm 
>sure to hit another hurdle down the road.
>
>As for Apache::DB, read the mod_perl guide at perl.apache.org. The 
>debugger is a pain to learn but has helped me to solve several problems. 
>There is good documentation on using the debugger in the camel book as 
>well. One trick I learned was to let the script run through once using the 
>'c' command. That will load all the scripts and modules into memory which 
>will let you set breaks in your code without having to watch every line go 
>by.
>
>Also, I noticed some folks pointing out some global variables. If you're 
>having troubles tracking these down in your script, you can see all the 
>variables your script has instantiated by using perl-status and looking at 
>the Loaded Modules. Find your CGI::App module in the list and click it to 
>get a detailed list of the arrays, functions, hashes, etc. that it loads.
>
>Good luck,
>William
>
>-- 
> Lead Developer
> Knowmad Services Inc. || Internet Applications & Database Integration
> http://www.knowmad.com
> 
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: Apache::DBI and CGI::Application with lots of modules.

2002-10-14 Thread Eric Frazier

Perrin,

I am starting to feel guilty about bugging you so much, but you are the only
person to have responded, and I watch the list enough to value your advice
quite a bit. 

>>sub new { 
>>my $invocant = shift;
>>my $class = ref($invocant) || $invocant;
>>
>
>That looks like voodoo code copied from a man page.  If you call this as 
>Holds->new(), you don't need that junk about ref.  (And most people 
>recommend against the "new Holds" syntax.)
>
>>my $self  = { @_ };
>>bless ($self, $class);
>>$dbh = db_connect();
>>
>
>You don't seem to need this.  You aren't using the database handle for 
>anything in this sub and you aren't gaining anything by calling it here.


I wanted the DBH to be global since just about every sub in Holds does a
query of some sort. I guess it doesn't matter either way if I do the connect
in the new() vs  up top outside of a sub. 

What is the problem with the my $holdcheck = new Holds() type of syntax?
I never read anything about that either way. 

>
>>sub GetProcessed {
>>
>>my $self = shift;
>>
>> This has a bug, somtimes the cached query doesn't stick around.
>>
>
>If you lose your database connection, Apache::DBI will reconnect.  Any 
>prepared queries will be lost.  You *must* prepare every time, but see 
>below...
>
>>sub db_connect {
>>
>>require DBI;
>>
>
>You don't need that.  You should have already loaded it in startup.pl.
>
>>my $dbname = 'CS';
>>my ($dbuser, $dbpasswd) = ('myuser', 'mypass');
>>
>
>Probably should be in a config file, rather than buried in here.
>
>>my $dbh = DBI->connect("DBI:mysql:$dbname", $dbuser, $dbpasswd)
>>   or die "can't connect: $DBI::errstr\n";
>>   
>>   # we need these waiting for queries, so we are going to prepare them
ahead of
>> time, and yes
>>   # horror of horror they will be global. Sorry Mom I tried :( 
>>   $processed_hnd = $dbh->prepare_cached("select ord_tpak_processed from
orders
>>where ord_num=?") or confess("can't get tpak processed");
>>   $status_hnd = $dbh->prepare_cached("select is_hold_set,holdstate from
>>holds where ord_num=?") or confess("can't get hold status");
>>   #DBI->trace(2,"/usr/local/apache/htdocs/out.log");
>>   return $dbh;
>>
>
>Don't put those in globals.  The prepare_cached call already stores them 
>for the life of your database connection.  Apache::DBI will keep that 
>connection alive (in a global hash) as long as it can and reconnect if 
>the connection is lost.  If the connection does get lost, the statement 
>handles in these globals will stop working.  You do recreate them every 
>time since you call this sub every time, but you could lose the 
>connection between the time this sub is called and the time you use 
>these handles.
>

I did this, I was a little scared about calling $dbh->finish() but I did
what you said, and yes life is good I don't notice a speed difference. 

>>4. I know the way I have done these db connects is sloppy. But I can't seem
>>to find a better way. Could I make one db_connect sub,and inherite it all
>>though my modules? 
>>
>
>Make one sub that returns a database handle and use it from everywhere. 
> Doesn't need to be inherited, you can just stick it in a module that 
>all the other modules call.

I have no idea why I put off doing that for so long. But that is done now as
well. 


>
>Hope some of that was helpful,
>Perrin
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: Apache::DBI and CGI::Application with lots of modules.

2002-10-14 Thread Eric Frazier

At 11:58 AM 10/14/02 -0400, Perrin Harkins wrote:
>Eric Frazier wrote:
>> Here is the kind of thing that is driving me nuts. Please see: 
>> http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Remed
>> ies_for_Inner_Subroutines
>> 
>> If what this says is true, then either I don't have a closure type problem,
>> or else what is says isn't true.
>
>That documentation refers to one particular problem involving nested 
>subs.  You don't need to have nested subs to have closures, and closures 
>may not even be the problem.
>
>You need to do some debugging.  Narrow things down by verifying your 
>assumptions one by one.  Is CGI.pm really giving you the values you 
>expect?  (Some people have experienced issues with params not being 
>reset when using CGI.pm in certain ways.)  Is your SQL query being built 
>correctly each time?

I have checked the above, and I have lots of warns spaced around so I can
watch things in the error log. 

  Is the data that you're passing to the template 
>correct?

That I am not so sure of. I will do some more investigation. It seems like
the only variables that could be causing this are the result set from the
query and the scalar which holds the html template.  I feel like I know
absolutly nothing now :(   I installed Apache::DB but don't yet know what to
make of it. 


Thanks again,

Eric 

  Throw in some warn statements.  Run it in the debugger if you 
>need to.
>
>- Perrin
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: Apache::DBI and CGI::Application with lots of modules.

2002-10-13 Thread Eric Frazier

Hi,

Here is the kind of thing that is driving me nuts. Please see: 
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Remed
ies_for_Inner_Subroutines

If what this says is true, then either I don't have a closure type problem,
or else what is says isn't true. It says that 
if I have this situation, I will get a warning. I am not getting any
warnings, but I am getting this behaviour with my search queries "getting stuck"


The only thing I do is again, copied from the perltoot 


package Searches;

use strict;
use Carp;
use vars qw($dbh);
use gentimeid; # generate time id based
use Calc_Price; # get totals  
use warnings;
# use DBIx::XHTML_Table;  # maybe later
use QueryPrint;

#use Data::Dumper;



# These searches are restricted to user level searches, there will be a
admin level search for 
# managment reports 

$dbh = db_connect();


# requires a $q query object to be init.



sub new {
my $self  = {};
my $proto = shift;
my $class = ref($proto) || $proto;
$self->{queryobject}   = undef;
$self->{isDomestic} = undef;
$self->{isInternational} = undef;
$self->{isShippingSame} = undef;
$self->{CustIsInserted} = undef;
$self->{OrderIsInserted} = undef;
$self->{CustNum} = undef;
$self->{OrderNum} = undef;
bless ($self, $class);
return $self;
}


sub queryobject {
  
  my $self = shift;
  if (@_) { $self->{queryobject} = shift }
  return $self->{queryobject};
}


 Other stuff not used yet



sub LookupOrder {

my $self = shift;
my $q = $self->{queryobject};
my $output = '';
my $hasparameter = 0;



... Build a query from CGI.pm vars passed in though queryobject





... 


$order_name_qu .= " ORDER BY $orderby "; # the query string is here


if ($hasparameter == 1) {  # if something was filled in the search form

my $sth = $dbh->prepare($order_name_qu) or confess("Main search
failed $order_name_qu");
$sth->execute() or confess("Main search failed $order_name_qu");  

my $headers = $sth->{'NAME'};   

my @rows= $sth->fetchall_arrayref();

my $resulthtml = new QueryPrint(ResultSet => @rows,
Action => 'customer',
ColumnList => $headers);

my $html = $resulthtml->SetAction();  # sets a template type in the
QueryPrint module
$output = $resulthtml->QueryPrint();  
$sth->finish();
#warn "QUERY - $order_name_qu";
undef @rows;
undef $resulthtml;
undef $order_name_qu;
return $output;

} else {


return "no query to do";

}


Then this is all called from my CGI::Application module

sub customer_display{

my $self = shift;
my $q = $self->query();

my $customersearch = new Searches();
$customersearch->queryobject($q); # set the query

my $header = parse_header($self);
return $header . $customersearch->LookupCustName(); 

}


So going nuts now, where is the problem?  My QueryPrint module is pretty
much the same, so if this is ok, it should be as well. 


Thanks,

Eric 



>Are you using any modules that have subs with sub ref prototypes, like 
>Error.pm?  That can do it.
>
>>All I have read says that because I am using oop
>>modules and use strict along with use vars that should not happen.
>>
>
>It's actually really easy to create closures.  Here is a closure:
>
>my $holdtype = $q->param('holdstate');
>display_holdtype();
>
>sub display_holdtype {
>print "holdtype: $holdtype in process $$\n";
>}
>
>This will always print whatever the value was the first time, no matter 
>what you change it to later.  (The first time for that process, that 
>is.)  Watch out for things like that.  You should always pass params 
>explicitly.
>
>>4. I know the way I have done these db connects is sloppy. But I can't seem
>>to find a better way. Could I make one db_connect sub,and inherite it all
>>though my modules? 
>>
>
>Make one sub that returns a database handle and use it from everywhere. 
> Doesn't need to be inherited, you can just stick it in a module that 
>all the other modules call.
>
>Hope some of that was helpful,
>Perrin
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: Apache::DBI and CGI::Application with lots of modules.

2002-10-12 Thread Eric Frazier

Perrin,

I am going to read over this closely, thanks for all of the advice! 

What frustrats me about the search getting cached/closure thing is that I
just don't have any global variables that have anything to do at all with
the search results. I have read over and over examples with closures,
recognize the example you included as one, but I still can't seem to find it
in my own code. I guess I need to take a fresh look again. I did -X httpd
and it is happening every time. I think part of what is getting me is I have
used mod_perl for smaller things, but now it is a pretty big system. I don't
seem to  be able to get away with as much :) Also, I am really trying to
bring my code level up a notch, but as you pointed out, there are some
things I am doing that  I don't really understand well enough yet. 

Thanks,

Eric 

http://www.kwinternet.com/eric
(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Apache::DBI and CGI::Application with lots of modules.

2002-10-12 Thread Eric Frazier
ny "this variable will not stay shared" types of warnings.
for this I have tried specificly undefing the display scalars, the result
sets etc. I just can't seem to find out what var is causing the problem, and
I can't find any examples of closures. 
4. I know the way I have done these db connects is sloppy. But I can't seem
to find a better way. Could I make one db_connect sub,and inherite it all
though my modules? 

5. I am also using Innodb tables and it seems I am having problems with some
commits happening. I don't get a error and I am checking to see if they
succeed, but the commit doesn't happen unless I go with AUTOCOMMIT=1 which I
don't want to do long term. 

All of this makes me think, hmm it all sounds pretty fishy, like fix one
thing and I may fix it all. And all of those modules with all of those
db_connect methods are the first thing  I am afraid of. I had to make these
work under CGI as well, so I wanted each module to be totaly independent.
That is not so important now as far as the DB connection goes. 


I am posting this to mod_perl list as well. So why post to the CGI::App
list? Well I think there is a good chance that a CGI::App person will know
what is happening, just because of having a knowledge of CGI::App as used
with mod_perl. But then it is most likely a mod perl type of problem.


I am kind of desparate, so if anyone is looking for cash, rewards, or other
forms of kudos, please get in touch with me. I really need to solve this
problem. 


Thanks,


Eric 


PS in the process of writing this email I found one stupid thing I did. 

$processed_hnd->finish();

I don't know what I was thinking there :) since I want to keep this hnd
open. But I doubt very much that is the hole problem.. 






http://www.kwinternet.com/eric
(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: memory usage problem!

2002-10-08 Thread Eric

Hi,

What about in the case of a big query result? That is where it seems like 
you can get killed.
I can see my processes grow very large in that case, and there is no way 
the memory will come back. But I certainly don't want to limit my processes 
because I might want to get a big result from a query sometimes.

Thanks,

Eric

At 02:24 PM 2002-10-08 -0400, you wrote:
>Also, try to find an alternative to loading all that data into memory. You 
>could put it in a dbm file or use Cache::FileCache.  If you really have to 
>have it in memory, load it during startup.pl so that it will be shared 
>between processes.
>
>- Perrin
>
>Anthony E. wrote:
>>look into Apache::Resource or Apache::SizeLimit which
>>will allow you to set a maximum size for the apache
>>process.
>>both can be added to your startup.pl
>>--- Plamen Stojanov <[EMAIL PROTECTED]> wrote:
>>
>>>Hi all,
>>>I have a ig mem usage problem with perl. I load 2Mb data from a database 
>>>in perl hash and
>>>perl takes 15Mb memory. As I use this under mod_perl - perl never 
>>>returns this
>>>memory to the OS. I must set a little number for MaxRequestsPerChild in 
>>>order
>>>to restart perl interpreter not to eat a lot of memory. Is there any 
>>>solution to avoid such memory usage?




installation bug with Apache v2.0.42

2002-09-25 Thread Eugene Eric Kim

I found a minor installation bug in both modperl v1.99-5.  (The same bug 
also seems to be in the latest modperl-2.0 CVS tree.)

The bug occurs when you try to install modperl 2 with the latest version 
of Apache (2.0.42).  For whatever reason, the Apache folks changed the 
format of the macros in include/ap_release.h between 2.0.40 and 2.0.42.
AP_SERVER_BASEREVISION is now:

  #define AP_SERVER_BASEREVISION AP_SERVER_MINORREVISION "." AP_SERVER_PATCHLEVEL

instead of simply:

  #define AP_SERVER_BASEREVISION "2.0.42"

This breaks the httpd_version method in Apache/Build.pm.

I got around it by simply changing the AP_SERVER_BASEREVISION in 
include/ap_release.h to the latter format.  The "correct" solution depends 
on how stable the macro format will be for future versions of Apache.  If 
it's going to stay the way it is, httpd_version needs to be modified to 
search for other macros as an alternative method for computing the 
version.

-Eugene

-- 
+=== Eugene Eric Kim = [EMAIL PROTECTED] = http://www.eekim.com/ ===+
|   "Writer's block is a fancy term made up by whiners so they|
+=  can have an excuse to drink alcohol."  --Steve Martin  ===+




Re: top for apache? [OT]

2002-09-23 Thread Eric Cholet



--On Sunday, September 22, 2002 09:54:02 -0400 Perrin Harkins 
<[EMAIL PROTECTED]> wrote:

> Nigel Hamilton wrote:
>>  It would be great to have a similar tool for mod_perl/apache.
>
> The closest thing available is a combination of mod_status and
> Apache::Status.  If you haven't tried these yet, give them a shot.  They
> provide a good deal of information.

You might also want to check out Apache::VMonitor. From the module's
description: "This module emulates the reporting functionalities of top(1),
extended for mod_perl processes, mount(1), and df(1) utilities. It has a
visual alerting capabilities and configurable automatic refresh mode. All
the sections can be shown/hidden dynamically through the web interface."

--
Eric Cholet




mod_perl and DAV integration

2002-09-08 Thread Eric Flynn



Has 
anyone devised a method (using mod_dav or otherwise) for writing 
perl handlers to satisfy DAV requests?  All the solutions I 
have found so far either do not give enough control over the response formation 
or requre the use of C handlers.
 
Thanks,
 
Eric
***Eric 
Flynn[EMAIL PROTECTED]415-664-3631***  

 


Apache seems to ignore my PerlAuthenHandler & PerlAuthzHandler directives...

2002-09-03 Thread Eric Devolder

Hello,

I'm using a modified version of Apache::AuthTieDBI and
Apache::AuthzTieDBI ( from O'Reilly books, available on
http://www.modperl.com ), and they seems working
fine. But now I'm trying to export the configuration to a production
machine, and the troubles begins.

The entry in httpd.conf follows (sensitive info hidden):


SetHandler server-status
AuthName "Administrative access only"
AuthType Basic
PerlAuthenHandler Apache::AuthTieDBI
PerlSetVar  TieDatabase dbi:Pg:dbname=;host=localhost
PerlSetVar  TieTableauth_user:username:password
PerlSetVar  TieUser 
PerlSetVar  TiePassword 
PerlAuthzHandler Apache::AuthzTieDBI
require $perms =~ /admin/;


In the module Apache::AuthTieDBI, I've put some $r->log->notice()
messages to verify if it pass through.

What happens is that Apache is presenting the authentication box,
but 1° nothing is logged into /var/log/httpd/error_log and 2° I

could type in any user & password combination, it grants the access.
My guesses is that Apache doesn't even call the perl subroutines;
can anyone help? I'm becoming crazy...


=

-

Eric Devolder

email: [EMAIL PROTECTED]>


___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com



Re: [OT] Which is the fastest XML/XSL engine?

2002-08-30 Thread Eric Cholet

--On vendredi 30 août 2002 09:40 +0100 [EMAIL PROTECTED] wrote:

> Hi,
>
> This is rather off topic, but since I will be running this under mod_perl:
>
> What is the fastest technology available for transforming XML using XSL
> under perl/mod_perl on apache? The only perl api I'm aware of is
> XML::XSLT which is not particularly fast. I'd like to do transforms in
> realtime for a high traffic site.

Try XML::LibXSLT, in conjunction with XML::LibXML, these modules use
the Gnome project's LibXML and LibXSLT which are quite fast.

--
Eric Cholet




Re: Three tier computing: suggestion needed for DBI connection.

2002-08-26 Thread Eric Cholet


--On Thursday, August 15, 2002 12:32:16 +0200 "Fabiàn R. Breschi" 
<[EMAIL PROTECTED]> wrote:

> After digging more docs, finally found for PG DBI:
>
> DBI:Pg:dbname=mydb;host=Ultra1;port=5432
>
> question 2 still there, thanks.

All you need is the pgsql/lib and pgsql/include directories so that you can
install DBD::Pg.

>
> Fabian.
>
>
> "Fabián R. Breschi" wrote:
>
>> Hello all,
>>
>> At the moment I'm running Apache 1.3.12+mod_perl 1.27 with PG 7.2.1
>> via DBI-DBD on a SS5 Solaris 2.6 machine.
>>
>> I'd like to separate the database engine from the Apache environment
>> so, running Apache+mod_perl+DBI+DBD on the front end and PostgreSQL at
>> the backend (hope I'm right with this particular interpretation of
>> 3tier and split of modules...)
>>
>> I have glanced around for DBI connect scenarios but could not find any
>> useful example.
>>
>> My questions are:
>>
>> - How do I setup my connection string from
>> $dbh=DBI->connect('DBI:Pg:dbname=mydb','login','password') to include
>> in my 'dbname' the host name i.e. 'dbname=mydb@Ultra1' being Ultra1 a
>> fully qualified alias into my hosts table,
>> - Providing the above is possible, I imagine that leaving PG installed
>> at the front end it could only be useful for 'psql -h Ultra1 mydb' but
>> not necessarily used for DBI?
>>
>> Any suggestions are much appreciated.
>>
>> Fabian.
>



--
Eric Cholet




Re: [Newbie Q] Cleanest way to implement one logon per user?

2002-08-02 Thread Eric Cholet

--On Thursday, August 01, 2002 15:08:40 -0400 Baljit Sethi 
<[EMAIL PROTECTED]> wrote:

>
> Hello.
>
> I am hoping someone can point me in the right direction.
>
> What I want to do is limit client logons to one logon per username ie
> while a client has a session open, he/she cannot logon to the website
> from another terminal.
>
> Platform: Apache 1.3.x with mod_perl & DBI
>
> I have looked high and low, gone through Apache book after book with no
> measurable success (mod_usertrack & mod_session are the only modules
> briefly mentioned).
>
> If someone could just point me in the right direction, I will gladly do
> all the required research.

Someone recently suggested to me the following solution, based on slightly
modified sessions. It involves sending a cookie that contains a new ID with
each response. The server stores that ID keyed on the user's login name.
The next request from the client is expected to return that
cookie. If the ID doesn't match, redirect the user to the login page.
If one client is using the site, he will login once and thereafter can use
the site normally. If a second client comes in, after his initial login
he will get a cookie with a new ID. This will make the first client's ID
invalid. If both clients continue to issue requests they will keep on
invalidating each other's ID thus forcing repeated logins. In a case
where the contract explicitely disallows concurrent access with a given
login name, the rightful client will probably complain and be a bit more
weary of giving away his password to his friends or coworkers.
An advantage to this system is that it doesn't require logout or timing
out the session.

Disclaimer: I have not implemented this system, and it's possibly that it
has flaws that surely this list readers will be quick to point out, and
I'll be grateful for that.

--
Eric Cholet




reading an ENV with Perl that was set with mod_rewrite [E= : ]

2002-07-25 Thread Eric Frazier

Hi,

Has anyone used mod_rewrite to set an environmental variable based on the 
result of a reg exp?

For example:
RewriteRule ^/pt=([^/]+)?(.*) /home/me.com/public_html/$2  [E=PT:$1]

I can get a static url like:
RewriteRule   /perl  /usr/local/apache/perl/printenv [E=ERIC:bob]

to work, but the first one I can't. PT doesn't exist, but ERIC does.


I know this is not exactly on topic, but it is a weird sort of issue, the
admin I was dealing with said he could get the above ENV with PHP or
mod_perl but not with perl CGI's I can't seem to get it with a mod_perl
Registry script either though. 


Thanks,

Eric

http://www.kwinternet.com/eric
(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Give me the moron award please- Registry duplicates

2002-07-16 Thread Eric Frazier

Hi,

Well I found the problem. I had replaced PerlHandler Apache::Registry 
with  PerlHandler Apache::Registry::handler
But I didn't really replace it, I forgot to delete the PerlHandler 
Apache::Registry line. DOH Half a day killed on that.


Thanks,

Eric



Leading Edge Marketing Inc.
250-360-2992




Re: duplicate output with Registry.pm

2002-07-16 Thread Eric Frazier

Hi,

I will try that out. It was something like that, it even rings a bell a bit.
Thanks! I will let you know. 


Eric 

At 03:51 PM 7/16/02 +0200, Eric Cholet wrote:
>--On Tuesday, July 16, 2002 06:44:10 -0400 Eric Frazier <[EMAIL PROTECTED]> 
>wrote:
>
>>  Hi,
>>
>>  It happens with the printenv script also. Again, I did this to myself
>>  before, but I can't remember how I fixed it. It was something very
>> simple.
>>
>>  Thanks,
>
>Seems like  will happily match urls such as /perlrun.
>Maybe you want to add trailing slashes to your Location and Alias
>directives.
>
>
>>  Eric
>>
>>  My http.conf perl stuff
>>  =
>>
>>  # mod_perl config
>>
>>  PerlRequire /usr/local/apache/conf/Start.pl
>>  PerlFreshRestart On
>>  PerlInitHandler Apache::StatINC
>>  PerlSetVar StatINC_UndefOnReload On
>>  Alias /perl /usr/local/apache/perl
>>
>>  PerlWarn On
>>
>>  PerlModule Apache::Registry
>>
>>PerlHandler Apache::Registry::handler
>>  SetHandler  perl-script
>>  PerlHandler Apache::Registry
>>  PerlSendHeader  On
>>  Options +ExecCGI
>>  
>>
>>  Alias /perlrun /usr/local/apache/PerlRun
>>
>>  
>>
>>  SetHandler  perl-script
>>  PerlHandler Apache::PerlRun
>>  PerlSendHeader  On
>>  Options +ExecCGI
>>  
>>
>>
>> http://www.kwinternet.com/eric
>> (250) 655 - 9513 (PST Time Zone)
>>
>> "Inquiry is fatal to certainty." -- Will Durant
>>
>>
>>
>
>
>
>--
>Eric Cholet
>

http://www.kwinternet.com/eric
(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







Re: duplicate output with Registry.pm

2002-07-16 Thread Eric Cholet

--On Tuesday, July 16, 2002 06:44:10 -0400 Eric Frazier <[EMAIL PROTECTED]> 
wrote:

>  Hi,
>
>  It happens with the printenv script also. Again, I did this to myself
>  before, but I can't remember how I fixed it. It was something very
> simple.
>
>  Thanks,

Seems like  will happily match urls such as /perlrun.
Maybe you want to add trailing slashes to your Location and Alias
directives.


>  Eric
>
>  My http.conf perl stuff
>  =
>
>  # mod_perl config
>
>  PerlRequire /usr/local/apache/conf/Start.pl
>  PerlFreshRestart On
>  PerlInitHandler Apache::StatINC
>  PerlSetVar StatINC_UndefOnReload On
>  Alias /perl /usr/local/apache/perl
>
>  PerlWarn On
>
>  PerlModule Apache::Registry
>
>PerlHandler Apache::Registry::handler
>  SetHandler  perl-script
>  PerlHandler Apache::Registry
>  PerlSendHeader  On
>  Options +ExecCGI
>  
>
>  Alias /perlrun /usr/local/apache/PerlRun
>
>  
>
>  SetHandler  perl-script
>  PerlHandler Apache::PerlRun
>  PerlSendHeader  On
>  Options +ExecCGI
>  
>
>
> http://www.kwinternet.com/eric
> (250) 655 - 9513 (PST Time Zone)
>
> "Inquiry is fatal to certainty." -- Will Durant
>
>
>



--
Eric Cholet




Re: duplicate output with Registry.pm

2002-07-16 Thread Eric Frazier

 Hi,
 
 It happens with the printenv script also. Again, I did this to myself 
 before, but I can't remember how I fixed it. It was something very simple.
 
 
 Thanks,
 
 Eric
 
 My http.conf perl stuff
 =
 
 # mod_perl config
 
 PerlRequire /usr/local/apache/conf/Start.pl
 PerlFreshRestart On
 PerlInitHandler Apache::StatINC
 PerlSetVar StatINC_UndefOnReload On
 Alias /perl /usr/local/apache/perl
 
 PerlWarn On
 
 PerlModule Apache::Registry
   
   PerlHandler Apache::Registry::handler
 SetHandler  perl-script
 PerlHandler Apache::Registry
 PerlSendHeader  On
 Options +ExecCGI
 
 
 Alias /perlrun /usr/local/apache/PerlRun
 
 
 
 SetHandler  perl-script
 PerlHandler Apache::PerlRun
 PerlSendHeader  On
 Options +ExecCGI
 
 

http://www.kwinternet.com/eric
(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 







  1   2   3   4   >