Re: Apache::Session and blessed references

2000-06-01 Thread Jeffrey W. Baker

On Wed, 31 May 2000, Dylan Weed wrote:

 
 I can't seem to get Apache::Session to save the blessedness of an object.  
 Is this an oversight on my part, a limitation of the module, a limitation
 of the database, or an intentional design decision?  
 
 Conceptually, it seems as though an objects blessing is stored in a
 different place in the Perl guts than its contents.  Is the problem just
 that Apache::Session never saves this information to the database?
 
 Has anyone else had occasion to do this?

Well, that sucks a lot.  This is actually a bug in Apache::Session.  If it
was working properly, blessed references should be fine.  Unfortunately,
the module doesn't seem to be saving hash entries that are added
immediately after creation.  I will fix this tomorrow.

Also I will add a test for this case.

 
 
 
 An example in Perl:
 
 # %session is a hash tied to a DB with Apache::Session 1.51
 
 package main;
 
 my $dog_obj = { name = 'Fido', breed = 'Mutt' };
 
 bless ($dog_obj, 'Dog');
 
 $dog_obj-bark();
 $session{my_dog} = $dog_obj;
 
 # The following line dies with an error:
 #   cannot call method bark on unblessed reference.
 $session{my_dog}-bark();
 
 package Dog;
 
 sub bark {
   my $self = shift;
   print "Woof! I'm $self-{name}";
 }
 
 




Re[2]: Apache::Session and blessed references

2000-06-01 Thread serg gajdajchuk





Re[2]: Apache::Session and blessed references

2000-06-01 Thread serg gajdajchuk





Re: [OT] Bean::*?

2000-06-01 Thread Matt Sergeant

On Wed, 31 May 2000, DeWitt Clinton wrote:

 Hi all,
 
 Okay, this is a rather ridiculous question.  I spent the weekend
 implementing a property based object model in Java.  However, after I
 finished, someone in my company laughingly pointed out that I had just
 re-invented Java beans.  While there were some minor advantages to the
 model I came up with, the overwhelmingly richer feature set of the
 java.beans.* framework made my efforts redundant at best.
 
 One of the advantages, however, is that the object model I was working
 on would translate very nicely to Perl.  In fact, the language
 independent nature of this (other than OO being a requirement) was the
 real reason I bothered with it at all.
 
 My question is this -- has anyone written an implementation of the
 Java Bean standard in Perl?

CORBA::ORBit?

-- 
Matt/

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: Human readable flatfiles

2000-06-01 Thread Philip Mak

On Wed, 31 May 2000, Perrin Harkins wrote:

Thanks for the reply. I have a few problems though:

 You need to read up a little on modules and "require" in Perl5.
 
 The quick and dirty solution is to use "do" instead of require.  That will
 solve your immediate problem, but you'll still be reading the files every
 time which might eventually become a performance hit.

I can't seem to get "do" to work. I did this:

my $series_name;
do "series_$series.i"; # -- note include filename depends on a variable
print "$series_name\n";

but $series_name comes out undefined, even though series_$series.i (in
this case, series_ranma.i) sets $series_name.

I also tried the package thing:

 What I do when I have things like config files is make actual unique
 packages of them.  For example:
 
 (In My/Module.pm)
 package My::Module;
 # don't use strict here
 $foo = 7;
 
 (In some other program)
 use My::Module;
 print "$My::Module::foo\n";

How would this work if the include filename has to depend on a variable? I
think I have the parsing wrong; I kept getting error messages. e.g.
something like:

use $series;
print "$$series::series_name\n";

 Honestly though, your example makes it look like you'd be better off with
 dbm files and Tie::MLDBM or something.

The database files would have to be human readable though, such that they
can be edited by a text editor. The data that I am making includes an
index to content that is maintained by other webmasters. The other
webmasters don't even know how to use a UNIX shell, so I have to keep it
simple for them. If I used a binary file format I'd have to make them
learn the tools for changing it.

-Philip Mak ([EMAIL PROTECTED])




Re: Human readable flatfiles

2000-06-01 Thread Perrin Harkins

Philip Mak wrote:
 I can't seem to get "do" to work. I did this:
 
 my $series_name;
 do "series_$series.i"; # -- note include filename depends on a variable
 print "$series_name\n";

Your lexical ("my") variable in the same scope is taking precedence, and
the "do' is not allowed to see lexicals in its enclosing scope.  If you
make $series_name a global, I think it will work.  The alternative is to
read the file yourself and eval it, which would allow it to see the
lexical.

 I also tried the package thing:
 
  What I do when I have things like config files is make actual unique
  packages of them.  For example:
 
  (In My/Module.pm)
  package My::Module;
  # don't use strict here
  $foo = 7;
 
  (In some other program)
  use My::Module;
  print "$My::Module::foo\n";
 
 How would this work if the include filename has to depend on a variable? I
 think I have the parsing wrong; I kept getting error messages. e.g.
 something like:
 
 use $series;
 print "$$series::series_name\n";

If it depends on a variable, replace the "use" with "require".  The
"use" statment is evaluated at compile time, and "require" at run time.

Keep in mind that require only loads each file once, so if you need to
show changes in these files that happen while the server is running this
won't work for you.

  Honestly though, your example makes it look like you'd be better off with
  dbm files and Tie::MLDBM or something.
 
 The database files would have to be human readable though, such that they
 can be edited by a text editor. The data that I am making includes an
 index to content that is maintained by other webmasters. The other
 webmasters don't even know how to use a UNIX shell, so I have to keep it
 simple for them. If I used a binary file format I'd have to make them
 learn the tools for changing it.

Depending on how much of this data you have and how timely it has to be,
you could make a cron that crawls the text files every 5 minutes or so
and build a dbm with their data in it.

- Perrin



Re: Changes to module code only take effect if perl program updated

2000-06-01 Thread Perrin Harkins

Karl Djemal wrote:
 Thanks for the reply.  I'm not quite sure what you are asking here - may be
 what I asked wasn't to clear.

I was asking if you import any subs or variables from MyModule.pm.  If
you don't know what I mean, then you probably don't.

 I'm using Apache::Registry as a PerlHandler to run my perl CGI script.  This
 perl program in turn does a use MyModule.  What I don't understand is that I
 can see my perl module 'MyModule.pm' get reloaded if I change it, but the
 changes are not picked up until I update my perl program.
 
 It is when I update my perl program I start to see the 'Subroutine...
 redefined..' warnings.

 Does any one know why the parent httpd process doesn't reload my module (could
 it be that it does, but doesn't record this in the log file?).

It definitely sounds like inlined subroutines to me.  When your
Apache::Registry script got compiled, it inlined some subs from
MyModule.pm for performance reasons.  They won't get redefined until
your Registry script gets compiled again.  This isn't related to the
parent process.  Looks like you'll have to touch the file, or do some
hacking on StatINC to make it unload your Registry script when it
reloads your modules.

- Perrin



Re: Changes to module code only take effect if perl program updated

2000-06-01 Thread Karl Djemal

The penny's dropped!  I now understand what you are getting at.

Thanks for the help.

Regards,

Karl

Perrin Harkins wrote:

 Karl Djemal wrote:
  Thanks for the reply.  I'm not quite sure what you are asking here - may be
  what I asked wasn't to clear.

 I was asking if you import any subs or variables from MyModule.pm.  If
 you don't know what I mean, then you probably don't.

  I'm using Apache::Registry as a PerlHandler to run my perl CGI script.  This
  perl program in turn does a use MyModule.  What I don't understand is that I
  can see my perl module 'MyModule.pm' get reloaded if I change it, but the
  changes are not picked up until I update my perl program.
 
  It is when I update my perl program I start to see the 'Subroutine...
  redefined..' warnings.
 
  Does any one know why the parent httpd process doesn't reload my module (could
  it be that it does, but doesn't record this in the log file?).

 It definitely sounds like inlined subroutines to me.  When your
 Apache::Registry script got compiled, it inlined some subs from
 MyModule.pm for performance reasons.  They won't get redefined until
 your Registry script gets compiled again.  This isn't related to the
 parent process.  Looks like you'll have to touch the file, or do some
 hacking on StatINC to make it unload your Registry script when it
 reloads your modules.

 - Perrin



***
Bear Stearns is not responsible for any recommendation, solicitation, 
offer or agreement or any information about any transaction, customer 
account or account activity contained in this communication.
***




non-DSO mod_perl, Embperl, and AIX not working

2000-06-01 Thread Greg Estep


I am using IBM's C complier (cc) under AIX 4.3.3 with Apache 1.3.12, 
mod_perl 1.24 (statically linked, not DSO), perl 5.00503, and Embperl 
1.3b3.

The "offline", "execute function", and "cgi mode" Embperl tests are 
all successful. In the "mod_perl" mode, even the simple "ascii" test 
fails.  It fails with a seg. fault and a dbx stack trace that looks 
like this:

ap_palloc() at 0xd1179d98
EMBPERL__malloc() at 0xd1178b98
EMBPERL_SetupFileData() at 0xd1177118
EMBPERL_SetupRequest() at 0xd1177764
XS_HTML__Embperl_SetupRequest() at 0xd116fcb8
.() at 0x1004a344
.() at 0x100536f0
.() at 0x1002ff98
perl_call_handler(??, ??, ??) at 0x10113f70
perl_run_stacked_handlers(??, ??, ??) at 0x10113160
perl_handler(??) at 0x10111d38
ap_invoke_handler(0x2011f1f0) at 0x100c42bc
process_request_internal(0x2011f1f0) at 0x100f4d6c
ap_process_request(0x2011f1f0) at 0x100f648c
child_main(0x0) at 0x10002d24
make_child(0x200498e0, 0x0, 0x39363aa3) at 0x100025a0
startup_children(0x2) at 0x1000248c
standalone_main(0x4, 0x2ff228c8) at 0x10001928
main(0x4, 0x2ff228c8) at 0x100014b0


To get Embperl.so to successfully build I added "-b erok" to 
LDDLFLAGS.  I also tried '-G' with similar results. Without the 
modification to LDDLFLAGS I got several "unresolved symbol" errors.

I also get similar results with Embperl 1.2b9, Apache 1.3.9, and 
mod_perl 1.23.

BTW, I did not personally compile my perl executable, it is straight 
from a fileset on the AIX 4.3.3 CD.  I have, however, upgraded 
several modules to their most recent CPAN version.  My 'perl -V' 
output looks like this:

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=aix, osvers=4.3.3.0, archname=aix
uname='aix funny 3 4 01716600 '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-O', gccversion=
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
qmaxmem=16384'
ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
qmaxmem=16384'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='ld', ldflags ='-s'
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lbsd -lPW -lC_r
libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-
bE:perl.exp'
cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -
bI:$(PERL_INC)/perl.exp -bE:$(B
ASEEXT).exp -b noentry -lc'


Characteristics of this binary (from libperl):
  Built under aix
  Compiled at Aug 14 1999 08:59:55
  @INC:
/usr/opt/perl5/lib/5.00503/aix
/usr/opt/perl5/lib/5.00503
/usr/opt/perl5/lib/site_perl/5.005/aix
/usr/opt/perl5/lib/site_perl/5.005
.

--
Greg Estep [EMAIL PROTECTED] 




Re: [OT] Bean::*?

2000-06-01 Thread DeWitt Clinton

On Wed, May 31, 2000 at 04:16:09PM -0700, Perrin Harkins wrote:

 Maybe I'm just being thick, but if you leave out the event driven parts of
 the spec, what's left that isn't just an ordinary Perl class?  You can
 easily make classes to hold data using Class::Struct or
 Class::MethodMaker.

In all this time, I don't think I've seen you simply being thick even
once.  :) I agree, if you take out the event driven stuff, beans
aren't that exciting.  They are basically just property bags with a
way to reflect over those properties.  However, if I build the
beginning of the bean model in Perl, then someone might come along and
add the event model.

 Is it just that you want a safer way to do introspection than looking at
 the data structure the class is made from?  Maybe you want the
 Class::Fields module from CPAN.

Trust me -- this has nothing to do with "safe."  :)  The bean model is 
simply a convention -- if a class has a getFoo and a setFoo, then it
has the property Foo.  Like I said, I don't want to debate whether or
not it is a good standard.  The entire point is to have a consistent
framework between Java and Perl.  Chances are, the underlying
mechanism for doing the reflection will leverage something from the
Class:: package. 

