Re: Apache 2?

2002-11-28 Thread Stas Bekman
Issac Goldstand wrote:

- Original Message -
From: Stas Bekman [EMAIL PROTECTED]



. Since if your mod_perl handler sends


the data to a thread which runs a filter that send the data to a client
(and doesn't need perl) it'll still block on the network transfer, which
will block the response handler sending the data. So I can imagine that
we will need a special filter that buffers the data, immediately
releasing the perl handler and then slowly feeding it to the the client.



This isn't just a mod_perl thing, either.  This would be a generic Apache2
thing.  *ANY* content should be filtered as such through a 2-tier system
like this - but I thought that's what the bucket brigades did.  Please
correct me if I'm wrong in this picture:

Response Handler  start of buckets  Filter API   End of
buckets  Core Output  client

it was my understanding that one of  the purposes of the core-output filter
was to do exactly what we want - free the backend request and filter threads
once they've finished with the EOS bucket.  Am I missing something?


From a quick read through:

server/core.c:static apr_status_t core_output_filter(ap_filter_t *f, 
apr_bucket_brigade *b)

I don't think core_output_filter does anything to buffer up the data and 
release the handler. The only buffering it does is if it doesn't have 
*enough* bytes to send so it waits for the next brigade.

In order to understand how the new model works you really have run the 
snooping filter and study the output. The important outcome that you 
gain is that filters are called in a pipeline, i.e. the response handler 
sends a portion of data to the first filter, which immediately passes 
that data to the next filter, and so on, while all previous filters that 
have already passed the first chunk await for the latter filters to 
return. That's my understanding so far, please correct me if I'm wrong.

So if you want to release the handler asap, you need a filter that will 
buffer up the data and feed it to the remaining filters at the speed 
they request. It should probably be inserted just before the 
core_output_filter, so all the processings will be already completed by 
that time. Think of it as an extension to the core_output_filter which 
buffers things up. And the cool thing is that you can inject it only 
when you want it, e.g. you don't want it for non-mod_perl requests.

And of course it's not mod_perl specific like you've mentioned, but I 
don't really know of any other producers that consume a lot of memory 
and therefore for which we want to minimize their number and keep them 
busy for real all the time.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Apache::DB and perl 5.80

2002-11-28 Thread Rob Mueller
I've noticed a few comments around the web of problems with 5.8.0 and
Apache::DB, but no responses that anyone is looking at it or has a solution.

~www/bin/httpd -X -Dperldb
[notice] Apache::DB initialized in child 2076
[Thu Nov 28 03:24:44 2002] [error] No DB::DB routine defined at
/usr/local/lib/perl5/5.8.0/i686-linux/lib.pm line 10.
Compilation failed in require at conf/startup.pl line 21.
BEGIN failed--compilation aborted at conf/startup.pl line 21.
Compilation failed in require at (eval 6) line 1.

Does anyone know is anyone is looking into this or if there's a solution
floating around?

Rob




Re: segmentation fault using a startup file

2002-11-28 Thread Stas Bekman
Ged Haywood wrote:

On 27 Nov 2002, Jan Theofel wrote:



Especially because we use SuSE Linux Enterprise Server which is a
hihgly integrated system and we would loose the benefits of this
system when we compile apache on our own.



I don't understand that at all.  Can somebody help me out here?


Sure. Many (linux|other) systems nowadays rely on Apache and Perl to do 
the UI to the system. Therefore they sometimes (always?) patch or change 
these tools to do what they want them to do. And when you want to add 
your own things collisions might happen.

Therefore if you want to keep the system intact, build your own Apache 
and your own Perl in a different directory. You especially want this if 
you are a developer that need to make sure that the product works with 
various versions.

e.g. I have:

% ls  ~/perl/
5.005_03  5.6.0  5.6.0-ithread  5.6.1  5.6.1-ithread  5.8.0 
5.8.0-ithread  blead  blead-ithread

% ls ~/httpd/
1.3  2.0  prefork  prefork-apreq  threaded  worker

Of course you probably don't need them all, but you get the idea.

the only caveat of installing your own Apache is that you can't use port 
80, if the system's Apache uses it. A simple rewrite rule solves this 
problem.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



default Content-Length calculation has been removed in 2.0 (was Re:mod_perl 2.x vs. mod_perl 1.x benchmarks)

2002-11-28 Thread Stas Bekman
Frank Wiles wrote:

 .--[ Ask Bjoern Hansen wrote (2002/09/19 at 01:47:39) ]--
 | 
 |  On Wed, 18 Sep 2002, Josh Chamas wrote:
 |  
 |  [...]
 |   So I run it again with ServerTokens Min, and get the same results. :)
 |   Still something different on the mod_perl headers, looks like mod_perl
 |   2.x is setting Content-Length where it didn't use to.
 |  
 |  The details evade me, but I recall something about how the buckets
 |  work in the httpd that makes httpd 2.0 always know (and set) the
 |  Content-Length.
 |  
 |  There was discussion about changing it; but I don't remember the
 |  outcome.

