Re: SQL log analyzer for Apache::DBILogger

2001-02-06 Thread T.J. Mather

On Mon, 5 Feb 2001 [EMAIL PROTECTED] wrote:

 Sometime in the next month I need to embark on a log analyzer for the logs
 we've been accumulating for many moons via Apache::DBILogger.  Has anyone
 made any effort to do such a thing already?  I've dug around the web for a
 while and come up with zilch.

I have a script that reads the logs from the database and dumps it out to
a flat file in the standard format Apache uses when writing access_log,
then I run a program called webalizer on it.  I actually don't use
Apache::DBILogger, but the database table is similar to the table
generated by Apache::DBILogger.
_
T.J. Mather http://tjmather.com
http://cpan2.org/   New CPAN Search Engine
http://www.anidea.com/  Digital Asset Management
http://www.theinnkeeper.com/Bed and Breakfast Directory




Re: Environnement stability and maturity

2001-02-06 Thread Lupe Christoph

In local.modperl you write:

What is the "official" home of 5.6.1rev2? I can't seem to locate it on
CPAN anywhere. The p5p summary on http://www.perl.com/ seems to be under
the impression that 5.6.1 isn't going to be out for a while. I remember
seeing a pointer to one of the very early patches, but I can't seem to
find it again. Thanks in advance--

Probably because you looked for 5.6.1rev2. The name is perl-5.6.1-TRIAL2.

Look for it at $CPAN/authors/id/G/GS/GSAR/perl-5.6.1-TRIAL2.tar.gz .
Sarathy is on it, and I expect the final 5.6.1 Real Soon Now. The
TRIAL2 had a couple of problems, and there will probably a TRIAL3.
(My personal guess.)
-- 
| [EMAIL PROTECTED]   |http://free.prohosting.com/~lupe |
| "Real stupidity beats artificial intelligence every time." |
| Hogfather  |
| Terry Pratchett|



Re: Apache::Session::File

2001-02-06 Thread harilaos

How do i change this locking mechanish of win32?
Am i using the wrong module? From apache::session::* modules
do you know which are supposed to work on win32?

Thanks

Gunther Birznieks wrote:
 
 You need to change the locking mechanism on Win32 to not use IPC. I believe
 there are examples for using Flock based locking but am not sure.
 
 If you are using win32 mod_perl, locking is irrelevant anyway because all
 requests are serialized through one engine.
 
 At 03:43 PM 2/5/01 +, harilaos wrote:
 Hello,
 I ma trying to use this module to store persident data on file
 on win32 environment.
 I use the code:
 
 use Apache;
 use Apache::Session::File;
 use CGI qw/:standard/;
 use CGI::Carp qw(fatalsToBrowser);
 
 print header();
 print start_html;
 
   my %global_data;
 
   eval {
   tie %global_data, 'Apache::Session::File', 1,
  {Directory = '/temp/sessiondata'};
   };
   if ($@) {
  die "Global data is not accessible: $@";
   }
 
 print "hello";
 
 print end_html;
 
 I get error in apache logs :
 Can't locate IPC/SysV.pm in @INC
 
 do I need the IPC/SysV.pm module?
 I have searched the documentation but i don't see a simple clear example
 to do this.
 
 Can you help please?
 
 Thanks
 
 __
 Gunther Birznieks ([EMAIL PROTECTED])
 eXtropia - The Web Technology Company
 http://www.extropia.com/



RE: Help: Can't use string (Exchange::Account::My) as a HASH ref while strict refs in use trying to use instance variables in my handler

2001-02-06 Thread Chris Strom

 Subject: Help: Can't use string ("Exchange::Account::My") as 
 a HASH ref
 while "strict refs" in use trying to use instance variables in my
 handler