There are a million ways I'd rather see this solved in Perl.  Or in
Java for that matter.  But java.beans are pretty popular, and they
provide the underpinnings for EJB, which, for better or for worse, is
very prevalent in e-commerce.  I'd rather support a mediocre standard
then invent a proprietary one.  And beans aren't *that* mediocre.

-DeWitt



Apache::Session

2000-06-01 Thread Niral Trivedi

All,

I have just installed Apache::Session successfully with Apache/mod_perl
version 1.24..

I have two sample script one from example avaiable with installation
which uses 'Apache::Session::File' for session tracking and other file,
I have created from the given example but that uses
'Apache::Session::MySQL' as object store...

I have also created database called 'sessions' in which I have table
called 'sessions' which has two columns as per the perldoc. First is
'id' which is primary key and second is 'a_session'.

Now, I am successfully able to run the script and generate sessionID and
store that sessionID in MySQL database table.. But column 'a_session' is
always empty!! Following is my code.. When I ran this code first time, I
thought, I will have value of '$name' in column 'a_session' but I was
wrong!! I mean I am in impression that, in MySQL datastore we can store
all information about session for a particular sessionID. But it's not
the case.. Whereas if I run the sample example which uses
Apache::Session::File, I can see value of '$name' in the actual session
file!!! So, Can somebody clear my doubts here??

Thanks in advance..
---
#!/usr/local/bin/perl5.00503

use strict;

use CGI;
use DBI;
use Apache::Session::MySQL;
my($query) = new CGI;
print $query-header;

#
 DB Connection 
my($dbh) = DBI-connect("DBI:mysql:$DB",$DBUSER,$DBPASS, {
PrintError = 1, # warn() on errors
RaiseError = 0, # don't die on error
AutoCommit = 1, # commit executes immediately
});
my($sessionID) = $ENV{'PATH_INFO'};
$sessionID =~ s/^\///;
$sessionID = $sessionID ? $sessionID : undef;
my %session;
my($name) = $query-param('name');

tie %session, 'Apache::Session::MySQL',$sessionID, {
Handle = $dbh,
LockHandle = $dbh
};
$session{name} = $name if $name;

print "Hellobr\n";
print "Session ID number is: $session{_session_id}br\n";
print "The Session ID is embedded in the URLbr\n";
print "br\n";
print "Your input to the form was: $namebr\n";
print "Your name is $session{name}br\n";
print "br\n";
print "a
href=\"http:\/\/www.server.com/perl\/session_test\.pl\/$session{_session_id}\"Reload
this session/abr\n";
print "a href=\"http:\/\/www.server.com\/perl\/session_test\.pl\"New
session/a\n";
print "form
action=\"http:\/\/www.server.com\/perl\/session_test\.pl\/$session{_session_id}\"
method=\"post\"\n";
print "Type in your name here:";
print "input type=\"text\" name=\"name\"BR\n";
print "input type=\"submit\" name=\"Go!\"\n";
print "/form\n";
---

Niral



Re: Apache::Session

2000-06-01 Thread JoshNarins

In a message dated 6/1/2000 10:59:48 AM Eastern Daylight Time, 
[EMAIL PROTECTED] writes:

 Now, I am successfully able to run the script and generate sessionID and
  store that sessionID in MySQL database table.. But column 'a_session' is
  always empty!! Following is my code.. When I ran this code first time, I
  thought, I will have value of '$name' in column 'a_session' but I was
  wrong!! I mean I am in impression that, in MySQL datastore we can store
  all information about session for a particular sessionID. But it's not
  the case.. Whereas if I run the sample example which uses
  Apache::Session::File, I can see value of '$name' in the actual session
  file!!! So, Can somebody clear my doubts here??
  
  Thanks in advance..

If you followed the perldocs, you also made a_session a BLOB.
You won't be able to see the contens of the BLOB doing a 
simple select from a command line SQL interface. A BLOB is
binary data.

Plus, it has three columns, not two as you say...
id varchar(16)
length int(11)
a_session blob

-Josh Narins



New list archive site

2000-06-01 Thread Email Archive

Folks,

I have created a web based searchable email archive for the mod_perl
mailing list. If anyone is interested in using it you can access it by
going to http://www.securityinsight.com/archive/external/mod-perl/.

I know there are several archives avaliable already but I figured since
I was archiving this for myself then I might as well see if someone else
can get some use out of it. 

Enjoy
Mike




Apache::PerlVINC again

2000-06-01 Thread Kees Vonk 7249 24549

The following works on Apache/1.3.6 (Unix) mod_perl/1.21 
mod_ssl/2.3.5 OpenSSL/0.9.3a

But when running on Apache/1.3.9 (Unix) mod_perl/1.21 
mod_ssl/2.4.8 OpenSSL/0.9.4, I get the following problem 
which _appears_ (I am not 100% sure) to be caused by 
Apache::PerlVINC. I have the following section in my 
httpd.conf


Perl
delete $INC{'Apache/PerlVINC.pm'};
require Apache::PerlVINC;
/Perl

#VirtualHost _default_:8444
   DocumentRoot /opt/ward/DocumentRoot

   SetEnv IDVENV Production

   Alias /idv/ "/opt/ward/IDV/PROD/Scripts/"
   Directory /opt/ward/IDV/PROD/Scripts
  Order allow,deny
  Allow from all

  DefaultType text/html

  SetHandler perl-script
  PerlHandler Apache::Registry

#  PerlVersionINC On
#  PerlINC /opt/ward/IDV/PROD/Modules
#  PerlFixupHandler Apache::PerlVINC
#  PerlRequire Ward/IDV/IDVDatabase.pm
   /Directory

# [ snipped some more Aliases ]

   IfDefine SSL
  SSLEngine on

# [ line 271 ]
  SSLCertificateFile/opt/ward/apache/conf/ssl.crt/server.crt
  SSLCertificateKeyFile /opt/ward/apache/conf/ssl.key/server.key

  SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
   /IfDefine
#/VirtualHost


As it stands it apache starts and things seem to work as expected.

The moment I uncomment the PerlVINC lines (or even just the first one) 
apache fails to start without any error message (STDOUT or logs (LogLevel 
debug)) or core file.

If I uncomment the VirtualHost tags I get the following error message in 
the logs:
Syntax error on line 271 of /opt/ward/apache/conf/httpd.conf.idv:
SSLCertificateFile: only up to 2 different certificates per virtual host 
allowed



Does Apache::PerlVINC interfer in anyway with mod_ssl ???. I don't 
understand what is going on here.



Kees




Re: Apache::Session

2000-06-01 Thread Niral Trivedi

Yup...

you were right Josh 

But actually I have defined that column as 'text' and not 'BLOB'.. But,
I wrote a small script to write query on that column and I was able to
see that.. So, my confusion has gone now..

The reason why I was wondering is, I had one application in which I am
using 'text' column and when I check that column on command prompt I am
able to see contents for that.. So, I was like, why its working for that
and not for this..

But oh well..

Thanks again...

Niral

[EMAIL PROTECTED] wrote:
 
 In a message dated 6/1/2000 10:59:48 AM Eastern Daylight Time,
 [EMAIL PROTECTED] writes:
 
  Now, I am successfully able to run the script and generate sessionID and
   store that sessionID in MySQL database table.. But column 'a_session' is
   always empty!! Following is my code.. When I ran this code first time, I
   thought, I will have value of '$name' in column 'a_session' but I was
   wrong!! I mean I am in impression that, in MySQL datastore we can store
   all information about session for a particular sessionID. But it's not
   the case.. Whereas if I run the sample example which uses
   Apache::Session::File, I can see value of '$name' in the actual session
   file!!! So, Can somebody clear my doubts here??
 
   Thanks in advance..
 
 If you followed the perldocs, you also made a_session a BLOB.
 You won't be able to see the contens of the BLOB doing a
 simple select from a command line SQL interface. A BLOB is
 binary data.
 
 Plus, it has three columns, not two as you say...
 id varchar(16)
 length int(11)
 a_session blob
 
 -Josh Narins



custom_response/segfaults

2000-06-01 Thread Paul

After code verifying that the user hasn't already
been registered/approved, I changed the code below
==
if ($url !~ /NewReg[.]cgi$/o) {
   $r-custom_response(FORBIDDEN,
   "/public/NewReg.cgi");
   return FORBIDDEN; # trigger custom_response
}
==
to 
==
return OK 
   if $url =~ m{  # (I removed a few patterns here)
.*NewReg.cgi 
   }ixo;
   $r-headers_out-add('Location' =
   "$serverpath/NewReg.cgi");
   return MOVED;
==
and my segfaults seem to have stopped killing my
server child provcesses.
Did I use custom_response incorrectly?

__
Do You Yahoo!?
Send instant messages  get email alerts with Yahoo! Messenger.
http://im.yahoo.com/



problem with IO::Select under Apache::Registry (long)

2000-06-01 Thread tim fulcher


Hi,

I'm starting to play around with mod_perl, beginning with moving some
stuff under Apache Registry from cgi-bin.

One script makes use of the Msg.pm module I nicked from the O'Reilly
Advanced Perl Programming Book, to send a message from the web server to
another machine. This all worked fine under cgi-bin, but under the
Registry, the script fails to compile.

In the error_log is the message

[Thu Jun  1 13:51:55 2000] [error] [Thu Jun  1 13:51:55 2000]
getSNum.pl: [Thu Jun  1 13:51:55 2000] Msg.pm: [Thu Jun  1 13:51:55
2000] Msg.pm: Can't call method "new" without a package or object
reference at /usr/borg/lib/perl5/5.00503/Msg.pm line 11.
[Thu Jun  1 13:51:55 2000] getSNum.pl: BEGIN failed--compilation aborted
at /export/tools/apache/perl/getSNum.pl line 8.

The offending line in Msg.pm is

$rd_handles   = IO::Select-new();

So being a good netizen I checked this list's archive's before posting
this, and found a similar query by Barry Hoggard Dec 99 re: IO::Select
usage in LWP. He fixed his problem by putting "" quotes round
IO::Select, but I tried that for me with no success.

Any ideas ???

environment:

Solaris 2.6
apache 1.3.9
mod_perl 1.21
perl 5.00503

cheers

Tim Fulcher




Re: [ANNOUNCE] Apache::Session 1.51

2000-06-01 Thread Neil Conway

On Thu, Jun 01, 2000 at 01:53:10AM -0400, Robin Berjon wrote:
 Suggestions about making portable database test scripts are welcome.
 
 I think that DBD::CSV comes standard with DBI, would testing using that work ?

It didn't come standard with my DBI (and it needs SQL::Statement and
Text::CSV_XS)

-- 
Neil Conway [EMAIL PROTECTED]
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

Nothing can stop the man with the right mental attitude from achieving
his goal; nothing on earth can help the man with the wrong
mental attitude.
-- Thomas Jefferson

 PGP signature


[OT] App Release Naming Convention

2000-06-01 Thread Michael Nachbaur

This is probably flamebait, but I don't know where to go for this question.

What kind of release naming convention would you reccomend?  Something like Debians' 
"Potatoe", or RedHats' "Hedwig" et al.

So, I'm working on a proposal for an application, and I have several (widely diverse) 
possibilities, that will be similar in some ways.  I don't want the "suits" to get all 
bent out of shape 'cause I keep refering to "Proposal A and C, but not B"...they'll 
loose it.  So, I wanted to assign real names to the proposals that have nothing to do 
with the application.

So, lets hear it.  Any ideas for a naming convention?

-man



Re: Segmentation fault (11) with mod_perl 1.23...

2000-06-01 Thread Mark Haviland

Doug MacEachern wrote:

 On Thu, 25 May 2000, Mark Haviland wrote:
  No...I was hoping to be able to use it as a DSO, but maybe I can't win
  on this one

 it would be worth testing a static build to confirm that the problem is
 dso related.  if it is, where to go from there i'm not sure, the dso
 troubles are supposed to have been ironed out.  can you send me your
 perl -V?

Finally - some free time to compile :).

I just got done compiling a static version mod_perl inside the httpd.
After modifying the config file to match my 'dynamic' httpd (ie. adding the
PerlRequire with a different config.pl file that has a 'use Sybase::CTlib;'
in it.), I fired it up and...no core dump or segmentation fault.  And, I'm
now able to successfully query my db.  So, it looks like something is wrong
with DSO and perl...the dynaloader ???  Any ideas ??

Here's my perl -V:

