rewrite rules in Perl sections

2001-04-04 Thread Francesc Guasch

Hi. I found and old thread about having rewrite rules inside
Perl sections in httpd.conf. In these mails it looks like there
is not an easy way to do this.
Is that still true ?

I've tried different guesses unsuccessfully:

$RewriteRule="^/(img/.*) http://other.server/$1";
$RewriteRule{"^/(img/.*)" } ="http://other.server/$1";
push @RewriteRule("^/(img/.*) http://other.server/$1");

any hints ?

-- 
 - frankie -



no_cache pragma/cache-control headers : confusion

2001-04-04 Thread Patrick

Dear all,

There is some kind of confusion in my head, and the Eagle book seems
to me even more confusing. Any help appreciated.

First, I always thought that no_cache() does everything regarding
headers, and that you have just to turn it on or off.
However I discovered yesterday that, at least in my setup, even with
no_cache(0) I have
Pragma: no-cache
Cache-control: no-cache
which seems counter-intuitive to me.

I've checked the Eagle : it says that no_cache() only adds an Expires
field.
Ok. But then from where does the Pragma header come ?

About -headers_out() it is specifically said : In addition, the
Pragma: no-cache idiom, used to tell browsers not to cache the
document, should be set indirectly using the no_cache() method.

So, that seems confusing to me, since the no_cache() methods seem not
to deal with Pragma headers.

Who sets Pragma/Cache-control headers and why are they like that by
default ?
How to override that (with headers_out ?) ?

TIA.

-- 
Patrick.
``C'est un monde qui n'a pas les moyens de ne plus avoir mal.''



Re: [OT] Apachecon folks

2001-04-04 Thread G.W. Haywood

Hi Gunther,

On Wed, 4 Apr 2001, Gunther Birznieks wrote:

 Did you check under the bar...?

:)

Thanks for brightening my day, Gunther.

Wish I was under the bar with Matt.

73,
Ged.




accessing SSL environment data in Perl*Handler

2001-04-04 Thread Paul

Though I feel rather foolish, the fact remains that I can't seem to
find my SSL environment variables.

httpd.conf has

Directory /
   SSLVerifyClient   require
   SSLOptions+StdEnvVars 
# ...
/Directory

Exactly when and where are they set? For example, SSL_CLIENT_S_DN. Once
set, shouldn't I be able to just say $ENV{SSL_CLIENT_S_DN}? 

My PerlPostReadRequestHandler can't seem to see them, but I figure
that's just because they haven't been set yet. I can't find when
they're set anywhere in the docs. (I probably haven't looked in the
right place, but it's not for lack of trying. =o)

Input, anyone?

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



[OT] activescripting.org

2001-04-04 Thread Frank Stuehmer

Hi folks,
could anybody tell me whats wrong with www.activescripting.org ?
There are many links in the net for there OpenASP and I can't retrieve the sources. 
There is no answer for weeks.
I tried apache:asp with mod_perl - works fine, but I need to transform ASP in VB from 
MS-Server.
The commercial versions of hylacon etc. I've found.

Thank you for hints.

Frank




Getting AuthCookie to return a wml page

2001-04-04 Thread Michael Smith

Dear All,