This has been changed to do the right thing around mid-Sep I believe. 
Previously httpd was buffering up the output and calculating the 
Content-Length header before sending the HTTP headers. It doesn't do 
that anymore, which is a relief for us. I've discovered this just before 
my presentation, where I've planned to demonstrate that bad behavior 
using the filter snooper, but there was no need any more :)

You can still inject a cl filter which will buffer the data and 
calculate its length e.g. to be cache friendly, if that's your intention.

Actually, returning to Issac's question regarding releasing the handler 
early, you need a slightly modified version of the cl filter to do that. 
Since it's already buffering the data, you just want to do this 
unconditionaly.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: Compilation problems with mod_perl

2002-11-28 Thread Stas Bekman
Stas Bekman wrote:

Benny Jensen wrote:


 
Hello,
 
I'm trying to compile mod_perl for apache2. But i got a error message 
that i dont know how to solve. The following message is what i get:
 
/LD_RUN_PATH= cc  -shared -L/usr/local/lib APR.o  -o 
../../../blib/arch/Apache2/auto/APR/APR.so   -lapr -laprutil
/usr/bin/ld: cannot find -lapr
collect2: ld returned 1 exit status
/
APR.so exist in following map:
 
//usr/local/lib/perl/5.8.0/Apache2/auto/APR/APR.so/
If anyone could help me to solve it


it's looking for libapr, not APR. You must have messed up the apache 
build step or missed it completely and don't have apache built yet. 
Review the installation steps at:
http://perl.apache.org/docs/2.0/user/install/install.html#Condiguring_and_Installing_Prerequisites 

That was actually a broken build after the apr project has changed the 
way it names the libraries. So please disregard my previous reply and 
get the latest cvs, it should work now.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: Apache::DB and perl 5.80

2002-11-28 Thread Michael Maibaum
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Thursday, Nov 28, 2002, at 00:25 US/Pacific, Rob Mueller wrote:


I've noticed a few comments around the web of problems with 5.8.0 and
Apache::DB, but no responses that anyone is looking at it or has a 
solution.


I've had much the same problem in OS X with 5.8.0, and even asked 
herebut no-one seemed to know anything (or at least no-one who did 
noticed my email ;) )

~www/bin/httpd -X -Dperldb
[notice] Apache::DB initialized in child 2076
[Thu Nov 28 03:24:44 2002] [error] No DB::DB routine defined at
/usr/local/lib/perl5/5.8.0/i686-linux/lib.pm line 10.
Compilation failed in require at conf/startup.pl line 21.
BEGIN failed--compilation aborted at conf/startup.pl line 21.
Compilation failed in require at (eval 6) line 1.

Does anyone know is anyone is looking into this or if there's a 
solution
floating around?

I'd love to be able to get it working as well

Michael
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.0 (Darwin)

iD8DBQE95d4kilk3LUlIL0MRAnFFAKDvfCe3omre/URaqGyIV173EWkvDACg01xa
llFbL019nQxnSSAOOSPodM8=
=arKd
-END PGP SIGNATURE-




Re: PATCH Apache::Status.pm

2002-11-28 Thread Stas Bekman
Dan Sully wrote:

This makes the syntax tree dump work for Apache::Status

