Re: [MP2][QUESTION]Session and inactivity

2008-02-13 Thread André Warnier



titetluc titetluc wrote:


OK, pooling is maybe a franglais (mix of French and English) term


By pooling, I mean the fact that expired sessionS have to be REGULARLY purge
(in opposed to a callback mechanism (IMHO,  the best solution ). This
callback would be called on ONE session expiration and would suppress it.
You would not have any purge latency with such a solution).


Polling ?
pool : a group of things or persons among which you can choose (or a big 
hole with liquid in it, but that's something else)


poll : an election (you ask several people something, and collect the 
answers). By extension : from time to time, you check a list of sessions 
if there is any expired one, to clean it up.


(s) André (just another Franglais speaker)





MP1 -> MP2 migration Problems.

2008-02-13 Thread Petry Roman, IT
Hello @all,

we are just transfering our Intranet Server which used Apache 1.3 and mod_perl1 
from SLES8 to SLES10 wiht Apache2 and mod_perl2.

The switch has to go quick and we can´t redesign all of our old mp1 programs to 
mp2, so we try to use the compat module. But I have no luck with it. 
I tested my config with SELS10, Opensuse 10.3 and Ubuntu but i hit everytime 
the same problem.
I searched the Mail Archvie and the Documentation, but no luck.

I have the following test script.Very simple.

test1.pl
#!/usr/bin/perl
my $r = Apache->request();
$r->send_http_header('text/plain');
$r->print("mod_perl rules!\n");

apache2 config looks like this. 

ScriptAlias /perl/ /usr/lib/cgi-bin/

# mod_perl mode
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI


and

[EMAIL PROTECTED]:/etc/apache2/conf.d# cat perl.conf
PerlRequire "/etc/apache2/mod_perl-startup.pl"

and mod_perl-startup.pl looks like this

[EMAIL PROTECTED]:/etc/apache2# cat mod_perl-startup.pl
# This file is a placeholder; you can safely ignore or delete it.
print "startup perl dh";
use lib '/usr/lib/perl5/';

  # enable if the mod_perl 1.0 compatibility is needed
  use Apache2::compat ();


I get the following output..

Software error:
Can't locate object method "request" via package "Apache" at 
/usr/lib/cgi-bin/test1.pl line 4.
For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving this 
error message and the time and date of the error. 

It seems, he can´t find the requested methods.. How can i validate that the 
compat module is loaded and working ?


if i print the @env array with this perl script i get.
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);

print "Content-type: text/html\n\n";
print '', "\n";
print "env array\n";
print "Umgebungsvariablen:\n";
print "\n";
print "varname",
  "value\n";
foreach(keys(%ENV)) {
  print "$_$ENV{$_}\n";
}
print "sum: ",
  scalar keys(%ENV)," envarray\n";
print "\n";
print "\n";

here the output...

MOD_PERL_API_VERSION2
PATH/usr/local/bin:/usr/bin:/bin
REQUEST_URI /perl/env.pl
GATEWAY_INTERFACE   CGI/1.1
SERVER_ADDR 172.31.127.193
DOCUMENT_ROOT   /var/www/html
HTTP_HOST   172.31.127.193
MOD_PERLmod_perl/2.0.2

so i think mod_perl2 is enabled.

Any help would be great.
bye
Roman

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: [MP2][QUESTION]Session and inactivity

2008-02-13 Thread Perrin Harkins
On Feb 13, 2008 2:03 AM, titetluc titetluc <[EMAIL PROTECTED]> wrote:
> By pooling, I mean the fact that expired sessionS have to be REGULARLY purge
> (in opposed to a callback mechanism (IMHO,  the best solution ). This
> callback would be called on ONE session expiration and would suppress it.
> You would not have any purge latency with such a solution).

There were multiple suggestions that worked through the sort of
callback solution you describe: mod_auth_tkt, CHI, storing a timestamp
in the session (as opposed to in a separate column in the sessions
database table), Apache::SessionManager...

- Perrin


Re: MP1 -> MP2 migration Problems.

2008-02-13 Thread Jim Brandt

