Apache2::Request install

2007-06-13 Thread Jeff Pang
hello,

When I installed Apache2::Request (without make test) and rut it I got
the errors:

[EMAIL PROTECTED] libapreq2-2.08]# perl -MApache2::Request -e ''
Can't load
'/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/APR/APR.so'
for module APR: libaprutil-0.so.0: cannot open shared object file: No
such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
 at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Pool.pm
line 23
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Pool.pm line 23.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Pool.pm line 23.
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request.pm
line 26.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request.pm
line 26.
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request/Param.pm
line 27.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request/Param.pm
line 27.
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Apache2/Request.pm
line 2.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Apache2/Request.pm
line 2.
Compilation failed in require.
BEGIN failed--compilation aborted.


[EMAIL PROTECTED] libapreq2-2.08]# perl -MAPR -e ''
Can't load
'/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/APR/APR.so'
for module APR: libaprutil-0.so.0: cannot open shared object file: No
such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
 at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.


What's the correct way to install Apache2::Request?
Thanks!


Re: Apache2::Request install

2007-06-13 Thread Jeff Pang
Jeff Pang 写道:
> hello,
> 
> When I installed Apache2::Request (without make test) and rut it I got
> the errors:
> 

Sorry,forgot the info for my system.

[EMAIL PROTECTED] ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant)

[EMAIL PROTECTED] ~]# uname -r
2.6.9-5.EL

[EMAIL PROTECTED] ~]# perl -v
This is perl, v5.8.5 built for i386-linux-thread-multi


FilterRequestHandler to get partial transfer bytes

2007-06-13 Thread Brad
Within a PerlCleanupHandler I'm trying to get hold of how much data has
been sent for interrupted transfers.  I had used $r->last->bytes_sent in
apache1 but it always just contains the whole filesize in apache2

I'm trying to use apache2 filters to get an accurate result like logio.
I have the below code that appears to work correctly counting out in
intervals of BUFF_LEN, however when the download is ended early it
continues to loop and counts up to the full filesize.

How come it doesn't stop when the download is cancelled?  I know it can
be done because logio.c can do it :)

I tried a connection example off the mod_perl site and i got one small
BB, and the next BB showed the full hundred Mb filesize, so also no good
for my purpose.

  sub handler : FilterRequestHandler {
my $f = shift;
my $count = 0;

while ($f->read(my $buffer, BUFF_LEN)) {
  $count += length($buffer);
  warn length($buffer);
  $f->print($buffer);
}
warn $count;
my $r = $f->r;
$r->pnotes('count'=>$count);
Apache2::Const::OK;
  }

Help greatly appreciated, I can see that these filters are a better way
of doing things, but they're a bit outta my league using them
properly :)



Re: DirectoryIndex vs. PerlTransHandler

2007-06-13 Thread Geoffrey Young

> My PerlResponseHandler works fine on files in the /tools directory for
> pages that are specified, for example:
> 
> /tools/environment.page
> /tools/index.page
> 
> If I use just the directory URI:
> 
> /tools/
> 
> the DirectoryIndex specification works but I don't get any configuration
> data inside the PerlResponseHandler from any variant of
> Apache2::Module::get_config.  So my response handler doesn't work right.
>   Everything's fine when I specify index.page, and when I don't the URI
> comes back as index.page, but in the case where DirectoryIndex makes
> this happen I don't get any configuration data item.
> 
> I have constructed a PerlTransHandler which can be attached to the
> VirtualHost.  In it I do what DirectoryIndex would do, I check for a
> trailing slash and append index.page.  When I do this the subsequent
> response handler has appropriate configuration data.
> 
> I find this odd.  Can anyone explain why DirectoryIndex doesn't work the
> same as an "equivalent" PerlTransHandler?

please take a look here

  http://marc.info/?l=apache-modperl&m=112805393100758&w=2

--GEoff


ENV stuff

2007-06-13 Thread Anthony Gardner
Okay, to answer my own post from a few days ago (I haven;t been working on it 
since the post, just the last 30 mins ;) )

