<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>modperl@perl.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/perl-modperl/"/>
<id>http://mail-archives.apache.org/mod_mbox/perl-modperl/</id>
<updated>2009-12-09T20:28:15Z</updated>
<entry>
<title>Building CPAN/ppm modules on 64bit Windows</title>
<author><name>&quot;will@serensoft.com&quot; &lt;will@serensoft.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3cb84520740912082200l40e050dbl9b19900af7d13ca7@mail.gmail.com%3e"/>
<id>urn:uuid:%3cb84520740912082200l40e050dbl9b19900af7d13ca7@mail-gmail-com%3e</id>
<updated>2009-12-09T06:00:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Newbie question here -- this isn't mod_perl specific but the lists
I've found that seem more appropriate have not-so-much traffic, and
we're in a bit of a bind...

How do we build CPAN libraries on Win64?


We've been building a bridge-module to migrate data from SIS
(registrar data such as courses, instructors, students) into an LMS
and back (as grades). We've got Win32::GUI to handle the interface of
course... It works fin on our little 32-bit workstations, but the
client has 64-bit windows on their server.

Nmake works on win32, but not on wni64. Dmake is recommended instead,
but it's only available in C-code source, and we don't have any C
compiler at hand. We're just looking to install a few perl modules,
argh!

Is there another way to get CPAN/PPM (activestate's
perl-package-manager) to build and install modules? Or does someone
have a compiled DMAKE we could try?

Thanks bunches, mod-perlers!

-- 
will trillich
"Tis the set of the sails / And not the gales / That tells the way we
go." -- Ella Wheeler Wilcox


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Subclassing Apache::AuthDBI</title>
<author><name>Tosh Cooey &lt;tosh@1200group.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c4B1ED0F9.9020709@1200group.com%3e"/>
<id>urn:uuid:%3c4B1ED0F9-9020709@1200group-com%3e</id>
<updated>2009-12-08T22:19:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm enjoying talking to myself here all month!  So the solution to my 
problem below...

Yay to MidLifeXis on PerlMonks for pointing out the problem.

When MyAuthDBI::authen is called then PERL looks to that specific object 
for the function rather than traversing up the parent tree. 
MyAuthDBI-&gt;authen would call the function but the original 
Apache::AuthDBI::authen expects $r as the first argument and not $self 
and so a new set of problems arises.

So the easy solution to this problem is:

package MyAuthDBI;
use base "Apache::AuthDBI";
sub authen {
   my ($r) = @_;
   Apache::AuthDBI::authen($r);
}
1;

To answer my final question, yes I was doing something glaringly dumb :)

Tosh


Tosh Cooey wrote:
&gt; I'm trying to subclass Apache::AuthDBI by doing:
&gt; 
&gt; package MyAuthDBI;
&gt; 
&gt; use base "Apache::AuthDBI";
&gt; 1;
&gt; 
&gt; 
&gt; Then in apache.conf
&gt; 
&gt; PerlModule MyAuthDBI
&gt; &lt;Location /test&gt;
&gt;   AuthType Basic
&gt;   PerlAuthenHandler MyAuthDBI::authen
&gt; ...
&gt; &lt;/Location&gt;
&gt; 
&gt; I'm getting the following error:
&gt; 
&gt; ...failed to resolve handler `MyAuthDBI::authen': Can't locate 
&gt; MyAuthDBI/authen.pm in @INC...
&gt; 
&gt; Which kinda makes sense as an error message since the handler is 
&gt; declared MyAuthDBI::authen and not MyAuthDBI-&gt;authen and yet it works 
&gt; just fine if I allow Apache::AuthDBI to handle the Authen.
&gt; 
&gt; Is it non trivial to subclass Apache::AuthDBI?  Am I doing something 
&gt; glaringly dumb?
&gt; 
&gt; Thanks again...
&gt; 
&gt; Tosh
&gt; 

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Detecting graceful restart/stop in child processes</title>
<author><name>Bill Moseley &lt;moseley@hank.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c16f65d000912070701g6744a925j20849d2108486143@mail.gmail.com%3e"/>
<id>urn:uuid:%3c16f65d000912070701g6744a925j20849d2108486143@mail-gmail-com%3e</id>
<updated>2009-12-07T15:01:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Mon, Dec 7, 2009 at 1:18 AM, André Warnier &lt;aw@ice-sa.com&gt; wrote:

&gt; Bill Moseley wrote:
&gt;
&gt;&gt;
&gt;&gt; Again, I've got keep alives set for a long time.
&gt;&gt;
&gt;
&gt; Well, isn't that your problem then ?
&gt;
KeepAlive connections were introduced at a time when establishing and
&gt; tearing down TCP connections were relatively expensive things to do.
&gt; With modern servers however, this is less important.
&gt;
&gt; By setting KeepAliveTimeOut long, you essentially "block" a child (and all
&gt; its resources), doing nothing but waiting for a follow-up request, for a
&gt; long time after the last related request from the browser has come in, for
&gt; the dubious benefit of avoiding the setup of a new connection.
&gt;

This is true for my test environment I described, but that was just for
testing and was on purpose.

Under production a load balancer is used between the client and the
Apache/mod_perl servers.  It works as a proxy where the connection to the
client is separate from the connection to the pool of backend processes on
each server.  The balancer manages this pool of persistent connections ready
to handle requests.  Clients make separate persistent connections on the
front of the balancer, too.  But these are not directly connected to any one
process.  Requests come in from the presistent clients and the balancer
finds a free backend process to handle the request.  The backend services
the request very quickly and then is available to service other requests
while the client receives its response.  The keep-alive timeouts are
different on both sides of the balancer.

If the balancer maintains persistent connections to the back-end processes
then the problem is how to gracefully shut down a server.  Just doing a
graceful stop won't work because the connections keeps the process alive.
One way is to pull the server from the balancer  pool, wait for existing
requests to finish (only a few seconds) and then stop the server.   Problem
there is that it's not always the same people running the web servers and
balancers.

So, it would be more convenient if a graceful restart could be done on just
Apache and that would trigger closing the connections on the next response
freeing up the process to exit.  That's the part I'm trying to get working.




-- 
Bill Moseley
moseley@hank.org


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Detecting graceful restart/stop in child processes</title>
<author><name>=?ISO-8859-1?Q?Andr=E9_Warnier?= &lt;aw@ice-sa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c4B1CC86C.6070702@ice-sa.com%3e"/>
<id>urn:uuid:%3c4B1CC86C-6070702@ice-sa-com%3e</id>
<updated>2009-12-07T09:18:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Bill Moseley wrote:
&gt; 
&gt; Again, I've got keep alives set for a long time.

Well, isn't that your problem then ?
KeepAlive connections were introduced at a time when establishing and 
tearing down TCP connections were relatively expensive things to do.
With modern servers however, this is less important.

By setting KeepAliveTimeOut long, you essentially "block" a child (and 
all its resources), doing nothing but waiting for a follow-up request, 
for a long time after the last related request from the browser has come 
in, for the dubious benefit of avoiding the setup of a new connection.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Detecting graceful restart/stop in child processes</title>
<author><name>Bill Moseley &lt;moseley@hank.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c16f65d000912062058g689f4bbfu603b85d981b5d5f1@mail.gmail.com%3e"/>
<id>urn:uuid:%3c16f65d000912062058g689f4bbfu603b85d981b5d5f1@mail-gmail-com%3e</id>
<updated>2009-12-07T04:58:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sun, Dec 6, 2009 at 9:51 AM, André Warnier &lt;aw@ice-sa.com&gt; wrote:

&gt;
&gt; I am not the ultimate authority here, but I think you are going to have
&gt; several problems with this idea.
&gt; - the first one is that under Windows (where Apache also runs) there are no
&gt; such signals.
&gt; - the second one is that the signal, if signal there is, is probably
&gt; addressed to the main Apache instance, not to the children processes.
&gt; I am not sure that the Apache main process then tells the children to stop
&gt; via a signal, or via some other mechanism.
&gt; - assuming that a child process (or thread) has received (from the main
&gt; Apache process) the order to terminate, it will do so after it finishes the
&gt; current request, by which time it will be too late to add your header.
&gt; But maybe I'm wrong with all of these.  Let's wait for a guru here to
&gt; comment..
&gt;

I'm not concerned with Windows.  I think all children in the process group
see the signals -- at least that's what I'm seeing.

Again, I've got keep alives set for a long time.   I can start up Apache and
make a request with firefox which establishes a connection with one
process.  Repeated request use the same connection (and process) due to the
keep alive. Then I do a graceful stop and just the parent process and that
one child process remain.

Netstat can also show that the connection is persistent to the child
process.

That process stays around serving requests until either the client (firefox)
closes the connection or a response sends a Connection: close header to the
client.  Then both the parent and child exit.  (I send a Connection: close
header when a query parameter is set.)

But, if I set a signal handler (either via $SIG or with a POSIX handler) I
can catch USR1 in the child process on a graceful stop, but it seems just
the act of catching the signal prevents the process from exiting.  That is,
the query parameter trick can still trigger closing the connection but the
process does not exit.

So, yes, an IPC and Apache guru would be the next step. ;)



-- 
Bill Moseley
moseley@hank.org


</pre>
</div>
</content>
</entry>
<entry>
<title>Subclassing Apache::AuthDBI</title>
<author><name>Tosh Cooey &lt;tosh@1200group.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c4B1C617C.1010906@1200group.com%3e"/>
<id>urn:uuid:%3c4B1C617C-1010906@1200group-com%3e</id>
<updated>2009-12-07T01:59:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm trying to subclass Apache::AuthDBI by doing:

package MyAuthDBI;

use base "Apache::AuthDBI";
1;


Then in apache.conf

PerlModule MyAuthDBI
&lt;Location /test&gt;
   AuthType Basic
   PerlAuthenHandler MyAuthDBI::authen
...
&lt;/Location&gt;

I'm getting the following error:

...failed to resolve handler `MyAuthDBI::authen': Can't locate 
MyAuthDBI/authen.pm in @INC...

Which kinda makes sense as an error message since the handler is 
declared MyAuthDBI::authen and not MyAuthDBI-&gt;authen and yet it works 
just fine if I allow Apache::AuthDBI to handle the Authen.

Is it non trivial to subclass Apache::AuthDBI?  Am I doing something 
glaringly dumb?

Thanks again...