--- lib/Apache/Status.pm.orig	Tue May 28 09:33:28 2002
+++ lib/Apache/Status.pm	Tue Sep 24 12:09:56 2002
@@ -345,6 +345,7 @@
 
 sub noh_b_terse {
 my $r = shift;
+return unless eval { require B::Terse };

Thanks Dan. Committed this and added two more similar fixes which solve 
the same problem in two other functions in that module.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: flush problem

2002-11-28 Thread Stas Bekman
Udlei Nattis wrote:

$r-rflush() doesnt work too

you have other idea?


I believe this was a bug in httpd, where the content was buffered up to 
calculate the Content-Length header. I've tested it with the cvs version 
of httpd and $|=1 sends the unbuffered output as with your original example:

use strict;

$| = 1;

my ($i,$r);

$r = shift;

$r-content_type('text/html');

while ($i  10) {
$r-printf($i.br\n);
$r-printf(\0);
$i++;
sleep 1;
}

---

$r-rflush() is indeed not working yet.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Redirect Problem

2002-11-28 Thread Udlei Nattis
hi all,

i have one problem,
when i set one cookie and REDIRECT , cookie dont is set

in file
  $r-status(REDIRECT);
   exit;

[nattis@nattis nattis]$ lynx -mime_header 
'http://200.189.180.107:84/client/go.new?id=8.1nick=wellington'   
HTTP/1.1 302 Found
Date: Thu, 28 Nov 2002 13:35:22 GMT
Server: Apache/2.0.44-dev (Unix) mod_perl/1.99_08-dev Perl/v5.8.0
Location: frame?id=8.1type=
Content-Length: 324
Connection: close
Content-Type: text/html; charset=iso-8859-1

!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
htmlhead
title302 Found/title
/headbody
h1Found/h1
pThe document has moved a href=frame?id=8.1amp;type=here/a./p
hr /
addressApache/2.0.44-dev (Unix) mod_perl/1.99_08-dev Perl/v5.8.0 
Server at 127.0.0.1Port 84/address
/body/html



if i comment
  #$r-status(REDIRECT);
   exit;

[nattis@nattis nattis]$ lynx -mime_header 
'http://200.189.180.107:84/client/go.new?id=8.1nick=wellington'
HTTP/1.1 200 OK
Date: Thu, 28 Nov 2002 13:36:30 GMT
Server: Apache/2.0.44-dev (Unix) mod_perl/1.99_08-dev Perl/v5.8.0
Set-Cookie: _session_id=c7b9948e90650cc21524aa96a9bcebeb; path=/
Location: frame?id=8.1type=
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=ISO-8859-1

now cookie is set

this is one bug or correct?

bye

nattis



Re: Redirect Problem

2002-11-28 Thread domm
Hi!

On Don, Nov 28, 2002 at 11:48:19 -0200, Udlei Nattis wrote:

 i have one problem,
 when i set one cookie and REDIRECT , cookie dont is set

http://perl.apache.org/docs/1.0/guide/snippets.html#Sending_Cookies_in_REDIRECT_Response

Please RTFM before posting questions:

http://perl.apache.org/maillist/email-etiquette.html

-- 
#!/usr/bin/perl
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}



Re: Redirect Problem

2002-11-28 Thread Udlei Nattis
sorry

but topic Sending Cookies in REDIRECT Response not is valid for 
modperl 2.0

Cookies dont send in modperl 2.0 when i redirect page

bye

nattis

[EMAIL PROTECTED] wrote:

Hi!

On Don, Nov 28, 2002 at 11:48:19 -0200, Udlei Nattis wrote:

 

i have one problem,
when i set one cookie and REDIRECT , cookie dont is set
   


http://perl.apache.org/docs/1.0/guide/snippets.html#Sending_Cookies_in_REDIRECT_Response

Please RTFM before posting questions:

http://perl.apache.org/maillist/email-etiquette.html

 



--
aa





Re: Redirect Problem

2002-11-28 Thread domm
Hi!

On Don, Nov 28, 2002 at 12:03:26 -0200, Udlei Nattis wrote:

 but topic Sending Cookies in REDIRECT Response not is valid for 
 modperl 2.0

You did't state that you're question was about mod_perl 2.0.

I'd suggest you either use some sort of tag in your Subject line
(eg: mp2) or state explicitly in your message that your question
is concerning mod_perl 2.0.

 Cookies dont send in modperl 2.0 when i redirect page

I know nothing about 2.0, sorry.

-- 
#!/usr/bin/perl
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}





windows not loading some images sent by mod_perl

2002-11-28 Thread Neil Watson
Hello everyone,