I'm trying to use AuthCookie to return a wml page for those lucky people on
wap browsers.  I've got it all working nicely for normal web browsers, but
am getting errors on wap (and the Nokia Wap Toolkit doesn't tell me very
much about why it's an error).  One thing that looks a bit suspicious is the
Content-type line which comes our as text/html - in fact to be precise it
comes out as:

Content-Type: text/html; charset=iso-8859-1

I've tried to override this with things like $r-content_type but to no
avail.  It seems that there's a line in http_protocol.c (line 2667) which is
setting this (this response is harcoded there).

Surely I ought to be able to override this ... in which case the obvious
question is, how?

Cheers

Mike




http://www.iii.co.uk 
Interactive Investor International is a leading UK Internet personal 
finance service that provides individuals with the capability to identify, 
compare, monitor and buy online a number of financial products and services.

Interactive Investor Trading Limited, a subsidiary of Interactive Investor 
International plc, is regulated by the SFA.



RE: Apache::AuthCookieDBI forgets its config [SOLVED]

2001-04-04 Thread Rob Bloodgood

 OK, more examination reveals that:
 At the time this BEGIN block is running, this call:
   my @keyfile_vars = grep {
   $_ =~ /DBI_SecretKeyFile$/
   } keys %{ Apache-server-dir_config() };

 is returning EMPTY.

 Meaning it's evaling too early to see the dir_config???  Or what?

- PerlModule Apache::AuthCookieDBI
 PerlSetVar AdminPath /admin
 PerlSetVar AdminLoginScript /scripts/adminlogin.pl

 # These must be set
 PerlSetVar AdminDBI_DSN "dbi:Oracle:STATS"
 PerlSetVar AdminDBI_SecretKeyFile /etc/httpd/conf/admin.secret.key
+ PerlModule Apache::AuthCookieDBI

My ealier message reveals the solution: move the line
PerlModule Apache::AuthCookieDBI
to *AFTER* the line(s)
PerlSetVar BlahBlahDBI_SecretKeyFile /path/to/keyfile

It now works perfectly!

Thx for putting up w/ me bouncing my problem-solving off the list...
hopefully somebody will save the day  a half I just spent on this.

L8r,
Rob

#/usr/bin/perl -w
use Disclaimer qw/:standard/;




RE: no_cache pragma/cache-control headers : confusion

2001-04-04 Thread Kyle Oppenheim

Apache (as in httpd) will set the 'Expires' header to the same value as the
'Date' header when no_cache is flagged in the request_rec.  When your Perl
handler sets $r-no_cache(1), mod_perl (in Apache.xs) is setting the
'Pragma: no-cache' and 'Cache-control: no-cache' headers in addition to
setting the no_cache flag in the request_rec.  From the code in Apache.xs,
it seems like setting $r-no_cache(0) will unset the flag, but not remove
the headers.

--
Kyle Oppenheim
Tellme Networks, Inc.
http://www.tellme.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Patrick
Sent: Wednesday, April 04, 2001 2:47 AM
To: [EMAIL PROTECTED]
Subject: no_cache  pragma/cache-control headers : confusion


Dear all,

There is some kind of confusion in my head, and the Eagle book seems
to me even more confusing. Any help appreciated.

First, I always thought that no_cache() does everything regarding
headers, and that you have just to turn it on or off.
However I discovered yesterday that, at least in my setup, even with
no_cache(0) I have
Pragma: no-cache
Cache-control: no-cache
which seems counter-intuitive to me.

I've checked the Eagle : it says that no_cache() only adds an Expires
field.
Ok. But then from where does the Pragma header come ?

About -headers_out() it is specifically said : In addition, the
Pragma: no-cache idiom, used to tell browsers not to cache the
document, should be set indirectly using the no_cache() method.

So, that seems confusing to me, since the no_cache() methods seem not
to deal with Pragma headers.

Who sets Pragma/Cache-control headers and why are they like that by
default ?
How to override that (with headers_out ?) ?

TIA.

--
Patrick.
``C'est un monde qui n'a pas les moyens de ne plus avoir mal.''




Re: access log and the request object

2001-04-04 Thread darren chamberlain

Andrew Lau ([EMAIL PROTECTED]) said something to this effect on
04/04/2001:
 I am currently developing a Perl based apache module and was
 wondering if such a functionality was available.  From within
 the module would it be possible to modify the request object so
 that the url that gets logged to the access.log is different
 from what the client actually requested?
 
 For example, if a client requested /file which was redirected
 to this module could it modify either the request object or
 some apache internal so that it gets written in the access log
 as /file?session=1234567890abcdef  .
 
 I apologize if this is readily available from some FAQ as i
 have been unable to find this information.  Thanks for your
 time.

This is untested, but I believe that mod_log_config logs, as part
of the %r CustomLog directive, r-the_request, which is the first
line of the request (i.e., "GET /file HTTP/1.0"). It might be
possible to do something like:

my @request = split / /, $r-the_request;
$request[1] = sprintf "%s?session=%s", $request[1], $r-param('session');
$r-the_request(join ' ', @request);

assuming that $r-the_request is not read-only.

Another option is to use CustomLog to log something other than
%r, like %{session}e to log an environment variable, or %q to log
the query string:

CustomLog "%h %l %u %t \"%m %U%q %H\" %s %b"

%m is the method, %U is the requested url, %q is the query
%string (or '' if no query string), %H is the request protocol.

(darren)

-- 
Everybody wants to go to heaven, but nobody wants to die.



Run away processes

2001-04-04 Thread Aaron Johnson

Hello all,

Having some hard ( for me ) to track memory usage issues. We have moved
our production environment to a new machine with what we thought was
plenty of memory, but we seem to have an erratic bit of code somewhere
that eats all the available memory.  We did not have this problem on our
previous machine, but it was running RH 6.1 and Perl 5.005 so by moving
to RH 7.0 and Perl 5.6 we have really asked for trouble.

My research shows that it might be in a search routine we have that
calls in Swish-E, but we can't get a consistent run away process when
testing.

In "the guide" it is recommended that a sub in the startup.pl file:
sub UNIVERSAL::AUTOLOAD {
   my $class = shift;
   warn "$class can't \$UNIVERSAL::AUTOLOAD!\n";
 }
to trap undefined sub routines might help find the problem.  I added
that code and now I am getting a laundry list of "bad" calls.  Here is
just a short list:

Apache::ASP::Server=HASH(0x929ebc4) can't $UNIVERSAL::AUTOLOAD!
Apache::ASP::Collection=HASH(0x91d3374) can't $UNIVERSAL::AUTOLOAD!
Apache=SCALAR(0x8d61160) can't $UNIVERSAL::AUTOLOAD!
Apache::ASP::GlobalASA=HASH(0x91d31d0) can't $UNIVERSAL::AUTOLOAD!
Errno=ARRAY(0x8317564) can't $UNIVERSAL::AUTOLOAD!
DBI::DBI_tie=HASH(0x83d1d64) can't $UNIVERSAL::AUTOLOAD!
MLDBM::Serializer::Data::Dumper=HASH(0x917091c) can't
$UNIVERSAL::AUTOLOAD!

These are all repeated several times.  I ran the same
UNIVERSAL::AUTOLOAD sub on another server and got very similar results (
the older RH 6.1 and Perl 5.005 one ) so it seems the errors might be
"normal" or at least under Apache::ASP.

So the summary of my setup is:
RH 7.0 ( with all RPM updates and new gcc )
Perl 5.6
Apache 1.3.19 compiled with the corrected gcc
mod_perl 1.25
Apache::ASP 2.09

If any more info is needed let me know.

Aaron Johnson




Re: Exempt a directory from Location?

2001-04-04 Thread Tim Tompkins

Directory /full/path/to/htdocs/bin
Satisfy any
/Directory

or, assuming that "bin" is at the root level of your document root,

Location /bin
Satisfy any
/Location



- Original Message -
From: "Richard Anderson" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 04, 2001 1:35 PM
Subject: Exempt a directory from Location?


I need to specify an authentication handler (in lieu of Basic or Digest) for
all directories in htdocs/ EXCEPT one, htdocs/bin/.  How can I do this?  I
don't want to specify another authentication handler for /htdocs/bin, I just
want to exempt it.

Here's my Location block:

Location /
   AuthType WWW::AuthCookieHandler
   AuthName HMAC
   PerlAuthenHandler WWW::AuthCookieHandler-authenticate
   PerlAuthzHandler WWW::AuthCookieHandler-authorize
   Require valid-user
/Location

How can I exempt htdocs/bin from this?

Richard Anderson, Ph.D.  www.unixscripts.com
Perl / Java / SQL / Unix   [EMAIL PROTECTED]
Raycosoft, LLC   Seattle, WA, USA






Re: Run away processes

2001-04-04 Thread Aaron Johnson

In a private email someone mentioned that removing the \ before the $ might
make the messages more meaningful.  That code was copy and pasted from the
current guide so if it should be $ and no \$ in front of UNIVERSAL then Stas
might want to know :^)