Anyway, the answer to me not seeing PerlPassEnv vars at server startup was 
because they were in files that were Include(d) into httpd.conf.

They are now in httpd.conf and everything is hunky dory. Will try to find out 
later what's happening there.

-Ants


-
 What kind of emailer are you? Find out today - get a free analysis of your 
email personality. Take the quiz at the Yahoo! Mail Championship.

Old Seg Fault Problem

2007-06-13 Thread Anthony Gardner
Also, ages ago, I asked the list about seg faults we were having plus I asked 
about syswrite and STDOUT being tied to MP etc.
 
 Well, the seg faults were coming from syswrite.  Here's the scenario 
 
 We have large files that can be downloaded and if a user clicks a file, the 
dialogue box asks about saving it or opening it. Well, while the user is 
deciding, the browser is already in the motions of downloading the file from 
us. If the user saves / opens the file, cool. If the user presses cancel before 
the background download has finished then we were inviting  problems.
 
 The main prob was that if exceptions were being thrown, they weren't being 
caught (legacy code) and tidied up. I've cleaned all that code up, but also, I 
now just use print and this avoids closing/reassigning STDOUT to syswrite etc.
 
 Anyway, maybe s.o will find this useful.

-Ants

   
-
 Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for 
your freeaccount today.

Re: Apache2::Request install

2007-06-13 Thread Jonathan Vanasco


On Jun 13, 2007, at 5:44 AM, Jeff Pang wrote:


When I installed Apache2::Request (without make test) and rut it I got
the errors:


at the risk of stating the obvious...

what happens why you run make test ?



// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|   CEO/Founder SyndiClick Networks
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|  FindMeOn.com - The cure for Multiple Web Personality Disorder
|  Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|  RoadSound.com - Tools For Bands, Stuff For Fans
|  Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -





Re: Apache2::Request install

2007-06-13 Thread Jeff Pang

Jonathan Vanasco 写道:


On Jun 13, 2007, at 5:44 AM, Jeff Pang wrote:


When I installed Apache2::Request (without make test) and rut it I got
the errors:


at the risk of stating the obvious...

what happens why you run make test ?



It said I was making test with root identify,but Apache would be run as 
nobody.So in the source dir,I do "chown -R nobody:nobody ." and re-make 
test with root and nobody,but both still got failed.


