Re: $r->args vs $r->content

2002-05-14 Thread Richard Clarke

Are you also processing the posted data at some earlier request stage? It
doesn't sound like you would be but I thought I would ask.

Richard


- Original Message -
From: Mike Melillo
To: [EMAIL PROTECTED]
Sent: Tuesday, May 14, 2002 5:22 PM
Subject: $r->args vs $r->content





Ok, I've switched to A::Request, but it still seems my parameters table is
empty.  I'll paste in the form data, as well as some code snippets to see if
that helps find the bug.

 

username



password






**End HTML Template**

** Join.pm **

sub submit {
my $DEBUG = 1;
my ($r) = shift;
my $apr = Apache::Request->new($r);
my $status = $apr->parse;
my @param = $apr->param;
$DEBUG && print STDERR Dumper($apr->parms)
$DEBUG && print STDERR Dumper(@param);

...
}


The first Data::Dumper print statement sends this to the errlog ->
$VAR1 = bless( {}, 'Apache::Table' );

The second print statement prints nothing.

I looked at perldoc Apache::Request, but didn't see anything wrong...

Help?

Mike



-Original Message-
From: Issac Goldstand [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 4:39 AM
To: Mike Melillo
Cc: [EMAIL PROTECTED]
Subject: Re: $r->args vs $r->content

Quoting Mike Melillo <[EMAIL PROTECTED]>:

>
> Hi,
>

> One of the fields is an image file that will be uploaded so I need to
> use POST requests.  Is this a job for Apache::Request?  The eagle book
> doesn't cover it much because it was "experimental" at the time of
> publishing.
>
There's a version 1.0 out by now.  That means stable as it's ever gonna get
:-)  I use it all the time, go for it!

  Issac


Internet is a wonderful mechanism for making a fool of
yourself in front of a very large audience.
  --Anonymous

Moving the mouse won\'t get you into trouble...  Clicking it might.
  --Anonymous

PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B






Re: HTTP version conflict with proxy setup.

2002-05-14 Thread Ian Macdonald

Just a quick note on the successful resolution of this; it's a bug in
Apache
1.3.24 with the handling of chunked data from proxies, details here:

http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=101805692511019&w=2
http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=101810478231242&w=2

and there's a patch available here (or your local equivalent):

http://apache.planetmirror.com.au/dist/httpd/patches/apply_to_1.3.24/proxy_http1.1_chunking.patch


Anybody who wants to use the ProxyPass feature in a front-end Apache
1.3.24 to get to a mod_perl-enabled server should install this patch.

Thanks
Ian Macdonald

Ian Macdonald wrote:

> Hi,
>
> More info on my problem with my proxied (via Rewrite rules) mod_perl
> apache giving responses that were a) topped & tailed with message size
> and "0" respectively, and b) delayed for about 15 seconds; thanks to
> Igor S. for tipping me off that this was chunking and therefore it was a
> HTTP 1.0 vs 1.1 problem, but I still haven't managed to completely solve
> it.
>
> Short version:
>
> Can I tell my mod_perl apache to either only ever respond with 1.0 HTTP,
> or to not use chunking? (Or how do I tell my main server not to
> "promote" the version when it routes the original request to the
> mod_perl server?)
>
> Setting force-response-1.0 & downgrade-1.0 to 1 doesn't seem to work
> (completely).
>
> Long version:
>
> The problem appears to be that the browser I'm using for testing
> (Netscape 4.78 on Redhat) is issuing GET xxx 1.0 requests; these are
> recognised as perl resources and passed to the mod_perl apache but the
> new requests are like GET xxx 1.1. The mod_perl apache obediently sends
> back a chunked 1.1 answer, which the browser can't handle. As
> confirmation I tried a different test machine running Netscape 6.? and
> the aberrant behaviour disappeared.  When I go straight to the mod_perl
> server by specifying the port in the URL, it works because the original
> request is 1.0 and so that is what is returned.
>
> I've tried adding "SetEnv force-response-1.0 1" and "SetEnv
> downgrade-1.0 1" in both servers config, but the only effect I've
> noticed is when I add "force-response-1.0" to the main server, the delay
> goes away; the size & 0 (ie the chunking info) still top & tail the
> response.
>
> Thanks
> Ian Macdonald
> [EMAIL PROTECTED]



Re: MLDBM Tie Errors

2002-05-14 Thread Mike Martinet

Are you suggesting that I modify Sync.pm?


MjM

[EMAIL PROTECTED] wrote:

 > Franck PORCHER wrote:
 >
 >>Well, I'm not 100% sure, but I recently switched for MLDBM and got this
 >>problem too. Here is what I found, and did to remedy the situation :
 >>
 >>It *seemed* to me that the physical MLDBM repository was not 
physically created
 >>until I actually wrote something into it, eventhough it was reported as
 >>correctly open RW.
 >>
 >>
 >
 > This is correct.  This is a performance enhancement, with the side effect
 > that write errors will occur at runtime.
 >
 >
 >>So, any ends of my application trying to fetch value during this
 >>transcient stage got this kind of error (I do not remember
 >>precisely which one I got, but very close indeed).
 >>
 >>I solved the problem by doing an awful trick on each RW opening, such as
 >>:
 >>
 >>eval {
 >>   tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
 >>   $hash{'__DuMmY__'} = 'OK';
 >>   delete $hash{'__DuMmY__'};
 >> };
 >>
 >>That solved the problem in the midtime, waiting for something
 >>much better...
 >>
 >>
 >
 > You could also
 >
 >   tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
 >   tied(%hash)->Lock;
 >
 > to similar effect, as Lock() will actually force a tie to
 > the dbm on disk.
 >
 > The basic premise of MLDBM::Sync is that the tie/untie actually
 > occur at the reads & writes, so that i/o is flushed correctly.
 >
 > --Josh
 > _
 > Joshua Chamas   Chamas Enterprises Inc.
 > NodeWorks Founder   Huntington Beach, CA  USA
 > http://www.nodeworks.com1-714-625-4051
 >





Re: MLDBM Tie Errors

2002-05-14 Thread Joshua Chamas

Franck PORCHER wrote:
> 
> Well, I'm not 100% sure, but I recently switched for MLDBM and got this
> problem too. Here is what I found, and did to remedy the situation :
> 
> It *seemed* to me that the physical MLDBM repository was not physically created
> until I actually wrote something into it, eventhough it was reported as
> correctly open RW.
> 

This is correct.  This is a performance enhancement, with the side effect
that write errors will occur at runtime.

> So, any ends of my application trying to fetch value during this
> transcient stage got this kind of error (I do not remember
> precisely which one I got, but very close indeed).
> 
> I solved the problem by doing an awful trick on each RW opening, such as
> :
> 
> eval {
>tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
>$hash{'__DuMmY__'} = 'OK';
>delete $hash{'__DuMmY__'};
>  };
> 
> That solved the problem in the midtime, waiting for something
> much better...
> 

You could also 

  tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
  tied(%hash)->Lock;

to similar effect, as Lock() will actually force a tie to 
the dbm on disk.

The basic premise of MLDBM::Sync is that the tie/untie actually
occur at the reads & writes, so that i/o is flushed correctly.

--Josh
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks Founder   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



mod_perl 2.0 - writing a proxy handler