[snip]

 sub handler ($$) {
   my ($self, $q) = @_;
 
   my $r= Apache::Request-new($q);
 
   $self-child_init unless $self-{_child_started_up};  #  dies
 here!
[snip]

I think that you really need to have a legitimate constructor, not one that
is called conditionally.  $self is not a blessed reference - just a string
containing the class name.  The call to $self-child_init works, even with
strict refs, because there is a child_init subroutine defined in your
package's namespace.  With $self-{_child_started_up}, you're just calling
"Exchange::Account::My"-{_child_started_up}, which will cause the error
since the string "Exchange::Account::My" is not a reference to a hash, it's
just a string.

Anyway, what you should do is create a constructor:

sub new {
  my $class = shift;
  my $self {@_};
  bless $self, $class;
  return $self;
}

Then rewrite the above snippet of your code to:

sub handler ($$) {
  my ($class, $q) = @_;
  my $r = Apache::Request-new($q);
  my $self = $class-new(request=$r);
  $self-child_init unless $self-{_child_started_up};
  # The rest of the code...

Then you should be good to go (instance variables and all!).  Hope that
helps,

Chris



Apache::DBILogger

2001-02-06 Thread c.w.huling


I have set this up with our Oracle Database, but I am not getting
anything in the database nor am I getting any errors.  Everything
still seems to log to the log files?

If errors are being generated, where would I find them?  Any way to
trace through and see what is happening?

-- 
C Wayne Huling [EMAIL PROTECTED]



Re: SQL log analyzer for Apache::DBILogger

2001-02-06 Thread chicks

On Tue, 6 Feb 2001, T.J. Mather wrote:
 I have a script that reads the logs from the database and dumps it out
 to a flat file in the standard format Apache uses when writing
 access_log, then I run a program called webalizer on it.  I actually
 don't use Apache::DBILogger, but the database table is similar to the
 table generated by Apache::DBILogger.

I'd thought of doing that or modifying webalizer to work off the SQL
tables.  It seems to me like there's so much more possible with storing
summary information in the database that's periodically refreshed and
avoiding HTML generation except when the user requests it.  I'm going to
look at the code Ask recommended today.

-- 
/chris

Those who cannot remember the past are doomed to buy Microsoft products.





Re: [OT] Design Patterns in mod_perl apps?

2001-02-06 Thread Bakki Kudva

Thank you for that pointer. I checked http://www.pagekit.org/. Looks
very interesting.
While on the subject I'd like to mention another really nice book by
Mark Grand  called "Patterns in Java" that might be of interest to those
looking into Design Patterns. This book has many additional pattern to
those in GoF such as 'concurrency patterns' and 'filter' which Gunther
was alluding to. Also there is a chapter on UML which was very useful to
me. The patterns are all illustrated with UML.

It would be terrific if those who ARE using Design Patterns in their web
apps could contribute to a 'Design patterns' chapter to Stas's Guide. I
would have been happy to volunteer but for the 
fact that I am way early on my learning curve and it will be a while
before I can do it.

-or-

Gunther, I have two of your books on my shelf and would love to add a
third one, how about it? :))

-bakki

Perrin Harkins wrote:
 
 Gunther Birznieks wrote:
  GoF did not introduce Model-View-Controller architecture. But it is
  discussed in Wiley's "A System of Patterns: Pattern-Oriented Software
  Architecture".
 
 MVC is frequently used in mod_perl apps.  For example, see
 Apache::PageKit.
 - Perrin

-- 
  _ _
 .-. |M|S|  Bakki Kudva
 |D|_|a|y|  Navaco
 |o|m|n|s|\420 Pasadena Drive
 |c|e|a|t| \\   Erie, PA 16505-1037
 |u|n|g|e|  \\  http://www.navaco.com/
 | |T|e|m|   \ ph: 814-833-2592
""  fax:603-947-5747
e-Docs



RE: Doh; StatINC can't find files?

2001-02-06 Thread Rob Bloodgood

 wm looks like a home directory.  The default perms on the home
 directory are usually 700.  Try changing that to something like 755
 or even 744 (it may not need execute).

Actually, the x bit on directory perms means "accessible," meaning if you
KNOW the name of the file, U can reach it at all... I ran into this when
trying to allow ~/public_html.

701 is the correct mask.

L8r,
Rob




RE: Doh; StatINC can't find files?

2001-02-06 Thread Robert Landrum

Neither of the following combinations worked for me:

drwx--x--x3 rlandrum devel4096 Jan 30 14:14 public_html
(711, Forbidden)
drwx-x3 rlandrum devel4096 Jan 30 14:14 public_html
(701, Forbidden)

The only one that worked was:

drwxr-xr-x3 rlandrum devel4096 Jan 30 14:14 public_html
(755)

I didn't try 705, but I'm pretty sure it would work.

Under Linux, 'x' does mean execute... from the chmod manpage
 
