Re[2]: File::Cache problem

2001-02-07 Thread BeerBong

Hello DeWitt,

Wednesday, February 07, 2001, 6:51:24 PM, you wrote:


DC> On Wed, Feb 07, 2001 at 04:02:39PM +0400, BeerBong wrote:

>> Cache size after 24 hours of working

>> via 'du -s' - 53M
>> via 'perl -MFile::Cacje -e"print File::Cache::SIZE('PRTL')"' - 10M

DC> That looks like a serious bug.  Can you double check on that?  Where
DC> are you running the "du -s"?

maul:/tmp/File::Cache/apache# ls
PRTL  PRTLDev
maul:/tmp/File::Cache/apache# du -s *
27924   PRTL
536 PRTLDev
maul:/tmp/File::Cache/apache# perl -MFile::Cache -e"print File::Cache::SIZE('PRTL')"
4178662
maul:/tmp/File::Cache/apache# perl -MFile::Cache 
-e"File::Cache::REDUCE_SIZE(100,'PRTL')"
maul:/tmp/File::Cache/apache# perl -MFile::Cache -e"print File::Cache:SIZE('PRTL')"
4178662
maul:/tmp/File::Cache/apache# 

DC> The SIZE( ) method returns the total size of the objects in the cache,
DC> not including the overhead of directories themselves.  As the
DC> documentation explains, it isn't a perfect mechanism, but it should be
DC> a lot closer than you experienced.

I understand that, but it is not a problem. Why size of cache is not
reduced ? There are not any warnings, just nothing happens.


>> 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...

DC> I personally prefer using a cron job to periodically limit the size of
DC> the cache.  I don't like using "max_size" because of the overhead
DC> involved on every set.  I'd rather just fine tune the number of times
DC> a cron script is executed (i.e., once an hour vs. once a day).



>> Another kind of problem appears recently.
>> 
>> In logs
>> [Wed Feb  7 15:42:57 2001] [error] Couldn't rename 
>/tmp/File::Cache/.description.tmp13984 to /tmp/File::Cache/.description at 
>/usr/web/inc/WebCache.pm line 15
>> [Wed Feb  7 15:44:37 2001] [error] Couldn't rename 
>/tmp/File::Cache/apache/PRTL/b/5/a/b5a261aa13cf0ddfd41beb7d64960248.tmp13441 to
>> /tmp/File::Cache/apache/PRTL/b/5/a/b5a261aa13cf0ddfd41beb7d64960248 at 
>/usr/web/inc/WebCache.pm line 87
>> ...propagated at /usr/web/inc/Apache/Portal.pm line 109.
>> 
>> What I can do ?

DC> Unfortunately the error message doesn't tell me enough.  If you can,
DC> please modify lines 1578 and 1579 of Cache.pm to read as follows:

DC>rename ($temp_filename, $filename) or
DC>  croak("Couldn't rename $temp_filename to $filename:  $!");


DC> The next time it hangs, the error message will have more information.

DC> I'll fix that in the next version of File::Cache.

Done...
Wait for errors now.


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]





Re: Silly Question Not in the FAQ

2001-02-07 Thread Stas Bekman

On Thu, 8 Feb 2001, Stef Telford wrote:

> Hello,
>   Me again (sorry about this) and this is probably a silly question
> but, each of my Apache children load in CGI.pm at startup time (via the
> startup.pl method). The only problem is that the apache-error log grows
> due to the CGI.pm startup message
>
>  (offline mode: enter name=value pairs on standard input).
>
>   Now, how do i get these messages removed or not going to my
> logfile ? I have the latest CGI.pm from CPAN,along with perl 5.005 patch
> 3,
> mod_perl 1.24 and Apache 1.3.17 on a FreeBSD box.
>
>   Its not 'mission critical' (obviously) but its jst one of those little
> 'niggling' things that i would like to know how to 'scratch'. Thank you
> as
> always.

it shouldn't happen (probably a bug in CGI.pm), but a quick workaround
will do:

$CGI::NO_DEBUG = 1;

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





ecommendations for secured file and mod_perl

2001-02-07 Thread Wade Burgett

 My basic problem is that I need for mod_perl scripts to get to a
database password and an encryption key.  I would like to be able to
store these in a file not-readable by the apache user.  I've got them
out of the web tree already, but I would really like to make them
inaccessable to the web-server  user period.  I'm really just looking
for some thoughts as to how/where I could store these safely.  Its only
a couple strings.

One idea I am starting to tinker with, and will, as soon as my
isp gets the router rebooted :)
If I have a module that gets loaded by my startup.pl script (with use
myModule statement) is that happening as root?, or as the web-server
user?  This would be my specific question.  I am thinking that having
the module read the values from a config file and make them globals for
the module.  That seems like it should work.

I understand that mod_perl couldn't be setuid'd since it runs as
part of the apache process.Not sure how else to access files you
don't want the web server user to read.  Thats what I would have done
before becoming moded (and now I can't seem to stand not having
persistent db connections and that massive speed boost of Registry
anymore).   Any thoughts/links/etc would be useful.


--
Wade Burgett
Burgett Systems
http://www.burgettsys.com/
[EMAIL PROTECTED]






Re: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Wade Burgett

This is working for me.  I do some aliasing of mod_perl directories outside
of the  section for stuff that all my hosts need to share so my httpd.conf
is not all perl, but I do have some aliasing going on.

There's some stuff there to pull my records out of a database but basically
the $Company hash_ref is for each company I host.



use Asql::utility;
use Apache::PerlSections();
my $statement = "select ID,Company,webhost,rootdir,master_user,domain,rt from
Companies where webhost is not  NULL and master_user is not NULL";
my $dbh = connect_system_db();
my $sth = $dbh->prepare($statement)|| die "$DBI::errstr\n";
$sth->execute()|| die "$DBI::errstr\n";
my $counter = 0;

while ($Company = $sth->fetchrow_hashref()){

$$Company{ServerAdmin} = "$$Company{master_user}\@"."$$Company{domain}";
my $statement = "select Domain from domains where CompanyID=?";
my $sth2 = $dbh->prepare($statement)|| die "$DBI::errstr\n";
$sth2->execute($$Company{ID})|| die "$DBI::errstr\n";
my $othersites = $sth2->fetchall_arrayref;
@$othersites = map {$_="www.$_";} @$othersites;
#build the hosts

$VirtualHost{'192.168.0.50:80'}[$counter] = {
 SSLDisable   => '',
 ServerName   => "$$Company{webhost}",
 DocumentRoot => "$$Company{rootdir}/public_html",
 ErrorLog => "$$Company{rootdir}/log/error.log",
 CustomLog  => "$$Company{rootdir}/log/access.log combined",
 ServerAdmin  => "$$Company{ServerAdmin}",
 CheckSpelling => 'on',
 "ErrorDocument 404" => "/errors/404.shtml",
 Alias => ["/webrt" => "/var/burgettsys/rt/lib/images"],
 ScriptAlias => ["/rt" => "$$Company{rootdir}/rt/bin/cgi/"],
 ServerAlias => $othersites,
};
$counter++;
};

#print STDERR Apache::PerlSections->dump();
__END__





Dave Baker wrote:

> > Has anyone successfully built a fully perl conf file with multiple virtual
> > hosts on the same IP?  I'm giving it my best, but just can't quite get it to
> > work.  I'm stuck on aliases.  The Eagle book and the mod_perl guide have
> > both been of great help getting this far, but I can't find an example of
> > setting anything where "Directive is Repeated Multiple Times" (which may be
> > an indication that it just don't work).
>
> Not a direct answer, but an alternative to fighting with the data
> structure is just just plug a programmatic $PerlConfig .= $string and
> build the VirtualHosts as if they were plain text.
>
> Not as elegant as doing this the hard way, but it's also easier to
> explain if you have to hand the config file off to someone who knows
> Apache but not Perl.
>
> Dave
>
> --
>
> -  Dave Baker  :  [EMAIL PROTECTED]  :  [EMAIL PROTECTED]  :  http://dsb3.com/
> GnuPG: 1024D/D7BCA55D / 09CD D148 57DE 711E 6708  B772 0DD4 51D5 D7BC A55D
>
>   
>Part 1.2Type: application/pgp-signature

--
Wade Burgett
Burgett Systems
http://www.burgettsys.com/
[EMAIL PROTECTED]






Silly Question Not in the FAQ

2001-02-07 Thread Stef Telford

Hello, 
Me again (sorry about this) and this is probably a silly question
but, each of my Apache children load in CGI.pm at startup time (via the
startup.pl method). The only problem is that the apache-error log grows 
due to the CGI.pm startup message

 (offline mode: enter name=value pairs on standard input).

Now, how do i get these messages removed or not going to my 
logfile ? I have the latest CGI.pm from CPAN,along with perl 5.005 patch
3,
mod_perl 1.24 and Apache 1.3.17 on a FreeBSD box. 

Its not 'mission critical' (obviously) but its jst one of those little
'niggling' things that i would like to know how to 'scratch'. Thank you
as
always.

Stefs



Re: Sessions on win 32

2001-02-07 Thread Victor Michael Blancas

have u tried Apache::ASP by Joshua Chamas.  It has a nice Session and
Application state management.

On Wed, 7 Feb 2001, harilaos wrote:

> Hello,
> I have searched everywhere but there is documentation on
> how to implement Apache::Session on windows.
> Has anyone done this? Please point me to relevent
> docs if you know any.
> I have read about Apache::Session::Win32 but the package is
> removed and obsolete from the latest Apache::Session module.
>
> Thanks
>

-- 
Mike




Re: Reading email with mod_perl

2001-02-07 Thread Victor Michael Blancas

use the module MIME-tools.

On Wed, 7 Feb 2001, Jason Terry wrote:

> Does anybody have an information on how to read a MIME encoded email attachment with 
>mod_perl?
>

-- 
Mike




Re: Sessions on win 32

2001-02-07 Thread Gunther Birznieks

Have you tried doing a perldoc on the modules themselves?

At 02:35 PM 2/7/2001 +, harilaos wrote:
>Hello,
>I have searched everywhere but there is documentation on
>how to implement Apache::Session on windows.
>Has anyone done this? Please point me to relevent
>docs if you know any.
>I have read about Apache::Session::Win32 but the package is
>removed and obsolete from the latest Apache::Session module.
>
>Thanks

__
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Web Technology Company
http://www.extropia.com/




Re: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Dave Baker

> Has anyone successfully built a fully perl conf file with multiple virtual
> hosts on the same IP?  I'm giving it my best, but just can't quite get it to
> work.  I'm stuck on aliases.  The Eagle book and the mod_perl guide have
> both been of great help getting this far, but I can't find an example of
> setting anything where "Directive is Repeated Multiple Times" (which may be
> an indication that it just don't work).

Not a direct answer, but an alternative to fighting with the data
structure is just just plug a programmatic $PerlConfig .= $string and
build the VirtualHosts as if they were plain text.

Not as elegant as doing this the hard way, but it's also easier to
explain if you have to hand the config file off to someone who knows
Apache but not Perl.


Dave 

-- 

-  Dave Baker  :  [EMAIL PROTECTED]  :  [EMAIL PROTECTED]  :  http://dsb3.com/
GnuPG: 1024D/D7BCA55D / 09CD D148 57DE 711E 6708  B772 0DD4 51D5 D7BC A55D


 PGP signature


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

2001-02-07 Thread L.M.Orchard

From: "Chris Winters" <[EMAIL PROTECTED]>
Sent: Tuesday, February 06, 2001 08:14 PM


> From Perrin:
> > 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.

Hey, it's me poking my head briefly out of hiding here...  I'm the lout
responsible for Iaido and it's subsequent (temporary?) mothballing.  Glad
you think I have some cool apps with it, few that they are.  My problem is
that all my round tuits and copious amounts of free time dried up with a new
job and a promotion.  That's about when I disappeared from around this
mailing list and stopped updating my projects on SourceForge.  (Got a new
one on the way, though, new employers permitting)

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.

--
Leslie Michael Orchard  <[EMAIL PROTECTED]>
ICQ Home: 492905 / ICQ Work: 11082089





[PATCH] Put Apache/apxs flags into a safer place

2001-02-07 Thread Wilfredo Sanchez

   This puts Apache's CFLAGS into AP_CFLAGS instead of CFLAGS, so that 
wacky people like me who like to override CFLAGS from the make line 
(make CFLAGS='-arch ppc -arch i386') can do so without stomping the 
Apache flags.

-Fred


   Index: Makefile.tmpl
   ===
   RCS file: 
/cvs/Darwin/Services/apache_mod_perl/mod_perl/apaci/Makefile.tmpl,v
   retrieving revision 1.4
   retrieving revision 1.5
   diff -u -r1.4 -r1.5
   --- Makefile.tmpl2000/11/22 01:27:59 1.4
   +++ Makefile.tmpl2001/02/07 03:55:12 1.5
   @@ -14,7 +14,7 @@
#   from Perl and Apache parameters
MP_CC=$(PERL_CC)
MP_CFLAGS=$(PERL_OPTIMIZE) -I$(PERL_INC) $(PERL_CCFLAGS) \
   -  $(PERL_DEFS) $(INCLUDES) $(CFLAGS)
   +  $(PERL_DEFS) $(INCLUDES) $(AP_CFLAGS) $(CFLAGS)
MP_CFLAGS_SHLIB=$(PERL_CCCDLFLAGS) $(MP_CFLAGS)
MP_LD=$(PERL_LD)
MP_LDFLAGS_SHLIB=$(PERL_LDDLFLAGS)
   @@ -101,7 +101,7 @@
depend:
cp Makefile.tmpl Makefile.tmpl.bak \
&& sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
   -&& gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \
   +&& gcc -MM $(INCLUDES) $(AP_CFLAGS) $(CFLAGS) *.c >> 
Makefile.new \
&& sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \
   -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \
> Makefile.tmpl \



   1.2   +1 -1  Services/apache_mod_perl/mod_perl/apaci/configure

   Index: configure
   ===
   RCS file: 
/cvs/Darwin/Services/apache_mod_perl/mod_perl/apaci/configure,v
   retrieving revision 1.1
   retrieving revision 1.2
   diff -u -r1.1 -r1.2
   --- configure2000/03/31 05:26:41 1.1
   +++ configure2001/02/07 03:55:12 1.2
   @@ -91,7 +91,7 @@
echo "##" >>$my_makefileconf
echo "" >>$my_makefileconf
echo "#   provide some stuff Apache usually provides" 
 >>$my_makefileconf
   -echo "CFLAGS=-DMOD_PERL $my_apxs_cflags" >>$my_makefileconf
   +echo "AP_CFLAGS=-DMOD_PERL $my_apxs_cflags" >>$my_makefileconf
echo "INCLUDES=$my_apxs_includes" >>$my_makefileconf
echo "RANLIB=ranlib" >>$my_makefileconf
echo "LIBEXT=so" >>$my_makefileconf




Re: mod_perl/apache mysql memory usage

2001-02-07 Thread G.W. Haywood

Hi there,

On Wed, 7 Feb 2001, rene mendoza wrote:

> I have a Linux box running Red Hat 6.1, Apache 1.3.14, 
> compiled statically with mod_perl 1.24_01, mod_ssl, and Open SSL,
> mod_dav and mod_gzip running as DSO's,
> mysql-3.23.28-gamma-pc-linux-gnu-i686 (binary)

> im connecting via ethernet from a windows box with Internet Explorer
> and with Netscape, after a few requests httpd memory usage grows to
> 80MB, and mysqld to over 20MB
 
> it still feels fast but im wondering if its normal???

Perfectly normal.  See http://perl.apache.org/guide (and many, many
threads on the mod_perl List...:)

73,
Ged.




RE: mod_perl as DSO on AIX with perl-5.6

2001-02-07 Thread Christian Gilmore

Recompiling with dl_dlopen.xs instead of dl_aix.xs caused 49 of the 180
self-tests to fail. I recompiled with debugging turned on and ran against
GDB. Here's the result followed by the output of './perl -I./lib -V'.
Jens, did you have success running with dl_dlopen.xs without other
modification?

Regards,
Christian

web1-jr% gdb ./perl
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "rs6000-ibm-aix4.3.3.0"...
(gdb) set args t/lib/socket.t
(gdb) run
Starting program: /home/cgilmore/src/perl-5.6.0/./perl t/lib/socket.t

Program received signal SIGSEGV, Segmentation fault.
0xd1cc7534 in boot_Socket (cv=0x200851a8) at Socket.c:1221
1221Socket.c: No such file or directory.
(gdb) bt
#0  0xd1cc7534 in boot_Socket (cv=0x200851a8) at Socket.c:1221
#1  0x100b2818 in Perl_pp_entersub () at pp_hot.c:2533
#2  0x10091064 in Perl_runops_debug () at run.c:56
#3  0x100013ac in S_call_body (myop=0x2ff22078, is_eval=0) at perl.c:1761
#4  0x100064cc in Perl_call_sv (sv=0x2003, flags=6) at perl.c:1677
#5  0x100012f4 in S_call_list_body (cv=0x2003) at perl.c:3600
#6  0x10008534 in Perl_call_list (oldscope=1, paramList=0x20038804)
at perl.c:3528
#7  0x100993f4 in Perl_newATTRSUB (floor=78, o=0x2003c338, proto=0x0,
attrs=0x0, block=0x2003c478) at op.c:4641
#8  0x10099f3c in Perl_utilize (aver=1, floor=78, version=0x0,
id=0x2002bb78,
arg=0x0) at op.c:3162
#9  0x10092b70 in Perl_yyparse () at perly.y:403
#10 0x100023dc in S_parse_body (env=0x0,
xsinit=0x20020b18 ) at perl.c:1249
#11 0x10008c30 in perl_parse (my_perl=0x2002b338,
xsinit=0x20020b18 , argc=2, argv=0x2ff229c4,
env=0x0)
at perl.c:857
#12 0x10001070 in main (argc=2, argv=0x2ff229c4, env=0x2ff229d0)
at perlmain.c:50
#13 0x11dc in __start ()