2002-05-14 Thread Douglas Younger

Hello,
   Has anyone written a proxy handler in 2.0 similar to example 7-12 of the 
O`Reilly book? I've tried converting it without much luck. I don't need the 
add-blocker stuff, just a generic proxy handle that I can add some 
additional lines to parse the output.

I've had some problems with Apache's default mod_proxy so I'd like to just 
do everything with mod_perl. (problems include chunked data and empty pages)

Thanks!
   -Doug




Re: we need mod_perl banners

2002-05-14 Thread Matt Sergeant

On Tuesday 14 May 2002 4:12 pm, Stas Bekman wrote:
> Nobody has volunteered to lead the modperl banners effort, so if you are
> an artist or know someone who is and willing to help please send the
> banners to me.
>
> Approx Banner Spec:
> ---
> Format: PNG
> Dimensions: 468x60 and 150x40 (pixels)
> Size:   about 10k.
>
> BTW, we still don't have a button derived from the winner logo!
> should be 88x31px or something like that.

http://take23.org/modperl.svg

I'm surprised nobody has taken a snapshot of it yet to use as a banner or 
button (it's resizable - do a view-source for some details).

Matt.



Re: we need mod_perl banners

2002-05-14 Thread Matt Sergeant

On Tuesday 14 May 2002 4:12 pm, Stas Bekman wrote:
> Nobody has volunteered to lead the modperl banners effort, so if you are
> an artist or know someone who is and willing to help please send the
> banners to me.
>
> The story:
> --
> Some people want to advertise mod_perl on their sites. We need banners
> for that. Your help is appreciated.
>
> Approx Banner Spec:
> ---
> Format: PNG
> Dimensions: 468x60 and 150x40 (pixels)
> Size:   about 10k.
>
> BTW, we still don't have a button derived from the winner logo!
> should be 88x31px or something like that.

I made SVG that was perfect for the button. I'm not sure why nobody took a 
snapshot of it. http://take23.org/modperl.svg

Matt.



Re: unable to use method type handlers?

2002-05-14 Thread Geoffrey Young



Jeff AA wrote:

>>Try per load the class my::class via startup.pl or PerlModule
>>
> 
> I already had PerlModule my::classes in httpd.conf
> Tried PerlRequire as well - still the same error

the steps are outlined pretty well in recipe 10.3 (since you mentioned the cookbook 
earlier).  from the looks of your error message in your earlier post, I'd say you 
forgot 
to prototype your handler, since mod_perl was adding the ::handler stuff to your 
PerlHandler argument.  you might want to make sure you built with EVERYTHING=1 as 
well, 
since I'm not sure what mod_perl does if built with PERL_METHOD_HANDLERS=0 (check 
perl-status?hooks for PerlMethodHandlers to be sure).

however there could also be other things amiss, like the package name doesn't match 
what 
you have in your PerlHandler line or whatnot.  if I were you, I'd follow all the 
normal 
method handler steps in 10.3 but create a functional handler instead to make sure 
there 
aren't any typos in there or anything.  in other words, get

   sub mymethod { my $r = shift; ... }

to work first.  then, just change the prototype and recover ($self, $r) as a second 
step.

I know this may not be much help, but the basic steps are pretty much the same and are 
very simple - it's probably something little and unseen that is tripping you up.

HTH

--Geoff




Re: Load Balancing, mod_proxy, rewrite problem

2002-05-14 Thread Tom Lancaster

On closer examination, I don't think this will solve your problem - this 
helps when you want to proxy something that's been included via mod_include.

Tom


On Tue, May 14, 2002 at 09:32:54AM -0700, Tom Lancaster wrote:
> I think I had a similar problem. It's a while since I tackled it, so I might
> be wrong. In any case, I was having problems doing proxy with a rewritemap.
> My reason for wanting to do this was so I could use the weighting feature of
> rewritemaps to do weighted load balancing between frontend and backend 
> apaches.
> 
> I mailed Engelschall, but I hear he gets so much mail about mod_rewrite that
> it takes him years to respond.
> 
> In any case, I have a patch to mod_rewrite that fixed the problem for me.
> The breakdown of the issue was that mod_rewrite wouldn't do a proxy on a
> subrequest.
> 
> Be warned: I think this patch causes problems with the automatic adding of 
> trailing /'s on URLs.
> 
> Tom
> 
> 
> 
> On Tue, May 14, 2002 at 12:19:44PM -0400, Perrin Harkins wrote:
> > mire wrote:
> > > I have code like this:
> > > 
> > > RewriteEngine On
> > >  
> > > RewriteLog "/var/site/rewrite.log"
> > > RewriteMaplb  prg:/tmp/lb
> > > 
> > > RewriteRule  ^/trta$  http://${lb:prvi|drugi}  [proxy,last] 
> > > 
> > > and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems
> > > like perl script is waiting indeffinetly for input.
> > 
> > Sorry, this is not a mod_perl problem.  You should try the general 
> > Apache user mailing lists, or see if there's a list or newsgroup for 
> > mod_rewrite.
> > 
> > - Perrin
> 
> -- 
> Tom Lancaster Red Hat, Inc.
> [EMAIL PROTECTED]   (510)-986-8770 x 354

> This patch is necessary to allow rewriterules to be applied to subrequests when
> they are meant to be proxied. We need this to allow mod_include to get 
>/apps/include/pane.html from the app servers by proxy.
> 
> --- apache_1.3.19/src/modules/standard/mod_rewrite.c.proxy-subreq Wed Jan 31 
>20:12:26 2001
> +++ apache_1.3.19/src/modules/standard/mod_rewrite.c  Wed May 23 16:39:47 2001
> @@ -1604,10 +1604,10 @@
>  /*
>   *  Ignore this rule on subrequests if we are explicitly
> - *  asked to do so or this is a proxy-throughput or a
> + *  asked to do so or if this is a
>   *  forced redirect rule.
>   */
>  if (r->main != NULL &&
>  (p->flags & RULEFLAG_IGNOREONSUBREQ ||
> - p->flags & RULEFLAG_PROXY  ||
> +/*   p->flags & RULEFLAG_PROXY  ||  */
>   p->flags & RULEFLAG_FORCEREDIRECT)) {
>  continue;


-- 
Tom Lancaster   Red Hat, Inc.
[EMAIL PROTECTED] (510)-986-8770 x 354



$r->args vs $r->content

2002-05-14 Thread Mike Melillo








 

 

 

Ok, I've switched to A::Request,
but it still seems my parameters table is empty.  I'll paste in the form data,
as well as some code snippets to see if that helps find the bug.

 

 

 

username

 

 

password



 



 



 

**End HTML Template**

 

** Join.pm **

 

sub submit {

    my $DEBUG = 1;

    my ($r) = shift;

    my $apr = Apache::Request->new($r);

    my $status = $apr->parse;

    my @param = $apr->param;

    $DEBUG &&
print STDERR Dumper($apr->parms)

    $DEBUG &&
print STDERR Dumper(@param);

 

...

}

 

 

The first Data::Dumper print
statement sends this to the errlog -> 

$VAR1 = bless( {}, 'Apache::Table'
);

 

The second print statement
prints nothing.

 

I looked at perldoc Apache::Request,
but didn’t see anything wrong...

 

Help?

 

Mike

 

 

 

-Original Message-

From: Issac Goldstand [mailto:[EMAIL PROTECTED]] 

Sent: Tuesday, May 14, 2002
4:39 AM

To: Mike Melillo

Cc: [EMAIL PROTECTED]

Subject: Re: $r->args vs
$r->content

 

Quoting Mike Melillo
<[EMAIL PROTECTED]>:

 

> 

> Hi,

> 

 

> One of the fields is an
image file that will be uploaded so I need to 

> use POST requests.  Is
this a job for Apache::Request?  The eagle book 

> doesn't cover it much
because it was "experimental" at the time of 

> publishing.

> 

There's a version 1.0 out by
now.  That means stable as it's ever gonna get :-)  I use it all the time, go
for it!

 

  Issac

 

 

Internet is a wonderful
mechanism for making a fool of

yourself in front of a very
large audience.

  --Anonymous

 

Moving the mouse won\'t get
you into trouble...  Clicking it might.

  --Anonymous

 

PGP Key 0xE0FA561B -
Fingerprint:

7E18 C018 D623 A57B 7F37
D902 8C84 7675 E0FA 561B

 

 








Re: Load Balancing, mod_proxy, rewrite problem

2002-05-14 Thread Tom Lancaster

I think I had a similar problem. It's a while since I tackled it, so I might
be wrong. In any case, I was having problems doing proxy with a rewritemap.
My reason for wanting to do this was so I could use the weighting feature of
rewritemaps to do weighted load balancing between frontend and backend 
apaches.

I mailed Engelschall, but I hear he gets so much mail about mod_rewrite that
it takes him years to respond.

In any case, I have a patch to mod_rewrite that fixed the problem for me.
The breakdown of the issue was that mod_rewrite wouldn't do a proxy on a
subrequest.

Be warned: I think this patch causes problems with the automatic adding of 
trailing /'s on URLs.

Tom



On Tue, May 14, 2002 at 12:19:44PM -0400, Perrin Harkins wrote:
> mire wrote:
> > I have code like this:
> > 
> > RewriteEngine On
> >  
> > RewriteLog "/var/site/rewrite.log"
> > RewriteMaplb  prg:/tmp/lb
> > 
> > RewriteRule  ^/trta$  http://${lb:prvi|drugi}  [proxy,last] 
> > 
> > and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems
> > like perl script is waiting indeffinetly for input.
> 
> Sorry, this is not a mod_perl problem.  You should try the general 
> Apache user mailing lists, or see if there's a list or newsgroup for 
> mod_rewrite.
> 
> - Perrin

-- 
Tom Lancaster   Red Hat, Inc.
[EMAIL PROTECTED] (510)-986-8770 x 354


This patch is necessary to allow rewriterules to be applied to subrequests when
they are meant to be proxied. We need this to allow mod_include to get 
/apps/include/pane.html from the app servers by proxy.

--- apache_1.3.19/src/modules/standard/mod_rewrite.c.proxy-subreq   Wed Jan 31 
20:12:26 2001
+++ apache_1.3.19/src/modules/standard/mod_rewrite.cWed May 23 16:39:47 2001
@@ -1604,10 +1604,10 @@
 /*
  *  Ignore this rule on subrequests if we are explicitly
- *  asked to do so or this is a proxy-throughput or a
+ *  asked to do so or if this is a
  *  forced redirect rule.
  */
 if (r->main != NULL &&
 (p->flags & RULEFLAG_IGNOREONSUBREQ ||
- p->flags & RULEFLAG_PROXY  ||
+/*   p->flags & RULEFLAG_PROXY  ||  */
  p->flags & RULEFLAG_FORCEREDIRECT)) {
 continue;



RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan

> 
> At 08:58 AM 5/14/02 -0700, Erchinger, Ethan wrote:
> 
> Do you think it could be the 
> startup.pl (handler.pl),
> >shouldn't that only get run when the handler is perl-script?
> 
> If you have a "PerlRequire startup.pl" statement in your httpd.conf, 
> startup.pl will always be run as Apache is starting up. It 
> has nothing to 
> do with the Set/AddHandler directives. I'm sure there is a 
> section in the 
> guide (http://perl.apache.org/guide/) which has more info, 
> but I don't have 
> a link handy.

Thanks.  So in the handler.pl I now have a stanza that looks for my
/yadda-yadda uri in $r, and just return 1; if that's the case, put this in
the handler() sub.  So I believe the startup.pl should no longer be causing
problems.  I find it interesting that if I comment out the 
directive which sets the "SetHandler perl-script", then the problem
disappears, maybe no so interesting, probably more obvious.  By the way,
this directory /yadda-yadda is actually being redirected via the mod_jk
ajp13 protocol to a Tomcat server.  If that helps at all.

Thanks,
EE



RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan

I have it setup that way, thanks, still no dice.


> Subject: Re: How to disable mod_perl in a subdir (apache)
> 
> 
> Make sure you put it after the Location directive that sets 
> HTML::Mason
> 
> 
> SetHandler perl-script
> PerlHandler HTML::Mason
> 
> 
> 
> SetHandler default-handler
> 
> 
> 
> Regards,
> 
> Tim Tompkins
> --
> Programmer
> http://www.arttoday.com/
> http://www.rebelartist.com/
> --
> - Original Message -
> From: "Erchinger, Ethan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, May 14, 2002 8:58 AM
> Subject: RE: How to disable mod_perl in a subdir (apache)
> 
> 
> 
> > Try
> > 
> > SetHandler default-handler
> > 
> 
> I tried that as well.  Do you think it could be the 
> startup.pl (handler.pl),
> shouldn't that only get run when the handler is perl-script?
> 
> EE
> 
> 
> >> Subject: How to disable mod_perl in a subdir (apache)
> 
> 
> >> Hi all,
> >> I saw a posting about this subject from earlier this year. 
>  I'm unable to
> >> make this work, and was hoping for some help.  I have a 
> directive
> >> for / (for the entire docroot).   I would like to make one 
> subdirectory
> not
> >> be handled by perl-script, but am unable to do so.  Excerpt from
> httpd.conf:
> >>
> >> ~snip~
> >> PerlModule Apache::DBI
> >> PerlFreshRestart On
> >> PerlRequire /etc/apache/handler.pl
> >> 
> >> Options FollowSymLinks
> >> AllowOverride None
> >> order allow,deny
> >> allow from all
> >> 
> >>
> >> 
> >>SetHandler perl-script
> >>PerlHandler HTML::Mason
> >> 
> >> ~snip~
> >>
> >> I'm trying to make it so that, a subdir, like 
> /yadda-yadda, is _not_
> handled
> >> by Mason.  Here is what I've tried to do:
> >>
> >> 
> >> RemoveHandler .html
> >> 
> >>
> >> I've also tried moving the  directive contents 
> into the above
> >> , seeing as the docs mention that  directives
> override
> >> a  directive, with no luck.
> >>
> >> Yet these files are still being served through Mason, and 
> I can't figure
> out
> >> why.  Should my handler.pl (startup.pl) be moved so that it's not
> executed
> >> in that Location?  I've read as much as I can find on 
> Apache's site, with
> no
> >> luck.
> >>
> >> Debian 2.2r3
> >> Apache/1.3.9
> >> Mod_perl 1.21
> >>
> >> Thanks all,
> >> Ethan Erchinger
> 
> 



Re: Load Balancing, mod_proxy, rewrite problem

2002-05-14 Thread Perrin Harkins

mire wrote:
> I have code like this:
> 
> RewriteEngine On
>  
> RewriteLog "/var/site/rewrite.log"
> RewriteMaplb  prg:/tmp/lb
> 
> RewriteRule  ^/trta$  http://${lb:prvi|drugi}  [proxy,last] 
> 
> and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems
> like perl script is waiting indeffinetly for input.

Sorry, this is not a mod_perl problem.  You should try the general 
Apache user mailing lists, or see if there's a list or newsgroup for 
mod_rewrite.

- Perrin




RE: unable to use method type handlers?

2002-05-14 Thread Jeff AA


> Try per load the class my::class via startup.pl or PerlModule

I already had PerlModule my::classes in httpd.conf
Tried PerlRequire as well - still the same error

help??


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of
[EMAIL PROTECTED]
Sent: 14 May 2002 09:58
To: Jeff AA
Cc: [EMAIL PROTECTED]
Subject: Re: unable to use method type handlers?


Try per load the class my::class via startup.pl or PerlModule

Tor.


Jeff AA wrote:
> 
> Whenever I try to set up a method type handler
> 
>   PerlHandler my::classes->mymethod
> 
> I get the following in the error log:
> 
>   Undefined subroutine &my::classes->mymethod::handler called.
> 
> using:
>   Apache/1.3.23 (Unix) Debian GNU/Linux
>   mod_perl/1.26 mod_ssl/2.8.7 OpenSSL/0.9.6c
> 
> any hints would be appreciated





Re: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Tim Tompkins

Make sure you put it after the Location directive that sets HTML::Mason


SetHandler perl-script
PerlHandler HTML::Mason



SetHandler default-handler



Regards,

Tim Tompkins
--
Programmer
http://www.arttoday.com/
http://www.rebelartist.com/
--
- Original Message -
From: "Erchinger, Ethan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 14, 2002 8:58 AM
Subject: RE: How to disable mod_perl in a subdir (apache)



> Try
> 
> SetHandler default-handler
> 

I tried that as well.  Do you think it could be the startup.pl (handler.pl),
shouldn't that only get run when the handler is perl-script?

EE


>> Subject: How to disable mod_perl in a subdir (apache)


>> Hi all,
>> I saw a posting about this subject from earlier this year.  I'm unable to
>> make this work, and was hoping for some help.  I have a 
directive
>> for / (for the entire docroot).   I would like to make one subdirectory
not
>> be handled by perl-script, but am unable to do so.  Excerpt from
httpd.conf:
>>
>> ~snip~
>> PerlModule Apache::DBI
>> PerlFreshRestart On
>> PerlRequire /etc/apache/handler.pl
>> 
>> Options FollowSymLinks
>> AllowOverride None
>> order allow,deny
>> allow from all
>> 
>>
>> 
>>SetHandler perl-script
>>PerlHandler HTML::Mason
>> 
>> ~snip~
>>
>> I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_
handled
>> by Mason.  Here is what I've tried to do:
>>
>> 
>> RemoveHandler .html
>> 
>>
>> I've also tried moving the  directive contents into the above
>> , seeing as the docs mention that  directives
override
>> a  directive, with no luck.
>>
>> Yet these files are still being served through Mason, and I can't figure
out
>> why.  Should my handler.pl (startup.pl) be moved so that it's not
executed
>> in that Location?  I've read as much as I can find on Apache's site, with
no
>> luck.
>>
>> Debian 2.2r3
>> Apache/1.3.9
>> Mod_perl 1.21
>>
>> Thanks all,
>> Ethan Erchinger





RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Drew Taylor

At 08:58 AM 5/14/02 -0700, Erchinger, Ethan wrote:

> > Try
> > 
> > SetHandler default-handler
> > 
>
>I tried that as well.  Do you think it could be the startup.pl (handler.pl),
>shouldn't that only get run when the handler is perl-script?

If you have a "PerlRequire startup.pl" statement in your httpd.conf, 
startup.pl will always be run as Apache is starting up. It has nothing to 
do with the Set/AddHandler directives. I'm sure there is a section in the 
guide (http://perl.apache.org/guide/) which has more info, but I don't have 
a link handy.

Drew

==
Drew Taylor  |  Freelance web development using
http://www.drewtaylor.com/   |  perl/mod_perl/MySQL/postgresql/DBI
mailto:[EMAIL PROTECTED]   |  Email jobs at drewtaylor.com
--
Speakeasy.net: A DSL provider with a clue. Sign up today.
http://www.speakeasy.net/refer/29655
==




RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan


> Try
> 
> SetHandler default-handler
> 

I tried that as well.  Do you think it could be the startup.pl (handler.pl),
shouldn't that only get run when the handler is perl-script?

EE


>> Subject: How to disable mod_perl in a subdir (apache)


>> Hi all,
>> I saw a posting about this subject from earlier this year.  I'm unable to
>> make this work, and was hoping for some help.  I have a 
directive
>> for / (for the entire docroot).   I would like to make one subdirectory
not
>> be handled by perl-script, but am unable to do so.  Excerpt from
httpd.conf:
>>
>> ~snip~
>> PerlModule Apache::DBI
>> PerlFreshRestart On
>> PerlRequire /etc/apache/handler.pl
>> 
>> Options FollowSymLinks
>> AllowOverride None
>> order allow,deny
>> allow from all
>> 
>>
>> 
>>SetHandler perl-script
>>PerlHandler HTML::Mason
>> 
>> ~snip~
>>
>> I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_
handled
>> by Mason.  Here is what I've tried to do:
>>
>> 
>> RemoveHandler .html
>> 
>>
>> I've also tried moving the  directive contents into the above
>> , seeing as the docs mention that  directives
override
>> a  directive, with no luck.
>>
>> Yet these files are still being served through Mason, and I can't figure
out
>> why.  Should my handler.pl (startup.pl) be moved so that it's not
executed
>> in that Location?  I've read as much as I can find on Apache's site, with
no
>> luck.
>>
>> Debian 2.2r3
>> Apache/1.3.9
>> Mod_perl 1.21
>>
>> Thanks all,
>> Ethan Erchinger



Re: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Tim Burden

Try

SetHandler default-handler



- Original Message -
From: "Erchinger, Ethan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 14, 2002 11:50 AM
Subject: How to disable mod_perl in a subdir (apache)


> Hi all,
> I saw a posting about this subject from earlier this year.  I'm unable to
> make this work, and was hoping for some help.  I have a 
directive
> for / (for the entire docroot).   I would like to make one subdirectory
not
> be handled by perl-script, but am unable to do so.  Excerpt from
httpd.conf:
>
> ~snip~
> PerlModule Apache::DBI
> PerlFreshRestart On
> PerlRequire /etc/apache/handler.pl
> 
> Options FollowSymLinks
> AllowOverride None
> order allow,deny
> allow from all
> 
>
> 
>SetHandler perl-script
>PerlHandler HTML::Mason
> 
> ~snip~
>
> I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_
handled
> by Mason.  Here is what I've tried to do:
>
> 
> RemoveHandler .html
> 
>
> I've also tried moving the  directive contents into the above
> , seeing as the docs mention that  directives
override
> a  directive, with no luck.
>
> Yet these files are still being served through Mason, and I can't figure
out
> why.  Should my handler.pl (startup.pl) be moved so that it's not executed
> in that Location?  I've read as much as I can find on Apache's site, with
no
> luck.
>
> Debian 2.2r3
> Apache/1.3.9
> Mod_perl 1.21
>
> Thanks all,
> Ethan Erchinger




How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan

Hi all,
I saw a posting about this subject from earlier this year.  I'm unable to
make this work, and was hoping for some help.  I have a  directive
for / (for the entire docroot).   I would like to make one subdirectory not
be handled by perl-script, but am unable to do so.  Excerpt from httpd.conf:

~snip~
PerlModule Apache::DBI
PerlFreshRestart On
PerlRequire /etc/apache/handler.pl

Options FollowSymLinks
AllowOverride None
order allow,deny
allow from all



   SetHandler perl-script
   PerlHandler HTML::Mason

~snip~

I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_ handled
by Mason.  Here is what I've tried to do:


RemoveHandler .html


I've also tried moving the  directive contents into the above
, seeing as the docs mention that  directives override
a  directive, with no luck.

Yet these files are still being served through Mason, and I can't figure out
why.  Should my handler.pl (startup.pl) be moved so that it's not executed
in that Location?  I've read as much as I can find on Apache's site, with no
luck.

Debian 2.2r3
Apache/1.3.9
Mod_perl 1.21

Thanks all,
Ethan Erchinger



RE: we need mod_perl banners

2002-05-14 Thread Jonathan M. Hollin

>Do we have the source for those banners anywhere?  Preferably 
>vector, or 
>at least telling us what font the original was in.  I don't 
>think anyone 
>wants to work from bitmap.
>
>I seem to remember matts doing something with SVG a while 
>back, but him 
>waiting on the correct font (my memory is a bit vague on this)

Spec's are as follows:

Font:  Trebuchet MS, sans-serif (Trebuchet is available for download
from the M$ website)
Size:  60pt
Grey:  #99
Blue:  #326696

And the text was rendered in Bold.

An SVG version of the new logo is available at:
http://wypug.digital-word.com/mod_perl/svg_version/


Regards,

Jonathan M. Hollin - WYPUG Co-ordinator

West Yorkshire Perl User Group
http://wypug.pm.org/
http://wypug.digital-word.com/




Re: we need mod_perl banners

2002-05-14 Thread Stas Bekman

Mark Fowler wrote:
> On Tue, 14 May 2002, Stas Bekman wrote:
> 
> 
>>[ creating banners, etc ]
> 
> 
> Do we have the source for those banners anywhere?  Preferably vector, or 
> at least telling us what font the original was in.  I don't think anyone 
> wants to work from bitmap.
> 
> I seem to remember matts doing something with SVG a while back, but him 
> waiting on the correct font (my memory is a bit vague on this)

Only the new mod_perl logo:
http://wypug.digital-word.com/mod_perl/svg_version/

(the svg version will feature on the new site as well)

__
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: we need mod_perl banners

2002-05-14 Thread Mark Fowler

On Tue, 14 May 2002, Stas Bekman wrote:

> [ creating banners, etc ]

Do we have the source for those banners anywhere?  Preferably vector, or 
at least telling us what font the original was in.  I don't think anyone 
wants to work from bitmap.

I seem to remember matts doing something with SVG a while back, but him 
waiting on the correct font (my memory is a bit vague on this)

(Insert joke about needing the src and closed source banners here)

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}





we need mod_perl banners

2002-05-14 Thread Stas Bekman

Nobody has volunteered to lead the modperl banners effort, so if you are 
an artist or know someone who is and willing to help please send the 
banners to me.

The story:
--
Some people want to advertise mod_perl on their sites. We need banners 
for that. Your help is appreciated.

Approx Banner Spec:
---
Format: PNG
Dimensions: 468x60 and 150x40 (pixels)
Size:   about 10k.

BTW, we still don't have a button derived from the winner logo!
should be 88x31px or something like that.

Ideas for banners:
--
* world domination chapter 1 (only 20% achieved, see netcraft)
* world domination chapter 2 (50% target)
* include the 2.0 theme


Try to re-use the new logo:
---
http://wypug.digital-word.com/mod_perl/winner/

You can use Apache's feather:
-
http://apache.org/~stas/feather.gif
http://apache.org/~stas/feather_transbg.gif

And ORA's camel:

http://perl.oreilly.com/usage/
and probably can cut images from
http://wypug.digital-word.com/mod_perl/


Thanks.
__
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: filtering mod_proxy output

2002-05-14 Thread Drew Taylor

At 04:25 PM 5/14/02 +0200, Charles Bueche wrote:
>Hi all,
>
>I want to implement a transparent reverse proxy, to export an intranet web
>server to the Internet.
>
>I know about the ProxyPass friends, but with such a mapping :
>
> ProxyPass /toto http://intra.company.com
>
>the returned HTML page contains links that must be filtered (IMG SRC,
>etc).

Read up on the ProxyPassReverse directive of mod_proxy. This will do 
exactly what you are looking for.

Drew

==
Drew Taylor  |  Freelance web development using
http://www.drewtaylor.com/   |  perl/mod_perl/MySQL/postgresql/DBI
mailto:[EMAIL PROTECTED]   |  Email jobs at drewtaylor.com
--
Speakeasy.net: A DSL provider with a clue. Sign up today.
http://www.speakeasy.net/refer/29655
==




filtering mod_proxy output

2002-05-14 Thread Charles Bueche

Hi all,

I want to implement a transparent reverse proxy, to export an intranet web
server to the Internet.

I know about the ProxyPass friends, but with such a mapping :

ProxyPass /toto http://intra.company.com

the returned HTML page contains links that must be filtered (IMG SRC,
etc).

My original attempt was to create a Content Handler to filter the HTML
flow (add "/toto" on all links), but apparently, I can't hook my handler
after mod_proxy. Is there a way to realize this ?

The O'Reilly book mention writing my own proxy. Or would Apache 2.0
filters solve this in an elegant way ?

Thanks for any hint,

Charles
-- 
Charles Bueche <[EMAIL PROTECTED]>
sand, snow, wave, wind and net -surfer



Re: Moving from CGI to mod_perl

2002-05-14 Thread Jason

Probably the BIGGEST mod_perl pitfall is variable scoping/initialization.

I recommend that you try to

use strict;

whenever possible ESPECIALLY in mod_perl.

- Original Message - 
From: "Anton Permyakov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 14, 2002 12:15 AM
Subject: Moving from CGI to mod_perl


> Hi, all.
> 
> I have perl CGI-script, and i wanna run it as mod_perl script.
> 
> Is it enought to correctly edit only httpd.conf, or i've to add something
> special in my CGI-script? Maybe something like
> 
> use Apache::Registry;
> 
> or something else
> 
> Also is it needed to write some special script like startup.pl or not?
> 
> Thank you all, and sorry for this "easy question"...
> In doc i could not find "How to migrate from CGI to mod_perl" - step by step
> easy example.
> 
> Good luck,
> Anton Permyakov.




Re: Memory usage option in Apache::Status

2002-05-14 Thread Stas Bekman

[EMAIL PROTECTED] wrote:
>>ok, next trace to the offending code.

> [Tue May 14 10:38:19 2002] [error] Can't call method "size" on unblessed
> reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
> 94.
> B::AV::size(1, 'B::AV=SCALAR(0xa063444)') called at
> /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 438

I cannot reproduce the problem, but it seems that the problem is in
B/Size.pm:93my @vals = $sv->ARRAY;

which returns values which aren't references (at least one). You may 
want to muck around this code and print what's inside @vals.

> B::TerseSize::PADLIST_size('B::CV=SCALAR(0xa0674a0)',
> 'B::CV=SCALAR(0xa0674a0)', 'B::CV=SCALAR(0xa0674a0)',
> 'B::CV=SCALAR(0xa0674a0)') called at
> /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 190
> B::TerseSize::CV_walk('slow', 'B::NULL::size', 'op_size') called
> at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 123
> B::TerseSize::package_size('B::NULL') called at
> /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 542
> B::TerseSize::apache_package_size('B::HV', 'B::Terse',
> 'B::SPECIAL', 'B::NULL') called at
> /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 563
> B::TerseSize::status_memory_usage('Apache=SCALAR(0x9e4ae5c)',
> 'CGI=HASH(0x9e4aa8c)') called at
> /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache/Status.pm line 66
> Apache::Status::handler('Apache=SCALAR(0x9e4ae5c)') called at
> /usr/lib/perl5/5.6.0/Carp.pm line 119
> require 0 called at /usr/lib/perl5/5.6.0/Carp.pm line 119

> I will see if I can borrow a testing machine tomorrow to try the
> upgrade.

Please check if the problem does go away with 5.6.1. if not please
provide a short script/module that reproduces the problem (via
Apache::Status of course)



__
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




Embed Apache+Mod_perl into a application

2002-05-14 Thread Vitor

Hello Folks,

Does anybody tried to embed mod_perl and apache inside an windows
application ?

Thanks,

Vitor




Re: automatic redirect to https

2002-05-14 Thread Geoffrey Young



Aaron J Mackey wrote:

> Yes: simply because I want to be able to install the software at new
> sites with minimal httpd.conf twiddling (and the user has a configuration
> file in which they can switch on/off the SSL requirement).


in that case, you probably want to check $r->subprocess_env('HTTPS') instead of 
$ENV{HTTPS}, since PerlSetupEnv Off will cause $ENV{HTTPS} to be false.


--Geoff





RE: automatic redirect to https

2002-05-14 Thread Aaron J Mackey


Yes: simply because I want to be able to install the software at new
sites with minimal httpd.conf twiddling (and the user has a configuration
file in which they can switch on/off the SSL requirement).

Thanks for the easier answer though - it should probably be the first
answer in the FAQ (is there a FAQ file somewhere that I could patch in the
answers to this question and send it to someone?)

-Aaron

On Mon, 13 May 2002, Christian Gilmore wrote:

> Is there a reason you don't just use a Redirect?
>
>   
>   Redirect/   https://secure.server.com/
>   
>
> Regards,
> Christian
>
> -
> Christian Gilmore
> Technology Leader
> GeT WW Global Applications Development
> IBM Software Group
>
>
> > -Original Message-
> > From: Aaron J Mackey [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 13, 2002 1:12 PM
> > To: [EMAIL PROTECTED]
> > Subject: automatic redirect to https
> >
> >
> >
> > Can anyone see something wrong with this, or suggest a better
> > mechanism:
> >
> > unless ( $ENV{HTTPS} ) {
> > # bounce request to secure port
> > my $uri = $r->parsed_uri();
> > $uri->scheme('https');
> > $r->header_out(Location => $uri->unparse());
> > return REDIRECT;
> > }
> >
> > This doesn't seem to work for me; the browser acts as if it's in an
> > eternal redirection loop.  And the server's error log says
> > that a child
> > segfaulted in the process.  The $uri->unparse yields a string like
> > "https:/mydirectory" when I access
> > "http://myserver.org/mydirectory";.  Do
> > I need to rebuild the entire URI manually?
> >
> > Thanks,
> >
> > -Aaron
> >




Re: Memory usage option in Apache::Status

2002-05-14 Thread victor


> ok, next trace to the offending code. Put in your startup.pl:
> 
> use Carp;
> $SIG{__DIE__} = \&Carp::confess;
> 
> hopefully nobody redefines $SIG{__DIE__}


ok, this is what I get in the error log 


[Tue May 14 10:38:19 2002] [error] Can't call method "size" on unblessed
reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
94.
B::AV::size(1, 'B::AV=SCALAR(0xa063444)') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 438
B::TerseSize::PADLIST_size('B::CV=SCALAR(0xa0674a0)',
'B::CV=SCALAR(0xa0674a0)', 'B::CV=SCALAR(0xa0674a0)',
'B::CV=SCALAR(0xa0674a0)') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 190
B::TerseSize::CV_walk('slow', 'B::NULL::size', 'op_size') called
at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 123
B::TerseSize::package_size('B::NULL') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 542
B::TerseSize::apache_package_size('B::HV', 'B::Terse',
'B::SPECIAL', 'B::NULL') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 563
B::TerseSize::status_memory_usage('Apache=SCALAR(0x9e4ae5c)',
'CGI=HASH(0x9e4aa8c)') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache/Status.pm line 66
Apache::Status::handler('Apache=SCALAR(0x9e4ae5c)') called at
/usr/lib/perl5/5.6.0/Carp.pm line 119
require 0 called at /usr/lib/perl5/5.6.0/Carp.pm line 119


> >   Would love to, but it's a production machine, so .. I can't upgrade it
> > unless something major breaks.  (^_^!)
> 
> This is a *major* reason for updating :)
> 

I will see if I can borrow a testing machine tomorrow to try the
upgrade.

Tor.



RE: mod_perl2: nmake test crashes apache

2002-05-14 Thread Alessandro Forghieri

Greetings.

A few updates...

i) modperl-2.0_20020514042137.tar.gz 
   Now tests cleanly on:
   WinNT SP6/MSDEV 6 SP3/AS perl 5.6.1 b630/httpd-2.0_20020506161223.tar.gz

ii) It does however crash on my testbed app (which runs as standard CGI,
FastCGI and
moperl1). The crash itself appears to happen when a number of
nearly-simultaneous requests
arrive to the server and is fatal to modperl (but the static-serving part of
apache appears to survive)

iia) On non-debug modperl in post-mortem examination within msdev I have
been able to observe a seemingly incorrect r->pool thingy (casted to
"something else" within table related _palloc) triggering the
segfault.

iib) I then set out to build a debug version. That ain't easy I finally
got it with
semiautomatic Makefile mangling:

perl Makefile.PL MP_INST_APACHE2=1 MP_AP_PREFIX="D:\Apache2"
MP_GENERATE_XS=1 MP_DEBUG=1 MP_TRACE=1 

find . -name Makefile -print   | xargs perl -spi.bak -e
"s/-O1//g;s/-DNDEBUG//g;s/-release/-DEBUG -PDB:vc60.pdb/g;"

nmake

[Explanation: the generated Makefiles have sequences of -O1 -Od -O1 *AND*
the linkline misses the critical -DEBUG option. the PDB and -DNDEBUG things
may not be needed.]

After this the crash location moves (darn) and the debugger brings me in a
location with nothing obviously wrong in sight. It is wedged on
modperl_get_perl_module_config, called from
XS_Apache_RequestRec_send_cgi_header etc. etc.


Note: After switching to the debug version, I have started 
seeing apache errors - Your script did not blah blah - that were not there
before, coupled to diagnostics from ModPerl::Registry complaining about not
being able to call  send_cgi_header on an undefined value. This may be
significant.


I will sendo more info when I have it...
Cheers,
alf


 



Re: Memory usage option in Apache::Status

2002-05-14 Thread Stas Bekman

[EMAIL PROTECTED] wrote:
>>[EMAIL PROTECTED] wrote:
>>
>>>Hope someone can give me a hand on this, I am having some problem using
>>>the Memory Usage option in the main menu of Apache::Status.
>>>
>>>It always return me a 500 with the following error.
>>>
>>>[Tue May 14 08:48:21 2002] [error] Can't call method "size" on unblessed
>>>reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
>>>94.

>   yes, I have both installed. 

ok, next trace to the offending code. Put in your startup.pl:

use Carp;
$SIG{__DIE__} = \&Carp::confess;

hopefully nobody redefines $SIG{__DIE__}


>>Also 5.6.0 is *very* buggy, so upgrading to 5.6.1 is a very good idea.
> 
> 
> 
>   Would love to, but it's a production machine, so .. I can't upgrade it
> unless something major breaks.  (^_^!)

This is a *major* reason for updating :)


__
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: MLDBM Tie Errors

2002-05-14 Thread Franck PORCHER

Well, I'm not 100% sure, but I recently switched for MLDBM and got this
problem too. Here is what I found, and did to remedy the situation :

It *seemed* to me that the physical MLDBM repository was not physically created
until I actually wrote something into it, eventhough it was reported as
correctly open RW.

So, any ends of my application trying to fetch value during this
transcient stage got this kind of error (I do not remember
precisely which one I got, but very close indeed).

I solved the problem by doing an awful trick on each RW opening, such as
:

eval {
   tie %hash, "MLDBM::Sync", $storage, O_RDWR | O_CREAT, 0660;
   $hash{'__DuMmY__'} = 'OK';
   delete $hash{'__DuMmY__'};
 };

That solved the problem in the midtime, waiting for something
much better...

Franck

On Mon, 13 May 2002, Mike Martinet wrote:

> Greetings,
>
> With this setup:
>
> Linux kernel 2.4.7-10
> Apache 1.3.24
> mod_perl-1.26
> Apache::ASP 2.33
> MLDBM 0.25
>
> I keep getting the following errors:
>
> First this -
>
> [Mon May 13 08:57:26 2002] [notice] Apache/1.3.24 (Unix) mod_perl/1.26
> mod_ssl/2.8.8 OpenSSL/0.9.6b configured -- resuming normal operations
>
> [Mon May 13 08:57:26 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
> can't unlink dir /mnt/hdb/www/content//: Directory not empty at
> /usr/lib/perl5/site_perl/5.6.1/MLDBM/Sync.pm line 110.
>
> then shortly thereater (it seems) this -
>
> MLDBM error: Second level tie failed, "Invalid argument" at
> /usr/lib/perl5/site_perl/5.6.1/MLDBM/Sync.pm line 209
> [Mon May 13 09:25:48 2002] [error] can't tie to MLDBM with args:
> ,66,416; error:  at /usr/lib/perl5/site_perl/5.6.1/MLDBM/Sync.pm line 209.
>
>
> This appears to be random.  I'm trying to figure out which code I've
> written might be triggering it, but I'm having trouble tracking it down.
>   Sometimes a server restart is required to recover; sometimes not.  The
> two errors don't always appear together.
>
> Any help would be greatly appreciated.
>
>
> Thanks,
>
>
>
> MjM
>
>

-- 

Bonne réception,

Franck


Essential Software - Ingénierie Informatique
Solutions Linux & Open Source en Polynésie française

http://www.esoft.pf/
Tél: (689) 56 23 95





Re: Memory usage option in Apache::Status

2002-05-14 Thread victor

> 
> [EMAIL PROTECTED] wrote:
> > Hope someone can give me a hand on this, I am having some problem using
> > the Memory Usage option in the main menu of Apache::Status.
> >
> > It always return me a 500 with the following error.
> >
> > [Tue May 14 08:48:21 2002] [error] Can't call method "size" on unblessed
> > reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
> > 94.


Thanks for you prompt reply stats.

 
> Do you have B::Size installed?
> 
>perl -MB::Size -e1
> 
> Can you use TerseSize from the command line?
> 
>perl -MO=TerseSize -e '1'
> 

  yes, I have both installed. and here's the return running the command
you gave.


[]$ perl -MB::Size -e1
[]$ perl -MO=TerseSize -e '1'
LISTOP leave 0x818acf0 {36 bytes}
OP enter 0x81c6c90 {24 bytes}

COPnextstate 0x8173900 {24 bytes}
OP null  0x81d6140 {24 bytes} [const - constant item]
-e syntax OK


> Also 5.6.0 is *very* buggy, so upgrading to 5.6.1 is a very good idea.


  Would love to, but it's a production machine, so .. I can't upgrade it
unless something major breaks.  (^_^!)


Tor.



Re: Memory usage option in Apache::Status

2002-05-14 Thread Stas Bekman

[EMAIL PROTECTED] wrote:
> Hope someone can give me a hand on this, I am having some problem using
> the Memory Usage option in the main menu of Apache::Status.  
> 
> It always return me a 500 with the following error.
> 
> [Tue May 14 08:48:21 2002] [error] Can't call method "size" on unblessed
> reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
> 94.

Do you have B::Size installed?

   perl -MB::Size -e1

Can you use TerseSize from the command line?

   perl -MO=TerseSize -e '1'

Also 5.6.0 is *very* buggy, so upgrading to 5.6.1 is a very good idea.


> This is the config I added to httpd.conf to enable the feature.
> 
> 
>   SetHandler perl-script
>   PerlModule Apache::Status
>   PerlModule B::TerseSize
>   PerlHandler Apache::Status
> 
>   PerlSetVar StatusOptionsAll On
>   PerlSetVar StatusTerse On
>   PerlSetVar StatusTerseSize On
>   PerlSetVar StatusTerseSizeMainSummary On
> 

__
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: unable to use method type handlers?

2002-05-14 Thread victor

Try per load the class my::class via startup.pl or PerlModule

Tor.


Jeff AA wrote:
> 
> Whenever I try to set up a method type handler
> 
>   PerlHandler my::classes->mymethod
> 
> I get the following in the error log:
> 
>   Undefined subroutine &my::classes->mymethod::handler called.
> 
> using:
>   Apache/1.3.23 (Unix) Debian GNU/Linux
>   mod_perl/1.26 mod_ssl/2.8.7 OpenSSL/0.9.6c
> 
> any hints would be appreciated



unable to use method type handlers?

2002-05-14 Thread Jeff AA

Whenever I try to set up a method type handler 

  PerlHandler my::classes->mymethod

I get the following in the error log:

  Undefined subroutine &my::classes->mymethod::handler called.

using:
  Apache/1.3.23 (Unix) Debian GNU/Linux 
  mod_perl/1.26 mod_ssl/2.8.7 OpenSSL/0.9.6c

any hints would be appreciated





Memory usage option in Apache::Status

2002-05-14 Thread victor

Hope someone can give me a hand on this, I am having some problem using
the Memory Usage option in the main menu of Apache::Status.  

It always return me a 500 with the following error.

[Tue May 14 08:48:21 2002] [error] Can't call method "size" on unblessed
reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
94.


This is the config I added to httpd.conf to enable the feature.


  SetHandler perl-script
  PerlModule Apache::Status
  PerlModule B::TerseSize
  PerlHandler Apache::Status

  PerlSetVar StatusOptionsAll On
  PerlSetVar StatusTerse On
  PerlSetVar StatusTerseSize On
  PerlSetVar StatusTerseSizeMainSummary On



Any idea what I have missed?


Tor.



Re: $r->args vs $r->content

2002-05-14 Thread Issac Goldstand

Quoting Mike Melillo <[EMAIL PROTECTED]>:

> 
> Hi,
> 

> One of the fields is an image file that will be uploaded so I need to
> use POST requests.  Is this a job for Apache::Request?  The eagle book
> doesn't cover it much because it was "experimental" at the time of
> publishing.
> 
There's a version 1.0 out by now.  That means stable as it's ever gonna get :-)
 I use it all the time, go for it!

  Issac


Internet is a wonderful mechanism for making a fool of
yourself in front of a very large audience.
  --Anonymous

Moving the mouse won\'t get you into trouble...  Clicking it might.
  --Anonymous

PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B



RE: mod_perl: User Authentication recommendations requested

2002-05-14 Thread Jeff Armstrong

And then he reads on p360 that there are tantalising recipes in chapter
13...

I would still appreciate the lists thoughts and experience.

-Original Message-
From: Jeff AA [mailto:[EMAIL PROTECTED]] 
Sent: 14 May 2002 09:07
To: [EMAIL PROTECTED]
Subject: mod_perl: User Authentication recommendations requested



I have a requirement to protect all pages on a website, and to only
allow in users with a valid user id, password, client certificate and
recognised IP.

I know this is asking a lot, but I would appreciate an
overview/recommendation of approaches that are 1st safe, and 2nd fast.

I think something like:

Scenario 1: unauthenticated user gets authenticated
1) user hits site - no session = unauthenticated
   create new session, remember requested page, redirect to /login page
2) /login page: collect username/password, POST action is /authenticate
3) /authenticate page: perform checks, if all ok set
$session->is_logged_in(TRUE);
   and redirect to originally requested page [stored in session]

Scenario 2: authenticated user accesses site
1) user hits page - has session
   redirect to /login if ( not $session->is_logged_in() );
   redirect to /login?message=inactivity+timeout if (
time-$session->last_access()>1hr );

Which seems to fit the functionality bill - users can bookmark their
favourite part of the system. When they come in but have not yet
authenticated, they get momentarily diverted through the
/login/authenticate pages.

Is this safe? 
How should I ensure that the sessions never get hijacked?

I am thinking along the lines of an additional transient cookie issued
when
the session authenticates the user that contains
md5(some_secret+session_id) that
is also checked?

And... is there already a nifty mod_perl class that does all this? I
have Apache::AuthCookie working from examples, but don't know what the
security implications of using it are, without reading the code [which I
will do soon I guess]. I also have problems with the LOGIN POST saying
POST: METHOD NOT ALLOWED when I try to get mod_perl to be the handler
for Location /.

Any recommendations/feedback appreciated! Even if it's a recipe I
haven't yet reached!

Thanks in advance,
Jeff






mod_perl: User Authentication recommendations requested

2002-05-14 Thread Jeff AA


I have a requirement to protect all pages on a website, and to only
allow in users with a valid user id, password, client certificate and
recognised IP.

I know this is asking a lot, but I would appreciate an
overview/recommendation of approaches that are 1st safe, and 2nd fast.

I think something like:

Scenario 1: unauthenticated user gets authenticated
1) user hits site - no session = unauthenticated
   create new session, remember requested page, redirect to /login page
2) /login page: collect username/password, POST action is /authenticate
3) /authenticate page: perform checks, if all ok set
$session->is_logged_in(TRUE);
   and redirect to originally requested page [stored in session]

Scenario 2: authenticated user accesses site
1) user hits page - has session
   redirect to /login if ( not $session->is_logged_in() );
   redirect to /login?message=inactivity+timeout if (
time-$session->last_access()>1hr );

Which seems to fit the functionality bill - users can bookmark their
favourite part of the system. When they come in but have not yet
authenticated, they get momentarily diverted through the
/login/authenticate pages.

Is this safe? 
How should I ensure that the sessions never get hijacked?

I am thinking along the lines of an additional transient cookie issued
when
the session authenticates the user that contains
md5(some_secret+session_id) that
is also checked?

And... is there already a nifty mod_perl class that does all this? I
have Apache::AuthCookie working from examples, but don't know what the
security implications of using it are, without reading the code [which I
will do soon I guess]. I also have problems with the LOGIN POST saying
POST: METHOD NOT ALLOWED when I try to get mod_perl to be the handler
for Location /.

Any recommendations/feedback appreciated! Even if it's a recipe I
haven't yet reached!

Thanks in advance,
Jeff





Re: Moving from CGI to mod_perl

2002-05-14 Thread Anton Permyakov

Thank you, Stas.

It's really good place to learn about mod_perl.

Good luck,
Anton

- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Anton Permyakov" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, May 14, 2002 1:17 PM
Subject: Re: Moving from CGI to mod_perl


> [Please make sure to post follow-ups to the list! Thanks!]
>
> Anton Permyakov wrote:
> > Hi, all.
> >
> > I have perl CGI-script, and i wanna run it as mod_perl script.
> >
> > Is it enought to correctly edit only httpd.conf, or i've to add
something
> > special in my CGI-script? Maybe something like
> >
> > use Apache::Registry;
> >
> > or something else
> >
> > Also is it needed to write some special script like startup.pl or not?
> >
> > Thank you all, and sorry for this "easy question"...
> > In doc i could not find "How to migrate from CGI to mod_perl" - step by
step
> > easy example.
>
>
>
http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/getwet.h
tml#Porting_Existing_CGI_Scripts_to_run_under_mod_perl
>
>
> __
> 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: Moving from CGI to mod_perl

2002-05-14 Thread Stas Bekman

[Please make sure to post follow-ups to the list! Thanks!]

Anton Permyakov wrote:
> Hi, all.
> 
> I have perl CGI-script, and i wanna run it as mod_perl script.
> 
> Is it enought to correctly edit only httpd.conf, or i've to add something
> special in my CGI-script? Maybe something like
> 
> use Apache::Registry;
> 
> or something else
> 
> Also is it needed to write some special script like startup.pl or not?
> 
> Thank you all, and sorry for this "easy question"...
> In doc i could not find "How to migrate from CGI to mod_perl" - step by step
> easy example.


http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/getwet.html#Porting_Existing_CGI_Scripts_to_run_under_mod_perl


__
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