You might try it without the parens:

use Apache2::compat;


Petry Roman, IT wrote:

Hello @all,

we are just transfering our Intranet Server which used Apache 1.3 and mod_perl1 
from SLES8 to SLES10 wiht Apache2 and mod_perl2.

The switch has to go quick and we can´t redesign all of our old mp1 programs to mp2, so we try to use the compat module. But I have no luck with it. 
I tested my config with SELS10, Opensuse 10.3 and Ubuntu but i hit everytime the same problem.

I searched the Mail Archvie and the Documentation, but no luck.

I have the following test script.Very simple.

test1.pl
#!/usr/bin/perl
my $r = Apache->request();
$r->send_http_header('text/plain');
$r->print("mod_perl rules!\n");

apache2 config looks like this. 


ScriptAlias /perl/ /usr/lib/cgi-bin/

# mod_perl mode
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI


and

[EMAIL PROTECTED]:/etc/apache2/conf.d# cat perl.conf
PerlRequire "/etc/apache2/mod_perl-startup.pl"

and mod_perl-startup.pl looks like this

[EMAIL PROTECTED]:/etc/apache2# cat mod_perl-startup.pl
# This file is a placeholder; you can safely ignore or delete it.
print "startup perl dh";
use lib '/usr/lib/perl5/';

  # enable if the mod_perl 1.0 compatibility is needed
  use Apache2::compat ();


I get the following output..

Software error:
Can't locate object method "request" via package "Apache" at 
/usr/lib/cgi-bin/test1.pl line 4.
For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving this error message and the time and date of the error. 


It seems, he can´t find the requested methods.. How can i validate that the 
compat module is loaded and working ?


if i print the @env array with this perl script i get.
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);

print "Content-type: text/html\n\n";
print '', "\n";
print "env array\n";
print "Umgebungsvariablen:\n";
print "\n";
print "varname",
  "value\n";
foreach(keys(%ENV)) {
  print "$_$ENV{$_}\n";
}
print "sum: ",
  scalar keys(%ENV)," envarray\n";
print "\n";
print "\n";

here the output...

MOD_PERL_API_VERSION2
PATH/usr/local/bin:/usr/bin:/bin
REQUEST_URI /perl/env.pl
GATEWAY_INTERFACE   CGI/1.1
SERVER_ADDR 172.31.127.193
DOCUMENT_ROOT   /var/www/html
HTTP_HOST   172.31.127.193
MOD_PERLmod_perl/2.0.2

so i think mod_perl2 is enabled.

Any help would be great.
bye
Roman



--
Jim Brandt
Administrative Computing Services
University at Buffalo



Re: MP1 -> MP2 migration Problems.

2008-02-13 Thread Randy Kobes

On Wed, 13 Feb 2008, Petry Roman, IT wrote:


Hello @all,

we are just transfering our Intranet Server which used 
Apache 1.3 and mod_perl1 from SLES8 to SLES10 wiht Apache2 
and mod_perl2.


There's a couple of documents:
  http://perl.apache.org/docs/2.0/user/porting/porting.html
  http://perl.apache.org/docs/2.0/user/porting/compat.html
that may help in this regard.

--
best regards,
Randy Kobes


AW: MP1 -> MP2 migration Problems.

2008-02-13 Thread Petry Roman, IT
Hello Randy,

i did read those documents again and again, but i can´t find the cause of my 
problems with the compat module 8-(..
If i try the new mod_perl2 syntax everything is o.k.. but to redesign all 
scripts is not an solution at this time. i need backward compatibility with 
mod_perl1 at this time..
Sorry it´s not my decision.

Another tip 8-)
bye
ROman