web1-jr% ./perl -I./lib -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
osname=aix, osvers=4.3.3.0, archname=aix
uname='aix web1-jr 3 4 000528df4c00 '
config_args='-d'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=undef
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
cc='cc', optimize='-g', gccversion=
cppflags=''
ccflags
='-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=1638
4 -I/usr/vac/include -I/opt/gnu/include'
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
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='ld', ldflags ='-L/usr/vac/lib -L/opt/gnu/lib'
libpth=/opt/gnu/lib /usr/vac/lib /lib /usr/lib /usr/ccs/lib


  libs=-lbind -lnsl -ldbm -ldl -lld -lm -lC -lc -lcrypt -lbsd -lPW -liconv
libc=, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
cdlflags='  -bE:/opt/gnu/depot/perl-5.6.0/lib/5.6.0/aix/CORE/perl.exp -bE:
/opt/gnu/depot/perl-5.6.0/lib/5.6.0/aix/CORE/perl.exp -bE:/opt/gnu/depot/p
erl-5.6.0/lib/5.6.0/aix/CORE/perl.exp -bE:/opt/gnu/depot/perl-5.6.0/lib/5.
6.0/aix/CORE/perl.exp'
cccdlflags=' ',
lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b
noentry -lC -lc -L/opt/gnu/lib -L/usr/vac/lib'


Characteristics of this binary (from libperl):
  Compile-time options: DEBUGGING
  Built under aix
  Compiled at Feb  7 2001 18:22:19
  @INC:
./lib
/opt/gnu/depot/perl-5.6.0/lib/5.6.0/aix
/opt/gnu/depot/perl-5.6.0/lib/5.6.0
/opt/gnu/depot/perl-5.6.0/lib/site_perl/5.6.0/aix
/opt/gnu/depot/perl-5.6.0/lib/site_perl/5.6.0
/opt/gnu/depot/perl-5.6.0/lib/site_perl
.