I run MP1 with Apache::Request well for long time.But couldn't upgrade 
to MP2 and Apache2::Request.:(


Re: Apache2::Request install

2007-06-13 Thread Jonathan Vanasco


On Jun 13, 2007, at 11:52 AM, Jeff Pang wrote:


It said I was making test with root identify,but Apache would be  
run as nobody.So in the source dir,I do "chown -R nobody:nobody ."  
and re-make test with root and nobody,but both still got failed.


I run MP1 with Apache::Request well for long time.But couldn't  
upgrade to MP2 and Apache2::Request.:(


apache drops to nobody, so thats fine.

what was the error ?  why did it fail ?



// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|   CEO/Founder SyndiClick Networks
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|  FindMeOn.com - The cure for Multiple Web Personality Disorder
|  Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|  RoadSound.com - Tools For Bands, Stuff For Fans
|  Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -





open2 does not work in mod perl

2007-06-13 Thread sajid khan

Hi all

I am able to execute the below program in perl but NOT in mod_perl

$pid = open2(*Reader,*Writer,$test_cmd);
Writer->autoflush();
Reader->autoflush();

print Writer "mypwd\n";
while () {
$output .= $_;
}

In mod perl , whatever I write to Writer using "print Writer " does not get
reached to my program defined in $test_cmd. This works perfectly fine with
only perl but not with mod perl,what might be the reason and any workaround
Any help would be greatly appreciated

Thanks
Sajid


libapreq: end of file error, discard body request, and more fun

2007-06-13 Thread Jonathan Vanasco


i'm in a weird situation...

if i do this:

	my	$apr= Apache2::Request->new( $r , %{$self->URI_get_defaults( $r- 
>uri )} );

$r->discard_request_body;

everything works fine in one webapp, and i don't have to deal with  
weird stalls when an overlimit amount of data is posted.


however, in a nearly identitcal webapp (both custom framework, no  
mason, straight calls to libapreq ), that generates a 'End of file  
found' error, and I have no get/post data.


now if i just do this..
# $r->discard_request_body;

then i can access the data fine -- but i'll get a weird stall when an  
overlimit amount of data is posted


does anyone have an idea how i can better test this to figure out wtf  
is going on ?


// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|   CEO/Founder SyndiClick Networks
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|  FindMeOn.com - The cure for Multiple Web Personality Disorder
|  Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|  RoadSound.com - Tools For Bands, Stuff For Fans
|  Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -





mp1 and mp2

2007-06-13 Thread Jen mlists

hello list,

I have some questions for modperl before using them.
what's the difference for mp1 and mp2? Does mp2 have large improvement
on performance?what's better for these choices below?
apache1.3 + mp1
apache2.0 + mp2
apache2.2 + mp2

Thanks!


Re: DirectoryIndex vs. PerlTransHandler

2007-06-13 Thread Marc M. Adkins

Geoffrey Young wrote:

My PerlResponseHandler works fine on files in the /tools directory for
pages that are specified, for example:

/tools/environment.page
/tools/index.page

If I use just the directory URI:

/tools/

the DirectoryIndex specification works but I don't get any configuration
data inside the PerlResponseHandler from any variant of
Apache2::Module::get_config.  So my response handler doesn't work right.
  Everything's fine when I specify index.page, and when I don't the URI
comes back as index.page, but in the case where DirectoryIndex makes
this happen I don't get any configuration data item.

I have constructed a PerlTransHandler which can be attached to the
VirtualHost.  In it I do what DirectoryIndex would do, I check for a
trailing slash and append index.page.  When I do this the subsequent
response handler has appropriate configuration data.

I find this odd.  Can anyone explain why DirectoryIndex doesn't work the
same as an "equivalent" PerlTransHandler?


please take a look here

  http://marc.info/?l=apache-modperl&m=112805393100758&w=2

--GEoff



I read most of that a couple of nights ago while trying to fix the 
problem.  It seemed to slightly miss the mark at the time, though it 
makes more sense now (much other doc reading in the interim).


When I tried implementing Apache2::DirectoryFixup just now it did not 
solve the problem.  I can see it working via trace statements but I 
still don't have configuration objects when I get to the response handler.


It took a while to get it to set the magic value anyway.  I had to set 
the handler to 'perl-script' in my  block.  That isn't 
necessary with my PerlTransHandler for some reason.


I do find it interesting that $r->filename is  in my 
PerlTransHandler.  That would seem to indicate that the trans handler is 
called kind of early in the process compared to the fixup handler (quite 
obvious from http://perl.apache.org/docs/2.0/user/handlers/http.html).


Maybe that's a clue, maybe a red herring.  I just don't know at what 
point in the cycle the configuration objects get, um, configured.


It seems like using a  configuration block as I do the 
associated configuration items could not possibly be set until the map 
to storage step, so I have to fix things before there, not after.  Which 
might explain why I get results using a trans handler but not a fixup 
handler.  But shouldn't mod_dir be part of the trans handler?  I should 
perhaps look up that code.


I'm not unhappy with my solution, mostly curious.  Trying to understand 
"why" often helps me solve other problems later.  I should probably buy 
a copy of the mod_perl cookbook.  ;)


Re: mp1 and mp2

2007-06-13 Thread Perrin Harkins

On 6/13/07, Jen mlists <[EMAIL PROTECTED]> wrote:

I have some questions for modperl before using them.
what's the difference for mp1 and mp2?


It sounds like you're looking for this:
http://perl.apache.org/docs/2.0/user/intro/overview.html

- Perrin


Re: Apache2::Request install

2007-06-13 Thread Silent

2007/6/13, Jeff Pang <[EMAIL PROTECTED]>:


hello,

When I installed Apache2::Request (without make test) and rut it I got
the errors:

[EMAIL PROTECTED] libapreq2-2.08]# perl -MApache2::Request -e ''
Can't load
'/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/APR/APR.so'
for module APR: libaprutil-0.so.0: cannot open shared object file: No
such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Pool.pm
line 23
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Pool.pm line
23.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Pool.pm line
23.
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request.pm
line 26.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request.pm
line 26.
Compilation failed in require at

/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request/Param.pm
line 27.
BEGIN failed--compilation aborted at

/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/APR/Request/Param.pm
line 27.
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Apache2/Request.pm
line 2.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Apache2/Request.pm
line 2.
Compilation failed in require.
BEGIN failed--compilation aborted.


[EMAIL PROTECTED] libapreq2-2.08]# perl -MAPR -e ''
Can't load
'/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/APR/APR.so'
for module APR: libaprutil-0.so.0: cannot open shared object file: No
such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.