This is my first post to this group.  I have looked around the web for an answer to my 
question but no luck :(  Hopefully some here can help me.

After buying the eagle book I build a module that will parse and incomming request 
from a browser, then send a frame set html page with the correct html document in a 
specific frame.  From browsers on my linux box everything works find.  From the two 
window clients I've test both Mozilla and IE6, at random times, fail to load some of 
the images referenced in the html code.  This only occurs when using URLs that point 
to that module, even for the same module on different servers.  Normal browsing does 
not have this problem. Does anyone know what might be causing this?

Module:

package Apache::Content;

use strict;
use Apache::Constants qw(:common);
use Apache::URI();
use Apache::File();

sub handler {
my $r = shift;

my ($page, $adtitle, $fh);

#get the document root of the
#requested URL
my $document_root = $r-document_root;
my $uri = $r-uri;

#pars url to get form name and adtitle
if ($uri =~ m/\/content\/([^-]+)-([^-]+)/){
$page = $1;
$adtitle = $2;
}

$r-content_type('text/html');
$r-send_http_header;

my $path = $r-filename;
$path =~ s/(.*?)[^\/]+$/$1/;

#open index frameset
unless ($fh = Apache::File-new($path.index.html)){
$r-log_error(Can't open index.html: $!);
return SERVER_ERROR;
}
while ($fh){
#change main window from home.html to the page 
#requested

#if url contained vgfrom then pass to 
#vgform module (Vgform.pm)
if ($page =~ m/vgform/io){
s/src=?\/home\.html?/src=\/$page-$adtitle/io;
}else{
s/src=?\/home\.html?/src=\/$page/io;
}
$r-print($_);
}

return OK;
}
1;

Thanks for reading

-- 
Neil Watson
Network Administrator
watson-wilson.ca




Re: default Content-Length calculation has been removed in 2.0 (was Re: mod_perl 2.x vs. mod_perl 1.x benchmarks)

2002-11-28 Thread Issac Goldstand

- Original Message -
From: Stas Bekman [EMAIL PROTECTED]
Cc: Ask Bjoern Hansen [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, November 28, 2002 11:07 AM
Subject: default Content-Length calculation has been removed in 2.0 (was Re:
mod_perl 2.x vs. mod_perl 1.x benchmarks)


 Actually, returning to Issac's question regarding releasing the handler
 early, you need a slightly modified version of the cl filter to do that.
 Since it's already buffering the data, you just want to do this
 unconditionaly.

How do you mean unconditionaly?  BTW: I'm wondering whether the solutnio for
the whole buffering thing is write a buffer filter or is this something
that should be done internally within the brigades?  After all, once the
[mod_perl] response handler (or filter) passes the EOS bucket, it's not
needed anymore, and who cares if the other filters are ready or not?

Stas, it sounded to me like you were suggesting something like:

mod_perl handler/filter---Filter API---buffer
filtercore-outputclient

The assumption is that if bufer_filter slurps up the data, it will release
the previous filters' resources, but I think that's kinda backwards
thinking.  As far as I understand, the only buffer you EVER have to worry
about is the data coming IN to your filter.  Once you pass the buckets
along, you never have to worry about them again.

2 conclusions on this (my thought process included :-)):
1) The seemingly correct thing to do here would be to ensure that a
handler/filter's resource pool (and entire thread?)  is cleaned up as soon
as it's done running.  I think the latter is true, and to do this properly,
Apache'd really have to give each filter plugged into each request it's own
running thread.  That's gonna add lotsa overhead.  Maybe just a flag to
request it's own thread if the module author/user is expecting their
handler/filter to really use heavy resources (like an on-the-fly image
processing filter for example).  That way, heavy modules can get their own
resources for when their eneded and release them ASAP.
2) The flipside of this is that a heavy module (like discussed above)
*would* need this buffer filter;  but it would want the buffer to slurp up
the data coming *in*.  The idea would be to let these heavy modules *create*
themselves only when the data is ready (to optimize resource
allocation/usage).   The problem with this is that it's useless.  Each
request, as I understand, requires each filter in the chain to register
itself in the bucket brigade chain right at the offset - which means that
the private thread idea can't work since it will have to create the thread
at the beginning of the request anyway - certainly before the data is ready.

Comments?

  Issac




Re: Apache::DB and perl 5.80

2002-11-28 Thread John Siracusa
On 11/28/02 4:13 AM, Michael Maibaum wrote:
 On Thursday, Nov 28, 2002, at 00:25 US/Pacific, Rob Mueller wrote:
 I've noticed a few comments around the web of problems with 5.8.0 and
 Apache::DB, but no responses that anyone is looking at it or has a
 solution. 
 
 I've had much the same problem in OS X with 5.8.0, and even asked
 herebut no-one seemed to know anything (or at least no-one who did
 noticed my email ;) )

I asked about it as well, and I seem to recall someone responding, saying
that it doesn't work now, but top men are working on the problem.

(Who?  Top...men...)
-John




Re: default Content-Length calculation has been removed in 2.0 (wasRe: mod_perl 2.x vs. mod_perl 1.x benchmarks)

2002-11-28 Thread Stas Bekman
[Issac's view snipped]

Rather than commenting on your view Issac, please allow me to try again 
to explain how I think it works, hopefully more clear this time:

Let's forget for a moment about buckets inside bridades, and call the 
brigades themselves entities that are passed along.

Now think of a realworld fireman water bucket brigade, everybody passes 
a bucket (entity) and usually there are several buckets (entities) 
moving at the same time.

Now let's imagine that the first man in the brigade picks a new bucket 
only when the last man has poured its bucket out. So at any given moment 
there is only one bucket (entity) moving along the brigade.

This is exactly the situation with httpd. In the current httpd filtering 
model one entity is moving along the filters stack and no new entity 
will enter the stack, before the one on the stack will leave it (go to 
the client if we are talking about output filters).

I didn't want to use the httpd buckets and brigades in this example, 
because they make my comparison confusing. In the real world there is 
one brigade and many buckets. In httpd, there are many bridages that are 
moving along the stack of filters (and each brigade have one or more 
buckets, which are irrelevant to this particular discussion).

Hope this clearifies the picture.

The conclusion: If the filter stack is busy processing some data and the 
response handler hasn't finished sending the data, it'll block waiting 
for the filter stack to return and only then hand over the next chunk of 
data. At least that's how it appears to the filters.

Now if you want to play with it, it should be a trivial thing to do. 
Just take some response handler that generates a lot of data in a loop 
and prints some logs to STDERR on each iteration, then insert a filter 
that passes the brigades unmodified (like MyApache::FilterSnoop does) 
but has a 'sleep 3' statement. I expect that the response handler will 
block on each sleep. I hope that my understanding was correct :)