The letters `rwxXstugo' select the new permissions for the
affected users: read (r), write (w),  execute  (or  access
for directories) (x), execute only if the file is a direc-
tory or already has execute permission for some user  (X),
set  user  or group ID on execution (s), save program text
on swap device (t), the permissions that the user who owns
the  file  currently  has for it (u), the permissions that
other users in the file's group have for it (g),  and  the
permissions  that other users not in the file's group have
for it (o).

Without the x bit, a user does not have permission to execute 
anything from within the scope of that directory.  Nor can the user 
change into that directory.

Robert Landrum



At 10:49 AM -0800 2/6/01, Rob Bloodgood wrote:
  wm looks like a home directory.  The default perms on the home
 directory are usually 700.  Try changing that to something like 755
 or even 744 (it may not need execute).

Actually, the x bit on directory perms means "accessible," meaning if you
KNOW the name of the file, U can reach it at all... I ran into this when
trying to allow ~/public_html.

701 is the correct mask.

L8r,
Rob


Robert L. Landrum
Senior Programmer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It's working correctly.  It's simply working in contrast to what you have
perceived to be correct."



Re: Debugging mod_perl with gdb

2001-02-06 Thread G.W. Haywood

Hi there,

On Tue, 6 Feb 2001, Shane Adams wrote:

 I've found a "write to a dangling pointer" when apache/mod_perl
 evaluates a perl section of the apache config file.
 
 My question:  How do I go about attacking this problem?

1. Reduce your test case to the absolute minimum.
2. 'perldoc perldebug'
3. 'man gdb'
4. http://perl.apache.org/guide.

73,
Ged.




Re: Debugging mod_perl with gdb

2001-02-06 Thread sterling

If you're looking for which piece of perl code being processed, there
are some gdb macros to help.  If you source the .gdbinit in the root of
your modperl dir you have access to a bunch of cool macros to use.  In
this case, curinfo will give you the current line number in your perl
code.

here's the macro: 
define curinfo
   printf "%d:%s\n", PL_curcop-cop_line, \
   ((XPV*)(*(XPVGV*)PL_curcop-cop_filegv-sv_any)\
   -xgv_gp-gp_sv-sv_any)-xpv_pv 
end

hope that helps.

sterling


On Tue, 6 Feb 2001, Shane Adams wrote:

 Hey there - 
 
 I've successfully built apache/mod_perl with full debugging.  In
 addition, I'm running the whole setup through insure, a commercial
 memory leak/corruption tool.  
 
 I've found a "write to a dangling pointer" when apache/mod_perl
 evaluates a perl section of the apache config file.
 
 My question:  How do I go about attacking this problem?  I only know
 that I'm in a Perl section due to printing out some variables
 somewhere at ap_read_config() to invoke_cmd().  I guess I'm trying to
 find out what the perl script is doing when the memory corruption
 occurs.  Obviously if I could narrow the offending line of code (if
 possible) I might be able to better understand where the real bug is.
 
 Shane
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 30, 2001 5:25 PM
 To: AxKit Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: (Correction) Re: Object-XML serialization [was Re: AxKit
 Users?]
 
 
 On Tue, 30 Jan 2001 [EMAIL PROTECTED] wrote:
 
  Castor (for Java, from www.exolab.com), uses an actual XML Schema for
  this. The advantage is that you can leverage off the fairly rich
 existing
  set of defined datatypes.
 
 Sorry, it's www.exolab.org, don't you hate that?
 
 --Chris
 




RE: Debugging mod_perl with gdb

2001-02-06 Thread Shane Adams
Title: RE: Debugging mod_perl with gdb





Hey thanks. I'll try this. I tried the 'man gdb' command and it didn't help much I'm afraid...


-Original Message-
From: sterling [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 06, 2001 12:33 PM
To: Shane Adams
Cc: [EMAIL PROTECTED]
Subject: Re: Debugging mod_perl with gdb



If you're looking for which piece of perl code being processed, there
are some gdb macros to help. If you source the .gdbinit in the root of
your modperl dir you have access to a bunch of cool macros to use. In
this case, curinfo will give you the current line number in your perl
code.


here's the macro: 
define curinfo
 printf %d:%s\n, PL_curcop-cop_line, \
 ((XPV*)(*(XPVGV*)PL_curcop-cop_filegv-sv_any)\
 -xgv_gp-gp_sv-sv_any)-xpv_pv 
end


hope that helps.


sterling



On Tue, 6 Feb 2001, Shane Adams wrote:


 Hey there - 
 
 I've successfully built apache/mod_perl with full debugging. In
 addition, I'm running the whole setup through insure, a commercial
 memory leak/corruption tool. 
 
 I've found a write to a dangling pointer when apache/mod_perl
 evaluates a perl section of the apache config file.
 
 My question: How do I go about attacking this problem? I only know
 that I'm in a Perl section due to printing out some variables
 somewhere at ap_read_config() to invoke_cmd(). I guess I'm trying to
 find out what the perl script is doing when the memory corruption
 occurs. Obviously if I could narrow the offending line of code (if
 possible) I might be able to better understand where the real bug is.
 
 Shane
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 30, 2001 5:25 PM
 To: AxKit Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: (Correction) Re: Object-XML serialization [was Re: AxKit
 Users?]
 
 
 On Tue, 30 Jan 2001 [EMAIL PROTECTED] wrote:
 
  Castor (for Java, from www.exolab.com), uses an actual XML Schema for
  this. The advantage is that you can leverage off the fairly rich
 existing
  set of defined datatypes.
 
 Sorry, it's www.exolab.org, don't you hate that?
 
 --Chris
 





Re: Help: Can't use string (Exchange::Account::My) as a HASH ref while strict refs in use trying to use instance variables in my handler

2001-02-06 Thread Christopher L. Everett

 Anyway, what you should do is create a constructor:
 
 sub new {
   my $class = shift;
   my $self {@_};
   bless $self, $class;
   return $self;
 }

You mean like this code segment that I included in my original post
just below the handler code :)

sub init {
  my $invocant = shift;
  my $class = ref ($invocant) || $invocant;
  my $self = {};
  bless ($self, $class);

  $self-{config}= $self-init_config;
  $self-{dispatch}  = $self-init_dispatch_table;
  $self-{templates} = $self-init_templates;
  $self-{_child_started_up} = 0;
  
  return $self;
}

 ... straight out of "Programming Perl" ...

 
 Then rewrite the above snippet of your code to:
 
 sub handler ($$) {
   my ($class, $q) = @_;
   my $r = Apache::Request-new($q);
   my $self = $class-new(request=$r);

Hunh?!?

Wait a second.  I have a startup.pl, and inside that I have the lines:

use Exchange::Account::My;
my $account_interface = Exchange::Account::My-init;

Won't that do what I need it to do?  When the root process forks off
children, won't a complete copy of $account_interface go with it, with
everything all set and ready to go?

   $self-child_init unless $self-{_child_started_up};
   # The rest of the code...
 
 Then you should be good to go (instance variables and all!).  Hope that
 helps,
 
 Chris

Except for calling the contructor with every call of the handler, 
I think I've done everything right.  Isn't the part of idea behind 
mod_perl handlers that one _doesn't_ have to call the contructor 
_every_ time the handler gets called?  Otherwise invites massive 
overhead.

Obviously, what I'm doing doesn't work.  But could someone show me 
how to call the constructor just once in in a childs lifetime?  
Please?

  --Christopher



RE: Doh; StatINC can't find files?

2001-02-06 Thread Vivek Khera

 "RL" == Robert Landrum [EMAIL PROTECTED] writes:

RL Under Linux, 'x' does mean execute... from the chmod manpage
 
RL The letters `rwxXstugo' select the new permissions for the
RL affected users: read (r), write (w),  execute  (or  access
RL for directories) (x), execute only if the file is a direc-

