Re: modperl for httpd 2.4? Yes...

2017-06-23 Thread Peng Yonghua

Thanks for kind info, Randolf.

On 2017/6/23 星期五 23:56, Randolf Richardson wrote:

Yes, both ModPerl 2.0 and Apache HTTPd v2.4 are in active
development.

Please note that there are many different Apache HTTPd modules that
have their own version numbers that are not in lockstep with Apache's
HTTPd server version numbers.  Also, it's important to note that
while version numbers alone are not a reliable indicator of whether a
particular piece of software is in active development (you'd be
better off reading the changelogs which typically include dates with
version numbers that indicate when a particular change was
introduced), there's another important factor -- if the code works
reliably and there are no outstanding issues, then changes are very
likely unnecessary and so what might appear to be "inactive" really
doesn't provide sufficient information to determine other
information, such as research and testing, active development, the
amount of interest, real-world usage, etc.

We use the current production version of ModPerl 2 with a very
recent release of Apache HTTPd v2.4 (and the libapreq2 libraries as
well), and the HTTP, QOTD, and WHOIS services (the latter two are
written in ModPerl 2 and served by Apache HTTPd) that we host using
these solutions are themselves also actively maintained, plus we are
also adding new ModPerl 2 internet sites with some regularity.

I hope that helps to answer your question.  You are also always
welcome to ask if you have more questions.


Hi,

Apache httpd has get upgraded to 2.4.26.
But modperl is still in 2.0 branch.
Is it still in active development? thanks.


--
We are hiring:
http://ml.dnsbed.com/



Randolf Richardson - rand...@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/




--
  We are hiring:
  http://ml.dnsbed.com/


modperl for httpd 2.4?

2017-06-23 Thread Peng Yonghua

Hi,

Apache httpd has get upgraded to 2.4.26.
But modperl is still in 2.0 branch.
Is it still in active development? thanks.


--
  We are hiring:
  http://ml.dnsbed.com/


Re: internal dummy connection

2017-06-05 Thread Peng Yonghua

from the url:

When the Apache HTTP Server manages its child processes, it needs a way 
to wake up processes that are listening for new connections. To do this, 
it sends a simple HTTP request back to itself.


So, why apache want to wake up child processes periodically? It can do 
this based on event mechanism, only when new request is coming in, the 
child will be woken up.


thanks.