[root@hsimrhpc1 logs]# perl -V

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=linux, osvers=2.2.5-22smp, archname=i386-linux
uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2
09:11:51 edt 1999 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-O2 -m486 -fno-strength-reduce',
gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under linux
  Compiled at Feb  2 2000 15:35:58
  @INC:
/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005
.





Mod_perl installation on NT_ERROR

2000-06-01 Thread parthasarathy mahendirababu

Hi,

I am running ActivePerl 5.6.0.613, Apache 1.3.12 on my NT4 (sp5)
I downloaded mod_perl-1.16-bin-bindist1-i386-win32-vc5.zip  file to install 
mod_perl

According to the Readme, I uncompressed the file and

  * Moved ApacheModulePerl to c:\Apache\Modules(C:\Apache is the root for 
Apache)
  * Added a line LoadModule perl_module modules/ApacheModulePerl to 
httpd.conf

When I started the Apache Server I am getting the following Error

Apache.exe - Entry Point Not Found

The procedure entry point _ap_table_add@12 could not be located in the 
dynamic link library ApacheCore.dll

And I am not clear of the readme that tells

copy the perl\site\ tree to your Perl top level directory (e.g. c:\perl).

when I unzip the modperl under c:\test, I get the dir structure like

C:\test\mod_perl-1.16-bin\perl\site\5.00502\lib

I am confused, exactly what are the folders i need to copy to my main perl 
dir



I will appreciate for a quick response

Thanks

Mahen.



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com




Re: Mod_perl installation on NT_ERROR

2000-06-01 Thread parthasarathy mahendirababu




From: "parthasarathy mahendirababu" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Mod_perl installation on NT_ERROR
Date: Thu, 01 Jun 2000 10:13:01 PDT

Hi,

I am running ActivePerl 5.6.0.613, Apache 1.3.12 on my NT4 (sp5)
I downloaded mod_perl-1.16-bin-bindist1-i386-win32-vc5.zip  file to install
mod_perl

According to the Readme, I uncompressed the file and

  * Moved ApacheModulePerl to c:\Apache\Modules(C:\Apache is the root for
Apache)
  * Added a line LoadModule perl_module modules/ApacheModulePerl to
httpd.conf

When I started the Apache Server I am getting the following Error

Apache.exe - Entry Point Not Found

The procedure entry point _ap_table_add@12 could not be located in the
dynamic link library ApacheCore.dll

And I am not clear of the readme that tells

copy the perl\site\ tree to your Perl top level directory (e.g. c:\perl).

when I unzip the modperl under c:\test, I get the dir structure like

C:\test\mod_perl-1.16-bin\perl\site\5.00502\lib

I am confused, exactly what are the folders i need to copy to my main perl
dir



I will appreciate for a quick response

Thanks

Mahen.



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com




Re: Bugs 5.6.0 modperl use?

2000-06-01 Thread Doug MacEachern