-Ursprüngliche Nachricht-
Von: Randy Kobes [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 13. Februar 2008 17:55
An: Petry Roman, IT
Cc: modperl@perl.apache.org
Betreff: Re: MP1 -> MP2 migration Problems.


On Wed, 13 Feb 2008, Petry Roman, IT wrote:

> Hello @all,
>
> we are just transfering our Intranet Server which used 
> Apache 1.3 and mod_perl1 from SLES8 to SLES10 wiht Apache2 
> and mod_perl2.

There's a couple of documents:
   http://perl.apache.org/docs/2.0/user/porting/porting.html
   http://perl.apache.org/docs/2.0/user/porting/compat.html
that may help in this regard.

-- 
best regards,
Randy Kobes

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: MP1 -> MP2 migration Problems.

2008-02-13 Thread Petry Roman, IT
Hello Jim,
thanks for fast answer, but i still get this erros in the error file of apache, 
afteri have replaced the parens.

[Wed Feb 13 18:02:04 2008] [error] Can't locate object method "request" via 
package "Apache" at /usr/lib/cgi-bin/test1.pl line 4.\n

-Ursprüngliche Nachricht-
Von: Jim Brandt [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 13. Februar 2008 17:46
An: Petry Roman, IT
Cc: modperl@perl.apache.org
Betreff: Re: MP1 -> MP2 migration Problems.


You might try it without the parens:

use Apache2::compat;


Petry Roman, IT wrote:
> Hello @all,
> 
> we are just transfering our Intranet Server which used Apache 1.3 and 
> mod_perl1 from SLES8 to SLES10 wiht Apache2 and mod_perl2.
> 
> The switch has to go quick and we can´t redesign all of our old mp1 programs 
> to mp2, so we try to use the compat module. But I have no luck with it. 
> I tested my config with SELS10, Opensuse 10.3 and Ubuntu but i hit everytime 
> the same problem.
> I searched the Mail Archvie and the Documentation, but no luck.
> 
> I have the following test script.Very simple.
> 
> test1.pl
> #!/usr/bin/perl
> my $r = Apache->request();
> $r->send_http_header('text/plain');
> $r->print("mod_perl rules!\n");
> 
> apache2 config looks like this. 
> 
> ScriptAlias /perl/ /usr/lib/cgi-bin/
> 
> # mod_perl mode
> SetHandler perl-script
> PerlResponseHandler ModPerl::Registry
> PerlOptions +ParseHeaders
> Options +ExecCGI
> 
> 
> and
> 
> [EMAIL PROTECTED]:/etc/apache2/conf.d# cat perl.conf
> PerlRequire "/etc/apache2/mod_perl-startup.pl"
> 
> and mod_perl-startup.pl looks like this
> 
> [EMAIL PROTECTED]:/etc/apache2# cat mod_perl-startup.pl
> # This file is a placeholder; you can safely ignore or delete it.
> print "startup perl dh";
> use lib '/usr/lib/perl5/';
> 
>   # enable if the mod_perl 1.0 compatibility is needed
>   use Apache2::compat ();
> 
> 
> I get the following output..
> 
> Software error:
> Can't locate object method "request" via package "Apache" at 
> /usr/lib/cgi-bin/test1.pl line 4.
> For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving this 
> error message and the time and date of the error. 
> 
> It seems, he can´t find the requested methods.. How can i validate that the 
> compat module is loaded and working ?
> 
> 
> if i print the @env array with this perl script i get.
> #!/usr/bin/perl -w
> use strict;
> use CGI::Carp qw(fatalsToBrowser);
> 
> print "Content-type: text/html\n\n";
> print '', "\n";
> print "env array\n";
> print "Umgebungsvariablen:\n";
> print "\n";
> print "varname",
>   "value\n";
> foreach(keys(%ENV)) {
>   print "$_$ENV{$_}\n";
> }
> print "sum: ",
>   scalar keys(%ENV)," envarray\n";
> print "\n";
> print "\n";
> 
> here the output...
> 
> MOD_PERL_API_VERSION  2
> PATH  /usr/local/bin:/usr/bin:/bin
> REQUEST_URI   /perl/env.pl
> GATEWAY_INTERFACE CGI/1.1
> SERVER_ADDR   172.31.127.193
> DOCUMENT_ROOT /var/www/html
> HTTP_HOST 172.31.127.193
> MOD_PERL  mod_perl/2.0.2
> 
> so i think mod_perl2 is enabled.
> 
> Any help would be great.
> bye
> Roman
> 

-- 
Jim Brandt
Administrative Computing Services
University at Buffalo


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: MP1 -> MP2 migration Problems.

2008-02-13 Thread Perrin Harkins
On Feb 13, 2008 9:09 AM, Petry Roman, IT <[EMAIL PROTECTED]> wrote:
> Can't locate object method "request" via package "Apache" at 
> /usr/lib/cgi-bin/test1.pl line 4.

If Apache2::compat is loaded, it should create that namespace.  Dump
%INC from your script and see if Apache.pm is in it.

- Perrin


Re: MP1 -> MP2 migration Problems.

2008-02-13 Thread Petry Roman, IT
Hello Perrin, thanks for this hint.. here comes the output..

Lodded modules in %INC:
re.pm   
APR/Const.pm
File/Spec/Functions.pm  
Apache2/URI.pm  
APR/Status.pm   
warnings.pm 
Apache2/Connection.pm   
Apache2/XSLoader.pm 
Apache2/Util.pm 
Fcntl.pm
Symbol.pm   
Exporter.pm 
ModPerl/RegistryCooker.pm   
Apache2/Response.pm 
File/Spec.pm
Apache2/Const.pm
Apache2/ServerUtil.pm   
APR/Date.pm 
ModPerl/Global.pm   
mod_perl.pm 
warnings/register.pm
XSLoader.pm 
APR/Bucket.pm   
/etc/apache2/mod_perl-startup.pl
Apache2/SubRequest.pm   
Apache2/Log.pm  
ModPerl/Const.pm
Apache/Table.pm 
Apache2/Filter.pm   
APR/URI.pm  
base.pm 
APR/Util.pm 
File/Basename.pm
Config.pm   
Apache2/RequestRec.pm   
ModPerl/Util.pm 
APR/Pool.pm 
mod_perl2.pm
Carp.pm 
File/Spec/Unix.pm   
Apache2/RequestUtil.pm  
APR.pm  
Apache.pm   
strict.pm   
vars.pm 
CGI/Carp.pm 
constant.pm 
APR/XSLoader.pm 
Apache2/compat.pm   
Apache2/ServerRec.pm
Apache2/Access.pm   
Apache/Constants.pm 
APR/Brigade.pm  
AutoLoader.pm   
Apache2/Module.pm   
lib.pm  
ModPerl/Registry.pm 
DynaLoader.pm   
Apache2/RequestIO.pm
Apache/File.pm  
APR/Table.pm
sum: 61 

Looks ok i think. Apache.pm is loaded.. So why can´t i get it to work.. damn 
thing 8-).
bye
roman
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Perrin
Harkins
Gesendet: Mittwoch, 13. Februar 2008 20:47
An: Petry Roman, IT
Cc: modperl@perl.apache.org
Betreff: Re: MP1 -> MP2 migration Problems.


On Feb 13, 2008 9:09 AM, Petry Roman, IT <[EMAIL PROTECTED]> wrote:
> Can't locate object method "request" via package "Apache" at 
> /usr/lib/cgi-bin/test1.pl line 4.

If Apache2::compat is loaded, it should create that namespace.  Dump
%INC from your script and see if Apache.pm is in it.

- Perrin

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: MP1 -> MP2 migration Problems.

2008-02-13 Thread André Warnier


Hi.

About your problem below...

I am not sure that this is going to help, nor even if it is really 
relevant to your specific problem.  Just trying to give you ideas, 
because it reminds me of something.
Below are two configurations, of two of our systems which have slightly 
different versions of mod_perl and the rest.
I went through the same kind of problems you're going through, a while 
ago when going from Apache 1.x to Apache 2.x, and then again more 
recently when there were some changes in the mod_perl naming of modules 
between mod_perl 1.9xx and mod_perl 2.0, and then some additional things 
happened during a Linux Debian upgrade from Sarge to Etch, which changed 
the location where some Apache2 stuff was installed.
And there is still some difference to this day in some Perl scripts or 
modules between these two systems, which greatly bothers me, but it 
basically works.


The main difference is in the two first "use" statements in our 
"startup.pl" script (which I assume you are familiar with, as a way to 
pre-load some perl stuff when the server starts).
I do not remember precisely which problems we had, but they were of the 
same "general gist" as yours, so maybe this helps.

Here it goes :

1) system "colin"  (Debian Sarge, older)
=
version (uname -a) :
Linux colin 2.6.8-11-amd64-k8 #1 Sun Oct 2 21:26:54 UTC 2005 x86_64 
GNU/Linux