I changed it out and now it appears that it is all the DESTROY calls that
are making its way to the error log.  Should these be trapped some where
else?
I still don't think this has anything to do with my memory being consumed,
but I thought it seemed odd that so many things were called with no defined
sub.

Aaron Johnson

Aaron Johnson wrote:

 Hello all,

 Having some hard ( for me ) to track memory usage issues. We have moved
 our production environment to a new machine with what we thought was
 plenty of memory, but we seem to have an erratic bit of code somewhere
 that eats all the available memory.  We did not have this problem on our
 previous machine, but it was running RH 6.1 and Perl 5.005 so by moving
 to RH 7.0 and Perl 5.6 we have really asked for trouble.

 My research shows that it might be in a search routine we have that
 calls in Swish-E, but we can't get a consistent run away process when
 testing.

 In "the guide" it is recommended that a sub in the startup.pl file:
 sub UNIVERSAL::AUTOLOAD {
my $class = shift;
warn "$class can't \$UNIVERSAL::AUTOLOAD!\n";
  }
 to trap undefined sub routines might help find the problem.  I added
 that code and now I am getting a laundry list of "bad" calls.  Here is
 just a short list:

 Apache::ASP::Server=HASH(0x929ebc4) can't $UNIVERSAL::AUTOLOAD!
 Apache::ASP::Collection=HASH(0x91d3374) can't $UNIVERSAL::AUTOLOAD!
 Apache=SCALAR(0x8d61160) can't $UNIVERSAL::AUTOLOAD!
 Apache::ASP::GlobalASA=HASH(0x91d31d0) can't $UNIVERSAL::AUTOLOAD!
 Errno=ARRAY(0x8317564) can't $UNIVERSAL::AUTOLOAD!
 DBI::DBI_tie=HASH(0x83d1d64) can't $UNIVERSAL::AUTOLOAD!
 MLDBM::Serializer::Data::Dumper=HASH(0x917091c) can't
 $UNIVERSAL::AUTOLOAD!

 These are all repeated several times.  I ran the same
 UNIVERSAL::AUTOLOAD sub on another server and got very similar results (
 the older RH 6.1 and Perl 5.005 one ) so it seems the errors might be
 "normal" or at least under Apache::ASP.

 So the summary of my setup is:
 RH 7.0 ( with all RPM updates and new gcc )
 Perl 5.6
 Apache 1.3.19 compiled with the corrected gcc
 mod_perl 1.25
 Apache::ASP 2.09

 If any more info is needed let me know.

 Aaron Johnson