But it is a directory, so it means "access".  If you know the file
name, you can access it.

You just need to ensure that you don't need to read the directory
itself, if you don't want "r" permissions.



Re: Error reporting mod_perl 1.25 + apache 1.3.17

2001-02-06 Thread modperl

Actually My current builds are very similar. 1.3.17+1.25w/5.6.0 on
slackware linux 7.1, dually intel boxes.
Works fine and while watching error logs i haven't seen any
segfaults. returns our pages just fine.

Scott

On Mon, 5 Feb 2001, Paul Lindner wrote:
 On Mon, Feb 05, 2001 at 06:41:00PM +, G.W. Haywood wrote:
  Hi there,
  On Mon, 5 Feb 2001, Matisse Enzer wrote:
   I compiled perl 5.6 and Apache 1.3.17 using gcc egcs-2.91.66
   on a RH Linux 6.1 system.
  I'm sure there must be people on this List who have successfully built
  mod_perl systems using exactly the packages you have mentioned.
  Anyone care to confirm that?
 I've seen some strange segementation fault problems with mod_perl
 1.25.  I have not had the time to document these.
 Environment is similar to others: mod_perl 1.25, apache 1.3.17, perl
 5.00503, solaris 2.6...





RE: Apache::ASP Best Language to use?

2001-02-06 Thread S Muthu Ganesh



 -Original Message-
From:   [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]  On Behalf Of
Matthew Schroeder
Sent:   05 February 2001 21:13
To: '[EMAIL PROTECTED]'
Subject:Apache::ASP Best Language to use?

Currently the company I work for is using ASP code running on Windows
servers.

