[website] Incomplete information on the /about/license.html page

2007-10-09 Thread Mark Hindess

The web page at:

  http://perl.apache.org/about/license.html

only mentions the Apache Software License, Version 1.1 but mod_perl
2.0 is licensed under the Apache License, Version 2.0.

Perhaps this page should be update to include the new license (as well)?

Regards,
-Mark.




RE: Apache crashing

2007-10-09 Thread Ian G. Tyndall
Ok, I decided to upgrade my Apache to see if that would fix things.

I installed 2.2.4, and I was getting the same error as originally
reported... but more often.
Then, I upgraded to 2.2.6 from the Apachelounge... and now I'm getting
an error.

The error is as follows:

[Tue Oct 09 08:50:20 2007] [error] [client 192.168.3.28] failed to
resolve handler `ModPerl::Registry': Can't load
'X:/perl/5.8.8/site/lib/auto/Apache2/RequestRec/RequestRec.dll' for
module Apache2::RequestRec: load_file:The specified procedure could not
be found at X:/perl/5.8.8/lib/XSLoader.pm line 64.\n at
X:/perl/5.8.8/site/lib/Apache2/XSLoader.pm line 31\nCompilation failed
in require at X:/perl/5.8.8/site/lib/ModPerl/RegistryCooker.pm line
32.\nBEGIN failed--compilation aborted at
X:/perl/5.8.8/site/lib/ModPerl/RegistryCooker.pm line 32.\nCompilation
failed in require at (eval 5) line 3.\n\t...propagated at
X:/perl/5.8.8/lib/base.pm line 91.\nBEGIN failed--compilation aborted at
X:/perl/5.8.8/site/lib/ModPerl/Registry.pm line 26.\nCompilation failed
in require at (eval 4) line 3.\n

I did do a fresh install of ModPerl 2.0.3, and I've seen similar failed
to resolve handler messages on the web... but nothing like this.

Any suggestions/thoughts!

Thanks again,
Ian
 

-Original Message-
From: Randy Kobes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 04, 2007 3:40 PM
To: Ian G. Tyndall
Cc: modperl@perl.apache.org
Subject: Re: Apache crashing

On Thu, 4 Oct 2007, Ian G. Tyndall wrote:

 Oh the problems come and go so quickly!

 I've got one cgi script that always crashes apache. The error log 
 gives the following message:

 [Thu Oct 04 11:38:29 2007] [crit] (22)Invalid argument: Parent: Failed

 to create the child process.
 [Thu Oct 04 11:38:29 2007] [crit] (OS 6)The handle is invalid.  :
 master_main: create child process failed. Exiting.
 [Thu Oct 04 11:38:29 2007] [notice] Parent: Forcing termination of 
 child process 2474288

 Other scripts run fine... so what would be the best way of debugging 
 this.

 I'm in the process of commenting out modules/code, but no luck so
far...
 any recommendations?

 I'm using mod_perl 2.0.3, perl 5.8.8, apache 2.0.59 on a Windows 2003 
 server.

 Thanks,
 Ian

Is this a cgi script, or a mod_perl registry script?
Although the log messages are generic, similar messages appear when one
tries to restart apache with mod_perl enabled - if it's a cgi script,
does commenting out the loading of mod_perl.so help?

As for tracking down the problem, reducing it to a minimal version will
help. If you can do this, and don't see the problem, try posting it to
the list here. Also, trying some of the debugging tips suggested in the
thread
   http://marc.info/?t=11913767701r=1w=2
may help, along with installing
   http://www.apache.org/dist/httpd/binaries/win32/#source
to help in the crash analysis.

--
best regards,
Randy


Re: Apache crashing

2007-10-09 Thread Foo JH

What's your modperl config like?

Ian G. Tyndall wrote:

Ok, I decided to upgrade my Apache to see if that would fix things.

I installed 2.2.4, and I was getting the same error as originally
reported... but more often.
Then, I upgraded to 2.2.6 from the Apachelounge... and now I'm getting
an error.

The error is as follows:

[Tue Oct 09 08:50:20 2007] [error] [client 192.168.3.28] failed to
resolve handler `ModPerl::Registry': Can't load
'X:/perl/5.8.8/site/lib/auto/Apache2/RequestRec/RequestRec.dll' for
module Apache2::RequestRec: load_file:The specified procedure could not
be found at X:/perl/5.8.8/lib/XSLoader.pm line 64.\n at
X:/perl/5.8.8/site/lib/Apache2/XSLoader.pm line 31\nCompilation failed
in require at X:/perl/5.8.8/site/lib/ModPerl/RegistryCooker.pm line
32.\nBEGIN failed--compilation aborted at
X:/perl/5.8.8/site/lib/ModPerl/RegistryCooker.pm line 32.\nCompilation
failed in require at (eval 5) line 3.\n\t...propagated at
X:/perl/5.8.8/lib/base.pm line 91.\nBEGIN failed--compilation aborted at
X:/perl/5.8.8/site/lib/ModPerl/Registry.pm line 26.\nCompilation failed
in require at (eval 4) line 3.\n