Re: Run away processes

2001-04-04 Thread Ken Williams

[EMAIL PROTECTED] (Aaron Johnson) wrote:
In "the guide" it is recommended that a sub in the startup.pl file:
sub UNIVERSAL::AUTOLOAD {
   my $class = shift;
   warn "$class can't \$UNIVERSAL::AUTOLOAD!\n";
 }

You'll get more useful information if you get rid of the backslash:

  sub UNIVERSAL::AUTOLOAD {
my $class = shift;
warn "$class can't $UNIVERSAL::AUTOLOAD!\n";
  }

Stas - this should be changed in the guide, on the
'All_RAM_Consumed.html' page.

My guess at your problem - you haven't pre-loaded all necessary modules
in your startup files (httpd.conf and startup.pl).  The code is
disappearing when the children die and are re-spawned.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Re: Run away processes

2001-04-04 Thread Tim Tompkins

You don't need to trap DESTROY calls.  But if you're defining an AUTOLOAD,
you typically want to just return if the subroutine being called is DESTROY.


Thanks,

Tim Tompkins
--
Staff Engineer / Programmer
http://www.arttoday.com/
--


- Original Message -
From: "Aaron Johnson" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 04, 2001 2:48 PM
Subject: Re: Run away processes


 In a private email someone mentioned that removing the \ before the $
might
 make the messages more meaningful.  That code was copy and pasted from the
 current guide so if it should be $ and no \$ in front of UNIVERSAL then
Stas
 might want to know :^)

 I changed it out and now it appears that it is all the DESTROY calls that
 are making its way to the error log.  Should these be trapped some where
 else?
 I still don't think this has anything to do with my memory being consumed,
 but I thought it seemed odd that so many things were called with no
defined
 sub.

 Aaron Johnson

 Aaron Johnson wrote:

  Hello all,
 
  Having some hard ( for me ) to track memory usage issues. We have moved
  our production environment to a new machine with what we thought was
  plenty of memory, but we seem to have an erratic bit of code somewhere
  that eats all the available memory.  We did not have this problem on our
  previous machine, but it was running RH 6.1 and Perl 5.005 so by moving
  to RH 7.0 and Perl 5.6 we have really asked for trouble.
 
  My research shows that it might be in a search routine we have that
  calls in Swish-E, but we can't get a consistent run away process when
  testing.
 
  In "the guide" it is recommended that a sub in the startup.pl file:
  sub UNIVERSAL::AUTOLOAD {
 my $class = shift;
 warn "$class can't \$UNIVERSAL::AUTOLOAD!\n";
   }
  to trap undefined sub routines might help find the problem.  I added
  that code and now I am getting a laundry list of "bad" calls.  Here is
  just a short list:
 
  Apache::ASP::Server=HASH(0x929ebc4) can't $UNIVERSAL::AUTOLOAD!
  Apache::ASP::Collection=HASH(0x91d3374) can't $UNIVERSAL::AUTOLOAD!
  Apache=SCALAR(0x8d61160) can't $UNIVERSAL::AUTOLOAD!
  Apache::ASP::GlobalASA=HASH(0x91d31d0) can't $UNIVERSAL::AUTOLOAD!
  Errno=ARRAY(0x8317564) can't $UNIVERSAL::AUTOLOAD!
  DBI::DBI_tie=HASH(0x83d1d64) can't $UNIVERSAL::AUTOLOAD!
  MLDBM::Serializer::Data::Dumper=HASH(0x917091c) can't
  $UNIVERSAL::AUTOLOAD!
 
  These are all repeated several times.  I ran the same
  UNIVERSAL::AUTOLOAD sub on another server and got very similar results (
  the older RH 6.1 and Perl 5.005 one ) so it seems the errors might be
  "normal" or at least under Apache::ASP.
 
  So the summary of my setup is:
  RH 7.0 ( with all RPM updates and new gcc )
  Perl 5.6
  Apache 1.3.19 compiled with the corrected gcc
  mod_perl 1.25
  Apache::ASP 2.09
 
  If any more info is needed let me know.
 
  Aaron Johnson






Re: access log and the request object

2001-04-04 Thread Mike Cameron



How about writing your own log handler
 PerlLogHandler My::LogModule
or in your code
$r->push_handler(PerlLogHandler => \MyLoghandler);
sub MyLoghandler{
 my $r=Apache::Request;
 code to log info to file
}
the push_handler method does not pass the request object to the subroutine.
Andrew Lau wrote:

Hi,I
am currently developing a Perl based apache module and was wondering if
such a functionality was available. From within the module would
it be possible to modify the request object so that the url that gets logged
to the access.log is different from what the client actually requested?For
example, if a client requested /file which was redirected to this module
could it modify either the request object or some apache internal so that
it gets written in the access log as /file?session=1234567890abcdef
.I apologize if this
is readily available from some FAQ as i have been unable to find this information.
Thanks for your time.Sincerely,Andrew
LauAndrew Lau
Massachusetts Institute of Technology
2000
[EMAIL PROTECTED]
http://web.mit.edu/amlau/www





