Re: Clearsilver Templates

2005-08-17 Thread Perrin Harkins

Praveen Ray wrote:

Does anyone have any experience of using clearsilver
(http://www.clearsilver.net) with mod_perl (1 or 2)?


I remember talking to the author at one point.


Any comparisons of this with Template-Toolkit?


It will be less flexible (no simple handling of objects or complex 
structures without rearranging them for the template), have fewer bells 
and whistles (no wrappers, no plugins), and will not be possible to 
extend with Perl.  In exchange, it might be faster, might use less 
memory, and will be able to use the same templates from C code.  Yahoo 
liked it because they could load a bunch of data from C (e.g. XS code 
called from perl) without needing to turn it into perl data structures.



The
Template-Toolkit is getting rather slow for our needs and
I'm looking around for alternatives.


That's pretty surprising.  Pure template processing is your bottleneck? 
 Are you doing some kind of data processing or data retrieval from 
inside of your templates?


A very fast templating tool for Perl, suitable for people who don't need 
much beyond the basics, is HTML::Template::JIT.  It compiles templates 
into small C libraries.


- Perrin


Clearsilver Templates

2005-08-17 Thread Praveen Ray
Hi
Does anyone have any experience of using clearsilver
(http://www.clearsilver.net) with mod_perl (1 or 2)?
Any comparisons of this with Template-Toolkit? The
Template-Toolkit is getting rather slow for our needs and
I'm looking around for alternatives.
thanks

  - Praveen  

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: ModPerl 2.0.1 AIX4.3.3 - Make Test Fails to run

2005-08-17 Thread Stas Bekman

ODELL, TODD E (SWBT) wrote:
[...]

Is there another why to run this to show more detail of what's going on?


try to run the equivalent of strace on AIX and see where it hangs.

One reason could be the lack of entropy:
http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#Server_Hanging_at_the_Startup

but then you say that it runs fine with ModPerl::Registry, so probably 
it's not the case. Most likely it just fails to load some module and hangs 
(strace or the equivalent should tell you exactly what's going on)


--
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Hanging apache child on fork

2005-08-17 Thread Badai Aqrandista



The code that triggers the bug use Apache::Session::File, on an NFS
share. Have anyone had problem with that? Do I have some special
configuration to give to A::S::File to help it behave correctly on an
NFS share?


I have never used A::S::File over NFS share, but from what I heard, NFS 
locking can be a problem when a share is accessed heavily.



Any suggestion of a different method to share the session data between a
pool of 6 servers?


Use database based sessions, or memcached based session 
(Apache::Session::Memcached), but be careful with the later, because 
everything is only stored in memory.


---
Badai Aqrandista
Cheepy (?)

_
SEEK: Over 80,000 jobs across all industries at Australia's #1 job site.   
http://ninemsn.seek.com.au?hotmail




Re: Clear Registry

2005-08-17 Thread Badai Aqrandista



I use Apache::StatINC
It works fine for me, I haven't noticed needing to restart with it


Except you have two modules A and B, where A's BEGIN block depends on B's 
BEGIN block being executed beforehand, and you only change module A. In that 
case you definitely must restart.


Got bitten by that on the last project...

Cheers...

---
Badai Aqrandista
Cheepy (?)

_
Low rate ANZ MasterCard. Apply now! 
http://clk.atdmt.com/MAU/go/msnnkanz003006mau/direct/01/  Must be over 
18 years.




Re: Adding Directives At Runtime

2005-08-17 Thread Geoffrey Young

>>Exactly. IS there an an equivilant in MP1?
> 
> 
> Not exacrly, but pretty close.
> 
>  blocks are evaluated in the Apache::ReadConfig:: namespace. Anything 
> you place
> in there will be handled by the  block handler.

which is exactly what the Apache::ReverseLocation code I sent does, so look
there if you need some additional pointers.  IIRC it has the proper syntax
for adding a  block.

oh, and for the record, add_config() can't inject _any_ directive into
httpd.conf - add_config() runs under the same restrictions as .htaccess
files, which can potentially bite you.  at least it did to me when I was
trying to use it in one of my cpan modules :)

--Geoff


Re: Clear Registry

2005-08-17 Thread Boysenberry Payne

Guess that doesn't help with Apache2, sorry should have looked closer :(


Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 17, 2005, at 4:44 PM, Boysenberry Payne wrote:


I use Apache::StatINC
It works fine for me, I haven't noticed needing to restart with it

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 17, 2005, at 4:33 PM, Philip M. Gollucci wrote:


Justin Luster wrote:

So are you saying that a graceful restart is the only real answer?
I've noticed, when doing a lot of development, that Apache::Reload  
doesn't always work when it picks up the change.  I end up getting  
something I needed undefined in another module or something odd like 
 that, and end up with a graceful restart
99.9% of the time Apache2::Reload works well for me; though, I agree 
with jonathan, *sometimes*, I do have to restart -- though very 
infrequently.




--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com











Re: ModPerl 2.0.1 AIX4.3.3 - Make Test Fails to run

2005-08-17 Thread Philip M. Gollucci

ODELL, TODD E (SWBT) wrote:

Thanks for the quick reply. I just realized that even when I run export
APACHE_TEST_STARTUP_TIMEOUT=420 ( or any other value) it uses the
default 300. Shouldn't the command export

./t/TEST -help
[snip]
-startup_timeout
seconds to wait for the server to start (default is 60)

APACHE_TEST_STARTUP_TIMEOUT=420 set it for the test?



Is there another way to run this to show more detail of what's going on?

see some other options in the above output.

--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Re: Clear Registry

2005-08-17 Thread Boysenberry Payne

I use Apache::StatINC
It works fine for me, I haven't noticed needing to restart with it

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 17, 2005, at 4:33 PM, Philip M. Gollucci wrote:


Justin Luster wrote:

So are you saying that a graceful restart is the only real answer?
I've noticed, when doing a lot of development, that Apache::Reload  
doesn't always work when it picks up the change.  I end up getting  
something I needed undefined in another module or something odd like  
that, and end up with a graceful restart
99.9% of the time Apache2::Reload works well for me; though, I agree 
with jonathan, *sometimes*, I do have to restart -- though very 
infrequently.




--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com







Re: Clear Registry

2005-08-17 Thread Philip M. Gollucci

Justin Luster wrote:

So are you saying that a graceful restart is the only real answer?

I've noticed, when doing a lot of development, that Apache::Reload  
doesn't always work when it picks up the change.  I end up getting  
something I needed undefined in another module or something odd like  
that, and end up with a graceful restart
99.9% of the time Apache2::Reload works well for me; though, I agree 
with jonathan, *sometimes*, I do have to restart -- though very 
infrequently.




--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



RE: Clear Registry

2005-08-17 Thread Justin Luster
So are you saying that a graceful restart is the only real answer?

-Original Message-
From: Jonathan Vanasco [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 17, 2005 2:23 PM
To: mod_perl List
Subject: Re: Clear Registry


I've noticed, when doing a lot of development, that Apache::Reload  
doesn't always work when it picks up the change.  I end up getting  
something I needed undefined in another module or something odd like  
that, and end up with a graceful restart

On Aug 17, 2005, at 4:36 PM, Philip M. Gollucci wrote:

> Justin Luster wrote:
>> No I was not using Modperl::RegistryCooker.  I guess I will have to
>> "use" it.
>> In Mod_Perl my "library" files get loaded into memory.  If I want to
>> make a change to the "library" file (one that my main.pl file
>> "requires") I cannot since it is in memory or cache.  To get it to
>> realize the update I usually have to reset Apache.  I'm hoping for an
>> easier way especially since sometimes I don't have the right to reset
>> the server.
> Why not Apache2::Reload
> http://perl.apache.org/docs/2.0/user/coding/ 
> coding.html#Auto_Reloading_Modified_Modules_with_Apache2__Reload




Re: Clear Registry

2005-08-17 Thread Jonathan Vanasco


I've noticed, when doing a lot of development, that Apache::Reload  
doesn't always work when it picks up the change.  I end up getting  
something I needed undefined in another module or something odd like  
that, and end up with a graceful restart


On Aug 17, 2005, at 4:36 PM, Philip M. Gollucci wrote:


Justin Luster wrote:

No I was not using Modperl::RegistryCooker.  I guess I will have to
"use" it.
In Mod_Perl my "library" files get loaded into memory.  If I want to
make a change to the "library" file (one that my main.pl file
"requires") I cannot since it is in memory or cache.  To get it to
realize the update I usually have to reset Apache.  I'm hoping for an
easier way especially since sometimes I don't have the right to reset
the server.

Why not Apache2::Reload
http://perl.apache.org/docs/2.0/user/coding/ 
coding.html#Auto_Reloading_Modified_Modules_with_Apache2__Reload




RE: ModPerl 2.0.1 AIX4.3.3 - Make Test Fails to run

2005-08-17 Thread ODELL, TODD E \(SWBT\)
Thanks for the quick reply. I just realized that even when I run export
APACHE_TEST_STARTUP_TIMEOUT=420 ( or any other value) it uses the
default 300. Shouldn't the command export
APACHE_TEST_STARTUP_TIMEOUT=420 set it for the test?
I edited the ModPerl::TestRun from 300 to 600 to see if that would be
better but got the same results. So far, regardless of the TIMEOUT value
it will fail on waiting for server to start though for the first 10
seconds I can see the httpd running under ps -ef but it never gets past
the 
[Wed Aug 17 13:53:56 2005] [info] base server + 27 vhosts
Line. And seems to exit without writing to the error_log.

What confuses me as well is if I manually run the command:
/apacheDev/bin/httpd  -d /home/to2958/mod_perl-2.0.1/t -f
/home/to2958/mod_perl-2.0.1/t/conf/httpd.conf -D APACHE2 -D
PERL_USEITHREADS
I see this:
[Wed Aug 17 15:04:22 2005] [info] 6 Apache2:: modules loaded
[Wed Aug 17 15:04:22 2005] [info] 0 APR:: modules loaded
[Wed Aug 17 15:04:22 2005] [info] base server + 27 vhosts ready to run
tests
And then it exits and in total it's taking only ~10 seconds to complete.
But it only prints something like this to the error_log:
END in modperl_extra.pl, pid=39342

I'll try shutting other programs down prior to running and see if I can
set the timeout higher. I'm a little dubious

Is there another why to run this to show more detail of what's going on?


Thanks
-Original Message-
From: Philip M. Gollucci [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 17, 2005 12:42 PM
To: ODELL, TODD E (SWBT)
Cc: modperl@perl.apache.org
Subject: Re: ModPerl 2.0.1 AIX4.3.3 - Make Test Fails to run


ODELL, TODD E (SWBT) wrote:
> to start. I unpacked and compiled as my userid, not root, and am able
to
> start the httpd directly as that userid. With the
> APACHE_TEST_STARTUP_TIMEOUT=420 this is what is get from make test:
I believe whats happening here is that because you are testing the 
threaded version, you computer its taking too long to load and start all

the tests.  The ModPerl-Registry tests load substantially less; thus, 
start quicker.  You might try stopping other processes on your computer 
while make testing if it is busy.

If I read that correctly, 300s is not enough, but 420 is?

 From

lib/ModPerl/TestRun.pm:
sub new_test_config {
 my $self = shift;

 # default timeout in secs (threaded mpms are extremely slow to
 # startup, due to a slow perl_clone operation)
 $self->{conf_opts}->{startup_timeout} ||=
 $ENV{APACHE_TEST_STARTUP_TIMEOUT} ||
 Apache2::Build->build_config->mpm_is_threaded() ? 300 : 120;

 $self->{conf_opts}->{minclients} ||= MIN_CLIENTS;

 ModPerl::TestConfig->new($self->{conf_opts});
}
> *** /usr/opt/perl5.8.6/bin/perl -V
> Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
> usethreads=define use5005threads=undef useithreads=define
> usemultiplicity=define

> Characteristics of this binary (from libperl): 
>   Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> PERL_IMPLICIT_CONTEXT

> Apache2: -
> Apache2::Request   : 2.05-dev
Since you seem to be uptodate with most things, libapreq-2.06-dev is out
and fixes a few things :)



-- 
END

 What doesn't kill us can only make us stronger.
 Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com



Re: Clear Registry

2005-08-17 Thread Philippe M. Chiasson
Philip M. Gollucci wrote:
> Justin Luster wrote:
> 
>> No I was not using Modperl::RegistryCooker.  I guess I will have to
>> "use" it.
>>
>> In Mod_Perl my "library" files get loaded into memory.  If I want to
>> make a change to the "library" file (one that my main.pl file
>> "requires") I cannot since it is in memory or cache.  To get it to
>> realize the update I usually have to reset Apache.  I'm hoping for an
>> easier way especially since sometimes I don't have the right to reset
>> the server.
> 
> Why not Apache2::Reload
> http://perl.apache.org/docs/2.0/user/coding/coding.html#Auto_Reloading_Modified_Modules_with_Apache2__Reload

Or for more manual control:

ModPerl::Util::unload_package("My::Library");
require My::Library;

http://perl.apache.org/docs/2.0/api/ModPerl/Util.html#C_unload_package_


Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: Clear Registry

2005-08-17 Thread Philip M. Gollucci

Justin Luster wrote:

No I was not using Modperl::RegistryCooker.  I guess I will have to
"use" it.

In Mod_Perl my "library" files get loaded into memory.  If I want to
make a change to the "library" file (one that my main.pl file
"requires") I cannot since it is in memory or cache.  To get it to
realize the update I usually have to reset Apache.  I'm hoping for an
easier way especially since sometimes I don't have the right to reset
the server.

Why not Apache2::Reload
http://perl.apache.org/docs/2.0/user/coding/coding.html#Auto_Reloading_Modified_Modules_with_Apache2__Reload

--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



RE: Clear Registry

2005-08-17 Thread Justin Luster
No I was not using Modperl::RegistryCooker.  I guess I will have to
"use" it.

In Mod_Perl my "library" files get loaded into memory.  If I want to
make a change to the "library" file (one that my main.pl file
"requires") I cannot since it is in memory or cache.  To get it to
realize the update I usually have to reset Apache.  I'm hoping for an
easier way especially since sometimes I don't have the right to reset
the server.

Thanks,

Justin

-Original Message-
From: Philippe M. Chiasson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 17, 2005 1:03 PM
To: Justin Luster
Cc: 'Philip M. Gollucci'; modperl@perl.apache.org
Subject: Re: Clear Registry

Justin Luster wrote:
> I tried this and I get:
> 
> Can't locate object method: "cache_table_common".

Are you calling it as Modperl::RegistryCooker->uncache_myself()?

What is the _exact_ error message ?

But more interestingly, what exactly are you triyng to do that
requires you to clean the cached registry code yourself ?



Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID :
88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3A5A5




Re: Clear Registry

2005-08-17 Thread Philippe M. Chiasson
Justin Luster wrote:
> I tried this and I get:
> 
> Can't locate object method: "cache_table_common".

Are you calling it as Modperl::RegistryCooker->uncache_myself()?

What is the _exact_ error message ?

But more interestingly, what exactly are you triyng to do that
requires you to clean the cached registry code yourself ?


Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: mod_define apache2

2005-08-17 Thread Philippe M. Chiasson
Martin Moss wrote:
> All,
> 
> We're in the middle of centralising our apache (1.3)
> config files and I would like to use mod_define to
> simplify the process. However I've noticed that
> mod_define isn't available for apache2. 
> 
> Is there an alternative I can use, or is mod_define's
> functionality now core to mod_perl2?

mod_macro works with both apache 1 & 2, so I'd recommend it.
It's also somewhat more flexible than mod_define IMO.

http://www.cri.ensmp.fr/~coelho/mod_macro/


Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: Adding Directives At Runtime

2005-08-17 Thread Philippe M. Chiasson
Christopher H. Laco wrote:
> Philippe M. Chiasson wrote:
> 
>> A sample example of what I _think_ you are trying to do would look like:
>>
>> 
>> PerlModule Catalyst
>> 
>>
>> 
>> package Catalyst;
>> use Apache2::ServerUtil qw();
>>
>> [... figure out where/what to configure ...]
>>
>> Apache2::ServerUtil->server->add_config([
>> '',
>> '  SetHandler perl-script',
>> '  PerlHandler Catalyst::Foo::Bar',
>> ]);
>> 
>>
>> With ->add_config, you can just feed arbitrary chunks of config to
>> httpd, so you
>> are free to do whatever you need to do.
> 
> Exactly. IS there an an equivilant in MP1?

Not exacrly, but pretty close.

 blocks are evaluated in the Apache::ReadConfig:: namespace. Anything you 
place
in there will be handled by the  block handler.

so if in your module you put:

$Apache::ReadConfig::ServerAdmin = '[EMAIL PROTECTED]';

It will be identical to if you had :


$ServerAdmin = '[EMAIL PROTECTED]';


in your httpd.conf.


Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: Filter-Question : Caching

2005-08-17 Thread Philippe M. Chiasson
Markus Wolf wrote:
> Hallo,
> 
> I'm writing my first Apache 2 - Filter yesterday - it works fine,
> but i have one problem with caching.
> 
> This is my conf-entry
> 
> PerlOutputFilterHandler ApacheMY::session
> 
> 
> 
> my problem is, that the filter only work, when I save or "touch"
> the html-file again - the filter seems to cache the output with the
> help of the "last change date" of the file.

This is probably because your browser is sending If-Modified-Since
http GET requests and not re-requesting the file since it doesn't appear
to have changed. (see 
http://perl.apache.org/docs/general/correct_headers/correct_headers.html#Conditional_GET)

You can verify this is the case by using a simpler http client, like
LWP, wget, curl, etc and you should see your filter being run every
single time.

> What have I to do, that the filter is process every time, a
> site is called?

If you want to make sure the browsers _never_ cache your content (make really
sure that's what you want) and use $r->no_cache(1)

http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_no_cache_

But really, it's fairly possible that in your case, this is an annoyance for
development, but actually a fairly _good_ feature in general.


Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


signature.asc
Description: OpenPGP digital signature


Re: Apache (mod_perl) restart issues

2005-08-17 Thread Boysenberry Payne

The last set of errors are happening on my OSX box.
I get a different set of errors on our Linux server when it restarts:

[Sun Feb 13 01:00:00 2000] null: Attempt to free unreferenced scalar.
...

I get a whole mess of those, then I get:

Scalars leaked: 234

I'm not sure how to go about fixing these error on either server


Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 17, 2005, at 2:05 PM, Boysenberry Payne wrote:


When I restart apache I get the following errors on child processes:

child process 424 did not exit, sending another SIGHUP

One for each child process.  After the above I get:

SIGHUP received.  Attempting to restart

I'm using mod_perl 1.26 and apache 1.3.33 (only happens with my 
mod_perl scripts running)


I thought at first it was DBI connections not getting closed properly, 
they seem to be fine though.


I'm not exactly sure how to go about tracking down what's preventing 
the original SIGHUP.


Any ideas?

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com







Apache (mod_perl) restart issues

2005-08-17 Thread Boysenberry Payne

When I restart apache I get the following errors on child processes:

child process 424 did not exit, sending another SIGHUP

One for each child process.  After the above I get:

SIGHUP received.  Attempting to restart

I'm using mod_perl 1.26 and apache 1.3.33 (only happens with my 
mod_perl scripts running)


I thought at first it was DBI connections not getting closed properly, 
they seem to be fine though.


I'm not exactly sure how to go about tracking down what's preventing 
the original SIGHUP.


Any ideas?

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com



RE: Clear Registry

2005-08-17 Thread Justin Luster
I tried this and I get:

Can't locate object method: "cache_table_common".

Thanks,

Justin

-Original Message-
From: Philip M. Gollucci [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 17, 2005 11:05 AM
To: Justin Luster
Cc: modperl@perl.apache.org
Subject: Re: Clear Registry

Justin Luster wrote:
> Is there a way in Perl code to clear out the cached code in the
registry?
> 
 From lib/Modperl-Registry/lib/Modperl/RegistryCooker.pm:


#

# this is a function should be called from the registry script, and
# using the caller() method we figure out the package the script was
# compiled into and trying to uncache it.
#
# it's currently used only for testing purposes and not a part of the
# public interface. it expects to find the compiled package in the
# symbol table cache returned by cache_table_common(), if you override
# cache_table() to point to another function, this function will fail.
sub uncache_myself {
 my $package = scalar caller;
 my($class) = __PACKAGE__->cache_table_common();

 unless (defined $class) {
 Apache2->warn("$$: cannot figure out cache symbol table for 
$package");
 return;
 }

 if (exists $class->{$package} && exists $class->{$package}{mtime})
{
 Apache2->warn("$$: uncaching $package\n") if DEBUG & D_COMPILE;
 delete $class->{$package}{mtime};
 }
 else {
 Apache2->warn("$$: cannot find $package in cache");
 }
}


-- 
END

 What doesn't kill us can only make us stronger.
 Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com




Re: Clear Registry

2005-08-17 Thread Philip M. Gollucci

Justin Luster wrote:

Is there a way in Perl code to clear out the cached code in the registry?


From lib/Modperl-Registry/lib/Modperl/RegistryCooker.pm:

#

# this is a function should be called from the registry script, and
# using the caller() method we figure out the package the script was
# compiled into and trying to uncache it.
#
# it's currently used only for testing purposes and not a part of the
# public interface. it expects to find the compiled package in the
# symbol table cache returned by cache_table_common(), if you override
# cache_table() to point to another function, this function will fail.
sub uncache_myself {
my $package = scalar caller;
my($class) = __PACKAGE__->cache_table_common();

unless (defined $class) {
Apache2->warn("$$: cannot figure out cache symbol table for 
$package");

return;
}

if (exists $class->{$package} && exists $class->{$package}{mtime}) {
Apache2->warn("$$: uncaching $package\n") if DEBUG & D_COMPILE;
delete $class->{$package}{mtime};
}
else {
Apache2->warn("$$: cannot find $package in cache");
}
}


--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Clear Registry

2005-08-17 Thread Justin Luster








Is there a way in Perl code to clear out the cached code in
the registry?








Re: profiling DBI (was Re: apache children waits for each other?)

2005-08-17 Thread Philip M. Gollucci

Perrin Harkins wrote:

Malcolm J Harwood wrote:

Somehow I managed to miss the existence of DBI::Profile. Has anyone 
gotten this working with Apache::DBI (so that it aggregates across the 
entire lifetime of the DB connection)?



Just use DBI::ProfileDumper::Apache.

I don't believe thats been ported mp2.
Also doesn't look that hard to do so.

--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Re: ModPerl 2.0.1 AIX4.3.3 - Make Test Fails to run

2005-08-17 Thread Philip M. Gollucci

ODELL, TODD E (SWBT) wrote:

to start. I unpacked and compiled as my userid, not root, and am able to
start the httpd directly as that userid. With the
APACHE_TEST_STARTUP_TIMEOUT=420 this is what is get from make test:
I believe whats happening here is that because you are testing the 
threaded version, you computer its taking too long to load and start all 
the tests.  The ModPerl-Registry tests load substantially less; thus, 
start quicker.  You might try stopping other processes on your computer 
while make testing if it is busy.


If I read that correctly, 300s is not enough, but 420 is?

From

lib/ModPerl/TestRun.pm:
sub new_test_config {
my $self = shift;

# default timeout in secs (threaded mpms are extremely slow to
# startup, due to a slow perl_clone operation)
$self->{conf_opts}->{startup_timeout} ||=
$ENV{APACHE_TEST_STARTUP_TIMEOUT} ||
Apache2::Build->build_config->mpm_is_threaded() ? 300 : 120;

$self->{conf_opts}->{minclients} ||= MIN_CLIENTS;

ModPerl::TestConfig->new($self->{conf_opts});
}

*** /usr/opt/perl5.8.6/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES

PERL_IMPLICIT_CONTEXT



Apache2: -
Apache2::Request   : 2.05-dev

Since you seem to be uptodate with most things, libapreq-2.06-dev is out
and fixes a few things :)



--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



ModPerl 2.0.1 AIX4.3.3 - Make Test Fails to run

2005-08-17 Thread ODELL, TODD E \(SWBT\)
Mod_perl:   2.0.1
OS: AIX4.3.3 
-8<-- Start Bug Report 8<--
1. Problem Description:
I'm able to compile with IBM VAC 4.4.0.3 with no problem but the make
test fails to even start the tests. It timeouts waiting for the server
to start. I unpacked and compiled as my userid, not root, and am able to
start the httpd directly as that userid. With the
APACHE_TEST_STARTUP_TIMEOUT=420 this is what is get from make test:
make test   
cd "src/modules/perl" && make
Target "all" is up to date.
/usr/local/bin/perl -Iblib/arch -Iblib/lib  t/TEST -clean
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/local/bin/perl
/home/to2958/mod_perl-2.0.1/t/TEST -cle
an
APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT=
APACHE_TEST_USER
= APACHE_TEST_APXS=  /usr/local/bin/perl -Iblib/arch -Iblib/lib  t/TEST
-bugrepo
rt -verbose=0 
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/local/bin/perl
/home/to2958/mod_perl-2.0.1/t/TEST -bug
report -verbose=0
/apacheDev/bin/httpd  -d /home/to2958/mod_perl-2.0.1/t -f
/home/to2958/mod_perl-
2.0.1/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.0.53 (prefork MPM)

waiting 300 seconds for server to start: ...[Wed Aug 17 11:53:31 2005]
[info] 6 
Apache2:: modules loaded
[Wed Aug 17 11:53:31 2005] [info] 0 APR:: modules loaded
[Wed Aug 17 11:53:31 2005] [info] base server + 27 vhosts ready to run
tests






..
waiting 300 seconds for server to start: not ok
[  error] giving up after 301 secs. If you think that your system
is slow or overloaded try again with a longer timeout value.
by setting the environment variable APACHE_TEST_STARTUP_TIMEOUT
to a high value (e.g. 600) and repeat the last command.

[  error] server failed to start! (please examine t/logs/error_log)
++
| Please file a bug report: http://perl.apache.org/bugs/ |
++
make: 1254-004 The error code from the last command is 1.


Stop.

All I could see in the t/logs/error_log:
END in modperl_extra.pl, pid=340960

Early on in the make test I can see this with ps -ef:
 to2958  340960 202184  18 11:53:28  pts/3  0:00 /apacheDev/bin/httpd -d
/home/to2958/mod_perl-2.0.1/t -f
/home/to2958/mod_perl-2.0.1/t/conf/httpd.conf -D APACHE2 -D
PERL_USEITHREADS 

This only remians for maybe 5-10 seconds while the make test waits till
the TIMEOUT is reached. Also If I run that command string ( the full
/apacheDev/bin/httpd etc. ) directly this is what I get:
[Wed Aug 17 12:02:05 2005] [info] 6 Apache2:: modules loaded
[Wed Aug 17 12:02:05 2005] [info] 0 APR:: modules loaded
[Wed Aug 17 12:02:05 2005] [info] base server + 27 vhosts ready to run
tests

Futhermore if I drop into the ModPerl-Registry and run make test it runs
fine.

It seems almost like something is missing in the main make test to get
the tests started. ?

Any ideas for where else to look would be great! Thanks


2. Used Components and their Configuration:

*** mod_perl version 2.01

*** using /home/to2958/mod_perl-2.0.1/lib/Apache2/BuildConfig.pm

*** Makefile.PL options:
  MP_APR_LIB => aprext
  MP_APXS=> /apacheDev/bin/apxs
  MP_COMPAT_1X   => 1
  MP_GENERATE_XS => 1
  MP_LIBNAME => mod_perl
  MP_USE_DSO => 1


*** /apacheDev/bin/httpd -V
Server version: Apache/2.0.53
Server built:   Aug 11 2005 14:57:43
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/apacheDev"
 -D SUEXEC_BIN="/apacheDev/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** (apr|apu)-config linking info

 -L/apacheDev/lib -laprutil-0 -lexpat -liconv
 -L/apacheDev/lib -lapr-0 -lm -lnsl  -lpthread



*** /usr/opt/perl5.8.6/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
osname=aix, osvers=4.3.3.0, archname=aix-thread-multi
uname='aix sbctss2 3 4 000186704c00 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselarg

RE: APR

2005-08-17 Thread Paul Harrison
Yes, thx you


Cure

-Original Message-
From: Perrin Harkins [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 17, 2005 12:04 PM
To: Paul Harrison
Cc: modperl@perl.apache.org
Subject: Re: APR

Paul Harrison wrote:
> Hi All, I thought the APR module was use for  ==> to load mod_perl2 
> outside of Apache(command line). I'm lost when I see modules like ==> 
> use APR::Table () inside of Apache(not the command line)

The APR (Apache Portable Runtime) is an abstraction layer that provides 
portability for things that are normally platform-specific.  The apache 
web server is implemented using APR.  APR can also be used without the 
web server, for making other projects portable across platforms.  Does 
that answer your question?

- Perrin



Re: APR

2005-08-17 Thread Perrin Harkins

Paul Harrison wrote:
Hi All, I thought the APR module was use for  ==> to load mod_perl2 
outside of Apache(command line). I'm lost when I see modules like ==> 
use APR::Table () inside of Apache(not the command line)


The APR (Apache Portable Runtime) is an abstraction layer that provides 
portability for things that are normally platform-specific.  The apache 
web server is implemented using APR.  APR can also be used without the 
web server, for making other projects portable across platforms.  Does 
that answer your question?


- Perrin


APR

2005-08-17 Thread Paul Harrison








Hi All, I thought the APR module was use for  ==> to load
mod_perl2 outside of Apache(command line). I'm lost when I see modules like
==> use APR::Table () inside of Apache(not the command line)


Please Explain, thxs

 

 

Cure








Re: profiling DBI (was Re: apache children waits for each other?)

2005-08-17 Thread Perrin Harkins

Malcolm J Harwood wrote:
Somehow I managed to miss the existence of DBI::Profile. Has anyone gotten 
this working with Apache::DBI (so that it aggregates across the entire 
lifetime of the DB connection)?


Just use DBI::ProfileDumper::Apache.

- Perrin


profiling DBI (was Re: apache children waits for each other?)

2005-08-17 Thread Malcolm J Harwood

> >You can look at the tuning information on http://modperlbook.org/ for
> >some advice as well.  And don't forget that there is a profiler for DBI
> >queries that comes with DBI.

Somehow I managed to miss the existence of DBI::Profile. Has anyone gotten 
this working with Apache::DBI (so that it aggregates across the entire 
lifetime of the DB connection)?



-- 
"You heard Mr. Garibaldi. You did the right thing."
"Darling, I did the necessary thing. That is not always the same as
 the right thing."
- Janice and Laura Rosen in Babylon 5:"The Quality of Mercy"


Training recommendations?

2005-08-17 Thread Chris Werner
Title: Training recommendations?





Any recommendations for Apache/Mod_perl training? My company is exploring the possibility that we would suitcase a week of such instruction on site.

Thanks,
Christian Werner





Re: [mp2] wrong gateway interface

2005-08-17 Thread Geoffrey Young


Gunnar Koppel wrote:
> 
> I can't find a flaw in my conf. I am trying to conf some location act
> under PerlRun or Registry, but my test-script prints in %ENV still:
> 
> GATEWAY_INTERFACE: CGI/1.1

this is no longer the place to look in mp2

> MOD_PERL: mod_perl/2.0.1

look here instead :)

--Geoff




Re: Hanging apache child on fork

2005-08-17 Thread Benoit Caron
Philippe M. Chiasson wrote:
> Benoit Caron wrote:
> 
>>Hello.
>>
>>I'm having trouble with a new setup on a RedHat Entreprise Linux 4 box.
>>The problem is that whenever there is perl code that fork to execute
>>something, the apache child hang.
> 
> 
> Have you read:
> 
> http://perl.apache.org/docs/1.0/guide/performance.html#Forking_and_Executing_Subprocesses_from_mod_perl
> 
> And looked into Apache::SubProcess ?
> 
> http://search.cpan.org/dist/Apache-SubProcess/
> 


Yes, I did.

The problem I have is not really to be able to fork efficiently or
anything else. It really is the hang that bugs me. I'm wearing the
sysadmin's hat now...

The exemple I used for my test is done with /bin/hostname; I know of
course that it would make a lot more sense to use Sys::Hostname to do
this. But the problem I have happen with anything that fork. Another
example of such problematic scripts is one of the admins tool for the
sites that use cp and rsync: the performance is absolutely not a problem
for a scripts that's called 3 times a day.

I've continued my investigation: what I suspect is a bad interaction
with the NFS shared dir that somehow "corrupted" the Apache process and
later cause the hang. This problem happens only on my RHEL4 boxes; the
RHEL3 are doing fine with the same code.

What I would have really like is to someone familiar with the internals
of all of this to help me find more test of investigation to do. I can
take out that particular example (the hostname test) from the code and
to the job another way, but it is hard to be sure that none of the code
that run ou will run on the pool will use a backtick or a system call
somewhere.

The code that triggers the bug use Apache::Session::File, on an NFS
share. Have anyone had problem with that? Do I have some special
configuration to give to A::S::File to help it behave correctly on an
NFS share?

Any suggestion of a different method to share the session data between a
pool of 6 servers? I've used Apache::Session::Oracle a few years ago,
for another project, and the performance hit was way to big. The web
site is using an Oracle database, but could it still be faster to use a
MySQL server so store the sessions? I suppose that for the simple
get/set that the sessions support needs, MySQL could be faster?

Anyway, thanks for the help.

-- 
Benoit Caron
Administrateur système
Canoe inc.
[EMAIL PROTECTED]

I don't find that being really up on all the latest
technology ever does me any good.
-- William Gibson



signature.asc
Description: OpenPGP digital signature


[mp2] wrong gateway interface

2005-08-17 Thread Gunnar Koppel


I can't find a flaw in my conf. I am trying to conf some location act 
under PerlRun or Registry, but my test-script prints in %ENV still:


GATEWAY_INTERFACE: CGI/1.1

I added in apache2.conf such lines:
___
Alias /adm /home/xyz/adm
Alias /adm2 /home/xyz/adm


SetHandler perl-script
PerlHandler ModPerl::PerlRun
Options +ExecCGI
PerlSendHeader On
AllowOverride All



SetHandler perl-script
PerlHandler ModPerl::Registry
Options +ExecCGI
PerlSendHeader On
AllowOverride All

___

But in both Location my gateway is CGI/1.1. Other important variables in 
ENV:


MOD_PERL: mod_perl/2.0.1
MOD_PERL_API_VERSION: 2
SERVER_SIGNATURE:
Apache/2.0.54 (Debian GNU/Linux) mod_apreq2-20050712/2.1.3-dev 
mod_perl/2.0.1 Perl/v5.8.7 Server at localhost Port 80
SERVER_SOFTWARE: Apache/2.0.54 (Debian GNU/Linux) 
mod_apreq2-20050712/2.1.3-dev mod_perl/2.0.1 Perl/v5.8.7



What didn't i notice here?

--
TIA,
Tänud ette,

Gunnar Koppel


mod_define apache2

2005-08-17 Thread Martin Moss
All,

We're in the middle of centralising our apache (1.3)
config files and I would like to use mod_define to
simplify the process. However I've noticed that
mod_define isn't available for apache2. 

Is there an alternative I can use, or is mod_define's
functionality now core to mod_perl2?

Regards

Marty





___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


Re: apache children waits for each other?

2005-08-17 Thread Badai Aqrandista



> I don't know it's even possible in mysql. Its reference docs doesn't say
> that it is (http://dev.mysql.com/doc/mysql/en/join.html).
>

Yes it does :
http://dev.mysql.com/doc/mysql/en/identifier-qualifiers.html



Hmmm... Excellent!!! I'll use it then...Will let you know how it goes...

Thanks, mate...

---
Badai Aqrandista
Cheepy (?)

_
Single? Start dating at Lavalife. Try our 7 day FREE trial! 
http://lavalife9.ninemsn.com.au/clickthru/clickthru.act?context=an99&locale=en_AU&a=19179




Re: apache children waits for each other?

2005-08-17 Thread Clinton Gormley

> I don't know it's even possible in mysql. Its reference docs doesn't say 
> that it is (http://dev.mysql.com/doc/mysql/en/join.html).
> 

Yes it does :
http://dev.mysql.com/doc/mysql/en/identifier-qualifiers.html



Clinton Gormley [EMAIL PROTECTED]

www.TravelJury.com - For travellers, By travellers





Filter-Question : Caching

2005-08-17 Thread Markus Wolf
Hallo,

I'm writing my first Apache 2 - Filter yesterday - it works fine,
but i have one problem with caching.

This is my conf-entry

PerlOutputFilterHandler ApacheMY::session



my problem is, that the filter only work, when I save or "touch"
the html-file again - the filter seems to cache the output with the
help of the "last change date" of the file.

What have I to do, that the filter is process every time, a
site is called?



/\/\arkus
http://www.perlunity.de