Also allow me to suggest that reading the following section:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#All_in_One_Filter
and trying the MyApache::FilterSnoop module at work should clearify a lot.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: Apache::Reload and @INC

2002-11-28 Thread Stas Bekman
Igor Vylusko wrote:

in doc
http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
declared that when using Apache::Reload I may define additional lib
in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
But when I enable PerlInitHandler Apache::Reload in config all libs defined in
PERL5LIB are gone away from @INC.
I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
in VirtualHost sections.
I have bulk of VirtualHosts and would like make @INC different for each
one(i.e. not use lib ... in startup.pl).




SB It's not easy with mod_perl 1.0. The manpage is talking about changing 
SB @INC globally for the whole server. I usually do that with 'use lib' in 
SB startup.pl.

I define PerlSetEnv PERL5LIB globaly for the whole server but PERL5LIB
was stripped out from @INC anyway on enabling PerlInitHandler Apache::Reload
in _any_ vhost.
I am using PerlSetEnv PERL5LIB per vhost basis and it works fine for me
without Apache::Reload.

I can't reproduce what you see with Apache::Reload and I don't see 
anything in the code that mangles @INC.

Though what I do see, is that if you define PERL5LIB outside a 
VirtualHost, it overrides any PERL5LIB defined inside all VirtualHosts, 
no matter if you use Apache::Reload or not. I don't remember if that's 
how it should be or whether it's a bug. Those who use vhosts can 
probably help rectify the issue here.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: NTLM Authentication patch

2002-11-28 Thread Gerald Richter

 I am also interested in this patch, as we encounter lots of problems with
 some POSTed forms over here.

I just uploaded a new version with a fix to CPAN:

The URL

ftp://ftp.dev.ecos.de/pub/perl/ntlm/Apache-AuthenNTLM-0.23.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/G/GR/GRICHTER/Apache-AuthenNTLM-0.23.tar.gz
  size: 49682 bytes
   md5: 6a0e59d24b23737b2902e6cd43aceb77


 Gerald, was the logfile I sent you helpful?


Yes, thanks

Gerald


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-





ANNOUNCE: Apache::AuthenNTLM 0.23

2002-11-28 Thread Gerald Richter
The URL

ftp://ftp.dev.ecos.de/pub/perl/ntlm/Apache-AuthenNTLM-0.23.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/G/GR/GRICHTER/Apache-AuthenNTLM-0.23.tar.gz
  size: 49682 bytes
   md5: 6a0e59d24b23737b2902e6cd43aceb77

This version fixes the problem with POST request. Thanks to the people who
send me logfiles and patches.

Enjoy

Gerald

Changes since 0.21:

0.23  12. Nov 2002

   - Fixed possible lockup with POST data. Patch from Gerald Combs.

0.22  11. Nov 2002

   - Return FORBIDDEN (instead of SERVER_ERROR) when no PDC is
 configured for a given domain
   - Compiles now correctly with Perl 5.005
   - Fixed problem with POST data, based on a patch from Gerald Combs.


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-






Re: New problems making mod_perl run: Apache/2.0.43 (Unix) mod_perl/1.99_07-devPerl/v5.8.0

2002-11-28 Thread Stas Bekman
Juan Julian Merelo Guervos wrote:

Hi,
	Well, looks like I've managed to make this server run (thanks for your
help), and looks like, in this case, mod_cgi is working (unlike the one
shipped with RH 8.0). Now I'm trying to make HTML::Mason work with this
configuration. I have downloaded HTML::Mason 1.15, and force-compiled
it. This one requires libapreq, which I haven't been able to compile,
since it requires Apache::MyConfig . That's supposed to be in the old
version of mod_perl, right? So, the only way to have HTML::Mason working
is to have both things working at the same time? Any other option? Has
anybody made HTML::Mason work with this prerrelease of mod_perl?


I did a quick stub on porting Apache::MyConfig, it's incomplete so 
please post any fixes (which should be pretty easy to figure out) for 
those keys that weren't set yet. So here is the patch.

Index: lib/Apache/compat.pm
===
RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
retrieving revision 1.71
diff -u -r1.71 compat.pm
--- lib/Apache/compat.pm	23 Nov 2002 22:35:06 -	1.71
+++ lib/Apache/compat.pm	28 Nov 2002 16:52:49 -
@@ -509,5 +509,80 @@
 APR::Table::make($r-pool, $nelts);
 }