Apache::ASP -- Corruption of statedir files/truncation of methodnames

2001-04-04 Thread Carl Lipo


I've just started having problems with asp state files for Apache::ASP
2.09 becoming corrupted during use. My application will work just fine but
at somepoint the session asp state files get corrupted and only deleting
them allows the application to continue working. Oddly, this occurs on two
different servers so the problem does not appear to be machine specific. 

The symptom of the problem is that application errors are returned
from the asp code execution that look something like this:

Uncaught exception from user code:
Can't locate object method 'Quer' via package
quot;Apache::ASP::Request'; at (eval 263) a href=#167l
ine 167/a. 
INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called
at /usr/local/lib/site_perl/Apache/
ASP.pm line 1504

or

$Response::Appe not defined at /usr/local/lib/site_perl/Apache/ASP.pm a
href=#3132line 3132/a

Where the object method that cant be located is truncated from the actual
ASP method (i.e., Query will be truncated to be Quer or $Response::Append
to log will be tructed at Response::Appe). What appears to be happnening
is that the namespace is corrupted somehow and the Apache::ASP/mod_perl is
not mapping the names of methods correctly. 

When we delete the state files, the problem goes away (and then returns at
some point in the future). Has anyone encountered this problem? Is there a
bug in the 2.09 code?

This is our environment:
Linux,  Apache 1.3.19, mod_perl 1.25
Apache::ASP 2.09


Here is the actual error output:

table
trtd valign=topfont size=-1b Global: /btd valign=topfont size=-1 
/usr/local/etc/infosource/apps/netcfg/
trtd valign=topfont size=-1b   File: /btd valign=topfont size=-1 
/usr/local/applprod/infosource/apps/netcfg/viewNodes.htm
trtd valign=topfont size=-1b IP: /btd valign=topfont size=-1 
64.94.117.16
trtd valign=topfont size=-1b HTTP_*: /btd valign=topfont size=-1 
HTTP_ACCEPT= image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*br
  HTTP_ACCEPT_CHARSET= iso-8859-1,*,utf-8br
  HTTP_ACCEPT_ENCODING= gzipbr
  HTTP_ACCEPT_LANGUAGE= enbr
  HTTP_CONNECTION= Keep-Alivebr
  HTTP_COOKIE= session-id=0eef76d5377c6e62def6333423014869br
  HTTP_HOST= applprod4.sea.internap.combr
  HTTP_REFERER= https://applprod4.sea.internap.com/apps/netcfg/searchNode.htmbr
  HTTP_USER_AGENT= Mozilla/4.75 [en] (X11; U; Linux 2.2.16 i686)
trtd valign=topfont size=-1b  Query: /btd valign=topfont size=-1 
trtd valign=topfont size=-1b   Form: /btd valign=topfont size=-1 search= 
  Search  br
  searchLocation= br
  searchNodeName= br
  searchNodeStatus= br
  searchNodeType= br
  searchRack= br
  searchSiteCode= seabr
  sessionActive= Active
/table

tt
buErrors Output/u/b
ol

li Uncaught exception from user code:
Can't locate object method quot;Querquot; via package 
quot;Apache::ASP::Requestquot; at (eval 263) a href=#167line 167/a.
INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() 
called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504
eval {...} called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504
Apache::ASP::Execute('Apache::ASP=HASH(0x8d7d930)') called at 
/usr/local/lib/site_perl/Apache/ASP.pm line 174
Apache::ASP::handler('Apache=SCALAR(0x8d2b978)') called at /dev/null line 0
eval {...} called at /dev/null line 0
, /usr/local/lib/site_perl/Apache/ASP.pm line 1506
/ol

buDebug Output/u/b
ol

li Uncaught exception from user code:
Can't locate object method quot;Querquot; via package 
quot;Apache::ASP::Requestquot; at (eval 263) line 167.
INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() 
called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504
eval {...} called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504
Apache::ASP::Execute('Apache::ASP=HASH(0x8d7d930)') called at 
/usr/local/lib/site_perl/Apache/ASP.pm line 174
Apache::ASP::handler('Apache=SCALAR(0x8d2b978)') called at /dev/null line 0
eval {...} called at /dev/null line 0
, /usr/local/lib/site_perl/Apache/ASP.pm line 1506
/ol
/tt
pre

buASP to Perl Script/u/ba name=1nbsp;/a