Tosh

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Replacement for Apache::AuthDBI but not mod_authn_dbd</title>
<author><name>Tosh Cooey &lt;tosh@1200group.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c4B1C56D4.8080801@1200group.com%3e"/>
<id>urn:uuid:%3c4B1C56D4-8080801@1200group-com%3e</id>
<updated>2009-12-07T01:13:56Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Sorry, Apache::AuthDBI does still work just fine, I just had to patch 
Apache::DBI 1.07.

Still open for suggestions if anyone knows a cleverer way to accomplish 
what I'm doing.

Thanks!

Tosh



Tosh Cooey wrote:
&gt; If you saw my last post I described my solution for the following problem:
&gt; 
&gt; Right now I have an application set up for multiple clients: clientA, 
&gt; clientB, clientC.
&gt; 
&gt; Each client has their own users.
&gt; 
&gt; The way I have it setup is clientA goes to http://www.site.com/clientA 
&gt; and is presented with a login screen which is triggered by an .htaccess 
&gt; file in a directory called /clientA. The .htaccess file directs Apache 
&gt; to perform DBI-based authentication using Apache2::AuthCookieDBI.
&gt; 
&gt; The solution was to subclass Apache2::AuthCookieDBI (MyAuth.pm) to have 
&gt; it dynamically set the $database variable on each request depending on 
&gt; the client.
&gt; 
&gt; This works great, but now MyAuth.pm needs to be a bit more complicated 
&gt; to be able to handle BASIC Authentication as well, for example in this 
&gt; scenario:
&gt; 
&gt; http://www.site.com/clientA/calendar
&gt; http://www.site.com/clientA/calendar/ical
&gt; 
&gt; The first link is handled by a login screen and cookies.  The second 
&gt; would allow programs like iCal to subscribe to a calendar and so needs 
&gt; to be handled via BASIC Authentication.  My initial thought was that 
&gt; this would be easy, I would just do the following:
&gt; 
&gt; package MyAuth;
&gt; 
&gt; if ($var eq 'iCal') {
&gt;   use base "Apache::AuthDBI";
&gt;   ... do some other stuff...
&gt; } else {
&gt;   use base "Apache2::AuthCookieDBI";
&gt;   ... do some other stuff...
&gt; }
&gt; 
&gt; 
&gt; But if I'm not mistaken Apache::AuthDBI is a mp1 module not mp2 because 
&gt; all it's functionality is managed by mod_authn_dbd and also it's for 
&gt; Apache 1.3 which is great but doesn't help me in my above scenario.
&gt; 
&gt; Anyone have any suggestions for a Apache::AuthDBI replacement?  Or 
&gt; perhaps a different way to accomplish what I want?
&gt; 
&gt; Thanks!
&gt; 
&gt; Tosh

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


</pre>
</div>
</content>
</entry>
<entry>
<title>Replacement for Apache::AuthDBI but not mod_authn_dbd</title>
<author><name>Tosh Cooey &lt;tosh@1200group.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c4B1C51BD.10204@1200group.com%3e"/>
<id>urn:uuid:%3c4B1C51BD-10204@1200group-com%3e</id>
<updated>2009-12-07T00:52:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
If you saw my last post I described my solution for the following problem:

Right now I have an application set up for multiple clients: clientA, 
clientB, clientC.

Each client has their own users.

The way I have it setup is clientA goes to http://www.site.com/clientA 
and is presented with a login screen which is triggered by an .htaccess 
file in a directory called /clientA. The .htaccess file directs Apache 
to perform DBI-based authentication using Apache2::AuthCookieDBI.

The solution was to subclass Apache2::AuthCookieDBI (MyAuth.pm) to have 
it dynamically set the $database variable on each request depending on 
the client.

This works great, but now MyAuth.pm needs to be a bit more complicated 
to be able to handle BASIC Authentication as well, for example in this 
scenario:

http://www.site.com/clientA/calendar
http://www.site.com/clientA/calendar/ical

The first link is handled by a login screen and cookies.  The second 
would allow programs like iCal to subscribe to a calendar and so needs 
to be handled via BASIC Authentication.  My initial thought was that 
this would be easy, I would just do the following:

package MyAuth;

if ($var eq 'iCal') {
   use base "Apache::AuthDBI";
   ... do some other stuff...
} else {
   use base "Apache2::AuthCookieDBI";
   ... do some other stuff...
}


But if I'm not mistaken Apache::AuthDBI is a mp1 module not mp2 because 
all it's functionality is managed by mod_authn_dbd and also it's for 
Apache 1.3 which is great but doesn't help me in my above scenario.

Anyone have any suggestions for a Apache::AuthDBI replacement?  Or 
perhaps a different way to accomplish what I want?

Thanks!

Tosh
-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Detecting graceful restart/stop in child processes</title>
<author><name>=?ISO-8859-1?Q?Andr=E9_Warnier?= &lt;aw@ice-sa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c4B1BEF11.3000106@ice-sa.com%3e"/>
<id>urn:uuid:%3c4B1BEF11-3000106@ice-sa-com%3e</id>
<updated>2009-12-06T17:51:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Bill Moseley wrote:
&gt; I'm running mod_perl/2.0.4 with a very large keep-alive set in my
&gt; httpd.conf.
&gt; 
&gt; Is there a way to detect when a graceful stop or restart has been requested
&gt; in the child apache processes?
&gt; I tried $SIG{USR1} and $SIG{WINCH} but I'm not seeing them catch the signal.
&gt; 
&gt; I'd like to be able to detect when a graceful stop or restart has been
&gt; requested so that I can add a Connection: close header to the response.
&gt; 
&gt; 
I am not the ultimate authority here, but I think you are going to have 
several problems with this idea.
- the first one is that under Windows (where Apache also runs) there are 
no such signals.
- the second one is that the signal, if signal there is, is probably 
addressed to the main Apache instance, not to the children processes.
I am not sure that the Apache main process then tells the children to 
stop via a signal, or via some other mechanism.
- assuming that a child process (or thread) has received (from the main 
Apache process) the order to terminate, it will do so after it finishes 
the current request, by which time it will be too late to add your header.
But maybe I'm wrong with all of these.  Let's wait for a guru here to 
comment..




</pre>
</div>
</content>
</entry>
<entry>
<title>Detecting graceful restart/stop in child processes</title>
<author><name>Bill Moseley &lt;moseley@hank.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c16f65d000912060935l5cfe90fye93c86503eae6708@mail.gmail.com%3e"/>
<id>urn:uuid:%3c16f65d000912060935l5cfe90fye93c86503eae6708@mail-gmail-com%3e</id>
<updated>2009-12-06T17:35:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm running mod_perl/2.0.4 with a very large keep-alive set in my
httpd.conf.

Is there a way to detect when a graceful stop or restart has been requested
in the child apache processes?
I tried $SIG{USR1} and $SIG{WINCH} but I'm not seeing them catch the signal.

I'd like to be able to detect when a graceful stop or restart has been
requested so that I can add a Connection: close header to the response.


-- 
Bill Moseley
moseley@hank.org


</pre>
</div>
</content>
</entry>
<entry>
<title>WAS: A better way to handle multiple client authentication? AND ALSO: Dynamically setting PerlVars in Apache per-request</title>
<author><name>Tosh Cooey &lt;tosh@1200group.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200912.mbox/%3c4B17AB3E.6050108@1200group.com%3e"/>
<id>urn:uuid:%3c4B17AB3E-6050108@1200group-com%3e</id>
<updated>2009-12-03T12:12:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Sorry for the long subject but I solved the questions I posted about and 
thought I would share my $solution.

The initial problem was:

Right now I have an application set up for multiple clients: clientA, 
clientB, clientC.

Each client has their own users.

The way I have it setup is clientA goes to http://www.site.com/clientA 
and is presented with a login screen which is triggered by an .htaccess 
file in a directory called /clientA. The .htaccess file directs Apache 
to perform DBI-based authentication using Apache2::AuthCookieDBI.

PerlSetVar AuthDBI_DSN DBI:mysql:clientA

This works great, but I am aware of the limitations and I would like to 
set up some rules in the Apache config that accomplish this all without 
.htaccess files in every directory for every client (gonna get tricky 
around 100,000 clients for sure!)



William T. had an interesting suggestion to use the 'pwd_whereclause' 
but that wasn't exactly what I needed.  So my first go at it resulted in 
my second question, about setting PerlSetVar on the fly, per-request and 
do authentication that way.

Adam Prime (a Great Canadian) replied with a big hint that lead to my 
solution, he suggested just subclassing Apache2::AuthCookieDBI

And voila!  So in case anyone else ever needs to do this hopefully they 
can save some time, here is my $solution;

myAUTH.pm:
package myAUTH;

use base qw(Apache2::AuthCookieDBI);

#$CONFIG_DEFAULT is initialized in the parent (use base ...)
$CONFIG_DEFAULT{myAuthDBI_DSN} = "DBI:mysql:database=&amp;client";

sub client {
   ... do stuff to determine your client ID...
}

1;


Anything else you need to change WRT the DBI can be done with the 
$CONFIG_DEFAULT variable.  Use your new myAUTH module in the "AuthType 
myAUTH" section.  If you want to get more fancy you can explore into 
dir_config.

Anyway, I hope that helps somebody.

Tosh

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Apache2::SizeLimit aborts when smaps is not available</title>
<author><name>Harry Danilevsky &lt;harry.danilevsky@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c15f2cc5b0911301344i7d2af8bas8bd04a1c2e176c68@mail.gmail.com%3e"/>
<id>urn:uuid:%3c15f2cc5b0911301344i7d2af8bas8bd04a1c2e176c68@mail-gmail-com%3e</id>
<updated>2009-11-30T21:44:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
1. Problem Description:

  Apache2::SizeLimit aborts when smaps facility is unavailable. Here's the
error from the error log:

Linux::Smaps: Cannot open /proc/9700/smaps: No such file or directory
BEGIN failed--compilation aborted at
/data/wre/prereqs/lib/perl5/site_perl/5.10.0/i686-linux/Apache2/SizeLimit.pm
line 98

This installation is part of WebGUI CMS (hence the path, starting with
/data/wre),
but there's nothing specific to WebGUI here - it's just a plain mod_perl
file tree.

