Re: question on installing perl modules

2011-01-25 Thread André Warnier

marco.mase...@softeco.it wrote:

Hi André ,

use local::lib:

http://search.cpan.org/~apeiron/local-lib-1.008001/

it nicely handles your issue.


By the way, I tried to use local::lib "out of the box", and could not install 
it.
I think it is because the Makefile relies on a GNU make, and the HPUX host I was trying 
this on, has another version of make.
That version chokes on the last 2 lines of the Makefile generated by local::lib's 
Makefile.pl, and which look like this :


PERL  += -Ietc...
FULLPERL += -Ietc

The error is something like :
missing separator on line 838
missing separator on line 839

(Apologies for not being more precise, but I do not have access to that system 
right now)

Not being a great specialist of make (or in fact of anything), I figured that the HPUX 
version of make does not like these "+=" operators, but I did not know how to correct 
these 2 lines.  Of course not being root, I cannot easily install a GNU make on that 
system either.


Anyway, in fits and starts, by trying things derived from what I understood of the docs of 
local::lib about what local::lib does, I did in the end manage to get CPAN configured in 
such a way that it does install perl modules under my own chosen directory, while not root.


The gist of the matter is : if you do not have access to the target system as root *at any 
time*, it is quite tricky to get this done.


For example, on another system which I was using to "practice" this first, I could simply 
not run "perl -MCPAN ..", because there was a lockfile /root/.cpan/.lock, leftover I 
suppose from an aborted root session with CPAN, and when I tried to run CPAN with another 
user (to do a "o conf init"), it threw me out each time, because it was still trying to 
use the default CPAN parameters (from the /root/.cpan directory), and choking on this 
leftover .lock file, which could not be removed of course because it was owned by root.
Fortunately, on that particular system I did have root access, so I could go and remove 
that .lock file.  Had I been on the real target system, I would have been stuck right there.




Uploading Files bigger the 64M

2011-01-25 Thread Hibbard, Timothy
I am having all sorts of troubles uploading files bigger then 64M using 
mod_perl2.

Any file I try to upload that is bigger then 63M I get the following error.

(20014)Internal error: Content-Length header (723283299) exceeds configured 
max_body limit (67108864)

So I told myself lets do a little research  It is Perl so this should be 
easy to fix.  After a little of researching I found the APREQ2_ReadLimit 
parameter for the httpd.conf.  So I added this to my httpd.conf.

APREQ2_ReadLimit 1024M (1 Gig)

Restarted Apache and tried again  Still no luck with same error message.  
Back to researching.

I found 2 more things which I thought would solve my problem.  I found POST_MAX:

my $req = Apache2::Request->new($r,POST_MAX =>100 * 1024 * 1024);

And also

$req->read_limit(100 * 1024 * 1024);

So I tried playing with these settings and all I get now is "Conflicting 
information" in my log files.  As soon as I set POST_MAX or read_limit to 
anything below 67108864 it works fine for all files less then 64M in size.  How 
can I get mod_perl2 to upload a 700mb file.  If you need sample code of what I 
am doing I am more then happy to provide it.

Thanks in advance,

Tim Hibbard
Senior Program Engineer
Ohio University
Athens, Ohio 457-1


Re: Uploading Files bigger the 64M

2011-01-25 Thread Joe Schaefer
It's a bug in the merge code for mod_apreq2.  Basically
you have to set APREQ_ReadLimit to its max value
in the main server's context (not in a vhost or Location
or Directory config).

Otherwise use the code in apreq's trunk.



>
>From: "Hibbard, Timothy" 
>To: "modperl@perl.apache.org" 
>Sent: Tue, January 25, 2011 1:23:45 PM
>Subject: Uploading Files bigger the 64M
>
>Uploading Files bigger the 64M I am having all sorts of troubles uploading 
>files 
>bigger then 64M using mod_perl2.
>
>Any file I try to upload that is bigger then 63M I get the following error.
>
>(20014)Internal error: Content-Length header (723283299) exceeds configured 
>max_body limit (67108864)
>
>So I told myself lets do a little research  It is Perl so this should be 
>easy to fix.  After a little of researching I found the APREQ2_ReadLimit 
>parameter for the httpd.conf.  So I added this to my httpd.conf.
>
>APREQ2_ReadLimit 1024M (1 Gig)
>
>Restarted Apache and tried again  Still no luck with same error message. 
> Back to researching.
>
>I found 2 more things which I thought would solve my problem.  I found 
POST_MAX:
>
>my $req = Apache2::Request->new($r,POST_MAX =>100 * 1024 * 1024);
>
>And also
>
>$req->read_limit(100 * 1024 * 1024);
>
>So I tried playing with these settings and all I get now is “Conflicting 
>information” in my log files.  As soon as I set POST_MAX or read_limit to 
>anything below 67108864 it works fine for all files less then 64M in size.  
>How 
>can I get mod_perl2 to upload a 700mb file.  If you need sample code of what I 
>am doing I am more then happy to provide it.
>
>Thanks in advance,
>
>Tim Hibbard
>Senior Program Engineer
>Ohio University
>Athens, Ohio 457-1 


  