a name=2  1/a: package INAP::NEIS; ;; sub 
INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL {  ;;  @_ = 
(); ;; no strict;;use vars qw($Application $Session $Response $Server $Request);;use 
lib qw(/usr/local/etc/infosource/apps/netcfg/);;;
a name=3  2/a: 
a name=4  3/a: $Response-gt;AppendToLog(quot;[NEIS] - init.htm:quot;);
a name=5  4/a: 
a name=6  5/a: 
a name=7  6/a: ###
a name=8  7/a: #
a name=9  8/a: #init.htm
a name=10  9/a: #
a name=11 10/a: #   Dexter and Wayland
a name=12 11/a: #
a name=13 12/a: #   October 2000
a name=14 13/a: #
a name=15 14/a: #   10/12/00  Wayland Wasserman
a name=16 15/a: #   Common header file for entire NCM app
a name=17 16/a: #   Contains database 

Re: Run away processes

2001-04-04 Thread Aaron Johnson

So should the entry in the Guide be rewritten to:

sub UNIVERSAL::AUTOLOAD {
   my $class = shift;
if ($UNIVERSAL::AUTOLOAD !~ /DESTROY$/) {
   warn "$class can't $UNIVERSAL::AUTOLOAD!\n";
}
 }

??

Tim Tompkins wrote:

 You don't need to trap DESTROY calls.  But if you're defining an AUTOLOAD,
 you typically want to just return if the subroutine being called is DESTROY.

 Thanks,

 Tim Tompkins
 --
 Staff Engineer / Programmer
 http://www.arttoday.com/
 --

 - Original Message -
 From: "Aaron Johnson" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 04, 2001 2:48 PM
 Subject: Re: Run away processes

  In a private email someone mentioned that removing the \ before the $
 might
  make the messages more meaningful.  That code was copy and pasted from the
  current guide so if it should be $ and no \$ in front of UNIVERSAL then
 Stas
  might want to know :^)
 
  I changed it out and now it appears that it is all the DESTROY calls that
  are making its way to the error log.  Should these be trapped some where
  else?
  I still don't think this has anything to do with my memory being consumed,
  but I thought it seemed odd that so many things were called with no
 defined
  sub.
 
  Aaron Johnson
 
  Aaron Johnson wrote:
 
   Hello all,
  
   Having some hard ( for me ) to track memory usage issues. We have moved
   our production environment to a new machine with what we thought was
   plenty of memory, but we seem to have an erratic bit of code somewhere
   that eats all the available memory.  We did not have this problem on our
   previous machine, but it was running RH 6.1 and Perl 5.005 so by moving
   to RH 7.0 and Perl 5.6 we have really asked for trouble.
  
   My research shows that it might be in a search routine we have that
   calls in Swish-E, but we can't get a consistent run away process when
   testing.
  
   In "the guide" it is recommended that a sub in the startup.pl file:
   sub UNIVERSAL::AUTOLOAD {
  my $class = shift;
  warn "$class can't \$UNIVERSAL::AUTOLOAD!\n";
}
   to trap undefined sub routines might help find the problem.  I added
   that code and now I am getting a laundry list of "bad" calls.  Here is
   just a short list:
  
   Apache::ASP::Server=HASH(0x929ebc4) can't $UNIVERSAL::AUTOLOAD!
   Apache::ASP::Collection=HASH(0x91d3374) can't $UNIVERSAL::AUTOLOAD!
   Apache=SCALAR(0x8d61160) can't $UNIVERSAL::AUTOLOAD!
   Apache::ASP::GlobalASA=HASH(0x91d31d0) can't $UNIVERSAL::AUTOLOAD!
   Errno=ARRAY(0x8317564) can't $UNIVERSAL::AUTOLOAD!
   DBI::DBI_tie=HASH(0x83d1d64) can't $UNIVERSAL::AUTOLOAD!
   MLDBM::Serializer::Data::Dumper=HASH(0x917091c) can't
   $UNIVERSAL::AUTOLOAD!
  
   These are all repeated several times.  I ran the same
   UNIVERSAL::AUTOLOAD sub on another server and got very similar results (
   the older RH 6.1 and Perl 5.005 one ) so it seems the errors might be
   "normal" or at least under Apache::ASP.
  
   So the summary of my setup is:
   RH 7.0 ( with all RPM updates and new gcc )
   Perl 5.6
   Apache 1.3.19 compiled with the corrected gcc
   mod_perl 1.25
   Apache::ASP 2.09
  
   If any more info is needed let me know.
  
   Aaron Johnson
 
 




Re: Run away processes

2001-04-04 Thread ___cliff rayman___

i think that it should be:
warn "\$class=$class can't \$UNIVERSAL::AUTOLOAD=$UNIVERSAL::AUTOLOAD!\n";

leads to less grepping and a quicker understanding of the problem.

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/

Aaron Johnson wrote:

 So should the entry in the Guide be rewritten to:

 sub UNIVERSAL::AUTOLOAD {
my $class = shift;
 if ($UNIVERSAL::AUTOLOAD !~ /DESTROY$/) {
warn "$class can't $UNIVERSAL::AUTOLOAD!\n";
 }
  }

 ??








Re: Run away processes

2001-04-04 Thread Stas Bekman