I did do a fresh install of ModPerl 2.0.3, and I've seen similar failed
to resolve handler messages on the web... but nothing like this.

Any suggestions/thoughts!

Thanks again,
Ian
 


-Original Message-
From: Randy Kobes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 04, 2007 3:40 PM

To: Ian G. Tyndall
Cc: modperl@perl.apache.org
Subject: Re: Apache crashing

On Thu, 4 Oct 2007, Ian G. Tyndall wrote:

  

Oh the problems come and go so quickly!

I've got one cgi script that always crashes apache. The error log 
gives the following message:


[Thu Oct 04 11:38:29 2007] [crit] (22)Invalid argument: Parent: Failed



  

to create the child process.
[Thu Oct 04 11:38:29 2007] [crit] (OS 6)The handle is invalid.  :
master_main: create child process failed. Exiting.
[Thu Oct 04 11:38:29 2007] [notice] Parent: Forcing termination of 
child process 2474288


Other scripts run fine... so what would be the best way of debugging 
this.


I'm in the process of commenting out modules/code, but no luck so


far...
  

any recommendations?

I'm using mod_perl 2.0.3, perl 5.8.8, apache 2.0.59 on a Windows 2003 
server.


Thanks,
Ian



Is this a cgi script, or a mod_perl registry script?
Although the log messages are generic, similar messages appear when one
tries to restart apache with mod_perl enabled - if it's a cgi script,
does commenting out the loading of mod_perl.so help?

As for tracking down the problem, reducing it to a minimal version will
help. If you can do this, and don't see the problem, try posting it to
the list here. Also, trying some of the debugging tips suggested in the
thread
   http://marc.info/?t=11913767701r=1w=2
may help, along with installing
   http://www.apache.org/dist/httpd/binaries/win32/#source
to help in the crash analysis.

--
best regards,
Randy
  




RE: Apache crashing

2007-10-09 Thread Ian G. Tyndall
 My virtual host:

VirtualHost *:80
ServerName mysite.com
DocumentRoot X:/htdocs/sites/mysite_dev
ScriptAlias /cgi-bin/admin/
X:/htdocs/sites/mysite_dev/cgi-bin/admin/
ErrorLog logs/rt-error.log
Directory X:/htdocs/sites/mysite_dev
  Options +ExecCGI
  Order allow,deny
  Allow from all 
Files ~ \.(cgi)$
SetHandler perl-script
PerlHandler ModPerl::Registry
PerlSendHeader On
/Files
/Directory
/VirtualHost

Earlier in the conf, I'm doing:

PerlSwitches -IX:/perl/5.8.8/site/lib
PerlInitHandler Apache2::Reload
PerlHandler ModPerl::Registry