+package Apache::MyConfig;
+
+use Apache::Build ();
+
+use constant WIN32 = Apache::Build::WIN32;
+
+our %Setup;
+
+my $build = Apache::Build-new();
+
+my $XXX = Need to figure out;
+my $LEGACY = '';
+
+%Setup = (
+APACHE_SRC = $build-MP_AP_PREFIX, # can be not source
+SSL_BASE   = $LEGACY,
+APXS   = $build-apxs,
+PERL_USELARGEFILES = $XXX, # XXX
+PERL_TRACE = $build-MP_TRACE,
+PERL_DEBUG = $build-MP_debug,
+APACI_ARGS = $LEGACY,
+APACHE_PREFIX  = $build-MP_AP_PREFIX,
+DO_HTTPD   = 1, # always DO_HTTPD
+NO_HTTPD   = 0, # always DO_HTTPD
+PREP_HTTPD = 0, # always DO_HTTPD
+USE_APACI  = 0, # no more
+APACHE_HEADER_INSTALL   = 1, #
+PERL_STATIC_EXTS   = $XXX,
+PERL_SSI   = 0, # legacy
+USE_APXS   = $XXX, # only for non-win?
+);
+
+my @callback_hooks = qw{
+PERL_DISPATCH
+PERL_CHILD_INIT
+PERL_CHILD_EXIT
+PERL_POST_READ_REQUEST
+PERL_TRANS
+PERL_HEADER_PARSER
+PERL_ACCESS
+PERL_AUTHEN PERL_AUTHZ
+PERL_TYPE
+PERL_FIXUP
+PERL_HANDLER
+PERL_LOG
+PERL_INIT
+PERL_CLEANUP
+PERL_RESTART
+PERL_STACKED_HANDLERS
+PERL_METHOD_HANDLERS
+PERL_DIRECTIVE_HANDLERS
+PERL_TABLE_API
+PERL_LOG_API
+PERL_URI_API
+PERL_UTIL_API
+PERL_FILE_API
+PERL_CONNECTION_API
+PERL_SERVER_API
+PERL_SECTIONS
+};
+
+# we have all the APIs available, just need to load their modules
+$Setup{$_} = 1 for @callback_hooks;
+
+if (WIN32) {
+$Setup{APACHE_INC}  = $build-{APXS_INCLUDEDIR};
+$Setup{APACHE_LIB}  = $XXX;
+$Setup{MODPERL_INC} = $build-{MODPERL_INC};
+$Setup{MODPERL_LIB} = $XXX; # win32 lib?
+}
+
+#need this alias for Apache::src backwards compat
+$Setup{Apache_Src} = $Setup{APACHE_SRC};
+
+
 1;
 __END__




__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



[mp1] callback called exit (many times)

2002-11-28 Thread Marcin Kasperski
Recently I happened to get the error log flooded with the message
callback called exit
(repeated a couple of million times, probably by one process or a few
 processes).

This was some side-effect of the lack of memory (earlier in the logs I
found messages about allocation failures), which in turn was caused by
some non-apache process allocating too much. Nevertheless, I am trying
to find what happened to my apache/modperl process
(processess?). After all, aborting some processes due to lack of
memory is ok, but filling the whole disk with error log is not.

It is possible that the problem is not caused by the modperl itself
(for instance some of additional modules we implemented in both C and
perl could go wild). But trying to understand the problem I would like
to ask the following questions:

a) Have anyone anywhere observed similar behaviour?

b) When is the message 'callback called exit' printed - and can it be
   disabled?

c) Do you have any idea of what should I pay attention to?


-- 
( Marcin Kasperski   | Krlik to brzmi dumnie! Wszystko dla szympansa!   )
( http://www.mk.w.pl |   Chomikiem jestem, wszystko mi wolno! (Mroek)   )
()
( Sztuczki i kruczki w C++: http://www.mk.w.pl/porady/porady_cplusplus   )



Re: [mp1] callback called exit (many times)

2002-11-28 Thread Stas Bekman
Marcin Kasperski wrote:

Recently I happened to get the error log flooded with the message
callback called exit
(repeated a couple of million times, probably by one process or a few
 processes).

This was some side-effect of the lack of memory (earlier in the logs I
found messages about allocation failures), which in turn was caused by
some non-apache process allocating too much. Nevertheless, I am trying
to find what happened to my apache/modperl process
(processess?). After all, aborting some processes due to lack of
memory is ok, but filling the whole disk with error log is not.

It is possible that the problem is not caused by the modperl itself
(for instance some of additional modules we implemented in both C and
perl could go wild). But trying to understand the problem I would like
to ask the following questions:

a) Have anyone anywhere observed similar behaviour?

b) When is the message 'callback called exit' printed - and can it be
   disabled?

c) Do you have any idea of what should I pay attention to?


Hope that the following somewhat helps:
http://perl.apache.org/search/swish.cgi?query=callback+called+exitsbm=SecDsubmit=search

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: [mp1] callback called exit (many times)

