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!

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

Re: which module for this purpose?

2007-06-14 Thread Jen mlists
2007/6/14, Foo JH <[EMAIL PROTECTED]>: Otherwise it will load the file specified in the uri and send it back. Then how can I "load the file and send it back" under modperl?Do I need to call some routines like socket read/write? Please show me more details.Thanks a lot.

Re: which module for this purpose?

2007-06-14 Thread Jen mlists
2007/6/14, Clinton Gormley <[EMAIL PROTECTED]>: What you're after is a PerlAccessHandler http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlAccessHandler Yes I know whether I would return an OK or a FORBIDDEN under different conditions. My questions is,when return OK,what should I do

Re: which module for this purpose?

2007-06-14 Thread Jen mlists
2007/6/14, Clinton Gormley <[EMAIL PROTECTED]>: By using a PerlAccessHandler, you are adding a step into the standard apache process. So: - the user goes to: /path/file.xyz - your access handler performs its checks - Allowed? - Y : - return OK - file served by standard apache means

Re: which module for this purpose?

2007-06-14 Thread Jen mlists
2007/6/14, Clinton Gormley <[EMAIL PROTECTED]>: > > mhh,I understood for your meanings.but my real question is how I can > send the file to clients after returning OK.here is my apache config > and modperl script,please give more helps.thanks! > > from httpd.conf: > > PerlModule DLAuth > > >

Re: which module for this purpose?

2007-06-14 Thread Jen mlists
2007/6/14, Clinton Gormley <[EMAIL PROTECTED]>: If this is a new project in mod_perl, have you considered using Apache 2 and mod_perl 2? Yes I did also consider using mp2.But when I searched on this list and found many guys mentioned they install/run mp2 unsucessfully,so I picked the easy way

X_FORWARDED_FOR original IP

2007-08-03 Thread Jen mlists
Hello members, I meet a problem about getting client's original IP. Some clients use proxy servers to access our sites,and I need to get their original IPs instead of proxy servers' IPs. In CGI I can write it like: my $ip = $ENV{'HTTP_X_FORWARDED_FOR'} ? $ENV{'HTTP_X_FORWARDED_FOR'} : $c->remote

Re: X_FORWARDED_FOR original IP

2007-08-03 Thread Jen mlists
Thank you all guys.I've known this issue and know how to handle it. Thanks again. --jen

Re: X_FORWARDED_FOR original IP

2007-08-03 Thread Jen mlists
No.Here both PHP and CGI scripts can get the X_FORWARDED_FOR ip,but modperl can't.Is the %ENV hash not useful under modperl? 2007/8/3, Torsten Foertsch <[EMAIL PROTECTED]>: > On Friday 03 August 2007 12:29, Jen mlists wrote: > > > I meet a problem about getting client&

why error_log was written many times for same item?

2007-08-07 Thread Jen mlists
Hello, In my mp1 script I wrote some info to apache's error_log: } elsif ($ip_int != $ip_int2) { $r->log_error("[$ip FORBIDDEN] Request IP was not matched"); return FORBIDDEN; But I saw it wrote many times for same error item,like: [Tue Aug 7 16:24:08 2007] [error] [219.12

speed limit

2007-08-16 Thread Jen mlists
Hello list, Is it possible to write speed limit module (for file downloading) by modperl rather than using Apache's official module? Thanks.

compiled mp2 handler?

2007-08-21 Thread Jen mlists
I saw this document on perl.apache.com site, When a mod_perl hook is called for a given phase, the glue code has an index into the array of handlers, so it knows to return DECLINED right away if no handlers are configured, without entering the Perl runtime as 1.0 did. The handlers are also now sto