On Thu, 25 May 2000, Jeremy Howard wrote:

  CGI::Carp preloaded.
  DBI preloaded.
  
  [Wed May 24 19:58:28 2000] [error] PerlRun: `Bizarre copy of HASH in aassign
  at /usr5/perl/lib/5.6.0/Carp/Heavy.pm line 79.
  
  ...
  Anyone else seen these?
 
 Oh yes, I've been battling that tonight...
 
 Do the following:
 
 In Carp::Heavy, change 'DB' to 'DB_tmp':
 Line 39: while (do { { package DB_tmp; @a = caller($i++) } } ) {
 Line 79: @a = @{DB_tmp::args}; # must get local copy of args
 
 In CGI::Carp, change Line 257:
 FROM: my $message = shift;
 TO: my ($message) = @_;
 
 Yes, this really does matter--I carefully reproduced a problem that only
 occured when 'shift' was used!

do you have small test case to reproduce this bug?  i wasn't able to, but
poked around a bit and see:

#Carp.pm:
sub longmess {
{ local $@; require Carp::Heavy; }  # XXX fix require to not clear $@?
goto longmess_heavy;
}   

and perl.c:call_sv():
PL_eval_root = PL_op; /* Only needed so that goto works right.*/

which leads me to think goto() + call_sv() (which is how mod_perl
invokes handlers) can lead to trouble, we just need to figure out exactly
what is tripping it up.  it's not clear from the module changes you made
to bandaid the bug, i'd like to be able to reproduce this and step in with
gdb.  i have a feeling it's something to do with AUTOLOAD+eval "" changing
PL_eval_root, but i can only guess at this point.




Re: GET html page - permission denied

2000-06-01 Thread Doug MacEachern

On Thu, 25 May 2000, Prasit P wrote:

 By the way, i can access "http://209.10.98.1/index.html" using internet
 browser, but not the perl socket.

because the browser doesn't include http://x.x.x.x in the http request,
unless you are configured to use an http proxy.

 print $remote "GET http://209.10.98.1/index.html HTTP/1.0\n\n";

change that to "GET /index.html HTTP/1.0\n\n", which is the same as your
browser would send.





Re: global variables and reparsing (short reproducible example)

2000-06-01 Thread Doug MacEachern

On Fri, 26 May 2000, Marc Lehmann wrote:

 On Thu, May 25, 2000 at 12:09:09PM -0700, Doug MacEachern [EMAIL PROTECTED] wrote:
   You can only configure Apache from Perl sections, but you can load all
   your modules, shared data, etc. from a file pulled in with PerlRequire.
  
  actually you can, if a module defines variables in the
  Apache::ReadConfig:: namespace, they are fed to the apache config gears
  just as Perl sections are.
 
 Erhm, I am doing this right now (the functions I call just implant
 Location directives etc.. into the caller's package).
 
 Now it would be interesting to know wether that works only when called from
 perl sections or also form perlrequire? (Hmm, I'll just try it out and assume
 it's supported if it works ;)

yes, it's supported with PerlRequire and PerlModule.




Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Doug MacEachern

forget about mod_perl for a moment.  yes, true, Perl's built-in require
will not reload a module if it's already in %INC.  but that's doesn't mean
a Perl environment cannot un-cache that entry so it will be reloaded.
consider the code below, pretend that loop is a long-lifetime server,
Tk type application, vi or emacs with Perl embedded:

use Module::Reload ();

do {
Module::Reload-check;
require Foo;
} while (STDIN);

Module::Reload checks the mtime of Foo.pm (and all loaded modules) on
disk, if it has changed since the last time it was require'd, it will be
reloaded.  this is perfectly valid Perl, the language supports this
feature.  i'm quite certain your code be changed to adapt to such an
environment.




Re: does mod_perl with USE_DSO=1 require perl built with -Duseshrplib?

2000-06-01 Thread Doug MacEachern

On Fri, 26 May 2000, Benedict Lofstedt wrote:

 I have a number of apache servers on various hosts, not all of them are to
 be mod_perl enabled.  So, I tried to build apache with mod_perl as a DSO in
 order to enable mod_perl via the httpd.conf file if needed.
 
 I tried building mod_perl-1.24 as a DSO for apache-1.3.14 on my Irix
 platform.  Building went well, I got a libperl.so etc.
 
 However, the resulting httpd failed during make test, with a message about
 not being able to find PL_curpad when loading IO.so - similar to what is
 described in mod_perl_traps.pod.

-Duseshrplib is not required.  maybe you have a libperl.a in a place where
it shouldn't be, like /usr/local/lib/libperl.a?




Re: mod_perl 1.24 testing keeps failing

2000-06-01 Thread Doug MacEachern

On Fri, 26 May 2000, Mark Murphy wrote:
 
 I have one more issue with the "make test" for mod_perl. The documentation 
 indicates that SSL doesn't like /dev/null and that SSLDisable is set. Well, 
 after changing /dev/null and making sure SSLDisable is set in the httpd.conf 
 file, I was still getting an error with mod_ssl

where did you change /dev/null ?
 
 [Thu May 25 19:34:31 2000] [error] mod_ssl: Init: Failed to generate temporary 5
 12 bit RSA private key

no idea on this one, maybe a permission problem?  strace might help:
% make start_httpd
% strace -f -s1024 -o strace.out -p `cat t/logs/httpd.pid`
% make run_tests
% make kill_httpd

there's probably an open() call in strace.out to generate the tmp key.
 
 I had to comment out the LoadModule for libssl in the test httpd.conf file. Once 
 I did that I got results. During the "make test" for mod_perl I received 1 
 failure.

 modules/ssi.FAILED before any test output arrived

no cause for alarm.  the #perl ssi directive is disable when mod_perl is
built as a dso, the test should be skipped too, must be a flaw in the test
suite.




Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Doug MacEachern

On Fri, 26 May 2000, Marc Lehmann wrote:

 I know this and I have no problems with that (as I made very clear in my
 last mail). But when mod_perl requires special programming techniques this
 does not mean that code not using that techniques is "broken anyway", as
 dougm said, at least not in perl. It might be "broken code", but then the
 language is not perl (where the problematic technique is documented to
 work in perltoot).

when i said 'broken', that is shorthand for, you need to change your code
so it can deal with being reloaded.  which, is valid in the Perl language.
 
 As I explained I was getting defensive simply because _not_ all are
 friends here. I am still defensive because calling somebody else's code
 broken should not be done so lightly.

you shouldn't take offense to what i said, it was not directed at you
alone, i've said it plenty of times before you brought it up.  just as
i've said using 'exit()' is broken, along with any other code that makes
assumptions about it's calling environment.
 
 What happened, if you go back and read the thread, is that I had a question
 and had a very hard time explaining what I actually meant (because my initial
 mails were simply not verbose enough on the problem). Many responses
 (especially the private ones) were very aggressive, so "we are all friends"
 is a myth.

i didn't see any "aggressive" responses on the list, if mine came across
that way, i apoligize, i certainly didn't mean to.  i've spent a great
deal of time trying to help people on this list over the past 4 years and
trying to make mod_perl better at the same time.  my responses tend to be
short and to the point to optimize my time, i'm a really friendly guy in
person :)

 Since this is my first contact with modperl, however, this just means that
 I wasn't able to adjust myself to the tone on (and around) the modperl
 mailinglist.. Next time I will simply ignore most of the responses.

i think the tone in general on this list is *very* positive and friendly,
much more so than the few other lists i subscribe to.  don't let one
misunderstanding discourage you, harsh words are very rare here.




Re: Problem compiling mod_perl 1.24 on Solaris 2.6

2000-06-01 Thread Doug MacEachern

On Fri, 26 May 2000, Fred Miller wrote:
 
 Thank you very much. Sorry for being such a newbie. 

no need to apologize, this sort of problem isn't normal, if anyone should
say sorry, it's sun for their flawed compiler kit.

 I rebuilt Perl with gcc, and then was able to get a build of Apache with
 mod_perl.

great news.




RE: installation of GTop and Scoreboard

2000-06-01 Thread Doug MacEachern

On Tue, 30 May 2000, Alex Algard wrote:

 Thanks, but installing glibtop only solved the GTop.pm issue. We're still
 having the same problem with Scoreboard.pm. Below is the output from the
 Scoreboard.pm installation process.

 Error: 'Apache' not in typemap in DummyScoreboard.xs, line 122

you need to install mod_perl, a version that is built against the Apache
sources, so it installs the apache header files and the mod_perl typemap





Re: Perl 5.6+mod_perl bugs (was Re: Win32 mod_perl binary [update])

2000-06-01 Thread Doug MacEachern

On Tue, 30 May 2000, Jeremy Howard wrote:

 *  Many problems appear running under Apache::DB. In particular,
 Apache::Util::escape_uri causes a segfault under Apache::DB in some
 circumstances, as does Apache::Request::register_cleanup (when called as
 a class rather than an object method)
 *  Slight changes to code can cause a segfault for no apparent reason.
 For instance, under Apache::DB, the following causes a crash (from
 Email::Valid)...
 
 $Resolver = new Net::DNS::Resolver unless $@;
 
 ...while the following works fine...
 
 if (!$@) {
   $Resolver = new Net::DNS::Resolver;
 }

the debugger is often tripped up inside mod_perl (inside perl_call_sv i
should say), i've had problems with 5.005_03 too.  if you can post tiny
examples that trip up the debugger, i can look into them.
the debugger is another case of 'broken' code, it assumes it will only be
run from the command line with the -d switch (which is why the Apache::DB 
wrapper is required).  it's certainly worth doing what we need to so it's
happy inside mod_perl.




Re: CGI.pm's -compile/-autoload methods

2000-06-01 Thread Doug MacEachern

 
 1. regarding -compile, if the tags are imported into the startup.pl's
 package or main:: they aren't inhereted by child processes and therefore
 not adding some memory size to the total child process size, am I right? 
 (well it's shared anyway)

doesn't matter if it's shared, it's shared un-needed bloat!  i would use
CGI::compile() instead of use CGI -compile, as gunther suggested.




Re: Apache::Registry RFE

2000-06-01 Thread Doug MacEachern

On Tue, 30 May 2000, Michael Blakeley wrote:

 Of course there was an error...
 
 At 9:54 PM -0700 5/30/2000, Michael Blakeley wrote:
 
 $r-log_error($errsv) if $Apache::RegistryYA::AutoLog;
 
 s/RegistryYA/Registry
 
 I'm also having second thoughts about the binary nature of this 
 thing... I'd forgotten that $errsv might well be a text message like:
   Can't locate object method foo via package "Apache" at...
 which I'd quite like to see in the log.
 
 So maybe...
 
 $ diff -w Registry.pm.orig Registry.pm
 26a27,28
   $Apache::Registry::AutoLog ||= 32768;
 
 155c157,160
$r-log_error($errsv);
 ---
 {
local $^W = 0;
$r-log_error($errsv) if $Apache::Registry::AutoLog  0+$errsv
 }
 
 This way, setting $Apache::Registry::AutoLog = 300 gives me the 
 behavior I want (no extra log lines for 302, 304, 500) while still 
 letting "true" eval errors through. The default value should come 
 pretty close to the original behavior.

thanks for the patch, but we've stopped adding features to
Apache::Registry.  you can implement this with a subclass of
Apache::RegistryNG, something like so:

package My::Registry;

use Apache::RegistryNG (); 
@ISA = qw(Apache::RegistryNG);

sub log_error {
my($r, $errsv) = @_;
$r-SUPER::log_error($errsv) if $AutoLog  0+$errsv
}

1;
__END__

PerlHandler My::Registry




Re: Perl Section questions

2000-06-01 Thread Doug MacEachern

On Wed, 31 May 2000, Kees Vonk 7249 24549 wrote:

 I have two questions about perl sections:
 
 1) Has setting an entry in the %ENV hash in a perl section 
the same effect as using a SetEnv (or PerlSetEnv) 

no, %ENV is cleared at startup, you need to use the *Env directives for
any you want to stick around.

directive (What btw is the difference between SetEnv and 
PerlSetEnv, both seem to effect %ENV in the same way.)

SetEnv doesn't happen until the fixup phase, PerlSetEnv happens asap, so
those variables are available before then, e.g. in PerlAuthenHandler for
$ENV{ORACLE_HOME} + Apache::AuthenDBI

 2) If the order of directives in a Location section matters 
(see recent discussion on Apache::PerlVINC), does that 
mean I cannot use Perl Sections to configure that because 
the order of hash keys is unreliable.

you can use:

$PerlConfig .= EOF;
EOF

or 

push @PerlConfig, ...;

or

Apache-httpd_conf(...);

to generate config that must have order preserved.





RE: Wierd problem with redirect

2000-06-01 Thread Doug MacEachern

On Wed, 31 May 2000, Jeffrey W. Baker wrote:

 On Tue, 30 May 2000, Jerrad Pierce wrote:
 
  I'm running into an odd redirect ptoblem myself, I'm issuing:
  
  HTTP/1.1 302 Moved Temporarily\n\r
  Date: Tue 30 May 2000 18:18:07 GMT\n\r
  Server: Apache/1.311\n\r
  Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/;
  expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r
  Location: /\n\r
 
 If you don't follow the HTTP specification, you can't expect the browser
 to do the right thing.  "/" is not a valid URI for a Location.  According
 to RFC 2616, the Location must be an absolute URI:

but it is valid in apache, for mod_cgi scripts and mod_perl scripts that
have PerlSendHeader On.  apache will do an internal redirect if the url is
not absolute.




RE: elusive, disappearing notes?

2000-06-01 Thread Doug MacEachern

On Wed, 31 May 2000, Geoffrey Young wrote:

 I've seen this before and always thought to attribute it to mod_dir creating
 a new request to properly map / to /index.html
 
 since any notes set are for the lifetime of the request only, the new
 request (representing /index.html) would/should have no notes...

right.  you should be able to always get the same notes table with
something like so:

my $notes = $r-main ? $r-main-notes : $r-notes;





Re: Apache::PerlVINC again

2000-06-01 Thread Doug MacEachern

On Thu, 1 Jun 2000, Kees Vonk 7249 24549 wrote:

 The following works on Apache/1.3.6 (Unix) mod_perl/1.21 
 mod_ssl/2.3.5 OpenSSL/0.9.3a
 
 But when running on Apache/1.3.9 (Unix) mod_perl/1.21 
 mod_ssl/2.4.8 OpenSSL/0.9.4, I get the following problem 
 which _appears_ (I am not 100% sure) to be caused by 
 Apache::PerlVINC. I have the following section in my 
 httpd.conf
... 
 The moment I uncomment the PerlVINC lines (or even just the first one) 
 apache fails to start without any error message (STDOUT or logs (LogLevel 
 debug)) or core file.

you'll need to try this:

Date: Thu, 25 May 2000 12:13:20 -0700 (PDT)
From: Doug MacEachern [EMAIL PROTECTED]
To: Roberto Bourgonjen [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
Subject: Re: httpd exits with apache-1.3.12 and mod_perl-1.21 on Redhat
6.2

On Wed, 24 May 2000, Roberto Bourgonjen wrote:

 Hi all,
 
 I am encountering strange problems on redhat 6.2 installations with
 rpm's apache-1.3.12-2 and mod_perl-1.21-10 (the latest available
 versions from redhat. I _have_ to use rpm's). I've tried two machines.
 
 As soon as load certain modules the server exits immediately, without 
 producing the slightest error message.

try this:

% gdb httpd
(gdb) b exit
(gdb) run -X

whether it core dumps or exit() is called, post the output of:

(gdb) bt






Re: Mod_perl installation on NT_ERROR

2000-06-01 Thread Randy Kobes

On Thu, 1 Jun 2000, parthasarathy mahendirababu wrote:

 I am running ActivePerl 5.6.0.613, Apache 1.3.12 on my NT4 (sp5)
 I downloaded mod_perl-1.16-bin-bindist1-i386-win32-vc5.zip  file to install 
 mod_perl
 
 When I started the Apache Server I am getting the following Error
 
 Apache.exe - Entry Point Not Found
 
 The procedure entry point _ap_table_add@12 could not be located in the 
 dynamic link library ApacheCore.dll

Hi,
  You might want to try one of the Win32 mod_perl binaries listed 
in http://perl.apache.org/distributions.html - these also contain 
the necessary perl and apache binaries.

best regards,
randy kobes





Apache::Session

2000-06-01 Thread Niral Trivedi

All,

I need to clear myself on a small issue regarding Apache::Session.

As per my understanding, Apache::Session will store session information
in a backing store-either a flat file or in some database. And
everytime, request comes in, it will check for sessionID in backing
store and retrieve all information for that session. If request is new
than it will create new sessionID and also create an entry in backing
store..

Now, only way to remove this information from backing store is to do
'tied(%session_hash)-delete', Am I right? I mean is there any way we
can remove these entries by setting 'time_out_interval' or something
like that?? 

Because if we do 'tied(%session_hash)-delete' then it will create new
session for every request... So, I was thinking of not doing
'tied-delete' but write a small cron script which runs at specified
interval and removes entry from backing store which are older than some
time...

Because concept of 'time_out_interval' does exist in Apache JServ and
other application servers..

Any ideas, suggestions or pointers on this???

Thanks again..

Niral
--



RE: Apache::Session

2000-06-01 Thread Michael Nachbaur

Well, from what I'm reading, it looks like you don't want it to create sessions for 
all images, CSS, et al on the first page load, right?  Instead of deleting sessions 
that aren't used, you could try just not serving sessions to documents that don't need 
'em.

Like in my setup, I've put in a PerlTransHandler pointing to a custom perl module I've 
created:
PerlTransHandler  Apache::URISession

Then, in Apache::URISession, I've done the following:
package Apache::URISession;
 use strict;
 use Apache::Constants qw(:common);

 sub handler {
my $r = shift;
my $uri = $r-uri;
my ($session) = $uri =~ m|/S([0-9a-f]{32})|;
$uri =~ s|/S[0-9a-f]{32}||;
my $filename = $r-document_root . $uri;

$ENV{'SESSION_ID'} = $session if ( $session );
print STDERR "SESSION: " . $session, "\n";
print STDERR "URI: " . $uri, "\n";
$r-uri($uri);
$r-filename( $filename );
return OK;
 }

 1;
 __END__

There might be another module that does this, but I wanted to embed the session key in 
the URL.  So, in this example, it'll redirect the user to an address like this one:
http://127.0.0.1/S94b419c5908ae5f0773a4bfd61cbec1d/index.html

It'll rip the session out, put it in ENV{SESSION_ID}, and continue processing.  I'm 
not sure if I should be returning an OK there or not (I'm new to using handlers), but 
it does the job.

Also, keep in mind, I'm using the new Apache::Session which creates 32-character keys, 
which is why I'm doing the pattern match check like {32}.

-man

-Original Message-
From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 01, 2000 12:57 PM
To: [EMAIL PROTECTED]
Subject: Apache::Session


All,

I need to clear myself on a small issue regarding Apache::Session.

As per my understanding, Apache::Session will store session information
in a backing store-either a flat file or in some database. And
everytime, request comes in, it will check for sessionID in backing
store and retrieve all information for that session. If request is new
than it will create new sessionID and also create an entry in backing
store..

Now, only way to remove this information from backing store is to do
'tied(%session_hash)-delete', Am I right? I mean is there any way we
can remove these entries by setting 'time_out_interval' or something
like that?? 

Because if we do 'tied(%session_hash)-delete' then it will create new
session for every request... So, I was thinking of not doing
'tied-delete' but write a small cron script which runs at specified
interval and removes entry from backing store which are older than some
time...

Because concept of 'time_out_interval' does exist in Apache JServ and
other application servers..

Any ideas, suggestions or pointers on this???

Thanks again..

Niral
--



RE: Apache::Session

2000-06-01 Thread Michael Nachbaur

Sorry, forgot to mention, that you can define the PerlTransHandler in only those 
directories that you want sessions created for.

-man

-Original Message-
From: Michael Nachbaur [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 01, 2000 1:08 PM
To: Niral Trivedi; [EMAIL PROTECTED]
Subject: RE: Apache::Session


Well, from what I'm reading, it looks like you don't want it to create sessions for 
all images, CSS, et al on the first page load, right?  Instead of deleting sessions 
that aren't used, you could try just not serving sessions to documents that don't need 
'em.

Like in my setup, I've put in a PerlTransHandler pointing to a custom perl module I've 
created:
PerlTransHandler  Apache::URISession

Then, in Apache::URISession, I've done the following:
package Apache::URISession;
 use strict;
 use Apache::Constants qw(:common);

 sub handler {
my $r = shift;
my $uri = $r-uri;
my ($session) = $uri =~ m|/S([0-9a-f]{32})|;
$uri =~ s|/S[0-9a-f]{32}||;
my $filename = $r-document_root . $uri;

$ENV{'SESSION_ID'} = $session if ( $session );
print STDERR "SESSION: " . $session, "\n";
print STDERR "URI: " . $uri, "\n";
$r-uri($uri);
$r-filename( $filename );
return OK;
 }

 1;
 __END__

There might be another module that does this, but I wanted to embed the session key in 
the URL.  So, in this example, it'll redirect the user to an address like this one:
http://127.0.0.1/S94b419c5908ae5f0773a4bfd61cbec1d/index.html

It'll rip the session out, put it in ENV{SESSION_ID}, and continue processing.  I'm 
not sure if I should be returning an OK there or not (I'm new to using handlers), but 
it does the job.

Also, keep in mind, I'm using the new Apache::Session which creates 32-character keys, 
which is why I'm doing the pattern match check like {32}.

-man

-Original Message-
From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 01, 2000 12:57 PM
To: [EMAIL PROTECTED]
Subject: Apache::Session


All,

I need to clear myself on a small issue regarding Apache::Session.

As per my understanding, Apache::Session will store session information
in a backing store-either a flat file or in some database. And
everytime, request comes in, it will check for sessionID in backing
store and retrieve all information for that session. If request is new
than it will create new sessionID and also create an entry in backing
store..

Now, only way to remove this information from backing store is to do
'tied(%session_hash)-delete', Am I right? I mean is there any way we
can remove these entries by setting 'time_out_interval' or something
like that?? 

Because if we do 'tied(%session_hash)-delete' then it will create new
session for every request... So, I was thinking of not doing
'tied-delete' but write a small cron script which runs at specified
interval and removes entry from backing store which are older than some
time...

Because concept of 'time_out_interval' does exist in Apache JServ and
other application servers..

Any ideas, suggestions or pointers on this???

Thanks again..

Niral
--



RE: Apache::Session

2000-06-01 Thread Jay Jacobs

Mod_Rewrite does the same thing in a few less lines:

RewriteEngine On
RewriteCond /your/document_root/%{REQUEST_FILENAME} !-f
RewriteRule ^/S([^/]+)/(.*)/$2 [E=SESSION_ID:$1]

the RewriteCond statement just makes sure you don't (for some strange
reason) have a file/directory that is of the same name as the request, and
it's completely removable 

This also doesn't change the $r-uri value, but I find that kind of a
blessing.

Jay Jacobs
LachNet Inc.

On Thu, 1 Jun 2000, Michael Nachbaur wrote:

 Well, from what I'm reading, it looks like you don't want it to create sessions for 
all images, CSS, et al on the first page load, right?  Instead of deleting sessions 
that aren't used, you could try just not serving sessions to documents that don't 
need 'em.
 
 Like in my setup, I've put in a PerlTransHandler pointing to a custom perl module 
I've created:
 PerlTransHandler  Apache::URISession
 
 Then, in Apache::URISession, I've done the following:
 package Apache::URISession;
  use strict;
  use Apache::Constants qw(:common);
 
  sub handler {
 my $r = shift;
 my $uri = $r-uri;
 my ($session) = $uri =~ m|/S([0-9a-f]{32})|;
 $uri =~ s|/S[0-9a-f]{32}||;
 my $filename = $r-document_root . $uri;
 
 $ENV{'SESSION_ID'} = $session if ( $session );
 print STDERR "SESSION: " . $session, "\n";
 print STDERR "URI: " . $uri, "\n";
 $r-uri($uri);
 $r-filename( $filename );
 return OK;
  }
 
  1;
  __END__
 
 There might be another module that does this, but I wanted to embed the session key 
in the URL.  So, in this example, it'll redirect the user to an address like this one:
 http://127.0.0.1/S94b419c5908ae5f0773a4bfd61cbec1d/index.html
 
 It'll rip the session out, put it in ENV{SESSION_ID}, and continue processing.  I'm 
not sure if I should be returning an OK there or not (I'm new to using handlers), but 
it does the job.
 
 Also, keep in mind, I'm using the new Apache::Session which creates 32-character 
keys, which is why I'm doing the pattern match check like {32}.
 
 -man
 
 -Original Message-
 From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 01, 2000 12:57 PM
 To: [EMAIL PROTECTED]
 Subject: Apache::Session
 
 
 All,
 
 I need to clear myself on a small issue regarding Apache::Session.
 
 As per my understanding, Apache::Session will store session information
 in a backing store-either a flat file or in some database. And
 everytime, request comes in, it will check for sessionID in backing
 store and retrieve all information for that session. If request is new
 than it will create new sessionID and also create an entry in backing
 store..
 
 Now, only way to remove this information from backing store is to do
 'tied(%session_hash)-delete', Am I right? I mean is there any way we
 can remove these entries by setting 'time_out_interval' or something
 like that?? 
 
 Because if we do 'tied(%session_hash)-delete' then it will create new
 session for every request... So, I was thinking of not doing
 'tied-delete' but write a small cron script which runs at specified
 interval and removes entry from backing store which are older than some
 time...
 
 Because concept of 'time_out_interval' does exist in Apache JServ and
 other application servers..
 
 Any ideas, suggestions or pointers on this???
 
 Thanks again..
 
 Niral
 --
 




Re: Apache::Registry RFE

2000-06-01 Thread Michael Blakeley

At 12:40 PM -0700 6/1/2000, Doug MacEachern wrote:
On Tue, 30 May 2000, Michael Blakeley wrote:

   $ diff -w Registry.pm.orig Registry.pm
  26a27,28
$Apache::Registry::AutoLog ||= 32768;
  
  155c157,160
 $r-log_error($errsv);
  ---
  {
 local $^W = 0;
 $r-log_error($errsv) if 
$Apache::Registry::AutoLog  0+$errsv
  }

  This way, setting $Apache::Registry::AutoLog = 300 gives me the
  behavior I want (no extra log lines for 302, 304, 500) while still
  letting "true" eval errors through. The default value should come
  pretty close to the original behavior.

thanks for the patch, but we've stopped adding features to
Apache::Registry.  you can implement this with a subclass of
Apache::RegistryNG, something like so:

Thanks - but RegistryNG causes problems elsewhere in my code. 
Apache::File::mtime() doesn't seem to work with RegistryNG. The code:

$mtime = 954291795;
 if (defined $mtime) {
 $r-update_mtime($mtime);
 warn "mtime=".join(',', $mtime, $r-mtime);
 $r-set_last_modified;
 }

works fine in Apache::Registry, but seems to set mtime to 0 in 
Apache::RegistryNG. Since I can't seem to get a handle on this 
problem, I've gone back to Apache::Registry.

Solaris 2.6 + patches, Apache 1.3.9, mod_perl 1.24, perl -V says

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
   Platform:
 osname=solaris, osvers=2.6, archname=sun4-solaris
 uname='sunos mail 5.6 generic_105181-17 sun4u sparc sunw,ultra-5_10 '
 config_args='-des -Dcc=gcc -Dprefix=/usr/local -Doptimize=-g -O 
-Duseshrplib'
 hint=recommended, useposix=true, d_sigaction=define
 usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
 useperlio=undef d_sfio=undef uselargefiles=define
 use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
   Compiler:
 cc='gcc', optimize='-g -O', gccversion=2.95.1 19990816 (release)
 cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
 ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 stdchar='unsigned char', d_stdstdio=define, usevfork=false
 intsize=4, longsize=4, ptrsize=4, doublesize=8
 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
 ivtype='long', ivsize=4, nvtype='double', nvsize=8, 
Off_t='off_t', lseeksize=8
 alignbytes=8, usemymalloc=y, prototype=define
   Linker and Libraries:
 ld='gcc', ldflags =' -L/usr/local/lib '
 libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
 libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec
 libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
   Dynamic Linking:
 dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -R 
/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE'
 cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: DEBUGGING USE_LARGE_FILES
   Built under solaris
   Compiled at Apr  2 2000 14:37:00
   @INC:
 /usr/local/lib/perl5/5.6.0/sun4-solaris
 /usr/local/lib/perl5/5.6.0
 /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
 /usr/local/lib/perl5/site_perl/5.6.0
 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
 /usr/local/lib/perl5/site_perl/5.005
 /usr/local/lib/perl5/site_perl
 .

-- Mike



Re: Apache::Registry RFE

2000-06-01 Thread Doug MacEachern

 Thanks - but RegistryNG causes problems elsewhere in my code. 
 Apache::File::mtime() doesn't seem to work with RegistryNG. The code:

whoops!!  Apache::PerlRun/RegistryNG were written before apache introduced
the ap_update_mtime api function.  i've renamed Apache::PerlRun's version
to set_mtime, as it is not supposed to override Apache::update_mtime.

Index: lib/Apache/PerlRun.pm
===
RCS file: /home/cvs/modperl/lib/Apache/PerlRun.pm,v
retrieving revision 1.28
diff -u -r1.28 PerlRun.pm
--- lib/Apache/PerlRun.pm   2000/05/12 07:10:57 1.28
+++ lib/Apache/PerlRun.pm   2000/06/01 21:05:12
@@ -104,7 +104,7 @@
   $Apache::Registry-{$package}{'mtime'} = $mtime);
 }
 
-sub update_mtime {
+sub set_mtime {
 my($pr, $mtime, $package) = @_;
 $mtime   ||= $pr-{'mtime'};
 $package ||= $pr-{'namespace'};
Index: lib/Apache/RegistryNG.pm
===
RCS file: /home/cvs/modperl/lib/Apache/RegistryNG.pm,v
retrieving revision 1.5
diff -u -r1.5 RegistryNG.pm
--- lib/Apache/RegistryNG.pm1999/06/11 02:50:01 1.5
+++ lib/Apache/RegistryNG.pm2000/06/01 21:05:12
@@ -45,7 +45,7 @@
$pr-sub_wrap;
my $rc = $pr-compile;
 return $rc if $rc != OK;
-   $pr-update_mtime;
+   $pr-set_mtime;
 }
 
 $rc = $pr-run(@_);




Re: custom_response/segfaults

2000-06-01 Thread Doug MacEachern

On Thu, 1 Jun 2000, Paul wrote:

 After code verifying that the user hasn't already
 been registered/approved, I changed the code below
 ==
 if ($url !~ /NewReg[.]cgi$/o) {
$r-custom_response(FORBIDDEN,
"/public/NewReg.cgi");
return FORBIDDEN; # trigger custom_response
 }
 ==
 to 
 ==
 return OK 
if $url =~ m{  # (I removed a few patterns here)
 .*NewReg.cgi 
}ixo;
$r-headers_out-add('Location' =
"$serverpath/NewReg.cgi");
return MOVED;
 ==
 and my segfaults seem to have stopped killing my
 server child provcesses.
 Did I use custom_response incorrectly?

you're using it the right way.  which Perl*Handler are you calling it
from?  can you get a stacktrace?  (see SUPPORT doc)




logging bytes served

2000-06-01 Thread Paul

Is there a simple way already provided to add bytes served a request
into the log?

__
Do You Yahoo!?
Send instant messages  get email alerts with Yahoo! Messenger.
http://im.yahoo.com/



RE: logging bytes served

2000-06-01 Thread Michael Nachbaur

This is really an Apache question, but:
In your LogFormat call (if you're using it), include the %b flag, which means 'Bytes 
Sent'.  (I got this from the O'Reilly Apache book).

-man

-Original Message-
From: Paul [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 01, 2000 2:22 PM
To: modperl
Subject: logging bytes served


Is there a simple way already provided to add bytes served a request
into the log?

__
Do You Yahoo!?
Send instant messages  get email alerts with Yahoo! Messenger.
http://im.yahoo.com/



RE: logging bytes served

2000-06-01 Thread Jason Bodnar

$r-log-debug($r-bytes_sent);

On 01-Jun-2000 Paul wrote:
 Is there a simple way already provided to add bytes served a request
 into the log?
 
 __
 Do You Yahoo!?
 Send instant messages  get email alerts with Yahoo! Messenger.
 http://im.yahoo.com/

-- 
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

I'm sick of eating hoagies!  I want a grinder, a sub, a foot-long
hero!  I want to live, Marge!  Won't you let me live?  Won't you,
please?

-- Homer Simpson
   Fear of Flying




Apache children hanging

2000-06-01 Thread Gustavo Duarte

Hi there people,

I have inherited a web server running mod_perl and I am experiencing a
somewhat critical problem: http processes sometimes get into an infinite
loop, using 100% cpu time, and given enough time bring the machine to a
halt.

I've done a lot of testing, and there isn't a specific http request that
triggers the behaviour, eventhough it always happens after a request. It
seems to happen every few hours: the httpd process simply starts hogging
up the CPU, and won't let go of it. After a while, I have a few of these
processes running, and the machine's load average skyrockets. Sometimes
it's bad enough I'm not even able to log in via console.

I'll upgrade all the software to new versions, but apparently this
problem has been ocurring for a while, and survived a couple of
hardware/software upgrades. I'll also be rewriting the perl code running
there to see if it stops the problem (the code isn't too clean - lots of
global variables, not written under strict, etc, but "it works").
However, it would be cool if someone could enlighten me on what's going
on, and possibly suggest a fix :).

Thanks a lot!

signed,
gustavo

begin debugging info

= our OS is:

[root@blueland /root]# uname -a
Linux blueland 2.2.14-5.0 #4 Wed Apr 12 20:28:28 MDT 2000 i586 unknown

= Apache:

Server Version: Apache/1.3.6 (Unix) mod_perl/1.19 mod_ssl/2.2.8
OpenSSL/0.9.2b

= let's look into one of the monster processes:

497 ?R288:06 /usr/local/apache_1.3.6/bin/httpd

= (nice cpu time there...)
= now for gdb...

[root@blueland /root]# gdb /usr/local/apache/bin/httpd 497
GNU gdb 4.18
Copyright 1998 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.

Attaching to program: /usr/local/apache/bin/httpd, Pid 497
Reading symbols from /lib/libNoVersion.so.1...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libcrypt.so.1...done.
Reading symbols from
/usr/lib/perl5/5.00502/i586-linux/CORE/libperl.so...done.
Reading symbols from /lib/libnsl.so.1...done.
Reading symbols from /lib/libdl.so.2...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libnss_files.so.2...done.
Reading symbols from
/usr/lib/perl5/site_perl/5.005/i586-linux/auto/Sybase/DBlib/DBlib.none...done.

Reading symbols from /opt/sybase/lib/libsybdb.so...done.
Reading symbols from /opt/sybase/lib/libinsck.so...done.
Reading symbols from /lib/libnss_nisplus.so.2...done.
Reading symbols from /lib/libnss_nis.so.2...done.
0x80a7407 in free_blocks ()

= let's see what the stack tells us...

(gdb) i s
#0  0x80a7407 in free_blocks ()
#1  0x80a7660 in ap_clear_pool ()
#2  0x80a76a1 in ap_destroy_pool ()
#3  0x80be71a in ap_destroy_sub_req ()
#4  0x8070d8a in XS_Apache__SubRequest_DESTROY ()
#5  0x400d0f45 in Perl_pp_entersub () at pp_hot.c:1965
#6  0x4007aa8d in perl_call_sv () at perl.c:1008
#7  0x400d9d4c in Perl_sv_clear () at sv.c:2418
#8  0x400da451 in Perl_sv_free () at sv.c:2418
#9  0x400d24ab in do_clean_objs (sv=0x8385744) at sv.c:338
#10 0x400d237c in visit (f=0x400d2410 do_clean_objs) at sv.c:306
#11 0x400d263f in Perl_sv_clean_objs () at sv.c:359
#12 0x40077fa5 in perl_destruct () at perl.c:1008
#13 0x80635a3 in perl_shutdown ()
#14 0x80645c5 in perl_child_exit ()
#15 0x8064430 in perl_child_exit_cleanup ()
#16 0x80a8dd6 in run_cleanups ()
#17 0x80a762c in ap_clear_pool ()
#18 0x80a76a1 in ap_destroy_pool ()
#19 0x80b3b03 in clean_child_exit ()
#20 0x80b6773 in child_main ()
#21 0x80b6e14 in make_child ()
#22 0x80b716e in perform_idle_server_maintenance ()
#23 0x80b7665 in standalone_main ()
#24 0x80b7cd3 in main ()

= registers have:

(gdb) i r
eax0x8a3e408144958472
ecx0x8608414140542996
edx0x8a3e408144958472
ebx0x8239208136548872
esp0xb90c   0xb90c
ebp0xb910   0xb910
esi0x1  1
edi0x   -1
eip0x80a74070x80a7407
eflags 0x202514
cs 0x23 35
ss 0x2b 43
ds 0x2b 43
es 0x2b 43
fs 0x0  0
gs 0x0  0

= this is a dump of the running function

(gdb) disas
Dump of assembler code for function free_blocks:
0x80a73e0 free_blocks:push   %ebp
0x80a73e1 free_blocks+1:  mov%esp,%ebp
0x80a73e3 free_blocks+3:  sub$0x4,%esp
0x80a73e6 free_blocks+6:  cmpl   $0x0,0x8(%ebp)
0x80a73ea free_blocks+10: jne0x80a73f0 free_blocks+16
0x80a73ec free_blocks+12: jmp0x80a7439 free_blocks+89
0x80a73ee free_blocks+14: mov%esi,%esi
0x80a73f0 free_blocks+16: mov0x8146b88,%eax
0x80a73f5 

Re: Apache children hanging

2000-06-01 Thread John Armstrong

I have had this problem to varying degrees in all of my high traffic 
mod perl installations. The thing that saves me is Apache::Resource. 
In my httpd.conf I put :

PerlModule Apache::Resource
PerlSetEnv PERL_RLIMIT_DATA 32
PerlSetEnv PERL_RLIMIT_CPU 640
PerlChildInitHandler Apache::Resource

That kills off any bad children. Before I installed this things were 
regularly spinning out of control. You could sit and watch them go 
nuts. After installing it you could watch them _attempt_ to go nuts 
and then watch apache clean house. Its a lifesaver.

Why does it happen? A variety of reasons but I have just accepted it 
as the cost of doing business with mod_perl and gone on with things. 
Not the most proactive response but so be it :(

John Armstrong


At 3:33 PM -0700 6/1/00, Gustavo Duarte wrote:
Hi there people,

I have inherited a web server running mod_perl and I am experiencing a
somewhat critical problem: http processes sometimes get into an infinite
loop, using 100% cpu time, and given enough time bring the machine to a
halt.

I've done a lot of testing, and there isn't a specific http request that
triggers the behaviour, eventhough it always happens after a request. It
seems to happen every few hours: the httpd process simply starts hogging
up the CPU, and won't let go of it. After a while, I have a few of these
processes running, and the machine's load average skyrockets. Sometimes
it's bad enough I'm not even able to log in via console.

I'll upgrade all the software to new versions, but apparently this
problem has been ocurring for a while, and survived a couple of
hardware/software upgrades. I'll also be rewriting the perl code running
there to see if it stops the problem (the code isn't too clean - lots of
global variables, not written under strict, etc, but "it works").
However, it would be cool if someone could enlighten me on what's going
on, and possibly suggest a fix :).

Thanks a lot!

signed,
gustavo

begin debugging info

= our OS is:

[root@blueland /root]# uname -a
Linux blueland 2.2.14-5.0 #4 Wed Apr 12 20:28:28 MDT 2000 i586 unknown

= Apache:

Server Version: Apache/1.3.6 (Unix) mod_perl/1.19 mod_ssl/2.2.8
OpenSSL/0.9.2b

= let's look into one of the monster processes:

497 ?R288:06 /usr/local/apache_1.3.6/bin/httpd

= (nice cpu time there...)
= now for gdb...

[root@blueland /root]# gdb /usr/local/apache/bin/httpd 497
GNU gdb 4.18
Copyright 1998 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.

Attaching to program: /usr/local/apache/bin/httpd, Pid 497
Reading symbols from /lib/libNoVersion.so.1...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libcrypt.so.1...done.
Reading symbols from
/usr/lib/perl5/5.00502/i586-linux/CORE/libperl.so...done.
Reading symbols from /lib/libnsl.so.1...done.
Reading symbols from /lib/libdl.so.2...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libnss_files.so.2...done.
Reading symbols from
/usr/lib/perl5/site_perl/5.005/i586-linux/auto/Sybase/DBlib/DBlib.none...done.

Reading symbols from /opt/sybase/lib/libsybdb.so...done.
Reading symbols from /opt/sybase/lib/libinsck.so...done.
Reading symbols from /lib/libnss_nisplus.so.2...done.
Reading symbols from /lib/libnss_nis.so.2...done.
0x80a7407 in free_blocks ()

= let's see what the stack tells us...

(gdb) i s
#0  0x80a7407 in free_blocks ()
#1  0x80a7660 in ap_clear_pool ()
#2  0x80a76a1 in ap_destroy_pool ()
#3  0x80be71a in ap_destroy_sub_req ()
#4  0x8070d8a in XS_Apache__SubRequest_DESTROY ()
#5  0x400d0f45 in Perl_pp_entersub () at pp_hot.c:1965
#6  0x4007aa8d in perl_call_sv () at perl.c:1008
#7  0x400d9d4c in Perl_sv_clear () at sv.c:2418
#8  0x400da451 in Perl_sv_free () at sv.c:2418
#9  0x400d24ab in do_clean_objs (sv=0x8385744) at sv.c:338
#10 0x400d237c in visit (f=0x400d2410 do_clean_objs) at sv.c:306
#11 0x400d263f in Perl_sv_clean_objs () at sv.c:359
#12 0x40077fa5 in perl_destruct () at perl.c:1008
#13 0x80635a3 in perl_shutdown ()
#14 0x80645c5 in perl_child_exit ()
#15 0x8064430 in perl_child_exit_cleanup ()
#16 0x80a8dd6 in run_cleanups ()
#17 0x80a762c in ap_clear_pool ()
#18 0x80a76a1 in ap_destroy_pool ()
#19 0x80b3b03 in clean_child_exit ()
#20 0x80b6773 in child_main ()
#21 0x80b6e14 in make_child ()
#22 0x80b716e in perform_idle_server_maintenance ()
#23 0x80b7665 in standalone_main ()
#24 0x80b7cd3 in main ()

= registers have:

(gdb) i r
eax0x8a3e408144958472
ecx0x8608414140542996
edx0x8a3e408144958472
ebx0x8239208136548872
esp0xb90c   0xb90c
ebp0xb910   0xb910
esi0x1

Re: Apache children hanging

2000-06-01 Thread Doug MacEachern

On Thu, 1 Jun 2000, Gustavo Duarte wrote:
 there to see if it stops the problem (the code isn't too clean - lots of
 global variables, not written under strict, etc, but "it works").

looks like a global variable is exactly what your problem is.  somebody is
creating an Apache::SubRequest object (via $r-lookup_{file,uri}, and it's
not going out of scope until the child exits.  in this case, when
Apache::SubRequest::DESTROY is called, it calls destroy_sub_req() on a
pool that's already been cleared.

 #0  0x80a7407 in free_blocks ()
 #1  0x80a7660 in ap_clear_pool ()
 #2  0x80a76a1 in ap_destroy_pool ()
 #3  0x80be71a in ap_destroy_sub_req ()
 #4  0x8070d8a in XS_Apache__SubRequest_DESTROY ()
...
 #12 0x40077fa5 in perl_destruct () at perl.c:1008
 #13 0x80635a3 in perl_shutdown ()
 #14 0x80645c5 in perl_child_exit ()




Re: Bugs 5.6.0 modperl use?

2000-06-01 Thread Michael hall

On Thu, Jun 01, 2000 at 12:00:45PM -0700, Doug MacEachern wrote:

 On Fri, 26 May 2000, Michael hall wrote:
 
  On Fri, May 26, 2000 at 01:36:33AM -0400, Jeff Stuart wrote:
  
   Ok, follow up question if I may.  :)  Are any of you using it with DBI and
   DBD::mysql?  I see on the Mason list that people are using it with
   HTML::Mason so that module is safe. :)  Looks like I'm gonna have to pull
   out that old Linux box and do a test on it. :)
  
  Using DBI, DBD:mysql, and perl 5.60 (compiled with -DUseThreads) here. Doug
  was kind enough to post a couple of patches for DBI and DBD:mysql to get
  them to compile (when using -DUseThreads). I wouldn't call it a production
  server though since its very low volume, but I haven't had any problems
  with it.
 
 did you forward those patches along to the authors?

Yes, and also posted them on the 'dbi-users' list. Other than a few requests
for them from others (which I sent them :-) I haven't had any response from
either Tim or Joachim (sp?). Just installed a new Mysql-modules the other
day, no changes I could see so I just applied your patch and compiled it
otherwise it failed with the same old stuff. Tim posted a message awhile
ago that there would be a new version of DBI coming out soon, hopefully
it'll incorporate some fixes.

--
Do I have to pee whenever I see this sign ? WET FLOOR...

Mike Hall,
Unix Admin   - Rock Island Communications   [EMAIL PROTECTED]
System Admin - riverside.org[EMAIL PROTECTED]



Re: Apache children hanging

2000-06-01 Thread Doug MacEachern

you can find out which line of Perl code is triggering a spin, by
attaching to the process with gdb;

% gdb httpd $pid_of_spinning_process
% source modperl_x.xx/.gdbinit
% curinfo

should show you the filename:line_number where Perl is stuck.




Re: Apache children hanging

2000-06-01 Thread Doug MacEachern

 % gdb httpd $pid_of_spinning_process
 % source modperl_x.xx/.gdbinit
 % curinfo

oops, that should be:

% gdb httpd $pid_of_spinning_process
(gdb) source modperl_x.xx/.gdbinit
(gdb) curinfo





Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Marc Lehmann

On Thu, Jun 01, 2000 at 11:59:53AM -0700, Doug MacEachern [EMAIL PROTECTED] wrote:
 will not reload a module if it's already in %INC.  but that's doesn't mean
 a Perl environment cannot un-cache that entry so it will be reloaded.
 consider the code below, pretend that loop is a long-lifetime server,

Doing that, however, breaks code that uses documented and recommended
techniques (see perltoot for the best example).

My problem is not that it is possible to actively break code within normal
perl, this is easy in any language.

 Module::Reload checks the mtime of Foo.pm (and all loaded modules) on
 disk, if it has changed since the last time it was require'd, it will be
 reloaded.  this is perfectly valid Perl, the language supports this
 feature.

You miss a very large point: Modules are not just files containing perl
code.  One of the features of modules is that, how often you might use
them, they are only loaded once (unlike "do EXPR", for example).

Sure, you can load modules in different ways, even in ways that break
them, and the code still runs under perl (that is, without syntax error),
but this has not much to do with perl's concept of modules anymore.

 i'm quite certain your code be changed to adapt to such an environment.

It's easy, I just have to kick my ass each time I want to use a lexical
for data abstraction and use a package variable instead, with only the
exception that I have to be very careful that I never re-use the same
name. This is quite difficult for code that resides in many files (package
variables are, of course, global to the whole package not just the file or
the block), but not unsolvable.

You see, my first problem was misunderstanding (or not understanding) what
apache does during the "module initialization phase", and how "reload"
is defined (namely by not deleting the package). I assumed that a "fresh
restart" would imply a fresh perl interpreter, or at least a fresh
package, not just loading the code over the old one, preserving it.

While I am not sure why PerlFreshRestart is implemented in this misleading
manner, I can definitely live with that, as it is an option that can be
turned off, which is much more than one can expect (namely nothing at
all!), and, given that this is not considered a bug but a limitation with
mod_perl (spec. that single option), can be worked around consistently (as
it is relatively minor). The biggest problem with PerlFreshRestart is that
it causes bugs which are very difficult to find and that might only be
found after a lot of debugging, as the problem might be in a third-party
module you have never seen the source code of.

The more important aspects of mod_perl of course work fine, and this is
what counts most. So consider that totally solved to my satisfaction.

(Indirectly) calling my code broken (ah, you probably see where the
problem is, now ;), however, will require some very good arguments from
your side, which you didn't give so far.

Especially I'd like to hear why perltoot (and others) actively encourage
these "broken" programming techniques that enable data hiding and
definitely work with "perl modules": Surely I can load a .pm file using
other methods, like "do", or by nuking the %INC entry, but changing the
behaviour of "use" so drastically changes the notion of "modules" as well.

In my opinion, using a different way of loading modules than the
documented one, a way that breaks modules that work fine under the
documented mechanism, does not magically turn recommended code practises
into broken code practises.

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



cleaning old Apache::Session's

2000-06-01 Thread Adam Cassar

I was wondering how people are clearing out old Apache::Session's

No timestamp is used on the fields used by Apache::Session, so how do
we clear the old sessions? 

I am not talking about the delete() method to remove a session, as that
presumes that a user will always leave your site via pre-defined access
points.

-- 

Adam Cassar
Senior Web Developer
___
NetRegistry http://www.netregistry.com.au
Tel: +61 2 9699 6099 | Fax: +61 2 9699 6088
PO Box 270 Broadway NSW 2007 Australia




Re: cleaning old Apache::Session's

2000-06-01 Thread Richard Dice

 I was wondering how people are clearing out old Apache::Session's
 
 No timestamp is used on the fields used by Apache::Session, so how do
 we clear the old sessions?
 
 I am not talking about the delete() method to remove a session, as that
 presumes that a user will always leave your site via pre-defined access
 points.

This is how I handle it...

Your 'sessions' table schema has to have _at least_ the columns in it that
are talked about in the Apache::Session documentation.  That doesn't mean
that you can't add on your own timestamp column as well.  Your program
can use that as a basis upon which to delete rows.

Cheers,
Richard


 Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
 ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED]
 Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
 "squeeze the world 'til it's small enough to join us heel to toe"
 - jesus jones



RE: cleaning old Apache::Session's

2000-06-01 Thread Michael Nachbaur

Theres a problem with that however...it assumes you use mySQL.  I use Oracle, and it 
doesn't provide that functionality; you need to alter the INSERT or UPDATE statements 
to include passing a SYSDATE into the timestamp field.  'Course, you could create a 
trigger that adds the SYSDATE after an insert or update, but thats not really 
elegant...and PL_SQL really sucks (warning...flamebait)

-man

-Original Message-
From: Richard Dice [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 01, 2000 4:31 PM
To: Adam Cassar
Cc: [EMAIL PROTECTED]
Subject: Re: cleaning old Apache::Session's


 I was wondering how people are clearing out old Apache::Session's
 
 No timestamp is used on the fields used by Apache::Session, so how do
 we clear the old sessions?
 
 I am not talking about the delete() method to remove a session, as that
 presumes that a user will always leave your site via pre-defined access
 points.

This is how I handle it...

Your 'sessions' table schema has to have _at least_ the columns in it that
are talked about in the Apache::Session documentation.  That doesn't mean
that you can't add on your own timestamp column as well.  Your program
can use that as a basis upon which to delete rows.

Cheers,
Richard


 Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
 ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED]
 Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
 "squeeze the world 'til it's small enough to join us heel to toe"
 - jesus jones



Re: cleaning old Apache::Session's

2000-06-01 Thread Tobias Hoellrich

At 09:26 AM 6/2/00 +1000, Adam Cassar wrote:
I was wondering how people are clearing out old Apache::Session's

No timestamp is used on the fields used by Apache::Session, so how do
we clear the old sessions? 

I am not talking about the delete() method to remove a session, as that
presumes that a user will always leave your site via pre-defined access
points.


Adam,

nobody stops you from adding a timestamp :-)

mysql describe sessions;
+---+---+--+-+-+---+
| Field | Type  | Null | Key | Default | Extra |
+---+---+--+-+-+---+
| id| varchar(16)   |  | MUL | |   |
| modtime   | timestamp(14) | YES  | | NULL|   |
| a_session | blob  | YES  | | NULL|   |
+---+---+--+-+-+---+
3 rows in set (0.00 sec)

For every access to a session entry mysql will automatically set the first
timestamp field in a row to the current time. We run a cronjob every 15
minutes, which does a:


#!/bin/sh
/usr/local/mysql/bin/mysql -px -u sessions  EOSQL
  delete from sessions where time_to_sec(now()) - time_to_sec(modtime) 
60*60;
EOSQL

to clear any session entry older than one hour. Internally the session wil
expire after 30 minutes. 


Hope this helps
   Tobias






Re: cleaning old Apache::Session's

2000-06-01 Thread Richard Dice

 Theres a problem with that however...it assumes you use mySQL.  I use Oracle,
 and it doesn't provide that functionality; you need to alter the INSERT or
 UPDATE statements to include passing a SYSDATE into the timestamp field. 
 'Course, you could create a trigger that adds the SYSDATE after an insert or
 update, but thats not really elegant...and PL_SQL really sucks
 (warning...flamebait)

While perhaps the syntax "timestamp" suggested that I only meant that this
would work for MySQL, I didn't.  I figured that people could mentally
substitute in whatever the equivalent was for their dbms.  I know that
there is are equivalents for Postgresql and MS SQL Server (the other 2
dbms' I've worked with), and I figure that most should have something like
this.  I'm surprised to hear that Oracle makes it _that_ hard to get at this
kind of functionality.

Oh well... we've all got fights to fight.

Here's another possible approach to the problem them...

Put datetime information _inside_ the session, and then run a crom job
every time that opens up _every_ session, checks against the datetime
info, and deletes based on that information.

Isn't life ugly when you don't have a timestamp type in your dbms? :-)

Cheers,
Richard


 Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
 ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED]
 Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
 "squeeze the world 'til it's small enough to join us heel to toe"
 - jesus jones



Re: Apache::Session

2000-06-01 Thread Perrin Harkins

On Thu, 1 Jun 2000, Niral Trivedi wrote:

 Now, only way to remove this information from backing store is to do
 'tied(%session_hash)-delete', Am I right? I mean is there any way we
 can remove these entries by setting 'time_out_interval' or something
 like that?? 

Your cron job idea sounds fine.  If you need the expiration to be more
precise than that, you could alter the storage class you're using to check
a timeout value in the session against the current time.  If the session
is too old, it acts like it couldn't find it.  In the database classes
this could be done as a WHERE clause in the SQL.  You'd still want to run
a cron to actually delete the old session data.

- Perrin




Re: cleaning old Apache::Session's

2000-06-01 Thread Michael Schout

On Fri, Jun 02, 2000 at 09:26:45AM +1000, Adam Cassar wrote:
 I was wondering how people are clearing out old Apache::Session's
 
 No timestamp is used on the fields used by Apache::Session, so how do
 we clear the old sessions? 
 
 I am not talking about the delete() method to remove a session, as that
 presumes that a user will always leave your site via pre-defined access
 points.

As was mentiuoned, TMTOWTDI, but for postgresql, you can just do:

CREATE TABLE sessions (
  id VARCHAR(32) NOT NULL,
  ts TIMESTAMP NOT NULL DEFAULT NOW(),
  a_session TEXT,
  PRIMARY KEY (id)
);

Which works.

Another equivalent solution would involve setting up a "view" on a different
table abd setting up RULES that update the timestamp.  E.g.:

CREATE TABLE session_data (
id CHAR(32) NOT NULL,
ts TIMESTAMP NOT NULL,
a_session TEXT,
PRIMARY KEY (id)
);

CREATE VIEW sessions AS SELECT id,a_session FROM session_data;

CREATE RULE sessions_update AS ON UPDATE TO sessions
DO INSTEAD
UPDATE session_data SET
   id = NEW.id,
   a_session = NEW.a_session,
   ts = CURRENT_TIMESTAMP
 WHERE id = OLD.id;

CREATE RULE sessions_delete AS ON DELETE TO sessions
DO INSTEAD
DELETE FROM session_data
  WHERE id = OLD.id;

CREATE RULE sessions_insert AS ON INSERT TO sessions
DO INSTEAD
INSERT INTO session_data
(id, a_session, ts)
 VALUES (NEW.id, NEW.a_session, CURRENT_TIMESTAMP);

This works too.  And has the added nifty feature that "sessions" looks exactly
like what Apache::Session expects to find.  

I'm sure there are other ways to do it (plpgsql, triggers come to mind) for
postgresql.  As I said, TMTOWTDI.

I'm sure nearly every dbms out there can use some variant of one of the above
two methods...  You'll just have to adapt it for your particular DBMS.

Mike



Re: global variables and reparsing question (low priority ;)

2000-06-01 Thread Perrin Harkins

On Thu, 1 Jun 2000, Marc Lehmann wrote:
 It's easy, I just have to kick my ass each time I want to use a lexical
 for data abstraction and use a package variable instead, with only the
 exception that I have to be very careful that I never re-use the same
 name. This is quite difficult for code that resides in many files (package
 variables are, of course, global to the whole package not just the file or
 the block), but not unsolvable.

The simplest thing is to just not use PerlFreshRestart or Apache::StatINC
(which works in a similar way).  These are generally a bad idea for
production servers anyway, due to their effect on shared memory, and
mostly exist to ease development, although in your case they had the
opposite effect.  There are several warnings about mysterious problems
caused by PerlFreshRestart in the guide, and my impression is that most
people simply avoid it altogether.

If you don't use these your code should work just fine, lexicals,
accessors, and all.

- Perrin




RE: Problem with mod_perl

2000-06-01 Thread Greg Estep


On Fri, 26 May 2000, Eugene S. Panenko wrote:

 Hi all,

 Sorry if it is an incorrect list to ask...

 I have a strange problem with mod_perl. I've tested mod_perl using a very
 simple scripts (one of them is attached). The network load is emulated via
LAN
 using a special proggy. The problem is: under load above 20 requests per
second
 after working some time (about 15-30 sec) Apache daemon stopts accepting
new
 connections and blocks forever (without -X option httpd at this moment
begin
 forking until it eats all resources) . I've found that the problem exists
 only when scripts use modules (tested with CGI v 2.46, IPC::Shareable, our
own
 modules).  Test scripts without modules work fine even under load of 200
 requests per second.


Without knowing too much about your apache config. files, machine specs,
etc. I am guessing that your Apache MaxClients is still set at 150 (the
out-of-the-box value).

When apache receives a request that it cannot immediately handle (all of the
pre-forked process are busy) it will fork another one (up to MaxClients).
Eventually, you will run out of physical memory and begin to hit your swap
space.  When this happens, it takes longer to handle a request.  That causes
more requests to back up in the queue, so apache forks some more processes
to handle the load. These new processes increase the amount of swapping that
needs to be done, and the situation gets out of control.

How many subprocesses you can support depends upon the size of your httpd
process's text and data segments.  I have seen several mod_perl applications
increase the size of an httpd process to over 10 Mbytes.  If you set
MaxClients to a number that can be safely stored in physical memory
(adjusting for the OS and other processes running on the machine, of course)
you might eliminate your problem.

--
Greg Estep [EMAIL PROTECTED]




Re: High-volume mod_perl based ecommerce sites?

2000-06-01 Thread Ask Bjoern Hansen

On Thu, 25 May 2000, Michael Nachbaur wrote:

[...]
 This site will have major traffic, will need to be extended and
 changed (a lot), and needs to scale very well.  My experience with
 Perl (as well as what I've heard from other developers) is that Perl
 turns to spaghetti rapidly once you hit the 10,000 line mark.  I know
 Perl can handle the performance.  What are your experiences with
 extendability and readability of code?

That Perl works very well in those areas.

The slightly longer story: At ValueClick we have far more than 1 lines
of code (can't find an easy way to make a count right now, but I think
it's about 5, highly reused and moduarlized and what have you not).
Our site served about 100 million dynamic impressions yesterday, mod_perl
in the front end and all our backend applications are in Perl too.

Bad programmers will screw up code in any languge. The "problem" for Perl
is just that it takes a lot less to get productive and useful, which puts
more less experienced people to the code. At ValueClick we're getting
pretty far with having our version control system sending mail to everyone
on the team with the diff everytime someone commits. That way no change
goes unnoticed and it makes it easy for the more experienced to catch
mistakes and give advice to the less experienced.

But this topic goes far beyond the scope of this mailinglist. :)

To not end up with a mess of a code pile and development process, your
usual deal of good practices and methods applies for any language,
including Perl.

Favorite books on the topic includes the mythical man month
http://www.amazon.com/exec/obidos/ASIN/0201835959/asksplayground and
"Rapid Development - Taming Wild Software Schedules"
http://www.amazon.com/exec/obidos/ASIN/1556159005/asksplayground (yup,
it's a MicroSoft product, but it's truly recommended).


 - ask

-- 
ask bjoern hansen - http://www.netcetera.dk/~ask/
more than 70M impressions per day, http://valueclick.com




Re: Apache children hanging

2000-06-01 Thread Steve Reppucci


This is *exactly* the symptoms we see, and we're just about always up to
date with Apache/Perl/modperl releases.

We've spent a fair amount of time trying to isolate the cause of these,
but haven't been able to point the finger at any one cause.  Some of the
things we've determined:

- The same behavior is displayed under Solaris (5.6 and 5.7) and Linux
  (2.2.14).
- We've seen this through through a bunch of releases of
  Apache/Perl/modperl over the past 6 months.
- When a child process goes astray, it is in a tight loop, quickly growing
  to consume 95 to 100% of the cpu cycles.
- Under Linux, running strace on the runaway results in nothing -- 
  no system calls are shown whatsoever, so it's apparently spinning in
  a tight CPU loop (though see the next bullet -- it's possible I've
  just never caught it at an early enough stage.)
- Under Solaris, I've managed to catch a few of these at an early stage
  and observed (via truss) an endless series of 'sbrk' calls, eventually
  this gets bound up tight with no system calls displayed, like the
  Linux case.
- This seems to happen more often under heavy load, but we've also seen it
  fairly regularly during low traffic periods.
- We did have some luck in doing a thorough read of our handlers that use
  DBI, making sure that all database connections are explicitly closed 
  at the end of a request (we *don't* use Apache::DBI).  This cut down on
  the number of runaways, but we still see them.

We've kept our runaways under control by running a watchdog script that
looks for modperl processes with the correct load numbers (cpu%  10% and
run time  something), but we've all along thought that this would be a
temporary solution until we determined what we're doing wrong.

Now that I've seen this report from a couple of others on the list, I'm
wondering if it's not something we're doing, but rather something within
Apache or modperl.

If there's anything anyone on the list can recommend that I do to try to
collect more clues on the cause, I'll be happy to try it.

Or maybe if there are others who've seen the same behavior, pipe in so
that we can get a feeling for how many sites are experiencing this?

Steve Reppucci

On Thu, 1 Jun 2000, Gustavo Duarte wrote:

 Hi there people,
 
 I have inherited a web server running mod_perl and I am experiencing a
 somewhat critical problem: http processes sometimes get into an infinite
 loop, using 100% cpu time, and given enough time bring the machine to a
 halt.
 
 I've done a lot of testing, and there isn't a specific http request that
 triggers the behaviour, eventhough it always happens after a request. It
 seems to happen every few hours: the httpd process simply starts hogging
 up the CPU, and won't let go of it. After a while, I have a few of these
 processes running, and the machine's load average skyrockets. Sometimes
 it's bad enough I'm not even able to log in via console.
 
 I'll upgrade all the software to new versions, but apparently this
 problem has been ocurring for a while, and survived a couple of
 hardware/software upgrades. I'll also be rewriting the perl code running
 there to see if it stops the problem (the code isn't too clean - lots of
 global variables, not written under strict, etc, but "it works").
 However, it would be cool if someone could enlighten me on what's going
 on, and possibly suggest a fix :).
 
 Thanks a lot!
 
 signed,
 gustavo
 
 begin debugging info
 
 = our OS is:
 
 [root@blueland /root]# uname -a
 Linux blueland 2.2.14-5.0 #4 Wed Apr 12 20:28:28 MDT 2000 i586 unknown
 
 = Apache:
 
 Server Version: Apache/1.3.6 (Unix) mod_perl/1.19 mod_ssl/2.2.8
 OpenSSL/0.9.2b
 
 = let's look into one of the monster processes:
 
 497 ?R288:06 /usr/local/apache_1.3.6/bin/httpd
 
 = (nice cpu time there...)
 = now for gdb...
 
 [root@blueland /root]# gdb /usr/local/apache/bin/httpd 497
 GNU gdb 4.18
 Copyright 1998 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.
 
 Attaching to program: /usr/local/apache/bin/httpd, Pid 497
 Reading symbols from /lib/libNoVersion.so.1...done.
 Reading symbols from /lib/libm.so.6...done.
 Reading symbols from /lib/libcrypt.so.1...done.
 Reading symbols from
 /usr/lib/perl5/5.00502/i586-linux/CORE/libperl.so...done.
 Reading symbols from /lib/libnsl.so.1...done.
 Reading symbols from /lib/libdl.so.2...done.
 Reading symbols from /lib/libc.so.6...done.
 Reading symbols from /lib/ld-linux.so.2...done.
 Reading symbols from /lib/libnss_files.so.2...done.
 Reading symbols from
 /usr/lib/perl5/site_perl/5.005/i586-linux/auto/Sybase/DBlib/DBlib.none...done.
 
 Reading symbols from /opt/sybase/lib/libsybdb.so...done.
 Reading symbols from /opt/sybase/lib/libinsck.so...done.
 Reading symbols from 

Re: [ANNOUNCE] Apache::Session 1.51

2000-06-01 Thread Robin Berjon

At 12:25 01/06/2000 -0400, Neil Conway wrote:
On Thu, Jun 01, 2000 at 01:53:10AM -0400, Robin Berjon wrote:
 Suggestions about making portable database test scripts are welcome.
 
 I think that DBD::CSV comes standard with DBI, would testing using that 
work ?

It didn't come standard with my DBI (and it needs SQL::Statement and
Text::CSV_XS)

You're right, no DBD comes standard with it. I thought it had one for it's
tests (and CSV seemed like a good candidate).



-- robin b.
You can tune a piano, but you can't tuna fish.




FW: [Q] session mgmt

2000-06-01 Thread vladp

Sorry, it did not look like the email got sent
the first time.

-FW: [EMAIL PROTECTED]-

Date: Thu, 01 Jun 2000 21:53:49 -0500 (EST)
Sender: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Q] session mgmt

Hello,
I have difficulty in designing
highly scalable session management,
mod_perl is the tool I would like
to use, but so far I cannot see
how to do it in anything other
then hand-coded C++ or use transaction
management software such as MTS.
Basically, the system I am building
has to be distributed with load-balancing
going across heterogenus computer systems.
When a user logs in, he may be doing something
on Page 1, then he decides to go to Page 2,
from Page 1 to Page 2, the system will have
to perform a long query.  I do not want the
user to wait, therefore I allow him to go to
page 2, but in the mean time I want to show him
some kind of progress bar that demostrates that
his request from page one is being worked on.
Then he spends an hour on page 1 (refreshing
once in a while the view of the data charts),
and then goes to page 3. Things on page 3
take very long time to execute, I will have
load balancing software redirect the request
to other web servers (that are not the once
who handled requests from Page 1), and on Page 3
I need info from Page 1.

So my questions are: how to save session info
from page 1 and allow a web server that services
age 3 to access it.  Second, (this is probably not
related to mod-perl) is how to show a progress
bar while allowing a user to continue through
other pages (frames).

MS suggests to use their 
distributed directory services to store session
info (instead of cookies) and they do not suggest
to use a DB for performance reasons. I would like
to know if there are alternatives to MS solutions.

Thanks in advance,
Vladislav

--End of forwarded message-




Re: Urgent: remove password from server cert?

2000-06-01 Thread James Lyon

 machines boot cycle) that when we reboot (*every* monday morning in the
 wee hours) it's not terribly likely that anyone's going to be around to
 feed the password to the startup query.

Why reboot every week? My web servers are never rebooted, save for hardware
upgrades...


 This really needs to be automated.

There is a security risk associated with automating it. There are
instructions for removing the password from the cert in the on-line doc's /
FAQs.


begin:vcard 
n:Lyon;James
tel;pager:24-hour contact via Work number
tel;cell:+44 (7973) 824857
tel;fax:+44 (24) 7670 2501
tel;home:Please use Cellular number.
tel;work:+44 (24) 7670 2500
x-mozilla-html:TRUE
url:http://www.aztec.co.uk/
org:Business IT Research Ltd t/a Aztec Business Solutions
version:2.1
email;internet:[EMAIL PROTECTED]
title:Managing Director
adr;quoted-printable:;;Enterprise House=0D=0ACourtaulds Way;Coventry;;CV6 5NX;UK
fn:James Lyon
end:vcard



Re: SOLVED! - Help with Apache::SSI Apache::Filter in Apache::ASP

2000-06-01 Thread montefin

KEN!

Bingo.

My bad. I was too anxious to make this work tonight and just did NOT do
the make properly.

KICK MYSELF! KICK MYSELF!

Thanks for being there,

montefin


Ken Williams wrote:
 
 [EMAIL PROTECTED] (montefin) wrote:
 Or, could it be that the location that %="$demo-{file}?virtual=1"%
 references on my system has wrong ownership or permissions set?
 
 No, it wouldn't be that.  It's failing before that.
 
 - begin ssi_filter.ssi snippet ---
 table width=100%trtd
 !--#include virtual="%="$demo-{file}?virtual=1"%" --
 /td/tr/table
 - end ssi_filter.ssi snippet ---
 
 Here's an idea.  I think the double-quotes are messing up the parsing of the
 line because they're used in two different ways.  The new HTML::SimpleParse can
 handle single-quotes as delimiters.
 
 So grab the latest HTML::SimpleParse from CPAN, version 0.09.  And the latest
 Apache::SSI, at http://mathforum.com/~ken/modules/Apache-SSI/SSI.pm (there's
 been a one-line change that allows compatibility with the latest SimpleParse).
 Then change your component to
 
table width=100%trtd
   !--#include virtual='%="$demo-{file}?virtual=1"%' --
/td/tr/table
 
 I think that might make things work.  Let me know.
 
   ------
   Ken Williams Last Bastion of Euclidity
   [EMAIL PROTECTED]The Math Forum

-- 
In Life Timing is everything; in Linux Permissions is everything.
http://www.montefin.com/~montefin/ (up 24/7)
http://finux.com:8080 (our Zope experiment...evenings  weekends)
http://finux.com:8085 (our XML adventures...evenings  weekends)