2002-11-28 Thread Marcin Kasperski
Stas Bekman [EMAIL PROTECTED] writes:

 Marcin Kasperski wrote:
  Recently I happened to get the error log flooded with the message
  callback called exit
  (repeated a couple of million times, probably by one process or a few
   processes).
  This was some side-effect of the lack of memory
  (...)


 Hope that the following somewhat helps:
 
http://perl.apache.org/search/swish.cgi?query=callback+called+exitsbm=SecDsubmit=search

Thank you for the pointer.

Am I right deducing, that I should attempt recompiling perl with
-DEMERGENCY_SBRK? 

The perl I use describes itself as below so probably this option is
not turned on:

$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=dec_osf, osvers=5.1, archname=alpha-dec_osf
uname='osf1 banach.softax.local v5.1 1885 alpha '
config_args='-des -Dprefix=/opt/igowwwroot/tools_test/perl -Uinstallusrbinperl 
-Duseshrplib=1 -Dusemymalloc -Ubincompat5005'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
  Compiler:
cc='cc', ccflags ='-std -fprm d -ieee -D_INTRINSICS -I/usr/local/include 
-DLANGUAGE_C',
optimize='-O4',
cppflags='-std -fprm d -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
ccversion='V6.4-009', gccversion='', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib 
/var/shlib
libs=-ldbm -ldb -lm -liconv -lutil
perllibs=-lm -liconv -lutil
libc=/usr/shlib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-shared -expect_unresolved * -O4 -msym -std -s 
-L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES
  Built under dec_osf
  Compiled at Nov 21 2002 15:05:28
  @INC:
/opt/igowwwroot/tools/perl/lib/5.6.1/alpha-dec_osf
/opt/igowwwroot/tools/perl/lib/5.6.1
/opt/igowwwroot/tools/perl/lib/site_perl/5.6.1/alpha-dec_osf
/opt/igowwwroot/tools/perl/lib/site_perl/5.6.1
/opt/igowwwroot/tools/perl/lib/site_perl
.



Re: [mp1] callback called exit (many times)

2002-11-28 Thread Stas Bekman
Marcin Kasperski wrote:

Stas Bekman [EMAIL PROTECTED] writes:



Marcin Kasperski wrote:


Recently I happened to get the error log flooded with the message
   callback called exit
(repeated a couple of million times, probably by one process or a few
processes).
This was some side-effect of the lack of memory
(...)






Hope that the following somewhat helps:
http://perl.apache.org/search/swish.cgi?query=callback+called+exitsbm=SecDsubmit=search



Thank you for the pointer.

Am I right deducing, that I should attempt recompiling perl with
-DEMERGENCY_SBRK? 

Try to, but this doesn't solve the original problem. You still have to 
try to narrow down the code that causes the problem. Using ab or a 
similar load tester might help to stress test.

Using tools to prevent situations when the server runs out of memory is 
very important. See the online docs for more info. Using these tools 
should probably solve the problem altogether, without using any special 
compilation options.

The perl I use describes itself as below so probably this option is
not turned on:


Hmm, it's been a long time since we've last revisited this issue. The 
doc says that PERL_EMERGENCY_SBRK it's supposed to be on, but a quick 
test on several of my builds shows that it's not true:

#!/usr/bin/perl

use Inline C;

print PERL_EMERGENCY_SBRK is @{[ mytest() ? '' : 'not']} defined\n;

__END__
__C__
int mytest() {
#ifdef PERL_EMERGENCY_SBRK
return 1;
#else
return 0;
#endif
}

~/perl/5.8.0-ithread/bin/perl test.pl
PERL_EMERGENCY_SBRK is not defined

of course there is the source code, but Inline is nice :)

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: Apache::Reload - filtering include directories

2002-11-28 Thread Stas Bekman
Stas Bekman wrote:

Harry Danilevsky wrote:


I did send the patch to Matt couple of days ago, but haven't heard 
back yet.


Matt is on vacation


I suppose I can also brace myslef, add namespaces, and clean up my own 
code.


That's a good idea.


As for the versioning, if this patch could be useful in both mod_perl 
1.* and 2.0,
can it be applied to both distributions? I don't quite understand why 
installing
Apache::Reload from CPAN will cause mod_perl2.0 to be installed, but I'll
try to think some more about it.


Because Apache::Reload is distributed on CPAN and is not a part of 
mod_perl 1.0. And a genetically modified version is included in mod_perl 
2.0. The right solution is probably to make Apache::Reload a part of 
mod_perl 1.0 as well and kill the CPAN version, or simply have a higher 
number on it. So people won't need to install it manually.

I've committed your patch to the Apache::Reload version distributed with 
mod_perl 2.0 (plus documented the new feature). I've no control over the 
mod_perl 1.0 version maintained by Matt.

Thanks for the patch Harry.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: ap_unescape_url can't escape %uXXXX