We'd like to run a web server that isn't microsoft based for obvious
reasons.
We don't have so much ASP code, so it would be possible to scrap it and
start over.

What would you guys suggest as the best option:
1. Porting our ASP code to Apache::ASP and continue development in ASP
2. Doing new development in JSP
3. Doing new development in CGI
4. Doing new development in Coldfusion

ANSWER : 2 (TWO)

Please reply to my private email, since I'm not a subscriber to the modperl
mailing list.

Sincerely,

Matthew Schroeder
PMAI
Software Developer
Phone: 517-788--8100 ext. 352




RE: Debugging mod_perl with gdb

2001-02-06 Thread G.W. Haywood

Hi again,

On Tue, 6 Feb 2001, Shane Adams wrote:

 I tried the 'man gdb' command and it didn't
 help much I'm afraid...

Then why not have a look at

http://www.gnu.org/manual/gdb-4.17/gdb.html

I'm not a great fan of using debuggers, but as they go it's fantastic,
it's really worth getting to know it - especially when you may be
looking inside complex data structures, there it really shines.

73,
Ged.




Re: Error reporting mod_perl 1.25 + apache 1.3.17

2001-02-06 Thread dima


I used to have all these seg faults when dealing with apache1.3.14 and
mod_perl1.24_01 (perl5.6.0/redhat 6.2) when built as DSO. As soon as you
get a request through log files just get flooded with segmentation faults.
 However when I switched over to apache1.3.17 + mod_perl1.25 everything
goes on just fine.
 Try using PERL_USELARGEFILES=0 when building mod_perl too.

cheers,
dima

On Mon, 5 Feb 2001, modperl wrote:

 Actually My current builds are very similar. 1.3.17+1.25w/5.6.0 on
 slackware linux 7.1, dually intel boxes.
 Works fine and while watching error logs i haven't seen any
 segfaults. returns our pages just fine.

 Scott

 On Mon, 5 Feb 2001, Paul Lindner wrote:
  On Mon, Feb 05, 2001 at 06:41:00PM +, G.W. Haywood wrote:
   Hi there,
   On Mon, 5 Feb 2001, Matisse Enzer wrote:
I compiled perl 5.6 and Apache 1.3.17 using gcc egcs-2.91.66
on a RH Linux 6.1 system.
   I'm sure there must be people on this List who have successfully built
   mod_perl systems using exactly the packages you have mentioned.
   Anyone care to confirm that?
  I've seen some strange segementation fault problems with mod_perl
  1.25.  I have not had the time to document these.
  Environment is similar to others: mod_perl 1.25, apache 1.3.17, perl
  5.00503, solaris 2.6...






object not being destroyed in a TemplateToolkit-based handler

2001-02-06 Thread Vivek Khera

I sent this to the Template Toolkit list but got no responses.  I'm
pretty sure it is a mod_perl issue, but I can't for the life of me
figure out why the object doesn't get destroyed in the mod_perl
context.  A standalone test program always destroys the object at the
expected time.

This bug happens even under httpd -X.

--original message--

I have a plugin I'm writing to access an Apache::Session::MySQL
object.  What I do is create a hash that contains the fields
"_CONTEXT" pointing to the context, "verbose" being a debug flag, and
"_session" being a reference to the tied hash from
Apache::Session::MySQL.  The constructor looks something like this:

  my $self = { _CONTEXT = $context, verbose = 0 };

  bless $self, $class;

  # do the tie, error checks, etc.

  $self-{_session} = \%session;
  return $self;

Now I have a handler in mod_perl that runs *.mlm files through $tt,
which is a TT object that has pre/post process, plugin path, and some
global stash variables pre-defined.

This works fine from my templates:

[% USE s = session %]

[% s.stepsdone = s.stepsdone + 1 %]
Psteps done = [% s.stepsdone %]/P

However, at the end of the template processing, the object is not
destroyed; that is, the DESTROY() method is never called, and
therefore the tied hash never gets untied and  Apache::Session::MySQL
doesn't get a chance to write the data back to the store.

But when I kill httpd, all the objects created are then destroyed
(my DESTROY() has a debug statement that gets printed) and the session
is saved to the database (albeit, all identical since each new object
read the original data rather than the updated values).

It matters not whether I [% PROCESS %] or [% INCLUDE %] the template
that instantiates this object.

I tried to isolate a case of this in its own program, but of course
the object was destroyed every time...

Any ideas on where to trace this down?




FW: Doh; StatINC can't find files?

2001-02-06 Thread Rob Bloodgood