-Original Message-
From: Foo JH [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 09, 2007 12:43 PM
To: Ian G. Tyndall
Cc: modperl@perl.apache.org
Subject: Re: Apache crashing

What's your modperl config like?

Ian G. Tyndall wrote:
 Ok, I decided to upgrade my Apache to see if that would fix things.

 I installed 2.2.4, and I was getting the same error as originally 
 reported... but more often.
 Then, I upgraded to 2.2.6 from the Apachelounge... and now I'm getting

 an error.

 The error is as follows:

 [Tue Oct 09 08:50:20 2007] [error] [client 192.168.3.28] failed to 
 resolve handler `ModPerl::Registry': Can't load 
 'X:/perl/5.8.8/site/lib/auto/Apache2/RequestRec/RequestRec.dll' for 
 module Apache2::RequestRec: load_file:The specified procedure could 
 not be found at X:/perl/5.8.8/lib/XSLoader.pm line 64.\n at 
 X:/perl/5.8.8/site/lib/Apache2/XSLoader.pm line 31\nCompilation failed

 in require at X:/perl/5.8.8/site/lib/ModPerl/RegistryCooker.pm line 
 32.\nBEGIN failed--compilation aborted at 
 X:/perl/5.8.8/site/lib/ModPerl/RegistryCooker.pm line 32.\nCompilation

 failed in require at (eval 5) line 3.\n\t...propagated at 
 X:/perl/5.8.8/lib/base.pm line 91.\nBEGIN failed--compilation aborted 
 at X:/perl/5.8.8/site/lib/ModPerl/Registry.pm line 26.\nCompilation 
 failed in require at (eval 4) line 3.\n

 I did do a fresh install of ModPerl 2.0.3, and I've seen similar 
 failed to resolve handler messages on the web... but nothing like
this.

 Any suggestions/thoughts!

 Thanks again,
 Ian
  

 -Original Message-
 From: Randy Kobes [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 04, 2007 3:40 PM
 To: Ian G. Tyndall
 Cc: modperl@perl.apache.org
 Subject: Re: Apache crashing

 On Thu, 4 Oct 2007, Ian G. Tyndall wrote:

   
 Oh the problems come and go so quickly!

 I've got one cgi script that always crashes apache. The error log 
 gives the following message:

 [Thu Oct 04 11:38:29 2007] [crit] (22)Invalid argument: Parent: 
 Failed
 

   
 to create the child process.
 [Thu Oct 04 11:38:29 2007] [crit] (OS 6)The handle is invalid.  :
 master_main: create child process failed. Exiting.
 [Thu Oct 04 11:38:29 2007] [notice] Parent: Forcing termination of 
 child process 2474288

 Other scripts run fine... so what would be the best way of debugging 
 this.

 I'm in the process of commenting out modules/code, but no luck so
 
 far...
   
 any recommendations?

 I'm using mod_perl 2.0.3, perl 5.8.8, apache 2.0.59 on a Windows 2003

 server.

 Thanks,
 Ian
 

 Is this a cgi script, or a mod_perl registry script?
 Although the log messages are generic, similar messages appear when 
 one tries to restart apache with mod_perl enabled - if it's a cgi 
 script, does commenting out the loading of mod_perl.so help?

 As for tracking down the problem, reducing it to a minimal version 
 will help. If you can do this, and don't see the problem, try posting 
 it to the list here. Also, trying some of the debugging tips suggested

 in the thread
http://marc.info/?t=11913767701r=1w=2
 may help, along with installing
http://www.apache.org/dist/httpd/binaries/win32/#source
 to help in the crash analysis.

 --
 best regards,
 Randy
   



Re: [website] Incomplete information on the /about/license.html page

2007-10-09 Thread Philippe M. Chiasson
Mark Hindess wrote:
 The web page at:
 
   http://perl.apache.org/about/license.html
 
 only mentions the Apache Software License, Version 1.1 but mod_perl
 2.0 is licensed under the Apache License, Version 2.0.
 
 Perhaps this page should be update to include the new license (as well)?

Thanks for pointing it out. It was left out when we updated to the 2.0
license apparently.

Fixed in revision 583242.


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



signature.asc
Description: OpenPGP digital signature


mod_perl Apache2 RequestRec allowed problem

2007-10-09 Thread Christopher Stanton
I am trying to set the allowed bitmask in a custom request handler
when I receive the OPTIONS method (and when I receive a method request
for a method I do not support).

I have followed the example in
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_allowed_
but Apache always returns Allow: GET,HEAD,POST,OPTIONS,TRACE in the
header irrespective of what options I set.

For example, lets say I only accept PUT to try to restrict the
available options to OPTIONS, TRACE, and PUT.

I have tried both
$r-allowed($r-allowed | (1 Apache2::Const::M_PUT));
and
$r-allowed(1Apache2::Const::M_PUT);
with a return of Apache2::Const::DECLINED in either case in my handler.

Neither ends up modifying the supported options sent to the client.

In tha handler if I print the return value of $r-allowed:
print $r-allowed(1Apache2::Const::M_PUT) . \n;
print $r-allowed() . \n;
return Apache2::Const::DECLINED;

I get:
1
2

So the record is being updated, but for some reason Apache is not
basing its response to the client off of the record.

Can anyone provide any insight into why I am unable to modify the list
of request methods my handler is capable of servicing?

thanks,
Christopher


Re: -X and trapping kill?

2007-10-09 Thread Fred Moyer

Philippe M. Chiasson wrote:

Bill Moseley wrote:

Must be Monday.  Is there a problem with the -X switch and prefork?

I'm using:

Apache/2.2.3 (Debian) mod_ssl/2.2.3 OpenSSL/0.9.8e mod_perl/2.0.2 Perl/v5.8.8


for Apache/2.x, Shouldn't that now be:

$ httpd -DONE_PROCESS -DNO_DETACH


This is happening on my setup also, Apache 2.2.3, mod_perl 2.0.3, perl 
5.8.8, using a standard xterm to send the interrupt.


Re: mod_perl Apache2 RequestRec allowed problem

2007-10-09 Thread Geoffrey Young


Christopher Stanton wrote:
 I am trying to set the allowed bitmask in a custom request handler
 when I receive the OPTIONS method (and when I receive a method request
 for a method I do not support).
 
 I have followed the example in
 http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_allowed_
 but Apache always returns Allow: GET,HEAD,POST,OPTIONS,TRACE in the
 header irrespective of what options I set.
 
 For example, lets say I only accept PUT to try to restrict the
 available options to OPTIONS, TRACE, and PUT.
 
 I have tried both
 $r-allowed($r-allowed | (1 Apache2::Const::M_PUT));
 and
 $r-allowed(1Apache2::Const::M_PUT);
 with a return of Apache2::Const::DECLINED in either case in my handler.
 
 Neither ends up modifying the supported options sent to the client.
 
 In tha handler if I print the return value of $r-allowed:
 print $r-allowed(1Apache2::Const::M_PUT) . \n;
 print $r-allowed() . \n;
 return Apache2::Const::DECLINED;
 
 I get:
 1
 2
 
 So the record is being updated, but for some reason Apache is not
 basing its response to the client off of the record.
 
 Can anyone provide any insight into why I am unable to modify the list
 of request methods my handler is capable of servicing?

the Allow header appears to be built not from r-allowed but
r-allowed_methods-method_mask.  so, try this:

http://perl.apache.org/docs/2.0/api/Apache2/Access.html#C_allow_methods_

HTH

--Geoff


Re: mod_perl Apache2 RequestRec allowed problem

2007-10-09 Thread Christopher Stanton
Thanks for the reply Geoffrey.

I have updated the code to use $r-allow_methods rather than
$r-allowed per the documentation at:
http://perl.apache.org/docs/2.0/api/Apache2/Access.html#C_allow_methods_

Now additional methods are being included in the response, but the
reset boolean does not seem to completely reset the list of Allow
results.

$r-allow_methods(1, qw(PUT));
return Apache2::Const::DECLINED;
results in
Allow: GET,HEAD,POST,OPTIONS,PUT,TRACE
being returned to the client rather than
Allow: OPTIONS,PUT,TRACE

$r-allow_methods(1, qw(HEAD GET));
return Apache2::Const::DECLINED;
results in
Allow: GET,HEAD,POST,OPTIONS,TRACE
being returned to the client rather than maybe
Allow: HEAD,GET,OPTIONS,TRACE

So, this does not seem to be working as I would expect either.

And additional source of confusion is the fact that the documentation
(http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_allowed_)
about the $r-allowed() method states:
This bitvector is used to construct the Allow: header required for
OPTIONS requests, and Apache2::Const::HTTP_METHOD_NOT_ALLOWED (405)
and Apache2::Const::HTTP_NOT_IMPLEMENTED (501) status codes.

Are the docs just wrong?

thanks,
Christopher

On 10/9/07, Geoffrey Young [EMAIL PROTECTED] wrote:


 Christopher Stanton wrote:
  I am trying to set the allowed bitmask in a custom request handler
  when I receive the OPTIONS method (and when I receive a method request
  for a method I do not support).
 
  I have followed the example in
  http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_allowed_
  but Apache always returns Allow: GET,HEAD,POST,OPTIONS,TRACE in the
  header irrespective of what options I set.
 
  For example, lets say I only accept PUT to try to restrict the
  available options to OPTIONS, TRACE, and PUT.
 
  I have tried both
  $r-allowed($r-allowed | (1 Apache2::Const::M_PUT));
  and
  $r-allowed(1Apache2::Const::M_PUT);
  with a return of Apache2::Const::DECLINED in either case in my handler.
 
  Neither ends up modifying the supported options sent to the client.
 
  In tha handler if I print the return value of $r-allowed:
  print $r-allowed(1Apache2::Const::M_PUT) . \n;
  print $r-allowed() . \n;
  return Apache2::Const::DECLINED;
 
  I get:
  1
  2
 
  So the record is being updated, but for some reason Apache is not
  basing its response to the client off of the record.
 
  Can anyone provide any insight into why I am unable to modify the list
  of request methods my handler is capable of servicing?

 the Allow header appears to be built not from r-allowed but
 r-allowed_methods-method_mask.  so, try this:

 http://perl.apache.org/docs/2.0/api/Apache2/Access.html#C_allow_methods_

 HTH

 --Geoff



Re: mod_perl Apache2 RequestRec allowed problem

2007-10-09 Thread Christopher Stanton
$r-allowed_methods($reset, $list) only seems to respect the reset
flag if the return code from the handler is either
Apache2::Const::HTTP_METHOD_NOT_ALLOWED or
Apache2::Const::HTTP_NOT_IMPLEMENTED which is not in the
documentation.

The OPTIONS request is supposed to be URI/resource specific (unless
the URI is '*') but Apache seems to be treating it as '*' plus
whatever other additional options I set. OPTIONS is supposed to return
the set of methods available for the specific URI.

So can anyone shed some light on why Apache is ignoring the reset flag
when I am returning Apache2::Const::DECLINED?

And why $r-allowed() does not work as advertised in the documentation?

And which way is the proper/standard way of:
1) setting the Allow header field when responding to an OPTIONS
request on a URI
2) returing from handling an OPTIONS request. is it Apache2::Const::DECLINED?
2) setting the Allow header field when responding with either
HTTP_METHOD_NOT_ALLOWED or HTTP_NOT_IMPLEMENTED return codes

I have included a basic example handler and and returned output below.
The Allow hearder field for both OPTION and GET requests should be the
same, but as you can see, they are not.

I am using:
Fedora Core 6
Apache 2.2.4-2.1
mod_perl 2.0.2-6.2

thanks,
Christopher

--

sub handler {
  my $r = shift;
  my $status_code = Apache2::Const::SERVER_ERROR;

  if ($r-method eq OPTIONS){
$r-allow_methods(1, qw(PUT DELETE));
$status_code = Apache2::Const::DECLINED;
  } else {
$r-allow_methods(1, qw(PUT DELETE));
$status_code = Apache2::Const::HTTP_METHOD_NOT_ALLOWED;
  }
  return $status_code
}

--

#curl -D header.txt -X OPTIONS http://localhost:9080/somedir
#cat header.txt
HTTP/1.1 200 OK
Date: Tue, 09 Oct 2007 22:10:58 GMT
Server: Apache/2.2.4 (Fedora)
Allow: GET,HEAD,POST,OPTIONS,DELETE,PUT,TRACE
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=UTF-8

--

#curl -D header.txt -X GET http://localhost:9080/somedir
#cat header.txt
HTTP/1.1 405 Method Not Allowed
Date: Tue, 09 Oct 2007 22:14:26 GMT
Server: Apache/2.2.4 (Fedora)
Allow: DELETE,PUT,TRACE
Content-Length: 308
Connection: close
Content-Type: text/html; charset=iso-8859-1


Apache::LogFile and mod_perl2

2007-10-09 Thread Dan Thomas
Hi,

I'm in the process of shifting some old mod_perl1 code over to
Apache2.2 and mod_perl2. Part of it is using Apache::LogFile to write
to a custom log. Well.. actually, it pipes the data to a little script
that collects up lines and forks off processes to deal with them when
it's got a handful (it gets hit a couple of million times per day, and
processing them one by one isn't particularly efficient). But that's
not entirely relevant, I suppose.

As far as I can tell, Apache::LogFile was never ported to mp2, and I
can't find anything that will let me define my own logfile. The
Apache::LogFile solution was very convenient, as it shuts down and
restarts the collector script with the daemon, but as my C skills are
practically non-existent, I doubt very much I'd be able to port it
myself, so I'm looking for an alternative.

Ideally, I want a single filehandle that will be opened and closed
when Apache starts up and shuts down, that I can write to from a
handler, but I'm not really sure where to start. Can anyone point me
in the right direction?

Thanks,

Dan