Re: Uploading Files bigger the 64M

2011-01-25 Thread Ryan Gies
1) You may lower the limit, not raise it.  If you are trying to raise 
it, you will get "Conflicting information".


2) Your server config trumps your virtual-host config.  If you have not 
set APREQ2_ReadLimit outside of your VirtualHost, then it is set for you 
(64M).


Personally, I do this:

A) Set APREQ2_ReadLimit in /etc/httpd/conf.d/apreq.conf to the largest 
value I would allow for any virtual host.


B) Set APREQ2_ReadLimit to the largest upload value appropriate for the 
client inside their VirtualHost container.


C) Set $req->read_limit inside a PerlResponseHandler depending on the 
logical type of request:


  # The Apache request library only allows lowering the read limit 
(POST_MAX).
  # The default is 64M (64 * 1024 * 1024) so if larger uploads are 
desired, one
  # must raise the limit by setting APREQ2_ReadLimit in the Apache 
configuration.
  # When using VirtualHosts, the larger limit *must* be specified in 
server

  # configuration, and then optionally reduced in the vhost config.
  # http://marc.info/?l=apreq-dev&m=115829354028472&w=2
  my $limit = $req->read_limit();
  my $max = $rr->max_post_size; # the max post size allowed for the 
current request

  if ($max > $limit) {
$Log->warn(sprintf('Cannot raise read_limit from %d to %d', $limit, 
$max));

  } else {
$req->read_limit($max) or die $!;
$limit = $req->read_limit();
$Log->error('Error setting read_limit') unless $limit == $max;
  }



On 01/25/2011 01:23 PM, Hibbard, Timothy wrote:
I am having all sorts of troubles uploading files bigger then 64M 
using mod_perl2.


Any file I try to upload that is bigger then 63M I get the following 
error.


(20014)Internal error: Content-Length header (723283299) exceeds 
configured max_body limit (67108864)


So I told myself lets do a little research  It is Perl so this 
should be easy to fix.  After a little of researching I found the 
APREQ2_ReadLimit parameter for the httpd.conf.  So I added this to my 
httpd.conf.


APREQ2_ReadLimit 1024M (1 Gig)

Restarted Apache and tried again  Still no luck with same error 
message.  Back to researching.


I found 2 more things which I thought would solve my problem.  I found 
POST_MAX:


my $req = Apache2::Request->new($r,POST_MAX =>100 * 1024 * 1024);

And also

$req->read_limit(100 * 1024 * 1024);

So I tried playing with these settings and all I get now is 
"Conflicting information" in my log files.  As soon as I set POST_MAX 
or read_limit to anything below 67108864 it works fine for all files 
less then 64M in size.  How can I get mod_perl2 to upload a 700mb 
file.  If you need sample code of what I am doing I am more then happy 
to provide it.


Thanks in advance,

Tim Hibbard
Senior Program Engineer
Ohio University
Athens, Ohio 457-1 


Re: Uploading Files bigger the 64M

2011-01-25 Thread Hibbard, Timothy
Worked like a charm.  I had APREQ_ReadLimit in a vhost ... Once moving it out 
of the vhost I can now upload bigger files.  Should have used the mailing list 
before making an indentation in the brick wall with my forehead.

Many thanks!

Tim Hibbard


On 1/25/11 1:31 PM, "Joe Schaefer"  wrote:

It's a bug in the merge code for mod_apreq2.  Basically
you have to set APREQ_ReadLimit to its max value
in the main server's context (not in a vhost or Location
or Directory config).

Otherwise use the code in apreq's trunk.


From: "Hibbard, Timothy" 
To: "modperl@perl.apache.org" 
Sent: Tue, January 25, 2011 1:23:45 PM
Subject: Uploading Files bigger the 64M

Uploading Files bigger the 64M I am having all sorts of troubles uploading 
files bigger then 64M using mod_perl2.

Any file I try to upload that is bigger then 63M I get the following error.

(20014)Internal error: Content-Length header (723283299) exceeds configured 
max_body limit (67108864)

So I told myself lets do a little research  It is Perl so this should be 
easy to fix.  After a little of researching I found the APREQ2_ReadLimit 
parameter for the httpd.conf.  So I added this to my httpd.conf.

APREQ2_ReadLimit 1024M (1 Gig)

Restarted Apache and tried again  Still no luck with same error message.  
Back to researching.

I found 2 more things which I thought would solve my problem.  I found POST_MAX:

my $req = Apache2::Request->new($r,POST_MAX =>100 * 1024 * 1024);

And also

$req->read_limit(100 * 1024 * 1024);

So I tried playing with these settings and all I get now is "Conflicting 
information" in my log files.  As soon as I set POST_MAX or read_limit to 
anything below 67108864 it works fine for all files less then 64M in size.  How 
can I get mod_perl2 to upload a 700mb file.  If you need sample code of what I 
am doing I am more then happy to provide it.

Thanks in advance,

Tim Hibbard
Senior Program Engineer
Ohio University
Athens, Ohio 457-1