The error is not caused by insufficient read permissions - there are
simply no smaps files in /proc/xxx.
Apache2::SizeLimit documentation mentions two possible solutions:

   1. Installing an OS patch with smaps support (which may or may not be an
option)

   2. Setting $Apache2::SizeLimit::USE_SMAPS to 0 before the first check.
This doesn't
      help in this particular case, because the error is generated within
the BEGIN block;
      besides, the chunk of code which produces this error, pays no
attention to $USE_SMAPS


I believe the error is caused simply by placing the wrong (or rather
insufficient) statement inside eval() :

        if ( eval { require Linux::Smaps } and Linux::Smaps-&gt;new($$) ) {
             ...
        }

Linux::Smaps module is present, and obviously returns 1, but
Linux::Smaps-&gt;new throws an error
which is not being caught by eval.

I propose the following trivial patch:


--------------------------8&lt;--------------------

*** ./SizeLimit.pm      2009-11-30 09:13:16.000000000 -0600
--- /tmp/SizeLimit.pm.orig      2009-11-30 09:24:04.000000000 -0600
***************
*** 58,64 ****

      }
      elsif (LINUX) {
!         if ( eval { require Linux::Smaps and Linux::Smaps-&gt;new($$) } ) {
              $HOW_BIG_IS_IT = \&amp;linux_smaps_size_check_first_time;
          }
          else {
--- 58,64 ----

      }
      elsif (LINUX) {
!         if ( eval { require Linux::Smaps } and Linux::Smaps-&gt;new($$) ) {
              $HOW_BIG_IS_IT = \&amp;linux_smaps_size_check_first_time;
          }
          else {

--------------------------8&lt;--------------------


-- Harry Danilevsky

harry.danilevsky@gmail.com


2. Used Components and their Configuration:

*** mod_perl version 2.000004

*** using
/data/wre/prereqs/lib/perl5/site_perl/5.10.0/i686-linux/Apache2/BuildConfig.pm

*** Makefile.PL options:
  MP_APR_LIB     =&gt; aprext
  MP_APXS        =&gt; /data/wre/prereqs/bin/apxs
  MP_COMPAT_1X   =&gt; 1
  MP_GENERATE_XS =&gt; 1
  MP_LIBNAME     =&gt; mod_perl
  MP_USE_DSO     =&gt; 1


*** The httpd binary was not found


*** (apr|apu)-config linking info

 -L/data/wre/prereqs/lib -laprutil-1  -lexpat
 -L/data/wre/prereqs/lib -lapr-1 -lrt -lcrypt  -lpthread -ldl



*** /data/wre/prereqs/bin/perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.21-51.el, archname=i686-linux
    uname='linux centos3 2.4.21-51.el #1 thu aug 16 17:03:59 edt 2007 i686
i686 i386 gnulinux '
    config_args='-Dprefix=/data/wre/prereqs -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-59)',
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
                        USE_LARGE_FILES USE_PERLIO
  Built under linux
  Compiled at May 27 2009 20:31:04
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /data/wre/prereqs/lib/perl5/5.10.0/i686-linux
    /data/wre/prereqs/lib/perl5/5.10.0
    /data/wre/prereqs/lib/perl5/site_perl/5.10.0/i686-linux
    /data/wre/prereqs/lib/perl5/site_perl/5.10.0
    .

*** Packages of interest status:

Apache2            : -
Apache2::Request   : 2.08
CGI                : 3.42
ExtUtils::MakeMaker: 6.48
LWP                : 5.824
mod_perl           : -
mod_perl2          : 2.000004


3. This is the core dump trace: (if you get a core dump):



This report was generated by bin/mp2bug on Mon Nov 30 17:25:35 2009 GMT.


</pre>
</div>
</content>
</entry>
<entry>
<title>How to share variables when embedding, cloning perl</title>
<author><name>Sri &lt;w2learn@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c877954.63191.qm@web56501.mail.re3.yahoo.com%3e"/>
<id>urn:uuid:%3c877954-63191-qm@web56501-mail-re3-yahoo-com%3e</id>
<updated>2009-11-30T18:34:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

I havent found any relevant posts on this topic, so hoping the experts can rescue me.  My
posts on p5p and ithreads didnt get any responses.

I'm extending Perl (with SWIG) and also embedding a cloned interpreter.  I use the cloned
interpreter to invoke Perl sub's as callbacks.  The callback part is working fine.  However,
a variable changed in the callback subroutine is NOT becoming available in the rest of the
perl script.

I tried to "use threads:shared" and ":shared" the variable in question, but perl exits, complaining
that another completely unrelated scalar is "Invalid value for shared scalar at".  

How can I "share" variable updates between the main perl script and the callbacks invokved
thru the cloned interpreter?

I'm using v5.8.8 perl.  perl_clone() is using CLONEf_COPY_STACKS | CLONEf_KEEP_PTR_TABLE. 
The perl sub is sv_dup() with the same flags in CLONE_PARAMS before call_sv().

Please see this post that describes my current code.

http://markmail.org/thread/cjbhybjfikuirvud

Thanks


      


</pre>
</div>
</content>
</entry>
<entry>
<title>Bug in $r-&gt;no_cache(1) with mod_expires</title>
<author><name>Clinton Gormley &lt;clint@traveljury.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c1259165555.4657.41.camel@getafix.traveljury.com%3e"/>
<id>urn:uuid:%3c1259165555-4657-41-camel@getafix-traveljury-com%3e</id>
<updated>2009-11-25T16:12:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all

I think that the behaviour of $r-&gt;no_cache(1) is buggy, when combined
with mod_expires.

I have:

    ExpiresDefault            "access plus 1 month"
    ExpiresActive On

then in my mod_perl code, I call $r-&gt;no_cache(1)

The headers that are returned are:

    Pragma: no-cache
 ï»¿   Cache-control: no-cache, max-age=864000
ï»¿    Expires: Sat, 05 Dec 2009 16:08:53 GMT

Firefox doesn't cache this page, but IE6 - 8 does.

If I explicitly set the headers:

    $headers-&gt;set( 'Pragma',        'no-cache' );
    $headers-&gt;set( 'Cache-control', 'no-cache' );
    $headers-&gt;set( 'Expires',       -1 );

then I get:
    Pragma: no-cache
    Cache-control: no-cache
    Expires: -1

which works across all browsers. 

Could the behaviour of no_cache() be changed to do this instead?

thanks

Clint




</pre>
</div>
</content>
</entry>
<entry>
<title>Re: content_length</title>
<author><name>Adam Prime &lt;adam.prime@utoronto.ca&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c4B0C50F3.9000806@utoronto.ca%3e"/>
<id>urn:uuid:%3c4B0C50F3-9000806@utoronto-ca%3e</id>
<updated>2009-11-24T21:32:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Ryan Perry wrote:
&gt; How do I get the content length of the request body? or the equivalent  of $ENV{'CONTENT_LENGTH'}
?
&gt; 
&gt;         my $current_read = $r-&gt;read($current_buffer, $current_length - $current_remaining,
$current_remaining);
&gt; 
&gt; Thanks!


Content-Length is just a header, so you get it through headers_in.

mp2:

http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_in_

mp1:

http://perl.apache.org/docs/1.0/api/Apache.html#_r_E_gt_headers_in

Adam


</pre>
</div>
</content>
</entry>
<entry>
<title>content_length</title>
<author><name>Ryan Perry &lt;rperry@womenshealth.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3cA5E1F08D-5032-47F7-B4AC-3B0105632068@womenshealth.com%3e"/>
<id>urn:uuid:%3cA5E1F08D-5032-47F7-B4AC-3B0105632068@womenshealth-com%3e</id>
<updated>2009-11-24T21:25:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
How do I get the content length of the request body? or the equivalent  of $ENV{'CONTENT_LENGTH'}
?

        my $current_read = $r-&gt;read($current_buffer, $current_length - $current_remaining,
$current_remaining);

Thanks!

</pre>
</div>
</content>
</entry>
<entry>
<title>Problems running mod_perl install tests - where should these be posted to</title>
<author><name>greg.george@orica.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3cOFCF4BA7F0.B1A59B74-ONCA257678.0013B4F2-CA257678.0013CABC@orica.com%3e"/>
<id>urn:uuid:%3cOFCF4BA7F0-B1A59B74-ONCA257678-0013B4F2-CA257678-0013CABC@orica-com%3e</id>
<updated>2009-11-24T03:36:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Regards,
Greg George
IT Shared Services
Phone: +613-9091-2492
3/100 Victoria Prd, Melbourne

Please consider the environment before printing this e-mail
***********************************************************************************************************************************************************************************************
Please consider the environment before printing this e-mail.

This message is intended solely for the individual(s) and entity(s) addressed. It is confidential
and may contain legally privileged information. The use, copying or distribution of this 
message or any information it contains, by anyone other than the addressee, is prohibited.
If you have received this message in error, please notify postmaster@orica.com. The mailbox
address 
from which this message has been sent is for business mail only. Mail sent to it may be subject
to security scanning and delivery on non-business messages sent to this address may not occur.

Thank you.
***********************************************************************************************************************************************************************************************



</pre>
</div>
</content>
</entry>
<entry>
<title>[mp2] OS X snow leopard compile issue</title>
<author><name>&quot;R.Polonski&quot; &lt;rpolonski@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c6E3B5A3B-C17C-42A3-897F-B3496D6CF161@gmail.com%3e"/>
<id>urn:uuid:%3c6E3B5A3B-C17C-42A3-897F-B3496D6CF161@gmail-com%3e</id>
<updated>2009-11-23T22:45:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

I tried to compile mod_perl 2.0.4 on mac os x 10.6.2

httpd 2.2.14
./configure --prefix=/tmp/q
make ; make install

mod_perl 2.0.4 and latest from SVN
perl Makefile.PL MP_APXS=/tmp/q/bin/apxs PREFIX=/tmp/q2
system perl: perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=darwin, osvers=10.0, archname=darwin-thread-multi-2level
    uname='darwin b66.apple.com 10.0 darwin kernel version 10.0.0d8: tue may 5 19:29:59 pdt
2009; root:xnu-1437.2~2release_i386 i386 '
    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags= -Dman3ext=3pm -Duseithreads
-Duseshrplib -Dinc_version_list=none -Dcc=gcc-4.2'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_PERLIO USE_REENTRANT_API
  Locally applied patches:
	/Library/Perl/Updates/&lt;version&gt; comes before system perl directories
	installprivlib and installarchlib points to the Updates directory
  Built under darwin
  Compiled at Jul  9 2009 15:07:54
  @INC:
    /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level
    /Library/Perl/Updates/5.10.0
    /System/Library/Perl/5.10.0/darwin-thread-multi-2level
    /System/Library/Perl/5.10.0
    /Library/Perl/5.10.0/darwin-thread-multi-2level
    /Library/Perl/5.10.0
    /Network/Library/Perl/5.10.0/darwin-thread-multi-2level
    /Network/Library/Perl/5.10.0
    /Network/Library/Perl
    /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.10.0
    .


after make and make install I got .so file.

When I try to start apache now I get an error:
./apachectl  start
httpd: Syntax error on line 53 of /tmp/q/conf/httpd.conf: Cannot load /tmp/q/modules/mod_perl.so
into server: dlopen(/tmp/q/modules/mod_perl.so, 10): Symbol not found: _ap_add_input_filter\n
 Referenced from: /tmp/q/modules/mod_perl.so\n  Expected in: flat namespace\n in /tmp/q/modules/mod_perl.so

I decided to perform static installation but was not successful too:
I tried to build via:
perl Makefile.PL MP_USE_STATIC=1 MP_AP_PREFIX=/tmp/httpd-2.2.14 MP_AP_CONFIGURE="--with-mpm=prefork"
PREFIX=/tmp/q3

...
mod_perl.c:768: error: storage class specified for parameter 'modperl_destruct_level'
mod_perl.c:768: error: parameter 'modperl_destruct_level' is initialized
mod_perl.c:771: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
mod_perl.c:778: error: expected ';', ',' or ')' before '*' token
mod_perl.c:788: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
mod_perl.c:823: error: expected ')' before '*' token
mod_perl.c:833: error: expected ')' before '*' token
mod_perl.c:904: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'modperl_cmds'
mod_perl.c:961: error: expected declaration specifiers before ';' token
mod_perl.c:963: error: expected ')' before '*' token
mod_perl.c:986: error: expected ')' before '*' token
mod_perl.c:994: error: expected ')' before '*' token
mod_perl.c:1016: error: expected ')' before '*' token
mod_perl.c:1057: error: expected ')' before '*' token
mod_perl.c:1140: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
mod_perl.c:1145: error: expected declaration specifiers before 'module'
mod_perl.c:1153: error: expected declaration specifiers before ';' token
mod_perl.c:1153: error: old-style parameter declarations in prototyped function definition
/tmp/httpd-2.2.14/srclib/apr/include/apr_errno.h:52: error: parameter name omitted
mod_perl.c:1153: error: expected '{' at end of input
make[1]: *** [mod_perl.o] Error 1
make: *** [modperl_lib] Error 2


any ideas how to make step further?
--



</pre>
</div>
</content>
</entry>
<entry>
<title>Apache2/mod_perl2 test in module</title>
<author><name>=?UTF-8?B?QW5kcsOpIFdhcm5pZXI=?= &lt;aw@ice-sa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c4B0B0B92.6060705@ice-sa.com%3e"/>
<id>urn:uuid:%3c4B0B0B92-6060705@ice-sa-com%3e</id>
<updated>2009-11-23T22:24:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi.

I created a perl object module which can be used by mod_perl2 handlers, 
cgi scripts, or stand-alone perl programs.
It has a new() method which creates an object $obj, which is later used 
via standard $obj-&gt;method() calls.
What would be a recommended/elegant mechanism/idiom, to have this module 
log warnings and errors appropriately, depending on where it is 
currently being used, e.g. :
- to the Apache2 error log when it is used within Apache/mod_perl2
- warn() if it is used by a stand-alone program
- ?? when used in a cgi script

Thanks for ideas/examples/pointers.




</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Announcing: Server::Control and apachectlp</title>
<author><name>Devin Teske &lt;dteske@vicor.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c1259008501.23005.64.camel@localhost.localdomain%3e"/>
<id>urn:uuid:%3c1259008501-23005-64-camel@localhost-localdomain%3e</id>
<updated>2009-11-23T20:35:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Perhaps it would be prudent to add some logic that when "lsof" is not
available, check for (and possibly use) "fstat" instead.

Do note that the syntax of these two commands (lsof vs. fstat) are not
the same and additional logic may need to be added.

Just thought I'd mention "fstat" because not all systems have
"lsof" (for example, FreeBSD vs. Linux).
--
Devin



On Mon, 2009-11-23 at 12:14 -0800, Jonathan Swartz wrote:
&gt; Server::Control allows you to control servers ala apachectl, but with  
&gt; better diagnostics and many more features. It includes both a drop-in  
&gt; replacement for apachectl (â€apachectlpâ€) and an OO interface.
&gt; 
&gt; Though it was designed with Apache in mind, there are also subclasses  
&gt; for HTTP::Server::Simple and Net::Server, and itâ€™s general enough to  
&gt; use with any server that has a pid file and listens on a port.
&gt; 
&gt; Features include:
&gt; 
&gt;      * Checks server status via both pid file and port connect
&gt;      * Detects and handles corrupt or out-of-date pid files
&gt;      * Reports what is using a port when it is busy (via lsof)
&gt;      * Tails the error log when server fails to start
&gt;      * Supports sudo usage for restricted (&lt; 1024) port
&gt;      * Easy to customize for your environment with start/stop hooks,  
&gt; etc.
&gt; 
&gt; Coming soon: plugins for common tasks associated with starting and  
&gt; stopping servers, such as generating conf files from templates and  
&gt; auto-restarting a server on file change.
&gt; 
&gt; If you try this and have problems getting it to work, or suggestions  
&gt; for improvement, please let me know!
&gt; 
&gt; Jon
&gt; 
-- 
Cheers,
Devin Teske

-&gt; CONTACT INFORMATION &lt;-
Field Engineer
FIS - Vicor Business Unit
626-573-6040 Office
510-735-5650 Mobile
devin.teske@metavante.com

-&gt; LEGAL DISCLAIMER &lt;-
This message  contains confidential  and proprietary  information
of the sender,  and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person  is strictly prohibited.  If you have  received this
message in error,  please notify  the e-mail sender  immediately,
and delete the original message without making a copy.

-&gt; END TRANSMISSION &lt;-



</pre>
</div>
</content>
</entry>
<entry>
<title>Announcing: Server::Control and apachectlp</title>
<author><name>Jonathan Swartz &lt;swartz@pobox.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c7D4E3210-8E39-47AE-BA53-ACC819CB8A25@pobox.com%3e"/>
<id>urn:uuid:%3c7D4E3210-8E39-47AE-BA53-ACC819CB8A25@pobox-com%3e</id>
<updated>2009-11-23T20:14:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Server::Control allows you to control servers ala apachectl, but with  
better diagnostics and many more features. It includes both a drop-in  
replacement for apachectl (”apachectlp”) and an OO interface.

Though it was designed with Apache in mind, there are also subclasses  
for HTTP::Server::Simple and Net::Server, and it’s general enough to  
use with any server that has a pid file and listens on a port.

Features include:

     * Checks server status via both pid file and port connect
     * Detects and handles corrupt or out-of-date pid files
     * Reports what is using a port when it is busy (via lsof)
     * Tails the error log when server fails to start
     * Supports sudo usage for restricted (&lt; 1024) port
     * Easy to customize for your environment with start/stop hooks,  
etc.

Coming soon: plugins for common tasks associated with starting and  
stopping servers, such as generating conf files from templates and  
auto-restarting a server on file change.

If you try this and have problems getting it to work, or suggestions  
for improvement, please let me know!

Jon



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Dynamically setting PerlVars in Apache per-request</title>
<author><name>Adam Prime &lt;adam.prime@utoronto.ca&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c4B0ADE8E.8090105@utoronto.ca%3e"/>
<id>urn:uuid:%3c4B0ADE8E-8090105@utoronto-ca%3e</id>
<updated>2009-11-23T19:12:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

My suggestion would be to subclass AuthDBI to make the constructor 
fiddle with the dir_config entries that AuthDBI uses.

See the docs for dir_config (the perl interface to PerlSetVar variables:

http://perl.apache.org/docs/2.0/api/Apache2/ServerUtil.html#C_dir_config_

I have no idea how subclass friendly AuthDBI is or isn't.

Adam



Tosh Cooey wrote:
&gt; WAS: A better way to handle multiple client authentication?
&gt; 
&gt; Yeah I use something similar in another application, but in this 
&gt; application I actually need to change the Auth_DBI_data_source variable 
&gt; since the "FROM pwd_table" would actually need to be "FROM 
&gt; clientA.pwd_table" and I can't see how to set this on the fly.  I could 
&gt; probably also set the: Auth_DBI_pwd_table variable as well, but again 
&gt; the per-request setting is what's throwing me off.
&gt; 
&gt; PerlSetVar Auth_DBI_data_source   DBI:mysql:clientA
&gt; or
&gt; PerlSetVar Auth_DBI_pwd_table     clientA.pwd_table
&gt; 
&gt; Which is why I thought:
&gt; 
&gt; RewriteRule ^/(.+)/$ PerlSetVar Auth_DBI_data_source DBI:mysql:$1
&gt; 
&gt; I was hoping a SetEnvIf or IfDefine would work but after reading more 
&gt; about Apache configuration I see it won't.
&gt; 
&gt; Anyway, this is straying too far into Apache territory so I guess I will 
&gt; just set those variables within a modified Apache::AuthDBI
&gt; 
&gt; I guess if anyone already knows an auth module that does that above that 
&gt; would be awesome, or if anyone knows how to easily change PerlVars on 
&gt; the fly within the Apache config/htaccess space that's be great, 
&gt; otherwise it's a small change to the above module.
&gt; 
&gt; Thanks again!
&gt; 
&gt; Tosh
&gt; 
&gt; 
&gt; William T wrote:
&gt;&gt; The documentation alludes to the variable 'pwd_whereclause'.  If this
&gt;&gt; variable is set it will be used in the passwd query.  I would try and
&gt;&gt; set it per client so that the query gets an additional where clause:
&gt;&gt;
&gt;&gt;    SELECT pwd_field FROM pwd_table WHERE uid_field = user AND client = 
&gt;&gt; clientA
&gt;&gt;
&gt;&gt;                       ^^^^^^^^^^^^^^^^^^^^^^^^
&gt;&gt;
&gt;&gt; I havn't actually tried this so I don't know if there are any caveats,
&gt;&gt; but from the docs at least it seems possible.  The only trick is
&gt;&gt; making sure you can reset the pwd_whereclause with each different
&gt;&gt; client url, and make client an additional column in your pwd_table.
&gt;&gt;
&gt;&gt; -- 
&gt;&gt; -wjt
&gt;&gt;
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Dynamically setting PerlVars in Apache per-request</title>
<author><name>Tosh Cooey &lt;tosh@1200group.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c4B0AA68C.30002@1200group.com%3e"/>
<id>urn:uuid:%3c4B0AA68C-30002@1200group-com%3e</id>
<updated>2009-11-23T15:13:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
WAS: A better way to handle multiple client authentication?

Yeah I use something similar in another application, but in this 
application I actually need to change the Auth_DBI_data_source variable 
since the "FROM pwd_table" would actually need to be "FROM 
clientA.pwd_table" and I can't see how to set this on the fly.  I could 
probably also set the: Auth_DBI_pwd_table variable as well, but again 
the per-request setting is what's throwing me off.

PerlSetVar Auth_DBI_data_source   DBI:mysql:clientA
or
PerlSetVar Auth_DBI_pwd_table     clientA.pwd_table

Which is why I thought:

RewriteRule ^/(.+)/$ PerlSetVar Auth_DBI_data_source DBI:mysql:$1

I was hoping a SetEnvIf or IfDefine would work but after reading more 
about Apache configuration I see it won't.

Anyway, this is straying too far into Apache territory so I guess I will 
just set those variables within a modified Apache::AuthDBI

I guess if anyone already knows an auth module that does that above that 
would be awesome, or if anyone knows how to easily change PerlVars on 
the fly within the Apache config/htaccess space that's be great, 
otherwise it's a small change to the above module.

Thanks again!

Tosh


William T wrote:
&gt; The documentation alludes to the variable 'pwd_whereclause'.  If this
&gt; variable is set it will be used in the passwd query.  I would try and
&gt; set it per client so that the query gets an additional where clause:
&gt; 
&gt;    SELECT pwd_field FROM pwd_table WHERE uid_field = user AND client = clientA
&gt; 
&gt;                       ^^^^^^^^^^^^^^^^^^^^^^^^
&gt; 
&gt; I havn't actually tried this so I don't know if there are any caveats,
&gt; but from the docs at least it seems possible.  The only trick is
&gt; making sure you can reset the pwd_whereclause with each different
&gt; client url, and make client an additional column in your pwd_table.
&gt; 
&gt; --
&gt; -wjt
&gt; 

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: mod-perl child process</title>
<author><name>&quot;Carl Johnstone&quot; &lt;modperl@fadetoblack.me.uk&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c84A4372F68654D10AE2EF939BB717306@men.gmnews.co.uk%3e"/>
<id>urn:uuid:%3c84A4372F68654D10AE2EF939BB717306@men-gmnews-co-uk%3e</id>
<updated>2009-11-23T14:20:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Kulasekaran, Raja wrote:
&gt; The below method used to kill the child process after the successful
&gt; execution of web request.
&gt;
&gt; $r-&gt;child_terminate();
&gt;
&gt; Can anyone suggest me where and how do I call this method in the
&gt; httpd.conf file.

You don't, you put it in your application code.

However you should not be calling this under normal circumstances as all 
it'll do is cause the current apache child process to exit and for the main 
apache process to fork another child. Which will massively increase the load 
on your server for zero gain.

Specifically having read your previous posts it will not reduce the number 
of DB connections you're seeing, as the newly-forked replacement process 
will make a new DB connection. You'll also increase the load on your DB 
server as Oracle will be constantly closing down connections and opening new 
connections - which is relatively expensive in Oracle and the reason that 
modules such as Apache::DBI exist in the first place.

Assuming that your problem is the number of Oracle processes, then you may 
be better switching to multithreaded Oracle.

You may also be able to reduce the number of connection by checking your 
code base to ensure that the same options are used whenever you request a DB 
handle.

Finally you'll be able to limit the number of connection by limiting the 
number of Apache child processes (MaxClients in httpd.conf) - however all 
that you're likely to achieve is pushing the bottleneck closer to the 
client. As Perrin has already suggested if you're not proxying or dealing 
with static content in another manner you need to ensure that these requests 
aren't going through to your mod_perl server.

Carl



</pre>
</div>
</content>
</entry>
<entry>
<title>FW: mod-perl child process</title>
<author><name>&quot;Kulasekaran, Raja&quot; &lt;Raja.Kulasekaran@netapp.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3cCF4B8324B5D2934C9377BD36E370526B0A61E638@BTCMVEXC1-PRD.hq.netapp.com%3e"/>
<id>urn:uuid:%3cCF4B8324B5D2934C9377BD36E370526B0A61E638@BTCMVEXC1-PRD-hq-netapp-com%3e</id>
<updated>2009-11-23T13:57:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi 

The below method used to kill the child process after the successful
execution of web request. 

$r-&gt;child_terminate();

Can anyone suggest me where and how do I call this method in the
httpd.conf file. 

-Raja 
 


-----Original Message-----
From: Kulasekaran, Raja 
Sent: Thursday, October 29, 2009 7:36 PM
To: Perrin Harkins
Cc: mod_perl list
Subject: RE: mod-perl child process

Hi,

The below method used to kill the child process after the successful
execution of web request. 

$r-&gt;child_terminate();

How do I get the status that particular child process has been killed ?.
Any suggestion on this ?

Raja 

-----Original Message-----
From: Kulasekaran, Raja 
Sent: Wednesday, October 28, 2009 10:02 AM
To: Perrin Harkins
Cc: mod_perl list
Subject: RE: mod-perl child process


So, How to I control this ?. Is it possible to reuse the existing
connection ?. 

Raja 

-----Original Message-----
From: Perrin Harkins [mailto:pharkins@gmail.com] 
Sent: Tuesday, October 27, 2009 11:47 PM
To: Kulasekaran, Raja
Cc: mod_perl list
Subject: Re: mod-perl child process

On Tue, Oct 27, 2009 at 8:33 AM, Kulasekaran, Raja
&lt;Raja.Kulasekaran@netapp.com&gt; wrote:
&gt; I have configured the mod_perl with oracle persistent connection
through Apache::DBI module. On every web page request It creates a
process
&gt; something like below and It never be killed automatically when the
request has completed.

That is the intended behavior.  You should get one Oracle connection
for each apache child process.  They will stay connected for the life
of the process.

- Perrin


</pre>
</div>
</content>
</entry>
<entry>
<title>AW: print throwing intermittent Segfaults [ solved ]</title>
<author><name>&quot;Denis Banovic&quot; &lt;denis.banovic@ncm.at&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c5D748E04498DCC4EA33B9AED8B7363C305DB3228@srv-exchange.ncmintern.local%3e"/>
<id>urn:uuid:%3c5D748E04498DCC4EA33B9AED8B7363C305DB3228@srv-exchange-ncmintern-local%3e</id>
<updated>2009-11-23T10:24:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Morten,

Thanks a lot,

By putting an eval around the code I found out, that the segfault was produced by next request
to the same child after the $r-&gt;print failed.
$r-&gt;print is still failing from time to time, but it's not producing segfaults anymore!

Thanks

Denis


-----Ursprüngliche Nachricht-----
Von: Morten Bjørnsvik [mailto:morten.bjornsvik@experian-da.no] 
Gesendet: Montag, 23. November 2009 10:16
An: mod_perl list
Betreff: RE: AW: print throwing intermittent Segfaults

Hi

I've had a similar error I "fixed" it by adding an eval block around the offending code which
was tracked back to MASON.

http://rt.cpan.org/Public/Bug/Display.html?id=49031

We compile everything from scratch apache,perl,mod_perl,mason, all modules by an automated
build script. 

Earlier when we run on mod_perl1.99 and the redhat stack it worked fine.
But then we had other worries :-)

--
Morten Bjoernsvik, Developer, Decision Analytics


-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com]
Sent: 23. november 2009 09:46
To: mod_perl list
Subject: Re: AW: print throwing intermittent Segfaults

Denis Banovic wrote:
&gt; Hi Willian,
&gt; 
&gt; Thanks for your checklist, I've run through it, segfaults still there...
&gt; Right now it takes less then a minute from apache restart to the first segfault.
&gt; This is from the error_log from the RedHat 5 Production machine:
&gt; 
&gt; Apache2::RequestIO::print: (103) Software caused connection abort at
&gt; 
&gt; The guys from rackspace are saying that I should recompile all my perl modules installed
directly from CPAN ( see above ) , do you think this would help?
&gt; Or has someone another hint?
&gt; 
Just my grain of salt : in my own experience, 99% of the "segfault" 
cases I have encountered, was when Apache or Perl tried to run a piece of code not meant for
this machine (such as a library meant for another machine or another OS version).
Maybe one of the modules you are using installed a wrong library ?
In that sense, the guys from rackspace may be right, although I believe that the CPAN modules
don't generally contain object-code libraries, or else they do compile them at installation.
So maybe it is a library from the RHEL repository which is wrong.


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: AW: print throwing intermittent Segfaults</title>
<author><name>=?iso-8859-1?Q?Morten_Bj=F8rnsvik?= &lt;morten.bjornsvik@experian-da.no&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3cAA95537A4624A04F8F7BB3F43D73187B19CB16@CLEX01.iq.no%3e"/>
<id>urn:uuid:%3cAA95537A4624A04F8F7BB3F43D73187B19CB16@CLEX01-iq-no%3e</id>
<updated>2009-11-23T09:15:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi

I've had a similar error I "fixed" it by adding an eval block around the
offending code which was tracked back to MASON.

http://rt.cpan.org/Public/Bug/Display.html?id=49031

We compile everything from scratch apache,perl,mod_perl,mason, all modules
by an automated build script. 

Earlier when we run on mod_perl1.99 and the redhat stack it worked fine.
But then we had other worries :-)

--
Morten Bjoernsvik, Developer, Decision Analytics


-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: 23. november 2009 09:46
To: mod_perl list
Subject: Re: AW: print throwing intermittent Segfaults

Denis Banovic wrote:
&gt; Hi Willian,
&gt; 
&gt; Thanks for your checklist, I've run through it, segfaults still there...
&gt; Right now it takes less then a minute from apache restart to the first segfault.
&gt; This is from the error_log from the RedHat 5 Production machine:
&gt; 
&gt; Apache2::RequestIO::print: (103) Software caused connection abort at 
&gt; 
&gt; The guys from rackspace are saying that I should recompile all my perl modules installed
directly from CPAN ( see above ) , do you think this would help?
&gt; Or has someone another hint?
&gt; 
Just my grain of salt : in my own experience, 99% of the "segfault" 
cases I have encountered, was when Apache or Perl tried to run a piece 
of code not meant for this machine (such as a library meant for another 
machine or another OS version).
Maybe one of the modules you are using installed a wrong library ?
In that sense, the guys from rackspace may be right, although I believe 
that the CPAN modules don't generally contain object-code libraries, or 
else they do compile them at installation.
So maybe it is a library from the RHEL repository which is wrong.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: AW: print throwing intermittent Segfaults</title>
<author><name>=?ISO-8859-1?Q?Andr=E9_Warnier?= &lt;aw@ice-sa.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c4B0A4BCB.5000303@ice-sa.com%3e"/>
<id>urn:uuid:%3c4B0A4BCB-5000303@ice-sa-com%3e</id>
<updated>2009-11-23T08:46:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Denis Banovic wrote:
&gt; Hi Willian,
&gt; 
&gt; Thanks for your checklist, I've run through it, segfaults still there...
&gt; Right now it takes less then a minute from apache restart to the first segfault.
&gt; This is from the error_log from the RedHat 5 Production machine:
&gt; 
&gt; Apache2::RequestIO::print: (103) Software caused connection abort at 
&gt; 
&gt; The guys from rackspace are saying that I should recompile all my perl modules installed
directly from CPAN ( see above ) , do you think this would help?
&gt; Or has someone another hint?
&gt; 
Just my grain of salt : in my own experience, 99% of the "segfault" 
cases I have encountered, was when Apache or Perl tried to run a piece 
of code not meant for this machine (such as a library meant for another 
machine or another OS version).
Maybe one of the modules you are using installed a wrong library ?
In that sense, the guys from rackspace may be right, although I believe 
that the CPAN modules don't generally contain object-code libraries, or 
else they do compile them at installation.
So maybe it is a library from the RHEL repository which is wrong.


</pre>
</div>
</content>
</entry>
<entry>
<title>AW: print throwing intermittent Segfaults</title>
<author><name>&quot;Denis Banovic&quot; &lt;denis.banovic@ncm.at&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c5D748E04498DCC4EA33B9AED8B7363C305DB3206@srv-exchange.ncmintern.local%3e"/>
<id>urn:uuid:%3c5D748E04498DCC4EA33B9AED8B7363C305DB3206@srv-exchange-ncmintern-local%3e</id>
<updated>2009-11-23T08:27:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Willian,

Thanks for your checklist, I've run through it, segfaults still there...
Right now it takes less then a minute from apache restart to the first segfault.
This is from the error_log from the RedHat 5 Production machine:

Apache2::RequestIO::print: (103) Software caused connection abort at 

The guys from rackspace are saying that I should recompile all my perl modules installed directly
from CPAN ( see above ) , do you think this would help?
Or has someone another hint?

Thanks

Denis

-----Ursprüngliche Nachricht-----
Von: William T [mailto:dietbuddha@gmail.com] 
Gesendet: Samstag, 21. November 2009 19:28
An: Denis Banovic
Cc: modperl@perl.apache.org
Betreff: Re: print throwing intermittent Segfaults

This is the list of stuff I usually start with when I get a problem that doesn't seem to be
tied to a particular code path.

  * code path - perhaps a particular code path is only being exercised rarely, and it has
a bug
  * forking - when child dies, all open descriptors in it's name space also get closed
  * eval - always a good thing to look at when weird things happen
  * persistancy - globals, closures, persistant objects, serialized/restored objects, shared
memory, shared objects (between
processes)

-wjt


--------------------------------------------------------------------------------
Von: Denis Banovic [mailto:denis.banovic@ncm.at] 
Gesendet: Samstag, 21. November 2009 10:43
An: modperl@perl.apache.org
Betreff: print throwing intermittent Segfaults


Hi Everybody,

I'm having big problems with mod_perl throwing intermittent Segmentation faults our production
machines on RHEL 4 &amp; 5.
To be able to produce a core dump on this segfaults I've installed mod_dumpcore from this
tutorial:
http://mituzas.lt/2009/09/26/getting-apache-core-dumps-in-linux/

gdb /usr/sbin/httpd core.1 produces following output:

#0  0x00b29f4b in XS_Apache__RequestRec_content_type ()  from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/Apache/RequestRec/RequestRec.so

and very rarely ( 1 in 15 )

#0  0x003830b9 in apr_palloc () from /usr/lib/libapr-0.so.0


The content-type is set by
$r-&gt;content_type("text/html; charset=iso-8859-1") but this is not what is causing him to
segfault...

By try and error I've figured out that the segfault happens when I do a
$r-&gt;print($mypagecontent);

I've even tried to do a
unless($r-&gt;connection-&gt;aborted) {
    $r-&gt;print($mypagecontent);
}
 but this didn't help either.

The segfault happens randomly, between 30 and 250 mod_perl requests. There is no specific
request URL or script that causes him to segfault, it just happens after some time.
More load on the server means more segfaults. 

&gt;From my Apache Config:
&lt;IfModule prefork.c&gt;
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       200
MaxRequestsPerChild  15
&lt;/IfModule&gt;

There are some additional Perl Modules that I've build from CPAN:
Compress-Zlib-2.004
Digest-MD5-2.39
Email-MIME-1.861
Email-MIME-ContentType-1.014
Email-MIME-Encodings-1.311
Email-Simple-2.004
Encode-Detect-1.01
ExtUtils-CBuilder-0.23
File-Slurp-9999.12
IO-Compress-Zlib-2.004
MIME-Base64-3.07
MIME-Types-1.24
Module-Build-0.2808
Pod-Escapes-1.04
Pod-Simple-3.07
String-Similarity-1.03
Template-Plugin-XML-Escape-0.02
Test-Pod-1.26
Test-Simple-0.80

Has anyone a hint where to start looking and what to do next to figure out why this segfault
is happening?

Thanks

Denis


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Changing apache config with mod_perl, doesnt work!</title>
<author><name>&quot;Philippe M. Chiasson&quot; &lt;gozer@ectoplasm.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c4B09FAA3.5000407@ectoplasm.org%3e"/>
<id>urn:uuid:%3c4B09FAA3-5000407@ectoplasm-org%3e</id>
<updated>2009-11-23T02:59:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On 09-11-22 17:42 , Devrim Yasar wrote:
&gt; This script supposedly should take * out of *.domain.com, assign it to
&gt; $subdomain variable, and $subdomain should be put to AssignUserId.
&gt; 
&gt; However, no matter how hard I try, I can't get this to work. I've been
&gt; working on this for days, and am really desperate. If you think this is
&gt; a lot of work, please charge me consultancy and come get the root passwd.
&gt; 
&gt; Any ideas though? Thanks...
&gt; 
&gt; |&lt;Perl&gt;
&gt;  Use Apache2::ServerRec qw//; 
&gt;  use Apache2::ServerUtil qw//; 
&gt;  use Apache2::RequestRec qw//; 
&gt;  use Apache2::RequestUtil qw//; 
&gt;  use Apache2::Const qw/OK DECLINED/; 
&gt; 
&gt;  my $s = Apache2::ServerUtil-&gt;server; 
&gt; 
&gt;  $s-&gt;push_handlers(PerlHeaderParserHandler =&gt; sub { my($r) = @_; 

From a quick glance at the mpm-itk source-code, it does its magic in at
the headerparsing phase, so your attempt at using that phase to alter
it's behaviour was a good one.

 /* set the uid as fast as possible, but not before merging per-dit
config */
 ap_hook_header_parser(itk_post_perdir_config, NULL, NULL,
APR_HOOK_REALLY_FIRST);

Unfortunately, it seems to pick APR_HOOK_REALLY_FIRST as precedence,
which makes it run /before/ your code, in the same phase. So, even
though you actually succeed at changing it's run-time configuration, you
do it too late, and it doesn't even look at it.

&gt;  if ( $r-&gt;hostname =~ m/(.*)\.([^.]+\.\w+)$/ ) { 
&gt;  my($subdomain,$domain) = ($1,$2); 
&gt; 
&gt;  #
&gt;  # THIS WORKS!
&gt;  # -----------
&gt;  # if requested domain is fio.domain.com &lt;http://fio.domain.com/&gt;,
&gt;  # this successfully assigns ServerAdmin fio@domain.com &lt;mailto:fio@domain.com&gt;
&gt;  # so gathering domain parts working
&gt; 
&gt;  $r-&gt;server-&gt;server_admin("$subdomain\@$domain");

Yes, as expected, and it uses a published API to do that.

&gt;  #
&gt;  # THIS DOESN'T!
&gt;  # --------------
&gt;  # this is supposed to insert this line inside Virtual host
&gt;  # --------------
&gt;  # &lt;IfModule mpm_itk_module&gt; AssignUserId fio domain&lt;/IfModule&gt;
&gt;  # --------------
&gt; 
&gt;  $r-&gt;add_config([ "&lt;IfModule mpm_itk_module&gt;", 
&gt;  "AssignUserId $subdomain $domain", 
&gt;  "&lt;/IfModule&gt;", 
&gt;  ]); 
&gt; 

Except for my above explanation, this would work just fine. I would
however caution about using this kind of mechanism to alter run-time
configuration on a per-request basis. This comes at a non-negligable
performance impact, if that's important to your usage scenario.

Ideally, like in the server_admin() case outlined above, mpm-itk
could/should expose an API to allow for changing the userid/domain.

You could try and use PerlMapToStorageHandler as your phase, since it
happens before the PerlHeaderParserHandler phase.

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/



</pre>
</div>
</content>
</entry>
<entry>
<title>Changing apache config with mod_perl, doesnt work!</title>
<author><name>Devrim Yasar &lt;devrim@kodingen.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3cB98D2804-0353-4148-B08C-1BFAF2E341AC@kodingen.com%3e"/>
<id>urn:uuid:%3cB98D2804-0353-4148-B08C-1BFAF2E341AC@kodingen-com%3e</id>
<updated>2009-11-22T23:01:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
This script supposedly should take * out of *.domain.com, assign it to  
$subdomain variable, and $subdomain should be put to AssignUserId.

However, no matter how hard I try, I can't get this to work. I've been  
working on this for days, and am really desperate. If you think this  
is a lot of work, please charge me consultancy and come get the root  
passwd.

Any ideas though? Thanks...

&lt;Perl&gt;
  Use Apache2::ServerRec qw//;
  use Apache2::ServerUtil qw//;
  use Apache2::RequestRec qw//;
  use Apache2::RequestUtil qw//;
  use Apache2::Const qw/OK DECLINED/;

  my $s = Apache2::ServerUtil-&gt;server;

  $s-&gt;push_handlers(PerlHeaderParserHandler =&gt; sub { my($r) = @_;
  if ( $r-&gt;hostname =~ m/(.*)\.([^.]+\.\w+)$/ ) {
  my($subdomain,$domain) = ($1,$2);

  #
  # THIS WORKS!
  # -----------
  # if requested domain is fio.domain.com,
  # this successfully assigns ServerAdmin fio@domain.com
  # so gathering domain parts working

  $r-&gt;server-&gt;server_admin("$subdomain\@$domain");

  #
  # THIS DOESN'T!
  # --------------
  # this is supposed to insert this line inside Virtual host
  # --------------
  # &lt;IfModule mpm_itk_module&gt; AssignUserId fio domain&lt;/IfModule&gt;
  # --------------

  $r-&gt;add_config([ "&lt;IfModule mpm_itk_module&gt;",
  "AssignUserId $subdomain $domain",
  "&lt;/IfModule&gt;",
  ]);

  if ( $@ ) { warn $@ }


  return OK;

  } else {
  return DECLINED;
  }
  });
&lt;/Perl&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Changing apache config with mod_perl, doesnt work!</title>
<author><name>Devrim Yasar &lt;devrim@kodingen.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3cDA50FA90-5D4A-4939-9132-56E056ADAB29@kodingen.com%3e"/>
<id>urn:uuid:%3cDA50FA90-5D4A-4939-9132-56E056ADAB29@kodingen-com%3e</id>
<updated>2009-11-22T22:42:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
This script supposedly should take * out of *.domain.com, assign it to  
$subdomain variable, and $subdomain should be put to AssignUserId.

However, no matter how hard I try, I can't get this to work. I've been  
working on this for days, and am really desperate. If you think this  
is a lot of work, please charge me consultancy and come get the root  
passwd.

Any ideas though? Thanks...

&lt;Perl&gt;
  Use Apache2::ServerRec qw//;
  use Apache2::ServerUtil qw//;
  use Apache2::RequestRec qw//;
  use Apache2::RequestUtil qw//;
  use Apache2::Const qw/OK DECLINED/;

  my $s = Apache2::ServerUtil-&gt;server;

  $s-&gt;push_handlers(PerlHeaderParserHandler =&gt; sub { my($r) = @_;
  if ( $r-&gt;hostname =~ m/(.*)\.([^.]+\.\w+)$/ ) {
  my($subdomain,$domain) = ($1,$2);

  #
  # THIS WORKS!
  # -----------
  # if requested domain is fio.domain.com,
  # this successfully assigns ServerAdmin fio@domain.com
  # so gathering domain parts working

  $r-&gt;server-&gt;server_admin("$subdomain\@$domain");

  #
  # THIS DOESN'T!
  # --------------
  # this is supposed to insert this line inside Virtual host
  # --------------
  # &lt;IfModule mpm_itk_module&gt; AssignUserId fio domain&lt;/IfModule&gt;
  # --------------

  $r-&gt;add_config([ "&lt;IfModule mpm_itk_module&gt;",
  "AssignUserId $subdomain $domain",
  "&lt;/IfModule&gt;",
  ]);

  if ( $@ ) { warn $@ }


  return OK;

  } else {
  return DECLINED;
  }
  });
&lt;/Perl&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>'make test' Failure</title>
<author><name>greg.george@orica.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3cOFC934C893.D0F7F0E9-ONCA257673.001BF165-CA257676.0077871A@orica.com%3e"/>
<id>urn:uuid:%3cOFC934C893-D0F7F0E9-ONCA257673-001BF165-CA257676-0077871A@orica-com%3e</id>
<updated>2009-11-22T21:45:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
1. Problem Description:

make test fails to start the httpd - failure message:
[error] Insecure directory in $ENV{PATH} while running with -T switch at 
/opt/apache/perl/.cpan/build/mod_perl-2.0.4-xDMqqj/Apache-Test/lib/Apache/TestConfig.pm 
line 1108
[error] Can't load Perl file: 
/opt/apache/perl/.cpan/build/mod_perl-2.0.4-xDMqqj/t/conf/modperl_startup.pl 
for server loopback:8529, exiting...
[error] server failed to start! (t/logs/error_log wasn't created, start 
the server in the debug mode)

Apache/2.2.11 mod_perl/2.0.4 Perl/v5.10.1 all built with gcc
  gcc -v
  Using built-in specs.
  Target: powerpc-ibm-aix5.3.0.0
  Configured with: ../gcc-4.1.1/configure --disable-nls
  Thread model: aix
  gcc version 4.1.1

2. Used Components and their Configuration:

*** mod_perl version 2.000004

*** using 
/opt/apache/perl/.cpan/build/mod_perl-2.0.4-xDMqqj/lib/Apache2/BuildConfig.pm

*** Makefile.PL options:
  MP_APR_LIB     =&gt; aprext
  MP_APXS        =&gt; /opt/apache/bin/apxs
  MP_COMPAT_1X   =&gt; 1
  MP_GENERATE_XS =&gt; 1
  MP_LIBNAME     =&gt; mod_perl
  MP_USE_DSO     =&gt; 1


*** /opt/apache/bin/httpd -V
Server version: Apache/2.2.11 (Unix)
Server built:   Jul 22 2009 17:20:13
Server's Module Magic Number: 20051115:21
Server loaded:  APR 1.3.3, APR-Util 1.3.4
Compiled using: APR 1.3.3, APR-Util 1.3.4
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/opt/apache"
 -D SUEXEC_BIN="/opt/apache/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

*** /usr/bin/ldd /opt/apache/bin/httpd
/opt/apache/bin/httpd needs:
         /opt/apache/lib/libaprutil-1.so
         /opt/apache/lib/libapr-1.so
         /usr/lib/libpthread.a(shr_comm.o)
         /usr/lib/libpthread.a(shr_xpg5.o)
         /usr/lib/libc.a(shr.o)
         /usr/lib/librtl.a(shr.o)
         /opt/apache/lib/libexpat.a(libexpat.so.0)
         /usr/lib/libiconv.a(shr4.o)
 
/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.1.1/../../../libgcc_s.a(shr.o)
         /usr/lib/libpthreads.a(shr_comm.o)
         /unix
         /usr/lib/libcrypt.a(shr.o)


*** (apr|apu)-config linking info

 -L/opt/apache/lib -laprutil-1  -lexpat -liconv
 -L/opt/apache/lib -lapr-1 -lpthread -Wl,-brtl



*** /opt/apache/perl/bin/perl -V
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

  Platform:
    osname=aix, osvers=5.3.0.0, archname=aix
    uname='aix aumnp113s 3 5 00c7434d4c00 '
    config_args='-Dprefix=/opt/apache/perl -Dcc=gcc'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc -maix32', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE 
-D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe 
-I/usr/local/include -I/opt/local/include -D_LARGE_FILES',
    optimize='-O',
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE 
-DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe -I/usr/local/include 
-I/opt/local/include'
    ccversion='', gccversion='4.1.1', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc -maix32', ldflags =' -Wl,-brtl -Wl,-bdynamic -L/usr/local/lib 
-L/opt/local/lib -Wl,-b32 -Wl,-bmaxdata:0x80000000'
    libpth=/usr/local/lib /opt/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lc
    perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc
    libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Xlinker 
-bE:/opt/apache/perl/lib/5.10.1/aix/CORE/perl.exp'
    cccdlflags=' ', lddlflags='  -Wl,-bhalt:4 -Wl,-G 
-Wl,-bI:$(PERL_INC)/perl.exp -Wl,-bE:$(BASEEXT).exp -Wl,-bnoentry -lc -lm 
-L/usr/local/lib -L/opt/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP 
USE_FAST_STDIO
                        USE_LARGE_FILES USE_PERLIO
  Built under aix
  Compiled at Sep 18 2009 09:36:22
  %ENV:
    PERL5LIB=""
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /opt/apache/perl/lib/5.10.1/aix
    /opt/apache/perl/lib/5.10.1
    /opt/apache/perl/lib/site_perl/5.10.1/aix
    /opt/apache/perl/lib/site_perl/5.10.1
    .

*** Packages of interest status:

Apache2            : -
Apache2::Request   : -
CGI                : 3.48
ExtUtils::MakeMaker: 6.55_02
LWP                : 5.833
mod_perl           : -
mod_perl2          : - 

 perl Makefile.PL MP_APXS=/opt/apache/bin/apxs
Reading Makefile.PL args from @ARGV
   MP_APXS = /opt/apache/bin/apxs
no conflicting prior mod_perl version found - good.
Configuring Apache/2.2.11 mod_perl/2.0.4 Perl/v5.10.1


3. This is the core dump trace: (if you get a core dump):

  No core dump
  No t/logs/error_log

This report was generated by t/REPORT on Thu Nov 19 05:04:07 2009 GMT.

Regards,
Greg George
IT Shared Services
Phone: +613-9091-2492
3/100 Victoria Prd, Melbourne

Please consider the environment before printing this e-mail
***********************************************************************************************************************************************************************************************
Please consider the environment before printing this e-mail.

This message is intended solely for the individual(s) and entity(s) addressed. It is confidential
and may contain legally privileged information. The use, copying or distribution of this 
message or any information it contains, by anyone other than the addressee, is prohibited.
If you have received this message in error, please notify postmaster@orica.com. The mailbox
address 
from which this message has been sent is for business mail only. Mail sent to it may be subject
to security scanning and delivery on non-business messages sent to this address may not occur.

Thank you.
***********************************************************************************************************************************************************************************************


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: APR::Request gets Symbol Not Found</title>
<author><name>Bill Karwin &lt;bill@karwin.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c26459979.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26459979-post@talk-nabble-com%3e</id>
<updated>2009-11-21T20:45:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>



Joe Schaefer-6 wrote:
&gt; 
&gt; Did you remember to load mod_apreq2 into httpd?
&gt; Typically requires a LoadModule apreq_module modules/mod_apreq2.so
&gt; 

That did it!  Thanks very much.  I now can start Apache with mod_perl and
mod_apreq2, and I believe server-info confirms it:

Apache/2.2.14 (Unix) DAV/2 PHP/5.3.0 mod_fastcgi/2.4.6
mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.8.9 Server at
local.karwin.com Port 80

Regards,
Bill Karwin
-- 
View this message in context: http://old.nabble.com/APR%3A%3ARequest-gets-Symbol-Not-Found-tp26419579p26459979.html
Sent from the mod_perl - General mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: APR::Request gets Symbol Not Found</title>
<author><name>Joe Schaefer &lt;joe_schaefer@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c953420.12977.qm@web54401.mail.re2.yahoo.com%3e"/>
<id>urn:uuid:%3c953420-12977-qm@web54401-mail-re2-yahoo-com%3e</id>
<updated>2009-11-21T18:42:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Did you remember to load mod_apreq2 into httpd?
Typically requires a LoadModule apreq_module modules/mod_apreq2.so



----- Original Message ----
&gt; From: Bill Karwin &lt;bill@karwin.com&gt;
&gt; To: modperl@perl.apache.org
&gt; Sent: Sat, November 21, 2009 1:27:31 PM
&gt; Subject: Re: APR::Request gets Symbol Not Found
&gt; 
&gt; 
&gt; 
&gt; 
&gt; Perrin Harkins-3 wrote:
&gt; &gt; 
&gt; &gt; You can't load some of the Apache:: modules from the command-line.
&gt; &gt; They depend on the apache environment to run.  Try loading it from
&gt; &gt; your httpd.conf instead.
&gt; &gt; 
&gt; 
&gt; Hi Perrin, thanks for your quick reply.  I tried your suggestion but I got a
&gt; similar error as I got from the command line.
&gt; 
&gt; I added this in httpd-vhosts.conf:
&gt; 
&gt; PerlModule APR::Request
&gt; 
&gt; I tried restarting Apache and this appeared in my Apache error_log:
&gt; 
&gt; [Fri Nov 20 23:22:36 2009] [error] 
&gt; Can't load
&gt; '/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/APR/Request/Request.bundle'

&gt; 
&gt; for module APR::Request:
&gt; dlopen(/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/APR/Request/Request.bundle,
&gt; 1): 
&gt; Symbol not found: _apreq_hook_disable_uploads\n  
&gt; Referenced from:
&gt; /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/APR/Request/Request.bundle\n
 
&gt; 
&gt; Expected in: dynamic lookup\n at (eval 2) line 3\nCompilation failed in
&gt; require at (eval 2) line 3.\n
&gt; 
&gt; Regards,
&gt; Bill Karwin
&gt; 
&gt; -- 
&gt; View this message in context: 
&gt; http://old.nabble.com/APR%3A%3ARequest-gets-Symbol-Not-Found-tp26419579p26459073.html
&gt; Sent from the mod_perl - General mailing list archive at Nabble.com.



      


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: print throwing intermittent Segfaults</title>
<author><name>William T &lt;dietbuddha@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c59a07310911211027o6c2fb5f0s2c684b75fe2387d0@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59a07310911211027o6c2fb5f0s2c684b75fe2387d0@mail-gmail-com%3e</id>
<updated>2009-11-21T18:27:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
This is the list of stuff I usually start with when I get a problem
that doesn't seem to be tied to a particular code path.

  * code path - perhaps a particular code path is only being exercised
rarely, and it has a bug
  * forking - when child dies, all open descriptors in it's name space
also get closed
  * eval - always a good thing to look at when weird things happen
  * persistancy - globals, closures, persistant objects,
serialized/restored objects, shared memory, shared objects (between
processes)

-wjt


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: APR::Request gets Symbol Not Found</title>
<author><name>Bill Karwin &lt;bill@karwin.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c26459073.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26459073-post@talk-nabble-com%3e</id>
<updated>2009-11-21T18:27:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>



Perrin Harkins-3 wrote:
&gt; 
&gt; You can't load some of the Apache:: modules from the command-line.
&gt; They depend on the apache environment to run.  Try loading it from
&gt; your httpd.conf instead.
&gt; 

Hi Perrin, thanks for your quick reply.  I tried your suggestion but I got a
similar error as I got from the command line.

I added this in httpd-vhosts.conf:

PerlModule APR::Request

I tried restarting Apache and this appeared in my Apache error_log:

[Fri Nov 20 23:22:36 2009] [error] 
Can't load
'/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/APR/Request/Request.bundle' 
for module APR::Request:
dlopen(/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/APR/Request/Request.bundle,
1): 
Symbol not found: _apreq_hook_disable_uploads\n  
Referenced from:
/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/APR/Request/Request.bundle\n  
Expected in: dynamic lookup\n at (eval 2) line 3\nCompilation failed in
require at (eval 2) line 3.\n

Regards,
Bill Karwin

-- 
View this message in context: http://old.nabble.com/APR%3A%3ARequest-gets-Symbol-Not-Found-tp26419579p26459073.html
Sent from the mod_perl - General mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: A better way to handle multiple client authentication?</title>
<author><name>William T &lt;dietbuddha@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c59a07310911211011i1a186bb2w2f9561df393d49a3@mail.gmail.com%3e"/>
<id>urn:uuid:%3c59a07310911211011i1a186bb2w2f9561df393d49a3@mail-gmail-com%3e</id>
<updated>2009-11-21T18:11:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The documentation alludes to the variable 'pwd_whereclause'.  If this
variable is set it will be used in the passwd query.  I would try and
set it per client so that the query gets an additional where clause:

   SELECT pwd_field FROM pwd_table WHERE uid_field = user AND client = clientA

                      ^^^^^^^^^^^^^^^^^^^^^^^^

I havn't actually tried this so I don't know if there are any caveats,
but from the docs at least it seems possible.  The only trick is
making sure you can reset the pwd_whereclause with each different
client url, and make client an additional column in your pwd_table.

--
-wjt


</pre>
</div>
</content>
</entry>
<entry>
<title>A better way to handle multiple client authentication?</title>
<author><name>Tosh Cooey &lt;tosh@1200group.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c4B07D2D3.70303@1200group.com%3e"/>
<id>urn:uuid:%3c4B07D2D3-70303@1200group-com%3e</id>
<updated>2009-11-21T11:45:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Right now I have an application set up for multiple clients: clientA, 
clientB, clientC.

Each client has their own users.

The way I have it setup is clientA goes to http://www.site.com/clientA 
and is presented with a login screen which is triggered by an .htaccess 
file in a directory called /clientA. The .htaccess file directs Apache 
to perform DBI-based authentication using Apache::AuthDBI.

PerlSetVar Auth_DBI_data_source DBI:mysql:clientA

This works great, but I am aware of the limitations and I would like to 
set up some rules in the Apache config that accomplish this all without 
.htaccess files in every directory for every client (gonna get tricky 
around 100,000 clients for sure!)

Is this even possible? Can I do something like:

RewriteRule ^/(.+)/$ PerlSetVar Auth_DBI_data_source DBI:mysql:$1

Or do I have to create my own authentication module?

Thanks for any direction... And sorry if this is better for the Apache 
mailing list, I'm always a bit uncertain which group I should ask first...

Tosh

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


</pre>
</div>
</content>
</entry>
<entry>
<title>print throwing intermittent Segfaults</title>
<author><name>&quot;Denis Banovic&quot; &lt;denis.banovic@ncm.at&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/perl-modperl/200911.mbox/%3c5D748E04498DCC4EA33B9AED8B7363C3131E7E@srv-exchange.ncmintern.local%3e"/>
<id>urn:uuid:%3c5D748E04498DCC4EA33B9AED8B7363C3131E7E@srv-exchange-ncmintern-local%3e</id>
<updated>2009-11-21T09:43:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Everybody,
 
I'm having big problems with mod_perl throwing intermittent Segmentation faults our production
machines on RHEL 4 &amp; 5.
To be able to produce a core dump on this segfaults I've installed mod_dumpcore from this
tutorial:
http://mituzas.lt/2009/09/26/getting-apache-core-dumps-in-linux/
 
gdb /usr/sbin/httpd core.1 produces following output:
 
#0  0x00b29f4b in XS_Apache__RequestRec_content_type ()  from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/Apache/RequestRec/RequestRec.so
 
and very rarely ( 1 in 15 )
 
#0  0x003830b9 in apr_palloc () from /usr/lib/libapr-0.so.0
 
 
The content-type is set by
$r-&gt;content_type("text/html; charset=iso-8859-1") but this is not what is causing him to
segfault...
 
By try and error I've figured out that the segfault happens when I do a
$r-&gt;print($mypagecontent);
 
I've even tried to do a
unless($r-&gt;connection-&gt;aborted) {
    $r-&gt;print($mypagecontent);
}
 but this didn't help either.
 
The segfault happens randomly, between 30 and 250 mod_perl requests. There is no specific
request URL or script that causes him to segfault, it just happens after some time.
More load on the server means more segfaults. 
 
&gt;From my Apache Config:
&lt;IfModule prefork.c&gt;
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       200
MaxRequestsPerChild  15
&lt;/IfModule&gt;

There are some additional Perl Modules that I've build from CPAN:
Compress-Zlib-2.004
Digest-MD5-2.39
Email-MIME-1.861
Email-MIME-ContentType-1.014
Email-MIME-Encodings-1.311
Email-Simple-2.004
Encode-Detect-1.01
ExtUtils-CBuilder-0.23
File-Slurp-9999.12
IO-Compress-Zlib-2.004
MIME-Base64-3.07
MIME-Types-1.24
Module-Build-0.2808
Pod-Escapes-1.04
Pod-Simple-3.07
String-Similarity-1.03
Template-Plugin-XML-Escape-0.02
Test-Pod-1.26
Test-Simple-0.80
 
Has anyone a hint where to start looking and what to do next to figure out why this segfault
is happening?
 
Thanks
 
Denis
 


</pre>
</div>
</content>
</entry>
</feed>