Apache2 version : see below
Perl version (perl -v) : 5.8.4
mod_perl version (per Apache log) :
[Wed Feb 13 22:24:59 2008] [notice] Apache/2.0.54 (Debian GNU/Linux) 
DAV/2 mod_jk/1.2.6 PHP/4.3.10-22 mod_perl/1.999.21 Perl/v5.8.4 
configured -- resuming normal operations


mod_perl "startup.pl" script :  (invoked via "PerlRequire" in httpd config)
--

#!/usr/bin/perl
# modperl2_startup.pl
# Apache2 / mod_perl 2 startup script

  use Apache2 ();
  use Apache::compat ();
  use lib "/usr/lib/apache2/perllib";   # that's a local perl lib directory
  use lib "/home/EFS/lib"; # that also
  use ModPerl::Util ();
  use Apache::RequestRec ();
  use Apache::RequestIO ();
  use Apache::RequestUtil ();
  use Apache::Filter ();
  use Apache::ServerUtil ();
  use Apache::Connection ();
  use Apache::Log ();
  use Apache::Const -compile => qw(:common :log REDIRECT);
  use APR::Const -compile => ':common';
  use APR::Table ();
  use ModPerl::Registry ();
  use CGI ();
  CGI->compile(':all');
  1;

lines in httpd.conf :
(or, rather, in /etc/apache2/mods-available/perl.conf) :
PerlRequire "/usr/lib/apache2/perllib/modperl2_startup.pl"
SetEnv PERL5LIB "/usr/lib/apache2/perllib"