On 2017/6/5 星期一 16:49, Holger Kipp wrote:
You might simply want to google it (e.g. "mod_perl internal dummy 
connection")


https://knackforge.com/blog/sivaji/mitigating-apache-internal-dummy-connection-issue

Best regards,
Holger

On 5. Jun 2017, at 08:31, Peng Yonghua <p...@vodafonemail.de 
<mailto:p...@vodafonemail.de>> wrote:



I saw many items like these in log,

::1 - - [05/Jun/2017:14:29:06 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"
::1 - - [05/Jun/2017:14:29:07 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"
::1 - - [05/Jun/2017:14:29:08 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"
::1 - - [05/Jun/2017:14:29:09 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"


what does it mean? why it exists? thanks.


internal dummy connection

2017-06-05 Thread Peng Yonghua

I saw many items like these in log,

::1 - - [05/Jun/2017:14:29:06 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"
::1 - - [05/Jun/2017:14:29:07 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"
::1 - - [05/Jun/2017:14:29:08 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"
::1 - - [05/Jun/2017:14:29:09 +0800] "OPTIONS * HTTP/1.0" 200 125 "-" 
"Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_apreq2-20090110/2.8.0 
mod_perl/2.0.8 Perl/v5.18.2 (internal dummy connection)"


what does it mean? why it exists? thanks.


Re: mod_perl and utf8 and CGI->param

2017-06-01 Thread Peng Yonghua
And, can I override any method from a class via this way? is this a 
general trick? thanks.


On 2017/6/2  8:48, Peng Yonghua wrote:

good patch. thanks for sharing.

On 2017/6/1  23:34, Randal L. Schwartz wrote:

I realized that I never posted my ultimate solution.  I monkey patch
CGI.pm:

require CGI;
{
   my $orig = \::param;
   no warnings 'redefine';
   *CGI::param = sub {
 $CGI::LIST_CONTEXT_WARN = 0; # workaround for backward compatibility
 $CGI::PARAM_UTF8 = 1;
 goto &$orig;
   };
}

And this has been working just fine for both CGI and mod_perl.  Just 
for the

record.


Re: mod_perl and utf8 and CGI->param

2017-06-01 Thread Peng Yonghua

good patch. thanks for sharing.

On 2017/6/1  23:34, Randal L. Schwartz wrote:

I realized that I never posted my ultimate solution.  I monkey patch
CGI.pm:

require CGI;
{
   my $orig = \::param;
   no warnings 'redefine';
   *CGI::param = sub {
 $CGI::LIST_CONTEXT_WARN = 0; # workaround for backward compatibility
 $CGI::PARAM_UTF8 = 1;
 goto &$orig;
   };
}

And this has been working just fine for both CGI and mod_perl.  Just for the
record.


Re: capture exception

2017-06-01 Thread Peng Yonghua

Thanks for everyone's reply.

I got the idea from 
https://stackoverflow.com/questions/4006267/what-is-the-best-way-to-handle-exceptions-in-perl 
,


The consensus of the Perl community seems to be thatTry::Tiny 
is the preferred way of doing 
exception handling. The "lenient policy" you refer to is probably due to 
a combination of:


 * Perl not being a fully object-oriented language. (e.g. in contrast
   to Java where you can't avoid dealing with exceptions.)
 * The background of many Perl developers. (Languages like C^1 and
   shell don't have exception mechanisms.)
 * The kind of tasks people tend to use Perl for. (Small scripts for
   text munging and report generation where exception handling isn't
   needed.)
 * Perl not having a (good) built-in exception mechanism.

Note that the last item means that you'll see a lot of code like this:

|eval{something()};if($@){warn "Oh no! [$@]\n";}|

That's exception handling even though it doesn't use try/catch syntax. 
It's fragile, though, and will break in a number of subtle edge cases 
that most people don't think about. Try::Tiny and the other exception 
handling modules on CPAN were written to make it easier to get right.



On 2017/6/1 星期四 0:38, Hiram Gibbard wrote:
So when we say "from the internet" does that include intranet?  What I 
have is a form that lists all the members of a group defined in LDAP. 
The call to get the members for the group is all internal and our 
companies internal ldap server. is that considered "from internet". I 
didn't write this app, just trying to make adjustments. Currently if 
you hit a member of the group that has been terminated/removed from 
ldap, the app errors out because the its it a member of the group in 
which its trying to execute a look on while listing.






capture exception

2017-05-25 Thread Peng Yonghua

greeting,

I am not so good at perl/modperl,:)

In the handler, a method from a class was called, when something dies 
from within the method, what's the correct way the handler will take?


for example, I wrote this API which works right if given a correct 
domain name:


http://fenghe.org/domain/?d=yahoo.com

server response:
var data={"registration":"domain may be taken","domain":"yahoo.com"}

If given a wrong domain name:

http://fenghe.org/domain/?d=yahoo.nonexist

The server returns 500.

This is because, in the handler, I used this module (wrote also by me):

http://search.cpan.org/~pyh/Net-Domain-Registration-Check-0.03/lib/Net/Domain/Registration/Check.pm

And in the module, croak like this was happened,

croak "domain TLD not exists" unless tld_exists($tld);

When handler meets the croak, it dies (I guess) and server returns 500.

How will I make the full system work right? fix on handler, or the 
module itself?


Thanks.


Re: get apache's concurrent connection number

2007-11-26 Thread yonghua
On Nov 27, 2007 2:56 AM, Perrin Harkins [EMAIL PROTECTED] wrote:

 I think you'd be much better off building this into a proxy server.
 There are several that allow customization.  However, the way to
 access this information is through Apache::Scoreboard.


Thanks Perrin.
Our application has a large cluster, that's to say, there is an
application, which is running on about 40 linux boxes (each box is a
mirror).And those 40 linux boxes are locatated in different areas.
When a server get high load, we redirect the new requests to other
remote server box.
Will check Apache::Scoreboard. thanks.

--yonghua (Jeff)


get apache's concurrent connection number

2007-11-25 Thread yonghua
Hello,

How to get Apache's concurrent connection number under modperl?
We have a plan that, when an apache's concurrent connection is large,
we make the apache to redirect user's new request to another http
server. So I need to write a mp module to do that.

Thanks for any guide.