execute  (or  access
for directories) (x)

 drwx-x3 rlandrum devel4096 Jan 30 14:14 public_html
 (701, Forbidden)

that's not what I meant, I should have been more clear.

755 on public_html
701 on ~user

so ~user is still "hidden" from general eyes
but ~user/public_html is ACCESSIBLE (x) thru ~user, and public_html is
READABLE/ACCESSIBLE (r-x) to nobody.





FW: Doh; StatINC can't find files?

2001-02-06 Thread Rob Bloodgood






Thanks for the clarification.  It worked perfect.

drwx-x   12 rlandrum rlandrum 4096 Feb  6 14:05 rlandrum
drwxr-xr-x3 rlandrum devel4096 Jan 30 14:14 rlandrum/public_html

Rob


execute  (or  access
for directories) (x)

 drwx-x3 rlandrum devel4096 Jan 30 14:14 public_html
 (701, Forbidden)

that's not what I meant, I should have been more clear.

755 on public_html
701 on ~user

so ~user is still "hidden" from general eyes
but ~user/public_html is ACCESSIBLE (x) thru ~user, and public_html is
READABLE/ACCESSIBLE (r-x) to nobody.


Robert L. Landrum
Senior Programmer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It's working correctly.  It's simply working in contrast to what you have
perceived to be correct."




Re: object not being destroyed in a TemplateToolkit-based handler

2001-02-06 Thread darren chamberlain

Vivek Khera ([EMAIL PROTECTED]) said something to this effect on 02/06/2001:
 However, at the end of the template processing, the object is not
 destroyed; that is, the DESTROY() method is never called, and
 therefore the tied hash never gets untied and  Apache::Session::MySQL
 doesn't get a chance to write the data back to the store.

You aren't clear about the scope of $tt; it sounds like a package
level global, if it's being destroyed when the children exit.

How about creating a PerlCleanupHandler to explicit destroy $tt?

(darren)

-- 
Entropy isn't what it used to be.



Re: object not being destroyed in a TemplateToolkit-based handler

2001-02-06 Thread Perrin Harkins

On Tue, 6 Feb 2001, Vivek Khera wrote:
 However, at the end of the template processing, the object is not
 destroyed; that is, the DESTROY() method is never called, and
 therefore the tied hash never gets untied and  Apache::Session::MySQL
 doesn't get a chance to write the data back to the store.

Hmmm... If I'm reading the code correctly, what's supposed to happen is
that the stash (where your plugin instance lives) gets localized when you
call $tt-process() and de-localized at the end, which should result in
anything you added to it (with your USE s = session) getting DESTROY-ed.  
Maybe there's a bug in this process somewhere?  Are you keeping a copy of
the stash anywhere else?  Are you doing something in your plugin's load()
method that involves a reference to the session object?  That could cause
this kind of problem.  Maybe you could post a bit more of your plugin
code.

To make sure your stash is getting cleared, try putting some other object
into it (by passing it to process) and see if it gets destroyed.  If it
does, then there's something about the way your plugin is written that's
causing the problem.  If not, TT has a problem.

- Perrin




Re: object not being destroyed in a TemplateToolkit-based handler

2001-02-06 Thread Perrin Harkins

On Tue, 6 Feb 2001, darren chamberlain wrote:

 Vivek Khera ([EMAIL PROTECTED]) said something to this effect on 02/06/2001:
  However, at the end of the template processing, the object is not
  destroyed; that is, the DESTROY() method is never called, and
  therefore the tied hash never gets untied and  Apache::Session::MySQL
  doesn't get a chance to write the data back to the store.
 
 You aren't clear about the scope of $tt; it sounds like a package
 level global, if it's being destroyed when the children exit.
 
 How about creating a PerlCleanupHandler to explicit destroy $tt?

No, don't do that.  You need $tt to stick around, so that you can get the
large speed increase from using the in-memory cache.

- Perrin




Apache: ASP

2001-02-06 Thread Paul Scott

I am getting errors when I try and run ASP on my Linux box...

Here is what pops up on the web page, I am not sure how to fix it or
what exactly is wrong with it.  Any help you can offer will be
appreciated..

#!/usr/local/bin/perl5 asp [0]%   ([0]%source)

Thanks,
Paul Scott
[EMAIL PROTECTED]





ANNOUNCE: OpenInteract Web Application Server

2001-02-06 Thread Chris Winters

I'm jazzed to announce the public release of OpenInteract, an
extensible web application framework using mod_perl and the Template
Toolkit as its core technologies.  But the README already does all the
heavy lifting:



WHAT IS IT?
=

OpenInteract is an extensible application server using Apache and
mod_perl built for developers but also to be manageable almost
entirely via the web browser. It includes:

 - A robust system of components built on templates that can access
 your data just about any way that you can think of.

 - A very flexible separation of presentation and data access: you can
 use one template for accessing data from different sources (e.g., a
 listing of users from the system, from an LDAP server, from an NT/SMB
 authentication controller, etc.) or you can use one set of data to
 fill multiple templates.

 - A consistent security mechanism makes it a snap to control security
 for users and groups not only at the task level, but also at the
 individual data object level.

 - A simple user and group-management system that allows users to
 create their own accounts and an administrator to assign them to one
 or more groups.

 - A convenient packaging system that makes it simple for developers
 to distribute code, configuration and all other information necessary
 for an application. It also makes the installation and upgrading
 processes very straightforward.

 - An integrated, database-independent method for distributing data
 necessary for a package. You should be able to install any
 package on any database that's been tested with OpenInteract. (Some
 of this work must be done by the package authors, but OpenInteract
 tries to make this as painless as possible.)



OpenInteract is available via CPAN in a bundle form
('Bundle::OpenInteract') for EZ install. SourceForge currently hosts
CVS and mailing lists at:

 http://sourceforge.net/projects/openinteract/

Other information about the project (including press releases) is
available at:

 http://www.openinteract.org/

OpenInteract is available under the same Artistic/GPL license as
Perl. Hope you find it as much fun as I do!

Chris

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.



Re: ANNOUNCE: OpenInteract Web Application Server

2001-02-06 Thread Perrin Harkins

Chris Winters wrote:
 
 I'm jazzed to announce the public release of OpenInteract, an
 extensible web application framework using mod_perl and the Template
 Toolkit as its core technologies.

Hi Chris,

I've been reading the docs for the last couple of days and it looks very
interesting.  It's great to see a well-documented open source project. 
I have a couple of specific questions, which I guess are really about
SPOPS more than OpenInteract.

First, how much control do I have over what gets loaded when in objects
with dependencies?  For example, if I have an object with relationships
to other objects, some of which are expensive to fetch from the
database, can I defer certain parts from loading until I actually use
them?

Second, how hard is it to override the default load/save stuff in a
SPOPS object in order to do some fancy SQL?  I've had situations before
with O/R mappers where I want to use some more complex SQL for
efficiency reasons (optimizer hints, etc.) or to load a set of objects
at once (like a tree structure).  Is that possible with SPOPS?

Finally, if I'm using a SQL database, what support is provided for
evolving the data model?  Do I have to change my schema and write
conversion scripts every time I change an object attribute, or does
SPOPS try to use some sort of "generic" schema?

And just out of curiosity, are you familiar with any of the similar
projects that others have worked on, like Iaido (formerly Iaijutsu) or
Jellybean?

- Perrin



Re: ANNOUNCE: OpenInteract Web Application Server

2001-02-06 Thread Chris Winters

* Perrin Harkins ([EMAIL PROTECTED]) [010206 22:43]:
 Hi Chris,
 
 I've been reading the docs for the last couple of days and it looks very
 interesting.  It's great to see a well-documented open source project. 
 I have a couple of specific questions, which I guess are really about
 SPOPS more than OpenInteract.

Hi Perrin,

Thanks for the doc comments! More work always remains

 First, how much control do I have over what gets loaded when in objects
 with dependencies?  For example, if I have an object with relationships
 to other objects, some of which are expensive to fetch from the
 database, can I defer certain parts from loading until I actually use
 them?

Nothing gets loaded until you do a fetch() on an object or on one of
its dependent objects. For instance, in the standard user/group way of
doing things:

 # Fetch the user object
 my $user = My::User-fetch( $user_id );

 # None of the associated group objects get fetched until you ask for
 # them like this
 my $group_list = $user-group;

That said, efficiency hasn't been at the top of the list yet. (Some
basic caching hooks are there but nothing attached yet.) I'm following
Andy Wardley's example with the Template Toolkit -- make it right
first and fast second :-)

 Second, how hard is it to override the default load/save stuff in a
 SPOPS object in order to do some fancy SQL?  I've had situations before
 with O/R mappers where I want to use some more complex SQL for
 efficiency reasons (optimizer hints, etc.) or to load a set of objects
 at once (like a tree structure).  Is that possible with SPOPS?