On Wed, 4 Apr 2001, Ken Williams wrote:

 [EMAIL PROTECTED] (Aaron Johnson) wrote:
 In "the guide" it is recommended that a sub in the startup.pl file:
 sub UNIVERSAL::AUTOLOAD {
my $class = shift;
warn "$class can't \$UNIVERSAL::AUTOLOAD!\n";
  }

 You'll get more useful information if you get rid of the backslash:

   sub UNIVERSAL::AUTOLOAD {
 my $class = shift;
 warn "$class can't $UNIVERSAL::AUTOLOAD!\n";
   }

 Stas - this should be changed in the guide, on the
 'All_RAM_Consumed.html' page.

fixed. thanks!

 My guess at your problem - you haven't pre-loaded all necessary modules
 in your startup files (httpd.conf and startup.pl).  The code is
 disappearing when the children die and are re-spawned.


   ------
   Ken Williams Last Bastion of Euclidity
   [EMAIL PROTECTED]The Math Forum




_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: Apache::ASP -- Corruption of statedir files/truncation of methodnames

2001-04-04 Thread Carl Lipo


In addition:  here are the httpd.conf configurations for this application:

FilesMatch "\.(htm|asp)$"
PerlSetVar Global /usr/local/etc/infosource/apps/netcfg/
# PerlSetVar Global .
PerlSetVar GlobalPackage INAP::NEIS
PerlSetVar StateDir /usr/local/etc/infosource/apps/netcfg/state-dir
PerlSetVar CookiePath  /apps/netcfg
SetHandler perl-script
PerlHandler Apache::ASP Apache::SSI
PerlSetVar SessionTimeout 90
#0 production, 2 or 1 for dev
PerlSetVar Debug 0
PerlSetVar StatINCMatch PNAP|NCM
# PerlSetVar StatINC 1
#0 production, text compression
# PerlSetVar DynamicIncludes 0
PerlSetVar Clean 0
PerlSetVar StateDB DB_File
PerlSetVar AllowSessionState 1
PerlSetVar DebugBufferLength 500
PerlSetVar StateCache 0
# PerlSetVar UseStrict 1
PerlSetVar TimeHiRes 1
/FilesMatch


On Wed, 4 Apr 2001, Carl Lipo wrote:

 
 I've just started having problems with asp state files for Apache::ASP
 2.09 becoming corrupted during use. My application will work just fine but
 at somepoint the session asp state files get corrupted and only deleting
 them allows the application to continue working. Oddly, this occurs on two
 different servers so the problem does not appear to be machine specific. 
 
 The symptom of the problem is that application errors are returned
 from the asp code execution that look something like this:
 
 Uncaught exception from user code:
 Can't locate object method 'Quer' via package
 quot;Apache::ASP::Request'; at (eval 263) a href=#167l
 ine 167/a. 
INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called
 at /usr/local/lib/site_perl/Apache/
 ASP.pm line 1504
 
 or
 
 $Response::Appe not defined at /usr/local/lib/site_perl/Apache/ASP.pm a
 href=#3132line 3132/a
 
 Where the object method that cant be located is truncated from the actual
 ASP method (i.e., Query will be truncated to be Quer or $Response::Append
 to log will be tructed at Response::Appe). What appears to be happnening
 is that the namespace is corrupted somehow and the Apache::ASP/mod_perl is
 not mapping the names of methods correctly. 
 
 When we delete the state files, the problem goes away (and then returns at
 some point in the future). Has anyone encountered this problem? Is there a
 bug in the 2.09 code?
 
 This is our environment:
 Linux,  Apache 1.3.19, mod_perl 1.25
 Apache::ASP 2.09
 
 
 Here is the actual error output:
 
 table
 trtd valign=topfont size=-1b Global: /btd valign=topfont size=-1 
/usr/local/etc/infosource/apps/netcfg/
 trtd valign=topfont size=-1b   File: /btd valign=topfont size=-1 
/usr/local/applprod/infosource/apps/netcfg/viewNodes.htm
 trtd valign=topfont size=-1b IP: /btd valign=topfont size=-1 
64.94.117.16
 trtd valign=topfont size=-1b HTTP_*: /btd valign=topfont size=-1 
HTTP_ACCEPT= image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*br
   HTTP_ACCEPT_CHARSET= iso-8859-1,*,utf-8br
   HTTP_ACCEPT_ENCODING= gzipbr
   HTTP_ACCEPT_LANGUAGE= enbr
   HTTP_CONNECTION= Keep-Alivebr
   HTTP_COOKIE= session-id=0eef76d5377c6e62def6333423014869br
   HTTP_HOST= applprod4.sea.internap.combr
   HTTP_REFERER= https://applprod4.sea.internap.com/apps/netcfg/searchNode.htmbr
   HTTP_USER_AGENT= Mozilla/4.75 [en] (X11; U; Linux 2.2.16 i686)
 trtd valign=topfont size=-1b  Query: /btd valign=topfont size=-1 
 trtd valign=topfont size=-1b   Form: /btd valign=topfont size=-1 