What's the correct way to install Apache2::Request?
Thanks!




Hi, I remembered that I have met this problem before, But not very clearly.
so I install these again, but not found any problem:

history:
   2  mkdir opt
   3  mv httpd-2.0.59.tar.bz2 /opt

   6  cd opt/

  10  wget
http://search.cpan.org/CPAN/authors/id/J/JO/JOESUF/libapreq2-2.08.tar.gz
  12  wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
  14  tar -jxvf httpd-2.0.59.tar.bz2
  16  tar -zxvf libapreq2-2.08.tar.gz
  18  tar -zxvf mod_perl-2.0-current.tar.gz

build apache2
  27  ./configure --prefix=/web --enable-so --with-mpm=prefork
  28  make && make install

build mod_perl
  32  cd ../mod_perl-2.0.3/
  34  perl Makefile.PL MP_APXS=/web/bin/apxs
  35  make
  36  make install

build libapreq
  47  cd ../libapreq2-2.08
  50  perl Makefile.PL --with-apache2-apxs=/web/bin/apxs
  51  make
  52  make install

perl -MApache2::Request -e ''  --- OK


I am running fedora6, and have removed the old mod_perl and libapreq before
this installation,
and this is not the best method to install them,

if you still have this problem,
you can copy the shared libs to apache2 lib directory:

libapreq2-2.08]#find . -name "*.so*"
./glue/perl/blib/arch/auto/APR/Request/Request.so
./glue/perl/blib/arch/auto/APR/Request/Cookie/Cookie.so
./glue/perl/blib/arch/auto/APR/Request/Apache2/Apache2.so
./glue/perl/blib/arch/auto/APR/Request/Error/Error.so
./glue/perl/blib/arch/auto/APR/Request/Parser/Parser.so
./glue/perl/blib/arch/auto/APR/Request/Hook/Hook.so
./glue/perl/blib/arch/auto/APR/Request/Param/Param.so
./glue/perl/blib/arch/auto/APR/Request/CGI/CGI.so
./module/apache2/.libs/mod_apreq2.so
./module/apache2/.libs/mod_apreq2.soT
./library/.libs/libapreq2.so.2
./library/.libs/libapreq2.so.2.6.0
./library/.libs/libapreq2.so



#find /web -name "libaprutil-0.so*"
/web/lib/libaprutil-0.so.0.9.12
/web/lib/libaprutil-0.so
/web/lib/libaprutil-0.so.0



ps: I know you translated some section of , thanks!

hope you can do more work to let Perl much more popular in Chin4.


which module for this purpose?

2007-06-13 Thread Jen mlists

Hello members,

I would config/write a modperl module to do this thing.
When someone access a file which is located on special directory,say it was,
/download/test.flv
we would do some auth check.If his IP or request time were
reasonable,we could let him access this file.Otherwise we would return
a 403 error.

What's the correct module/way for protect this directory?
Thanks!