It's not too difficult. The SQL stuff for DBI SPOPS objects actually
goes through two layers -- one dealing with more abstract notions of
'save()' and 'remove()' and the other dealing with more concrete
INSERT/UPDATE/DELETE statements.

The second one (SPOPS::SQLInterface) is quite flexible but at a lower
level which should enable you to do custom statements. You can do as
much or as little as you like -- passing a fully-formed SQL statement
with a list of values to bind does the right thing.

So if you wanted to modify how objects get saved but not removed, you
should just be able to override the 'save()' interface of SPOPS::DBI
and nothing else. But I haven't tried this yet :-) 

 Finally, if I'm using a SQL database, what support is provided for
 evolving the data model?  Do I have to change my schema and write
 conversion scripts every time I change an object attribute, or does
 SPOPS try to use some sort of "generic" schema?

It's actually much simpler than that. Since SPOPS doesn't save any
schema information in the database itself, all you have to do is add
the field to your database (with an 'ALTER TABLE' statement or
whatnot) and add the field name to the SPOPS configuration definition
in the 'field' key. Removals are the same. And datatype definitions
shouldn't require any changes at all, as long as the DBD supports
datatype discovery sufficient for SPOPS to bind variables smartly.

It's a more lightweight approach than Tangram or Alzabo but deals with
most of the issues I've run across in a few years of web (etc.)
programming.

 And just out of curiosity, are you familiar with any of the similar
 projects that others have worked on, like Iaido (formerly Iaijutsu) or
 Jellybean?

I've looked into both of them at one time or another -- OpenInteract
has been under construction for about a year and SPOPS (and ancestors)
more another half-year before that. I'm jealous of Jellybean's
self-sufficiency, of the cool apps built on Iaido so far and of the
clean model of both of them. I hope to swipe (with generous
attribution) as much as possible.

Chris

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.



Re: [Templates] Re: ANNOUNCE: OpenInteract Web Application Server

2001-02-06 Thread Chris Winters

* L.M.Orchard ([EMAIL PROTECTED]) [010207 00:07]:

 So, I'm trying to install OpenInteract now since from 50,000 ft it sounds a
 lot like what I was trying to do with Iaido.  Using Template Toolkit for the
 presentation...  abstracted data management...  Need to look around more.
 I'd be more than glad to help you and maybe even have Iaido get eaten up by
 your project since I seem to have lost the momentum to sustain it by myself.
 There are a lot of neat things going in in Iaido, and still on my TODO list
 for it to get completely tossed, though.  (Like, I really want to get that
 FTPd interface to the data store up and running again :) )
 
 Anyway, having major problems getting past the oi_manage install_sql step so
 far, maybe I'll post to the -dev list or the bugs on sourceforge.

It's probably early to talk about one project swallowing another :-)
I'm certainly not shy about looking for great ideas wherever they
are. And now that OpenInteract is out I hope to take a step back and
look at other environments for inspiration. (Building some services on
top of POE would be extremely cool, for starters.)

One of the things OpenInteract has going for it is that a company
(intes.net) uses it constantly and pays people to develop applications
for it. I'm finding how difficult it is to do more programming after
hours, even fun stuff like this.

This is getting rapidly OT. Moving this onto the -dev list is a good
idea.

Thanks,

Chris


-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.



File::Cache problem

2001-02-06 Thread BeerBong

Hello modperl,

There is Apache Perl module, which uses File::Cache.
File::Cache object is initialized in every request with params

namespace PRTL
max_size 10485760
expires_in 86400
cache_depth 3

Cache size after 24 hours of working
via 'du -s' - 53M
via 'perl -MFile::Cacje -e"print File::Cache::SIZE('PRTL')"' - 10M
Count of cache nodes is several thousands.

And when cache size is exceeded all mod_perl processes are hanging.
In logs
[Wed Feb  7 08:50:50 2001] [error] Undefined subroutine File::Cache::thaw called at 
/usr/local/lib/site_perl/File/Cache.pm line 601.

What is the best way to limit cache ?
May be variant when File::Cache::REDUCE_SIZE(10485760) in cron.dayly
will be better solution ? I this case max_size doesnt need to specify
in object initialization params...

And another question (I'm use Linux Debian Potato)...
Is there way to define params of the currently performing request
(URI, script, etc) of hanging mod_perl process ? I browsed /proc/[PID of
mod_perl]/, but I think this info is about first request. Am I wrong ?



Sergey Polyakov   aka "BeerBong"
Chief of WebZavod http://www.webzavod.ru
Tel. +7 (8462) 43-93-85 | +7 (8462) 43-93-86
mailto:[EMAIL PROTECTED]