search=   Search  br
   searchLocation= br
   searchNodeName= br
   searchNodeStatus= br
   searchNodeType= br
   searchRack= br
   searchSiteCode= seabr
   sessionActive= Active
 /table
 
 tt
 buErrors Output/u/b
 ol
 
 li Uncaught exception from user code:
   Can't locate object method quot;Querquot; via package 
quot;Apache::ASP::Requestquot; at (eval 263) a href=#167line 167/a.
   INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() 
called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504
   eval {...} called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504
   Apache::ASP::Execute('Apache::ASP=HASH(0x8d7d930)') called at 
/usr/local/lib/site_perl/Apache/ASP.pm line 174
   Apache::ASP::handler('Apache=SCALAR(0x8d2b978)') called at /dev/null line 0
   eval {...} called at /dev/null line 0
 , /usr/local/lib/site_perl/Apache/ASP.pm line 1506
 /ol
 
 buDebug Output/u/b
 ol
 
 li Uncaught exception from user code:
   Can't locate object method quot;Querquot; via package 
quot;Apache::ASP::Requestquot; at (eval 263) line 167.
   INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() 
called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504
   eval {...} called at 

[BUG?] CGI::Cookie-parse() deletes $r-content()

2001-04-04 Thread Michael Lazzaro


I'm looking to see if anyone can verify whether the following behavior is a 
Feature or a Bug.  From within a PerlRequestHandler:

my $content = $r-content();
my $cookie = CGI::Cookie-parse( $r-headers_in-get('Cookie') );

works fine, but the reversed code:

my $cookie = CGI::Cookie-parse( $r-headers_in-get('Cookie') );
my $content = $r-content();

... sets $content to undef.  I'm aware you can only call $r-content() 
once; but it seems odd that Cookie-parse would squish it too.(?)  Note 
that this code:

my $cookie = $r-headers_in-get('Cookie');
my $content = $r-content();
my $cookie_parsed = CGI::Cookie-parse( $cookie );

... is OK, implying it's the -parse() that's undef'ing $content, not the 
call to headers_in().

-- using
(Apache/1.3.19 (Unix) mod_perl/1.25 Perl5.6.0 CGI::Cookie/1.12) undef Red 
Hat i686-linux:
-- the behavior doesn't happen on similarly configured older system,
(Apache/1.3.12 mod_perl/1.24 Perl5.005_03 CGI::Cookie/1.06))

Anyone else see this / can verify?

MikeL



Re: Apache::ASP -- Corruption of statedir files/truncation of methodnames

2001-04-04 Thread Joshua Chamas

Carl Lipo wrote:
 
 I've just started having problems with asp state files for Apache::ASP
 2.09 becoming corrupted during use. My application will work just fine but
 at somepoint the session asp state files get corrupted and only deleting
 them allows the application to continue working. Oddly, this occurs on two
 different servers so the problem does not appear to be machine specific.
 
 The symptom of the problem is that application errors are returned
 from the asp code execution that look something like this:
 
 Uncaught exception from user code:
 Can't locate object method 'Quer' via package
 quot;Apache::ASP::Request'; at (eval 263) a href=#167l
 ine 167/a. 
INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called
 at /usr/local/lib/site_perl/Apache/
 ASP.pm line 1504
 

Generally problems of this nature, where even perl data seems
to be corrupted, seem to be from buffer overrun type issues
that normally result in segfaults.  Looking at your config, 
I would suspect the culprit to be use of DB_File on your
StateDir, where /usr/local/etc/infosource/apps/netcfg/state-dir
may be mounted over NFS.  NFS typically does not support the 
flock() style locking that Apache::ASP uses to protect DB_File 
from corruption.  

If you are  must use NFS, don't use DB_File, use the default 
SDBM_File, which does not corrupt as easily.  If you need to 
get past the 1000 byte limit, then you might use 
MLDBM::Sync::SDBM_File which I developed just for this purpose.
I need to add config support for this still to Apache::ASP though.
If you can switch to a CIFS/or samba mounted file system, do 
this, as this supports flock() semantics.

If StateDir is mounted locally, then possibly there is a bug in 
Apache::ASP StateDB locking, but this is less likely the case
and we might look at other types of buffer overrun issues that
might corrupt perl data structures.  If your modperl httpd is compiled
DSO, compile it static, as I have seen no end of odd errors with
the DSO config from time to time.  

Also, DBD::Oracle and long values with CLOBs/BLOBs can create 
another type of buffer overrun, which is supposedly on OCI bug, 
though you didn't mention use of Oracle this is an odd bug that 
stung me recently.

If you give up on trying to find this bug, which seems to be 
related to StateDB corruption, you may create $Application  
$Session objects with Apache::Session in the global.asa Script_OnStart, 
which would at least eliminate the StateDB issue.

-- Josh

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks  free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051