2) system "arthur"  (Debian Etch, more recent)
  ==
version (uname -a) :
Linux arthur 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux

Apache2 version : see below
Perl version (perl -v) : 5.8.8
mod_perl version (per Apache log) :
[Wed Feb 13 22:29:38 2008] [notice] Apache/2.2.3 (Debian) DAV/2 
mod_jk/1.2.18 PHP/4.4.4-8+etch4 mod_ssl/2.2.3 OpenSSL/0.9.8c 
mod_perl/2.0.2 Perl/v5.8.8 configured -- resuming normal operations


mod_perl "startup.pl" script :
--

  #!/usr/bin/perl
# modperl2_startup.pl
# Apache2 / mod_perl 2 startup script

  use Bundle::Apache2 ();
  use Apache2::compat ();
  use lib "/usr/local/lib/apache2/perllib";  # that's a local perl lib 
directory

  use lib "/home/EFS/lib"; # that also
  use ModPerl::Util ();
  use Apache2::RequestRec ();
  use Apache2::RequestIO ();
  use Apache2::RequestUtil ();
  use Apache2::Filter ();
  use Apache2::ServerUtil ();
  use Apache2::Connection ();
  use Apache2::Log ();
  use Apache2::Const -compile => qw(:common :log REDIRECT);
  use APR::Const -compile => ':common';
  use APR::Table ();
  use ModPerl::Registry ();
  use CGI ();
  CGI->compile(':all');
  1;

lines in httpd.conf :
(or, rather, in /etc/apache2/mods-available/perl.conf) :
PerlRequire "/usr/local/lib/apache2/perllib/modperl2_startup.pl"
SetEnv PERL5LIB "/usr/local/lib/apache2/perllib"




Petry Roman, IT wrote:

Hello Perrin, thanks for this hint.. here comes the output..