> -Original Message-
> From: Jens-Uwe Mager [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 28, 2001 8:46 AM
> To: Christian Gilmore
> Cc: Modperl Mailing List (E-mail)
> Subject: Re: mod_perl as DSO on AIX with perl-5.6
>
>
> On Sat, Jan 27, 2001 at 01:42:44PM -0600, Christian Gilmore wrote:
>
> > Hey. I see in mod_perl's INSTALL document that there's a
> required patch
> > for DynaLoader if you intend to run mod_perl as DSO on AIX
> (4.3) with
> > perl-5.005_3. Is patching required for 5.6? If so, will the
> same patch in
> > the INSTALL doc apply?
>
> Unfortunately this is a bit complicated and it depends upon
> AIX version.
> For AIX versions before 4.3 yes, and I posted the patch on this list a
> while ago. But as you are using AIX 4.3 this is not required
> any more if
> you are careful

mod_perl/apache mysql memory usage

2001-02-07 Thread rene mendoza



Hi, i have a question regarding mod_perl/apache 
mysql memory usage
 
I have a Linux box running Red Hat 6.1, Apache 
1.3.14, compiled statically with mod_perl 1.24_01, mod_ssl, and Open 
SSL,mod_dav and mod_gzip running as DSO's, MYSQL 
ismysql-3.23.28-gamma-pc-linux-gnu-i686 (binary)
 
im using Apache DBI and Apache Session 
Mysqlthe linux box has an Intel celeron processor @400mhz, 96 Mb of RAM 
(graphics video share at 4MB i think)and a hard drive of 4GB
 
this is a development offline server so i 
running things like X, and, vnc and kde but im very concerned with the usage 
of memory
 
im connecting via ethernet from a windows box 
with Internet Explorer and withNetscape, after a few requests httpd memory 
usage grows to 80MB, and mysqld to over 20MB
 
it still feels fast but im wondering if its 
normal???
 
i m not familiar linux memory usage under 
linux, i know that probably this question should be sent to other 
listany suggestions to where??
 
anybody please could tell me where to look (my 
mason components, handler.pl,httpd.conf, or somewhere else)i guess that 
the same mysql database handle isnt being used by the components am i 
right?
 
 
im using  Mason 0.896

 
On startup this is the output of top 
-b:
 
  3:43pm  up 14 min,  1 user,  
load average: 0.09, 0.12, 0.0958 processes: 57 sleeping, 1 running, 0 
zombie, 0 stoppedCPU states:  2.1% user,  6.7% system,  0.0% 
nice, 91.1% idleMem:   87364K av,  85236K used,   
2128K free,  77048K shrd,   5944K buffSwap: 128512K 
av,   3492K used, 125020K 
free 
50264K cached
 
  PID USER PRI  
NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME 
COMMAND  726 root  18   0  
4204 4204  2948 S   0  4.9  
4.8   0:31 gtop  680 root   
9   0  4076 4076  1168 S   
0  1.5  4.6   0:24 Xvnc  756 
root   5   0  4268 4268  
3080 S   0  1.1  4.8   
0:04 ktop  770 root   9   
0  1032 1032   824 R   0  
0.9  1.1   0:00 top    3 
root   1   0 
0    0 0 SW  
0  0.1  0.0   0:00 kupdate    1 
root   0   0   460  
460   388 S   0  0.0  
0.5   0:04 init    2 
root   0   0 
0    0 0 SW  
0  0.0  0.0   0:00 kflushd    4 
root   0   0 
0    0 0 SW  
0  0.0  0.0   0:00 kpiod    5 
root   0   0 
0    0 0 SW  
0  0.0  0.0   0:00 kswapd    6 
root -20 -20 0    
0 0 SW< 0  0.0  
0.0   0:00 mdrecoveryd  291 
bin    0   0   
308  288   228 S   0  
0.0  0.3   0:00 portmap  307 
root   0   0   392  
380   328 S   0  0.0  
0.4   0:00 apmd  360 root   
0   0   516  508   420 
S   0  0.0  0.5   0:00 
syslogd  371 root   0   
0   668  656   316 
S   0  0.0  0.7   0:00 
klogd  387 daemon 0   0   
312  296   232 S   0  
0.0  0.3   0:00 atd  403 
root   0   0   548  
540   452 S   0  0.0  
0.6   0:00 crond  423 
root   0   0   444  
436   368 S   0  0.0  
0.4   0:00 inetd  439 
root   0   0   448  
436   368 S   0  0.0  
0.4   0:00 lpd  462 root   
0   0   868  868   672 
S   0  0.0  0.9   0:00 
in.telnetd  463 root   0   
0  1116 1116   868 S   0  
0.0  1.2   0:00 login  464 jaimeren   
0   0   956  956   768 
S   0  0.0  1.0   0:00 
bash  478 root   0   
0  1064 1064   704 S   0  
0.0  1.2   0:00 su  479 
root   5   0   988  
988   756 S   0  0.0  
1.1   0:00 bash  505 root   
0   0   808  664   516 
S   0  0.0  0.7   0:00 
sendmail  522 root   0   
0   340  312   268 
S   0  0.0  0.3   0:00 
gpm  539 xfs    0   
0  1088 1080   584 S   0  
0.0  1.2   0:00 xfs  590 
root   0   0   392  
332   252 S   0  0.0  
0.3   0:00 S99local  592 
root   0   0   840  
840   688 S   0  0.0  
0.9   0:00 safe_mysqld  621 
root   0   0  1632 
1632   988 S   0  0.0  
1.8   0:00 mysqld  623 
root   0   0   596  
512   408 S   0  0.0  
0.5   0:00 smbd  634 root   
0   0   756  708   572 
S   0  0.0  0.8   0:00 
nmbd  639 root   0   
0  1632 1632   988 S   0  
0.0  1.8   0:00 mysqld  640 
root   0   0  1632 
1632   988 S   0  0.0  
1.8   0:00 mysqld  641 
root   0   0  1200  
656   452 S   0  0.0  
0.7   0:00 named  643 
root   0   0   384  
384   316 S   0  0.0  
0.4   0:00 mingetty  644 
root   0   0   384  
384   316 S   0  0.0  
0.4   0:00 mingetty  645 
root   0   0   384  
384   316 S   0  0.0  
0.4   0:00 mingetty  646 
root   0   0   384  
384   316 S   0  0.0  
0.4   0:00 mingetty  647 
root   0   0   384  
384   316 S   0  0.0  
0.4   0:00 mingetty  648 
root   0   0   384  
384   316 S   0  0.0  
0.4   0:00 mingetty  649 
root   0   0  1004 
1004   944 S   0  0.0  
1.1   0:00 gdm  657 root   
0   0 11016  10M  1812 S   
0  0.0 12.6   0:00 X  658 
root   0   0   776  
736   668 S   0  0.0  
0.8   0:00 gdm  665 
gdm    0   0  3156 
3156

[OT] Mailing List Software

2001-02-07 Thread Robert Landrum

I've been looking for some mailing list software that is manageable 
from mod_perl  I need something capable of writing data to a database 
(Oracle) and creating sublists/queries from main lists of over 
250,000 users.

If you've seen or heard about such software, please let me know...


Thanks,

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: object not being destroyed in a TemplateToolkit-based handler

2001-02-07 Thread Perrin Harkins

On Wed, 7 Feb 2001, Vivek Khera wrote:
> Did you (or anyone else) reproduce the non-destroy of my mini-plugin?
> I'd like to at least know if I'm doing something wrong in mod_perl.  I
> find it disconcerting to have my plugin objects sitting around unused
> and unreaped, aka, memory leakage.

Okay, I just tried the code you posted under mod_perl and it worked fine.  
I changed a couple of lines having to do with locations and package names,
and I commented out the PRE_PROCESS/POST_PROCESS stuff.  The plugin object
reported being destroyed.
- Perrin




Re: Problem with $r->register_cleanup()

2001-02-07 Thread Robert Landrum

Is it possible that another handler (such as CGI, or parsed-html) is 
taking over before yours and exiting or returning OK.

Rob

>Hi,
>
>I just ran into a problem with $r->register_cleanup() only sometime beeing
>called.
>
>This is mod_perl 1.24_01, perl 5.6.0, apache 1.3.14 compiled with gcc 5.6.0 on
>AIX 4.3.3.
>
>Here's a sample code (snippet):
>
>sub handler { # PerlTransHandler
>  my $r = shift;
>  $r->register_cleanup(\&clean1);
>  $r->push_handlers(PerlCleanupHandler => \&clean2);
>  $r->pnotes('cleanup', bless {} );
>  print STDERR 'in ";
>  return DECLINE;
>}
>
>sub clean1 { print STDERR "register_cleanup "; }
>sub clean2 { print STDERR "push_handlers "; }
>sub DESTROY { print STDERR "DESTROY\n"; }
>
>And that's the error_log:
>
>in register_cleanup push_handlers DESTROY
>in register_cleanup push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in register_cleanup push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in push_handlers DESTROY
>in register_cleanup push_handlers DESTROY
>in push_handlers DESTROY
>
>
>The pushed handler only get's called about a third or less of the time. :-(
>
>Any idea, bug?
>
>Michael Jacob
>
>PS: Yes I did some tests with -x...


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



Problem with $r->register_cleanup()

2001-02-07 Thread Michael . Jacob

Hi,

I just ran into a problem with $r->register_cleanup() only sometime beeing
called.

This is mod_perl 1.24_01, perl 5.6.0, apache 1.3.14 compiled with gcc 5.6.0 on
AIX 4.3.3.

Here's a sample code (snippet):

sub handler { # PerlTransHandler
  my $r = shift;
  $r->register_cleanup(\&clean1);
  $r->push_handlers(PerlCleanupHandler => \&clean2);
  $r->pnotes('cleanup', bless {} );
  print STDERR 'in ";
  return DECLINE;
}

sub clean1 { print STDERR "register_cleanup "; }
sub clean2 { print STDERR "push_handlers "; }
sub DESTROY { print STDERR "DESTROY\n"; }

And that's the error_log:

in register_cleanup push_handlers DESTROY
in register_cleanup push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in register_cleanup push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in push_handlers DESTROY
in register_cleanup push_handlers DESTROY
in push_handlers DESTROY


The pushed handler only get's called about a third or less of the time. :-(

Any idea, bug?

Michael Jacob

PS: Yes I did some tests with -x...





Re: Reading email with mod_perl

2001-02-07 Thread Patrick

On Wed, Feb 07, 2001 at 11:29:59AM -0700, Jason Terry took time to write:
> Does anybody have an information on how to read a MIME encoded email attachment with 
>mod_perl?

This is not specific to modperl.
The module MIME::Entity does that very nicely IMNSHO.

-- 
Patrick.
``C'est un monde qui n'a pas les moyens de ne plus avoir mal.''



Re: Socket/PIPE/Stream to long running process

2001-02-07 Thread Simon Rosenthal

At 11:04 AM 2/2/01 -0800, Rob Bloodgood wrote:
>So, in my mod_perl app, I run thru each request, then blast a UDP packet to
>a process on the local machine that collects statistics on my traffic:
>
>



>My question is, should I be creating this socket for every request?  OR
>would it be more "correct" to create it once on process startup and stash it
>in $r->pnotes or something?

we have similar code in a mod_perl environment  for sending Multicast UDP 
packets - I just store the socket filehandle  in a global when it's 
created,  and the next request can pick it up from there (just test if the 
global is defined).
keeping the endpoint info in pnotes is only useful if you need write 
multiple UDP packets per request.

-Simon



>And if I did that, would it work w/ TCP?  Or unix pipes/sockets (which I
>*don't* understand) (btw the box is linux)?  In testing, I'd prefer not to
>use TCP because it blocks if the count server is hung or down, vs UDP, where
>I just lose a couple of packets.
>
>TIA!
>
>L8r,
>Rob

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"




Sr software engineer positions at AvantGo

2001-02-07 Thread Jon Swartz
Title: Sr software engineer positions at AvantGo





The mobile internet team at AvantGo is looking for excellent web engineers!


Located in San Mateo, AvantGo develops software to deliver internet/intranet content to handheld devices and cell phones. We mantain the fun, casual and intellectual environment of a small company, while striving to grow aggressively in our space.

The mobile internet team is responsible for technologies underlying AvantGo's web site, internet sync service, and the handheld user interface.  We develop web applications with Perl, Apache, mod_perl, Mason, and mysql.  We also develop our highly-tuned server infrastructure in C.  Generally engineers get the choice of which kind of work they'd like to do, with FreeBSD Unix as a common platform.

Requirements: strong software development skills, experience with Unix and web technologies. Plusses include experience with C and/or Perl, Apache, SQL, and a computer science or equivalent degree.

All positions are full-time and on-site. Occasional work-at-home may be negotiated.


Send your resume to [EMAIL PROTECTED] or [EMAIL PROTECTED] if interested.


Cheers
Jon





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

2001-02-07 Thread Vivek Khera

> "PH" == Perrin Harkins <[EMAIL PROTECTED]> writes:

PH> To find out if this is a mod_perl probelm or not, try makiing your command
PH> line script call $tt->process twice in a row.  If the object gets
PH> destroyed twice, this is mod_perl-related.  Otherwise, it's a TT 
PH> problem and officially [OT] for the mod_perl list.

Did.  It is definitely only happening in mod_perl.  On the command
line, the object properly gets destroyed when expected, ie, before the
print "end of template processing" happens.





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

2001-02-07 Thread Perrin Harkins

On Wed, 7 Feb 2001, Vivek Khera wrote:
> Did you (or anyone else) reproduce the non-destroy of my mini-plugin?

I didn't actually run it; just poked through the code.

> I'd like to at least know if I'm doing something wrong in mod_perl.  I
> find it disconcerting to have my plugin objects sitting around unused
> and unreaped, aka, memory leakage.

To find out if this is a mod_perl probelm or not, try makiing your command
line script call $tt->process twice in a row.  If the object gets
destroyed twice, this is mod_perl-related.  Otherwise, it's a TT 
problem and officially [OT] for the mod_perl list.

- Perrin




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

2001-02-07 Thread Vivek Khera

> "PH" == Perrin Harkins <[EMAIL PROTECTED]> writes:

PH> On Wed, 7 Feb 2001, Vivek Khera wrote:
>> Ok... here's a mini-plugin that exhibits this behavior, and a command
>> line script for it.

PH> This all looks like it should work, and the plugin object should get
PH> destroyed.  Until someone finds the source of the problem, you could work
PH> around it by keeping your session reference in $r->pnotes instead of the

You and your $r->pnotes()!!! :-)

Very useful idea...  I think for now I'll just go with a session.finish()
method to force the untie manually.

Did you (or anyone else) reproduce the non-destroy of my mini-plugin?
I'd like to at least know if I'm doing something wrong in mod_perl.  I
find it disconcerting to have my plugin objects sitting around unused
and unreaped, aka, memory leakage.


Thanks.



RE: [RESEND] Apache::Status and custom menu_items

2001-02-07 Thread Christian Gilmore

I believe I'm doing that. I don't have a startup.pl. Here's what's in
httpd.conf (in order):

  PerlModule Apache::Status
  PerlModule Apache::Resource
  PerlModule HTML::Embperl
  PerlModule B::Terse

  PerlSetEnv PERL_RLIMIT_CPU 120

  PerlModule Tivoli::Apache::AuthenLDAP
  PerlModule Tivoli::Apache::AuthzLDAP
  PerlModule Tivoli::Apache::AuthenCache
  PerlModule Tivoli::Apache::AuthzCache

Regards,
Christian

> -Original Message-
> From: Vivek Khera [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 07, 2001 1:21 PM
> To: 'Modperl Mailing List (E-mail)'
> Subject: RE: [RESEND] Apache::Status and custom menu_items
>
>
> > "CG" == Christian Gilmore <[EMAIL PROTECTED]> writes:
>
> CG> Are you saying that you see an extra menu from
> Apache::DBI when using
> CG> Apache::Status? I'm not seeing any custom menus. For instance,
>
> Yes, I do.  You need to load Apache::Status before Apache::DBI,
> however, as per the Apache::DBI docs.
>




RE: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Veatch, David W

Got it.  So far, everything appears to be working like a dream.  Here's the
changes I made:

# OLD and BREAKY

Location => {
'/' => {
SetHandler => 'perl-script',
PerlInitHandler => 'Apache::StatINC',
PerlHandler => 'Reckoning::IndexHandler::members',

AuthName => 'theReckoning',
AuthType => 'Basic',
Limit => {
'GET POST' => {
require => 'valid-user',
},
},
},
},

# SHINY and NEW

Location => {
'/' => {
SetHandler => 'perl-script',
PerlInitHandler => 'Apache::StatINC',
PerlHandler => 'Reckoning::IndexHandler::members',
AuthName => qw( theReckoning ),
AuthType => 'Basic',
require => 'valid-user',
},
},

Now, if you want to use the LIMIT directive for something, then I'm not sure
how to get that to work... I realized that I didn't really need it, yanked
it, and all is well.



RE: [RESEND] Apache::Status and custom menu_items

2001-02-07 Thread Vivek Khera

> "CG" == Christian Gilmore <[EMAIL PROTECTED]> writes:

CG> Are you saying that you see an extra menu from Apache::DBI when using
CG> Apache::Status? I'm not seeing any custom menus. For instance,

Yes, I do.  You need to load Apache::Status before Apache::DBI,
however, as per the Apache::DBI docs.



Re: Reading email with mod_perl

2001-02-07 Thread Matt Sergeant

On Wed, 7 Feb 2001, Jason Terry wrote:

> Does anybody have an information on how to read a MIME encoded email
> attachment with mod_perl?

Depends where you're reading it from, but there are lots of modules on
CPAN that can do this. Do a search for POP, IMAP, or MIME on
search.cpan.org.

-- 


/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




RE: [RESEND] Apache::Status and custom menu_items

2001-02-07 Thread Christian Gilmore

Are you saying that you see an extra menu from Apache::DBI when using
Apache::Status? I'm not seeing any custom menus. For instance,
Apache::Resource custom menu does not display. I'm currently using
apache-1.3.12 with mod_perl-1.24 on solaris-2.6.

Regards,
Christian

> -Original Message-
> From: Vivek Khera [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 07, 2001 1:05 PM
> To: Modperl Mailing List (E-mail)
> Subject: Re: [RESEND] Apache::Status and custom menu_items
>
>
> > "CG" == Christian Gilmore <[EMAIL PROTECTED]> writes:
>
> CG> I didn't get any responses on this thread a few weeks
> ago. Does anyone
> CG> have any successful experience with adding a custom menu in
> CG> Apache::Status?
>
> Apache::DBI appends its own menu item.  Couldn't you do yours the
> same way?
>




Re: [RESEND] Apache::Status and custom menu_items

2001-02-07 Thread Vivek Khera

> "CG" == Christian Gilmore <[EMAIL PROTECTED]> writes:

CG> I didn't get any responses on this thread a few weeks ago. Does anyone
CG> have any successful experience with adding a custom menu in
CG> Apache::Status?

Apache::DBI appends its own menu item.  Couldn't you do yours the
same way?



RE: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Veatch, David W

Yup... you and I came to the same conclusion at the same time.  I can't tell
if the var is truly being set, though, b/c AuthType, AuthName, or Limit vars
aren't being set...  My handler requires that $r->current_user be set, and
so it's bombing out.  On another vhost that doesn't require current_user,
it's getting through just fine, but w/o prompting for authentication.

Thanks again.  I feel like I'm getting closer and closer, and that's a Good
Thing. :)

] David <- still busily pecking.

> -Original Message-
> From: Benjamin Trott [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 07, 2001 12:38 PM
> To: Veatch, David W
> Cc: [EMAIL PROTECTED]
> Subject: Re: Perl Sections, NameVirtualHost, and Aliases
> 
> 
> > However, now I'm getting this:
> > 
> > : PerlSetVar takes two arguments, Perl config var and value.
> 
> I don't think PerlSetVar likes this line:
> 
> [ Auth_DBI_pwd_whereclause => '"user_usertype>0"' ],



[RESEND] Apache::Status and custom menu_items

2001-02-07 Thread Christian Gilmore

I didn't get any responses on this thread a few weeks ago. Does anyone
have any successful experience with adding a custom menu in
Apache::Status?

Regards,
Christian

-Original Message-
From: Christian Gilmore [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 5:26 PM
To: Modperl Mailing List (E-mail)
Subject: Apache::Status and custom menu_items


I'm attempting to insert a custom menu item as described in the eagle
book, pages 641-3. To my knowledge, I've properly coded, yet I don't see
any change in the /perl-status output. Also, a number of modules I know
are loaded, such as Apache::Resource and Tivoli::Apache::AuthenCache,
don't show up in the "Loaded Modules" section. Here's my httpd
configuration (the kitchen sink approach while attempting to determine the
problem):

  PerlModule Apache::Status
  PerlModule Apache::Resource
  PerlModule HTML::Embperl
  PerlModule B::Terse

  PerlSetEnv PERL_RLIMIT_CPU 120

  PerlModule Tivoli::Apache::AuthenLDAP
  PerlModule Tivoli::Apache::AuthzLDAP
  PerlModule Tivoli::Apache::AuthenCache
  PerlModule Tivoli::Apache::AuthzCache

  SetEnvEMBPERL_OPTIONS 19472
  SetEnvEMBPERL_ESCMODE 0

  
  SetHandlerperl-script
  PerlHandler   Apache::Status
  PerlSetVarStatusDumperOn
  PerlSetVarStatusPeek  On
  PerlSetVarStatusLexInfo   On
  PerlSetVarStatusDeparse   On
  PerlSetVarStatusTerse On
  PerlSetVarStatusTerseSize On
  PerlSetVarStatusTerseSizeMainSummary  On
  

Any ideas where these menu_items are supposed to show up? I understood it
to be the top level. Neither my module's menu_items nor Apache::Resource's
menu_items appear, although if I dig through the symbol table dump, I find
both packages have the routine for menu_items listed and available for
deparsing, dumps, etc.

Also, the "Memory Usage" item that should show up when
StatusTerseSizeMainSummary is on is not showing up.

Regards,
Christian

-
Christian Gilmore
Infrastructure & Tools Team Lead
Web & Multimedia Development
Tivoli Systems, Inc.





Reading email with mod_perl

2001-02-07 Thread Jason Terry

Does anybody have an information on how to read a MIME encoded email attachment with 
mod_perl?




Re: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Benjamin Trott

> However, now I'm getting this:
> 
> : PerlSetVar takes two arguments, Perl config var and value.

I don't think PerlSetVar likes this line:

[ Auth_DBI_pwd_whereclause => '"user_usertype>0"' ],

You could try taking out the quotes and see if that helps, cause it did for
me (though I didn't check whether the correct var got set):

[ Auth_DBI_pwd_whereclause => 'user_usertype>0' ],

bye,
Ben




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

2001-02-07 Thread Perrin Harkins

On Wed, 7 Feb 2001, Vivek Khera wrote:
> Ok... here's a mini-plugin that exhibits this behavior, and a command
> line script for it.

This all looks like it should work, and the plugin object should get
destroyed.  Until someone finds the source of the problem, you could work
around it by keeping your session reference in $r->pnotes instead of the
actual plugin object.  Then the session will get destroyed at the end of
the request even if the plugin object doesn't.

- Perrin




RE: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Veatch, David W

That was my conclusion as well... PerlSetVar is the same data structure (as
far as mod_perl is concerned), so it makes sense to use the same syntax.
However, now I'm getting this:

: PerlSetVar takes two arguments, Perl config var and value. 

If you have ideas, feel free, but I'm not going to wait. ;)

] David <- busily pecking away

> should look more like this:
> 
> PerlSetVar => [
> [ Auth_DBI_data_source => 'dbi:Pg:dbname=reckdb' ],
> [ Auth_DBI_username => 'dvicci' ],
> [ Auth_DBI_pwd_table => 'user_profile' ],
> [ Auth_DBI_uid_field => 'user_username' ],
> [ Auth_DBI_pwd_field  => 'user_password' ],
> [ Auth_DBI_pwd_whereclause => '"user_usertype>0"' ],
> [ Auth_DBI_encrypted => 'off' ],
> ],
> 
> That's the format I use when using PerlSetVar.

Thanks for the quick response, btw. :)



Re: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Benjamin Trott

I think that this:

> PerlSetVar => {
> Auth_DBI_data_source => 'dbi:Pg:dbname=reckdb',
> Auth_DBI_username => 'dvicci',
> Auth_DBI_pwd_table => 'user_profile',
> Auth_DBI_uid_field => 'user_username',
> Auth_DBI_pwd_field  => 'user_password',
> Auth_DBI_pwd_whereclause => '"user_usertype>0"',
> Auth_DBI_encrypted => 'off',
> },

should look more like this:

PerlSetVar => [
[ Auth_DBI_data_source => 'dbi:Pg:dbname=reckdb' ],
[ Auth_DBI_username => 'dvicci' ],
[ Auth_DBI_pwd_table => 'user_profile' ],
[ Auth_DBI_uid_field => 'user_username' ],
[ Auth_DBI_pwd_field  => 'user_password' ],
[ Auth_DBI_pwd_whereclause => '"user_usertype>0"' ],
[ Auth_DBI_encrypted => 'off' ],
],

That's the format I use when using PerlSetVar.

bye,
Ben




RE: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Veatch, David W

That did it!  The aliases problem is solved!  Thanks!

Before:
Alias => {
[ '/images' => "$vhosts_root/domain/images" ],
[ '/css' => "$vhosts_root/domain/css" ],
}

Now:
Alias => [
[ '/images' => "$vhosts_root/domain/images" ],
[ '/css' => "$vhosts_root/domain/css" ],
]


Now I've got to figure out what's going on with authentication... it's not
picking up the auth vars.  But with the Alias problem fixed, I'm feeling
much better about it.  Thanks!

Perhaps an Alias example could be added to the docs somewhere?

> -Original Message-
> From: Jason Terry [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 07, 2001 11:53 AM
> To: G.W. Haywood; Veatch, David W
> Cc: [EMAIL PROTECTED]
> Subject: Re: Perl Sections, NameVirtualHost, and Aliases
> 
> 
> I use this code to pull my domains from a VERY simple mySQL db



Re: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Jason Terry

I use this code to pull my domains from a VERY simple mySQL db


- Original Message - 
From: "G.W. Haywood" <[EMAIL PROTECTED]>
To: "Veatch, David W" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 10:04 AM
Subject: Re: Perl Sections, NameVirtualHost, and Aliases


> Hi there,
> 
> On Wed, 7 Feb 2001, Veatch, David W wrote:
> 
> > Has anyone successfully built a fully perl conf file with multiple virtual
> > hosts on the same IP?
> 
> Dunno if it will work for you in those circumstances, but have you
> looked at mod_macro?  I used it last year and it was fine for an
> ordinary (although complex, multiple virtual hosts) http.conf.
> 
> 73,
> Ged.

 virt_perl.inc


Re: [OT] Freeing Memory with of C extensions under Solaris

2001-02-07 Thread G.W. Haywood

Hi Bill,

On Wed, 7 Feb 2001, Bill Moseley wrote:

> I'm using some C extensions in my mod_perl application.  IIRC, memory used
> by perl is never given back to the system.  Does this apply also to
> malloc() and free()ed memory in my C extension?  Or is that OS dependent?

It's not clear from your post whethere you're using C to extend Apache
or Perl.  If it's Apache you should be using pools for efficiency's
sake.  There are two sorts of pools (at least:) - those which live for
the lifetime of the parent and those which live for the lifetime of
the child.

If you're using XS then you probably should be using the New(), Newc()
etc. interface to malloc().  See 'perldoc perlapi', 'perldoc perlguts'
and 'perldoc perlxs'.  I guess you already have?

If hacking Perl then you can probably do what you like.

Quote from perldoc perlguts:

   It is suggested that you enable the version of malloc that
   is distributed with Perl.  It keeps pools of various sizes
   of unallocated memory in order to satisfy allocation
   requests more quickly.  However, on some platforms, it may
   cause spurious malloc or free errors.

Eeek!

If you use plain old C malloc() then unless it's been replaced by the
Perl version (which I think they'd like) you'll get your memory back
OK.  Simple enough to check with 'top'.

> Can Apache ever shrink?

If you use plain malloc, yes.  You free some of the the Apache and
Perl pools when a child dies.

See also apache/htdocs/manual/new_features_1_3.html - look for "ALLOC_DEBUG".

HTH

73,
Ged.




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

2001-02-07 Thread Vivek Khera

> "PH" == Perrin Harkins <[EMAIL PROTECTED]> writes:

PH> Hmmm... If I'm reading the code correctly, what's supposed to happen is
PH> that the stash (where your plugin instance lives) gets localized when you
PH> call $tt->process() and de-localized at the end, which should result in
PH> anything you added to it (with your USE s = session) getting DESTROY-ed.  

Ok... here's a mini-plugin that exhibits this behavior, and a command
line script for it.  My mod_perl handler is essentially the same as
the command line script, except that $tt is a package "my" variable,
and the $tt->process() is called from the package handler() method.

In mod_perl, I change the goober object's "print" to "warn" so they go
to the error_log file.  The destroy message only shows up when httpd
exits.

Does anyone else have issues with TT plugin objects not getting
destroyed under the mod_perl environment?  It works as expected in the
command line version below.  That is, after process() finishes, the
object goes away.

TT version 2.0
mod_perl 1.24_02-dev
Apache 1.3.14
FreeBSD 4.2-STABLE (from Jan 29)


My/goober.pm:
--cut here--
#! /usr/bin/perl

package My::goober;
use strict;

use base qw( Template::Plugin );

sub new {
my $class   = shift;
my $context = shift;

my $id = rand;

print "creating goober object $id\n";

return bless { id => $id, _CONTEXT => $context }, $class;
}

sub DESTROY {
  my $self = shift;

  print "goober object $self->{id} destroyed\n";
}

1;
--cut here--

and the script to run it on command line:
--cut here--
#!/usr/bin/perl -w
use strict;

use Template;

$| = 1;

my $tt =
  Template->new({
 PLUGIN_BASE => 'My',
 POST_CHOMP => 1,
 PRE_CHOMP => 1,
 VARIABLES => {
   foo => 'hi!',
  },
}
   )
  or die "Template::new failure";

my $template = <<"EOT";
[% USE g = goober %]
...template output...
[% foo %]
EOT

print "Starting to process template\n";
$tt->process(\$template,undef) or die $tt->error();
print "Template processing done\n";
--cut here--


here's my mod_perl handler:
--cut here--
#! /usr/bin/perl

package MLM::MLMhandler;
use strict;
use 5.005;
use Apache::Constants qw(OK DECLINED NOT_FOUND SERVER_ERROR);

use vars qw($Debug $VERSION);
$Debug ||= 0;

BEGIN {
  $VERSION = do { my @r=(q$Revision: 0.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r 
};
}

use Template;
use Apache::Util;

my $tt =
  Template->new({
 PRE_PROCESS => 'header.tt',
 POST_PROCESS => 'footer.tt',
 DEFAULT => 'notfound.html',
 ABSOLUTE => 1,
 INCLUDE_PATH => 
'/home/khera/proj/vk-mlm/website/docs/_templates:/home/khera/proj/vk-mlm/website/docs',
 PLUGIN_BASE => 'MLM::Plugins',
 VARIABLES =>
 {
  time2str => sub {
return Apache::Util::ht_time(($_[1]||time),($_[0]||'%c'),0);
  },
 },
})
  or die "Template::new failure";

sub handler {
my($r) = @_;

# only works on main request
return DECLINED unless ($r->is_main());

my $subr = $r->lookup_uri($r->uri); # uri is relative to doc root
my $fileName = $subr->filename; # absolute file name

return NOT_FOUND unless -f $fileName; # file not found
#return DECLINED unless -T _; # not a text file

# send headers to the client
$r->send_http_header('text/html');

return OK if $r->header_only(); # HEAD request, so skip out early!

Apache->request($r);# plugins might need it
$tt->process($fileName, undef, $r)
  or do { warn $tt->error(); return SERVER_ERROR; };

return OK;
}

1;
--cut here--



RE: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Veatch, David W

I haven't no, but I will.  I'm doing this at home in preparation for
implementing it at work, where I hesitate to throw yet another module into
the mix (we already have a pretty rich set of compile time modules in
there).

Thanks! :)

> From: G.W. Haywood <[EMAIL PROTECTED]>
>
> Dunno if it will work for you in those circumstances, but have you
> looked at mod_macro?  I used it last year and it was fine for an
> ordinary (although complex, multiple virtual hosts) http.conf.



Re: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread G.W. Haywood

Hi there,

On Wed, 7 Feb 2001, Veatch, David W wrote:

> Has anyone successfully built a fully perl conf file with multiple virtual
> hosts on the same IP?

Dunno if it will work for you in those circumstances, but have you
looked at mod_macro?  I used it last year and it was fine for an
ordinary (although complex, multiple virtual hosts) http.conf.

73,
Ged.




Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Veatch, David W

Yo,

Has anyone successfully built a fully perl conf file with multiple virtual
hosts on the same IP?  I'm giving it my best, but just can't quite get it to
work.  I'm stuck on aliases.  The Eagle book and the mod_perl guide have
both been of great help getting this far, but I can't find an example of
setting anything where "Directive is Repeated Multiple Times" (which may be
an indication that it just don't work).  I just started on this project, and
this is the first major roadblock.  Here are the relevant portions (I hope)
of the config for reference.  Thank you in advance for any and all
help/clues.  This is getting deeper than I've previously gotten, so I'm
learning as I go.  An RTFM is welcome, just tell me which M and where. :)


#!/usr/local/bin/perl
# Trimmed for brevity here... the real file is MUCH larger

$Apache::Server::StrictPerlSections = 1;
$Apache::Server::SaveConfig = 1;

$ServerName = `hostname`;
$ServerType = 'standalone';
$ServerRoot = '/www';

my $conf_root = $ServerRoot . '/conf';
my $logs_root = $ServerRoot . '/logs';
my $vhosts_root = $ServerRoot . '/vhosts';

# olorin eq prod, erasmus eq dev
if ($ServerName =~ /olorin/) { 
$NameVirtualHost = '192.168.0.3'; 
}
elsif ($ServerName =~ /erasmus/) { 
$NameVirtualHost = '192.168.0.2'; 
}

my $NameVirtualHostIP = $NameVirtualHost . ':80';

$KeepAlive = 'Off';
$ExtendedStatus = 'On';
$UseCanonicalName = 'Off';
$HostnameLookups = 'Off';
$LogLevel = 'warn';

$VirtualHost{$NameVirtualHostIP} = [
# WWW.ACQUISITIONS.ORG
{
ServerName => 'www.acquisitions.org',
ServerAlias => 'acquisitions.org',
DocumentRoot => "$vhosts_root/www.acquisitions.org/htdocs",
ScriptAlias => [
'/cgi-bin/' => "$vhosts_root/www.acquisitions.org/cgi-bin/" 
],
CustomLog => "$logs_root/www.acquisitions.org_access_log combined",
ErrorLog => "$logs_root/www.acquisitions.org_error_log",
},
# MEMBERS.RECKONING.ORG
{
ServerName => 'members.reckoning.org',
Alias => {
[ '/images' => "$vhosts_root/members.reckoning.org/images"
],
[ '/css' => "$vhosts_root/members.reckoning.org/css" ],
},
ErrorLog => "$logs_root/members.reckoning.org_error_log",
TransferLog => "$logs_root/members.reckoning.org_access_log",

PerlAuthenHandler => 'Apache::AuthDBI::authen',
PerlSetVar => {
Auth_DBI_data_source => 'dbi:Pg:dbname=reckdb',
Auth_DBI_username => 'dvicci',
Auth_DBI_pwd_table => 'user_profile',
Auth_DBI_uid_field => 'user_username',
Auth_DBI_pwd_field  => 'user_password',
Auth_DBI_pwd_whereclause => '"user_usertype>0"',
Auth_DBI_encrypted => 'off',
},
Location => {
'/' => {
SetHandler => 'perl-script',
PerlInitHandler => 'Apache::StatINC',
PerlHandler => 'Reckoning::IndexHandler::members',

AuthName => 'theReckoning',
AuthType => 'Basic',
Limit => {
'GET POST' => {
require => 'valid-user',
},
},
},
'/images' => {
SetHandler => 'default-handler',
},
'/css' => {
SetHandler => 'default-handler',
},
'/Error' => {
SetHandler => 'perl-script',
PerlHandler => 'Reckoning::Error',
},
'/LoginError' => {
SetHandler => 'perl-script',
PerlHandler => 'Reckoning::LoginError',
},
},
ErrorDocument => {
'401' => '/LoginError',
}
},
# WWW.RECKONING.ORG
{
ServerName => 'www.reckoning.org',
ServerAlias => 'reckoning.org',
Alias => {
[ '/images' => "$vhosts_root/members.reckoning.org/images"
],
[ '/css' => "$vhosts_root/members.reckoning.org/css" ],
},
ErrorLog => "$logs_root/www.reckoning.org_error_log",
TransferLog => "$logs_root/www.reckoning.org_access_log",
Location => {
'/' => {
SetHandler => 'perl-script',
PerlInitHandler => 'Apache::StatINC',
PerlHandler => 'Reckoning::IndexHandler::www',
},
'/images' => {
SetHandler => 'default-handler',
},
'/css' => {
SetHandler => 'default-handler',
},
'/Error' => {
SetHandler => 'perl-script',
  

Re: Debugging mod_perl with gdb

2001-02-07 Thread clayton cottingham

Vivek Khera wrote:
> 
> > "TB" == Tim Bunce <[EMAIL PROTECTED]> writes:
> 
> TB> I recall someone once created a whole bunch of gdb macros for debugging
> TB> perl.  I've CC'd this to p5p in the hope that someone remembers.
> 
> In the mod_perl source tree (at least in CVS) there's a nice .gdbinit
> file that may be of use.
> 
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Vivek Khera, Ph.D.Khera Communications, Inc.
> Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
> AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/


has anyone had much exp with using Apache::DB?

ive had it running once but then it borked out
i havent got it running since
or had time to play with it again

thought i should drop the idea
that this might be useful
for debugging



Re: Debugging mod_perl with gdb

2001-02-07 Thread Vivek Khera

> "TB" == Tim Bunce <[EMAIL PROTECTED]> writes:

TB> I recall someone once created a whole bunch of gdb macros for debugging
TB> perl.  I've CC'd this to p5p in the hope that someone remembers.

In the mod_perl source tree (at least in CVS) there's a nice .gdbinit
file that may be of use.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Re: File::Cache problem

2001-02-07 Thread DeWitt Clinton

On Wed, Feb 07, 2001 at 04:02:39PM +0400, BeerBong wrote:

> Cache size after 24 hours of working

> via 'du -s' - 53M
> via 'perl -MFile::Cacje -e"print File::Cache::SIZE('PRTL')"' - 10M

That looks like a serious bug.  Can you double check on that?  Where
are you running the "du -s"?

The SIZE( ) method returns the total size of the objects in the cache,
not including the overhead of directories themselves.  As the
documentation explains, it isn't a perfect mechanism, but it should be
a lot closer than you experienced.



> 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...

I personally prefer using a cron job to periodically limit the size of
the cache.  I don't like using "max_size" because of the overhead
involved on every set.  I'd rather just fine tune the number of times
a cron script is executed (i.e., once an hour vs. once a day).



> Another kind of problem appears recently.
> 
> In logs
> [Wed Feb  7 15:42:57 2001] [error] Couldn't rename 
>/tmp/File::Cache/.description.tmp13984 to /tmp/File::Cache/.description at 
>/usr/web/inc/WebCache.pm line 15
> [Wed Feb  7 15:44:37 2001] [error] Couldn't rename 
>/tmp/File::Cache/apache/PRTL/b/5/a/b5a261aa13cf0ddfd41beb7d64960248.tmp13441 to 
>/tmp/File::Cache/apache/PRTL/b/5/a/b5a261aa13cf0ddfd41beb7d64960248 at 
>/usr/web/inc/WebCache.pm line 87
> ...propagated at /usr/web/inc/Apache/Portal.pm line 109.
> 
> What I can do ?

Unfortunately the error message doesn't tell me enough.  If you can,
please modify lines 1578 and 1579 of Cache.pm to read as follows:

   rename ($temp_filename, $filename) or
 croak("Couldn't rename $temp_filename to $filename:  $!");


The next time it hangs, the error message will have more information.

I'll fix that in the next version of File::Cache.



> 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 ?

Are you looking in /proc/[pid]/environ for the request parameters?
I'm surprised this information was available even for the first
request.  I don't believe environ is updated dynamically (I think it
is filled out once on the exec of the process).  It certainly won't
provide the information on subsequent requests.  In any case, the
format and behavior of /proc is so dependent on the particular version
of the Linux kernel that I wouldn't want to rely on it for anything
more than occasional debugging.

Two options for you would be to log the request every time via warn.
It will fill your logs very quickly, but hopefully it will hang
quickly and you can get the debugging information out.

Another solution is to compile apache and mod_perl with debugging
symbols and attach to it with "gdb".  I have tried this a long time,
though.  Please see the current thread about using gdb.


Best of luck!

-DeWitt



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

2001-02-07 Thread Vivek Khera

> "dc" == darren chamberlain <[EMAIL PROTECTED]> writes:

dc> 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

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

$tt is intended to be persistent.  TemplateToolkit cleans up its own
"stash" of objects after processing a template, but in mod_perl, the
stash objects seems to persist, even though they are inaccessible from
that stash.

I guess I need more explanation for mod_perl folks than I did for TT
folks.

Here's what happens.

$tt is the template toolkit object.

I call $tt->process($filename,$vars,$r) to process and output the page
to the web client.

During the process method, Template Toolkit creates a localized
"stash" of template variables.  One of those variables is a 'session'
object I made.  It is created like this: "[% USE s = session %]".

Now, when process() is done, it clears out the localized stash.  In a
regular perl program, this causes the "s" object to be destroyed, and
the DESTROY method called.  In mod_perl, the object is not destroyed
nor is the DESTROY method called until the httpd exits.



Sessions on win 32

2001-02-07 Thread harilaos

Hello,
I have searched everywhere but there is documentation on
how to implement Apache::Session on windows.
Has anyone done this? Please point me to relevent
docs if you know any.
I have read about Apache::Session::Win32 but the package is
removed and obsolete from the latest Apache::Session module.

Thanks



Re: File::Cache problem

2001-02-07 Thread Bill Moseley

At 11:56 AM 02/07/01 +0400, BeerBong wrote:
>And when cache size is exceeded all mod_perl processes are hanging.

I had this happen to me a few days back on a test server.  I thought I'd
made a mistake by doing a rm -rf /tmp/File::Cache while the server was
running (and while the File::Cache object was persistent).

>And another question (I'm use Linux Debian Potato)...
>Is there way to define params of the currently performing request

You could use a USR2 hander in your code, if that's what you are asking.

This is what my spinning httpd said the other day:

[DIE] USR2 at /data/_g/lii/perl_lib/lib/5.00503/File/Spec/Unix.pm line 57
File::Spec::Unix::catdir('File::Spec', '') called at
/data/_g/lii/perl_lib/lib/5.00503/File/Spec/Functions.pm line 41
File::Spec::Functions::__ANON__('') called at
/data/_g/lii/perl_lib/lib/site_perl/5.005/File/Cache.pm line 862
File::Cache::_GET_PARENT_DIRECTORY('/') called at
/data/_g/lii/perl_lib/lib/site_perl/5.005/File/Cache.pm line 962

But I haven't seen it happen since then.





Bill Moseley
mailto:[EMAIL PROTECTED]



[OT] Freeing Memory with of C extensions under Solaris

2001-02-07 Thread Bill Moseley

Hi,

Sorry for the OT, and I'm sure this is common knowledge.

I'm using some C extensions in my mod_perl application.  IIRC, memory used
by perl is never given back to the system.  Does this apply also to
malloc() and free()ed memory in my C extension?  Or is that OS dependent?
Can Apache ever shrink?

I ask because I'm using some C extensions that do a lot of memory
allocating and freeing of somewhat large structures.

I'm running under Linux and Solaris 2.6.

Another memory issue: I'm using File::Cache with a cron job that runs every
ten minutes to limit the amount of space used in /tmp/File::Cache -- it
seemed better than using an Apache child to do that clean up work.  But on
Solaris /tmp is carved out of swap.  Do you think it's risky to use /tmp
this way (since full /tmp could use up all swap)?

Thanks very much,



Bill Moseley
mailto:[EMAIL PROTECTED]



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-07 Thread Chris Strom

> > Anyway, what you should do is create a constructor:
> > 
> > sub new {
[snip]

> 
> You mean like this code segment that I included in my original post
> just below the handler code :)
> 
> sub init {
[snip] 

Ah yes, but you called your's "init", which is quite misleading to those of
us who tend not to pay attention.

> 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?
> 

I wouldn't think that this would be the case, but I may be mistaken.  Since
you've declared $account_interface with 'my', that variable should only be
available within the scope of the startup.pl script.  Even if you went with 

use vars qw($account_interface);

I still don't think that it would be available in the Exchange::Account::My
namespace.

> 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.

Is a bless really massive overhead?  I can't say as I've ever had a problem
calling the constructor with every request (at least with simple objects).
 
> 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?  

startup.pl is not the place to do this - it gets called at server start-up
(or restart), not child initialization.  What you could do is create a
ChildInitHandler for this class, which sets a global variable within your
package:

use vars qw($SELF);

sub configure {
  my ($class) = shift;
Apache->push_handlers( PerlChildInitHandler =>
sub {
# use that weird "init" constructor name
$SELF = $class->init(@_);
  }
);
}

You can then change your handler to not use the $$ prototype, but get an
object reference from $SELF:

sub handler {
  my $q = shift;
  my $self = $SELF;
  # the rest of your code as is...
}

In your startup.pl, you'd have:

use Exchange::Account::My;
Exchange::Account::My->configure();

I haven't tested that.  As I said, I've never had call to create the object
only upon child initialization.  I'll be the first to admit that I'm
relatively new to the mod_perl thing, so there may be an easier or more
elegant way to do this, but that ought to work.  Hope that helps.

Chris



Re: Debugging mod_perl with gdb

2001-02-07 Thread Tim Bunce

I recall someone once created a whole bunch of gdb macros for debugging
perl.  I've CC'd this to p5p in the hope that someone remembers.

Tim.

On Tue, Feb 06, 2001 at 12:32:45PM -0800, sterling wrote:
> 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  section of the apache config file.
> > 
> > My question:  How do I go about attacking this problem?  I only know
> > that I'm in a  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: Error reporting mod_perl 1.25 + apache 1.3.17

2001-02-07 Thread Vasily Petrushin


I removed this problem on Solaris 8 SPARC by compiling perl 5.6.0
with -Ubincompat and -Uuselargefiles and compiling mod_perl 1.25 + apache
1.3.17 statically.
Now httpd process eating less memory :).
It's cool.

On Tue, 6 Feb 2001, dima wrote:

> 
> 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...
> >
> >
> 
> 

Vasily Petrushin
+7 (095) 2508363
http://www.interfax.ru
mailto:[EMAIL PROTECTED]