2002-11-28 Thread Joe Schaefer
Tatsuhiko Miyagawa [EMAIL PROTECTED] writes:

 It seems that Apache's ap_unescape_url() can't handle %u style
 URI-escaped Unicode string, hence Apache::Request cannot neighther,
 while CGI.pm can.

You may want to take this issue up on [EMAIL PROTECTED]
Personally I've never seen this kind of character encoding, 
and my reading of

  Section 8 at http://www.w3.org/TR/charmod/ 
  and RFC 2718, Section 2.2.5, 

seems to indicate that this isn't a recommended practice. OTOH, IIRC the 
apache source claims to support utf8 extension(s) of www-urlencoded
ASCII, so if people really are using such encodings, supporting 
%u in ap_unescape_url shouldn't hurt server performance at all.

In any case, putting together a patch of ap_unescape_url along the lines 
of CGI::Util's utf8_chr() can't hurt :-).

-- 
Joe Schaefer



Re: ap_unescape_url can't escape %uXXXX

2002-11-28 Thread Tatsuhiko Miyagawa
At 29 Nov 2002 02:17:31 -0500,
Joe Schaefer wrote:
   It seems that Apache's ap_unescape_url() can't handle %u style
  URI-escaped Unicode string, hence Apache::Request cannot neighther,
  while CGI.pm can.

my WinIE 5.5 / WinIE 6.0 uses this style of URI escaping when you use
javascript to submit page's content. (Well, I'm talking about
MovableType's bookmarklet, if you're interested)
 
 seems to indicate that this isn't a recommended practice. OTOH, IIRC the 
 apache source claims to support utf8 extension(s) of www-urlencoded
 ASCII, so if people really are using such encodings, supporting 
 %u in ap_unescape_url shouldn't hurt server performance at all.
 
 In any case, putting together a patch of ap_unescape_url along the lines 
 of CGI::Util's utf8_chr() can't hurt :-).

Yep ;-)


-- 
Tatsuhiko Miyagawa [EMAIL PROTECTED]



Apache perl question. May be off topic.

2002-11-28 Thread John Michael



Sorry if this is off topic. I am attempting 
to take a perl script I already have written to do something before attempting 
to port it to modperl.

I have used this method to pass request to certain 
files to be redirected to a perl script to produce dynamic content. 
However, sometimes I would just like to pass it back to apache. I know 
that this will be possible with modperl by returning DECLINED.

Directory "/home/usr1/digital/html/protected"
AddHandler RTS-protected-htm htm
Action RTS-protected-htm /cgi-bin/content_manager/handler.pl
/Directory
My question: Is it possible to do this with 
perl. I want to be able to pass some request for static documents that 
should end in .htm back to apache and let apache send them out throuhg the 
normal channels.
Thanks
John michael



cvs commit: modperl Changes

2002-11-28 Thread stas
stas2002/11/28 01:42:46

  Modified:lib/Apache Status.pm
   .Changes
  Log:
  Need to load B::Terse/TerseSize if it wasn't loaded yet in that child
  before using it.
  Submitted by: Dan Sully [EMAIL PROTECTED]
  Reviewed by:  stas
  
  Revision  ChangesPath
  1.28  +3 -0  modperl/lib/Apache/Status.pm
  
  Index: Status.pm
  ===
  RCS file: /home/cvs/modperl/lib/Apache/Status.pm,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Status.pm 31 Jul 2002 02:10:15 -  1.27
  +++ Status.pm 28 Nov 2002 09:42:45 -  1.28
  @@ -345,6 +345,7 @@
   
   sub noh_b_terse {
   my $r = shift;
  +return unless eval { require B::Terse };
   $r-send_http_header(text/plain);
   no strict 'refs';
   my($arg, $name) = (split /, $r-uri)[-2,-1];
  @@ -368,6 +369,7 @@
   
   sub noh_b_terse_size {
   my $r = shift;
  +return unless eval { require B::TerseSize };
   $r-send_http_header(text/html);
   $r-print('pre');
   my($arg, $name) = (split /, $r-uri)[-2,-1];
  @@ -387,6 +389,7 @@
   
   sub noh_b_package_size {
   my($r, $q) = @_;
  +return unless eval { require B::TerseSize };
   $r-send_http_header(text/html);
   $r-print('pre');
   no strict 'refs';
  
  
  
  1.657 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.656
  retrieving revision 1.657
  diff -u -r1.656 -r1.657
  --- Changes   13 Aug 2002 03:18:48 -  1.656
  +++ Changes   28 Nov 2002 09:42:45 -  1.657
  @@ -10,6 +10,9 @@
   
   =item 1.27_01-dev
   
  +Need to load B::Terse/TerseSize if it wasn't loaded yet in that child
  +before using it.  [Dan Sully [EMAIL PROTECTED]]
  +
   document the server_root_relative() method [Stas Bekman [EMAIL PROTECTED]]
   
   eliminate warnings when flushing functions with empty () prototypes in