Lodded modules in %INC:
re.pm   
APR/Const.pm
File/Spec/Functions.pm  
Apache2/URI.pm  
APR/Status.pm   
warnings.pm 
Apache2/Connection.pm   
Apache2/XSLoader.pm 
Apache2/Util.pm 
Fcntl.pm
Symbol.pm   
Exporter.pm 
ModPerl/RegistryCooker.pm   
Apache2/Response.pm 
File/Spec.pm
Apache2/Const.pm
Apache2/ServerUtil.pm   
APR/Date.pm 
ModPerl/Global.pm   
mod_perl.pm 
warnings/register.pm
XSLoader.pm 
APR/Bucket.pm   
/etc/apache2/mod_perl-startup.pl
Apache2/SubRequest.pm   
Apache2/Log.pm  
ModPerl/Const.pm
Apache/Table.pm 
Apache2/Filter.pm   
APR/URI.pm  
base.pm 
APR/Util.pm 
File/Basename.pm
Config.pm   
Apache2/RequestRec.pm   
ModPerl/Util.pm 
APR/Pool.pm 
mod_perl2.pm
Carp.pm 
File/Spec/Unix.pm   
Apache2/RequestUtil.pm  
APR.pm  
Apache.pm   
strict.pm   
vars.pm 
CGI/Carp.pm 
const

Re: MP1 -> MP2 migration Problems.

2008-02-13 Thread André Warnier
Of course, what I forgot to mention below - and sorry if you know that 
already - is that whichever perl modules you pre-load in your main 
Apache server config via the startup.pl script, you do not need to "use" 
anymore in all your perl scripts or Apache/mod_perl handlers.
(At the cost of having them (insibly) duplicated in all the children 
processes).
But it may simplify your migration problems, and you can always tune 
this later.


André

André Warnier wrote:


Hi.

About your problem below...

I am not sure that this is going to help, nor even if it is really 
relevant to your specific problem.  Just trying to give you ideas, 
because it reminds me of something.
Below are two configurations, of two of our systems which have slightly 
different versions of mod_perl and the rest.
I went through the same kind of problems you're going through, a while 
ago when going from Apache 1.x to Apache 2.x, and then again more 
recently when there were some changes in the mod_perl naming of modules 
between mod_perl 1.9xx and mod_perl 2.0, and then some additional things 
happened during a Linux Debian upgrade from Sarge to Etch, which changed 
the location where some Apache2 stuff was installed.
And there is still some difference to this day in some Perl scripts or 
modules between these two systems, which greatly bothers me, but it 
basically works.


The main difference is in the two first "use" statements in our 
"startup.pl" script (which I assume you are familiar with, as a way to 
pre-load some perl stuff when the server starts).
I do not remember precisely which problems we had, but they were of the 
same "general gist" as yours, so maybe this helps.

Here it goes :

1) system "colin"  (Debian Sarge, older)
=
version (uname -a) :
Linux colin 2.6.8-11-amd64-k8 #1 Sun Oct 2 21:26:54 UTC 2005 x86_64 
GNU/Linux

Apache2 version : see below
Perl version (perl -v) : 5.8.4
mod_perl version (per Apache log) :
[Wed Feb 13 22:24:59 2008] [notice] Apache/2.0.54 (Debian GNU/Linux) 
DAV/2 mod_jk/1.2.6 PHP/4.3.10-22 mod_perl/1.999.21 Perl/v5.8.4 
configured -- resuming normal operations


mod_perl "startup.pl" script :  (invoked via "PerlRequire" in httpd config)
--

#!/usr/bin/perl
# modperl2_startup.pl
# Apache2 / mod_perl 2 startup script

  use Apache2 ();
  use Apache::compat ();
  use lib "/usr/lib/apache2/perllib";   # that's a local perl lib directory
  use lib "/home/EFS/lib"; # that also
  use ModPerl::Util ();
  use Apache::RequestRec ();
  use Apache::RequestIO ();
  use Apache::RequestUtil ();
  use Apache::Filter ();
  use Apache::ServerUtil ();
  use Apache::Connection ();
  use Apache::Log ();
  use Apache::Const -compile => qw(:common :log REDIRECT);
  use APR::Const -compile => ':common';
  use APR::Table ();
  use ModPerl::Registry ();
  use CGI ();
  CGI->compile(':all');
  1;

lines in httpd.conf :
(or, rather, in /etc/apache2/mods-available/perl.conf) :
PerlRequire "/usr/lib/apache2/perllib/modperl2_startup.pl"
SetEnv PERL5LIB "/usr/lib/apache2/perllib"




2) system "arthur"  (Debian Etch, more recent)
  ==
version (uname -a) :
Linux arthur 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux

Apache2 version : see below
Perl version (perl -v) : 5.8.8
mod_perl version (per Apache log) :
[Wed Feb 13 22:29:38 2008] [notice] Apache/2.2.3 (Debian) DAV/2 
mod_jk/1.2.18 PHP/4.4.4-8+etch4 mod_ssl/2.2.3 OpenSSL/0.9.8c 
mod_perl/2.0.2 Perl/v5.8.8 configured -- resuming normal operations


mod_perl "startup.pl" script :
--

  #!/usr/bin/perl
# modperl2_startup.pl
# Apache2 / mod_perl 2 startup script

  use Bundle::Apache2 ();
  use Apache2::compat ();
  use lib "/usr/local/lib/apache2/perllib";  # that's a local perl lib 
directory

  use lib "/home/EFS/lib"; # that also
  use ModPerl::Util ();
  use Apache2::RequestRec ();
  use Apache2::RequestIO ();
  use Apache2::RequestUtil ();
  use Apache2::Filter ();
  use Apache2::ServerUtil ();
  use Apache2::Connection ();
  use Apache2::Log ();
  use Apache2::Const -compile => qw(:common :log REDIRECT);
  use APR::Const -compile => ':common';
  use APR::Table ();
  use ModPerl::Registry ();
  use CGI ();
  CGI->compile(':all');
  1;

lines in httpd.conf :
(or, rather, in /etc/apache2/mods-available/perl.conf) :
PerlRequire "/usr/local/lib/apache2/perllib/modperl2_startup.pl"
SetEnv PERL5LIB "/usr/local/lib/apache2/perllib"




Petry Roman, IT wrote:

Hello Perrin, thanks for this hint.. here comes the output..

Lodded modules in %INC:
re.pm   
APR/Const.pm   
File/Spec/Functions.pm   
Apache2/URI.pm   
APR/Status.pm   
warnings.pm   
Apache2/Connection.pm   
Apache2/XSLoader.pm   
Apache2/Util.pm   
Fcntl.pm   
Symbol.pm   
Exporter.pm   
ModPerl/RegistryCooker.pm   
Apache2/Response.pm   
File/Spec.pm   
Apache2/Const.pm   
Apache2/ServerUtil.pm   
APR/Date.pm   
ModPerl/Global.pm   
mod_perl.pm   
warnings/register.pm   
XSLoader.pm   
APR/Bucket.pm   
/etc/apac

Re: [MP2][QUESTION]Session and inactivity

2008-02-13 Thread titetluc titetluc
2008/2/13, Perrin Harkins <[EMAIL PROTECTED]>:
>
> On Feb 13, 2008 2:03 AM, titetluc titetluc <[EMAIL PROTECTED]> wrote:
> > By pooling, I mean the fact that expired sessionS have to be REGULARLY
> purge
> > (in opposed to a callback mechanism (IMHO,  the best solution ). This
> > callback would be called on ONE session expiration and would suppress
> it.
> > You would not have any purge latency with such a solution).
>
>
> There were multiple suggestions that worked through the sort of
> callback solution you describe: mod_auth_tkt, CHI, storing a timestamp
> in the session (as opposed to in a separate column in the sessions
> database table), Apache::SessionManager...


All of these modules propose an expiration mechanism, but they do not
propose a mechanism to automatically destroy session at expiration (this is
what I call a "callback" mechanism).
This implies that the session destruction has to be called explicitly.

We could imagine an interface where a callback is defined when a session is
created

For example,
session_create(inactivity => 30, callback => sub{print "Session
automagically destroyed";})

There would be no need to call a session_delete function !!

Gaetan

- Perrin
>