Re: Apache::DBI-connect_on_init in BEGIN?

2000-05-16 Thread Doug MacEachern

On Sun, 14 May 2000, svante [iso-8859-1] sörmark wrote:

 hi all,
 
 what i'd like to do is "pre-initialize" my DBI connections from whithin
 my PerlHandler's BEGIN block. 
 
 something like this:
 BEGIN {
   if ( Apache-dir_config('CONNECT_ON_INIT') {
   Apache::DBI-connect_on_init(Apache-dir_config('DBI_INFO');
   }
 }

connect_on_init was written to be a PerlChildInitHandler, it doesn't make
sense to use it anywhere else.




RE: CGI::Delete for Apache::Request

2000-05-16 Thread Doug MacEachern

 +=item parms

thanks.  the reason i've been holding off though, was because i wanted
to rename parms() to be something a little more different from param().
i've asked for suggestions a few times, got any? :)

p.s.
from cvs Changes:
Apache::Table-unset can now be called with an array reference




Re: mod_perl-perl5.6.0

2000-05-16 Thread Doug MacEachern

On Mon, 15 May 2000, Asghar Nafarieh wrote:

 I did it and still I get the same error.

ok, then you'll have to get a stacktrace (see SUPPORT doc for tips),
assuming this is a core dump.




Re: Zombie processes under mod_perl

2000-05-16 Thread Doug MacEachern

On Mon, 15 May 2000, Leonardo Madrigal wrote:

 Hi everyone!
 
 Im working on some scripts that run under mod_perl via 
 Apache::Registry, on the latest stable versions of mod_perl and apache 
 under FreeBSD 3.3-stable.
 
 
 This scripts make authentication to cybercash using the api that they 
 provide.
 
 The problem is that in the API are 2 programs (binarys made in C) that 
 are called, if i ran the scripts under Apache::Registry, when the perl 
 scripts are done and the httpd proccess end, the 2 programs now are in 
 zombie state, for every request.
 
 If i dont use mod_perl the scripts are ok. No zombie proccesses.
 
 This is the code from cybercash that runs the first one:
 MCKencrypt="/usr/local/bin/mckencrypt";
 unless (open2(\*CIPHER, \*PLAINTEXT, $MCKencrypt)) {
 return($E_EncryptFailed, MCKGetErrorMessage($E_EncryptFailed));
   }
 
 As you can see, they use open() and my perl was not compiled with sfio 
 support.

i don't see you call close() on CIPHER and PLAINTEXT, which will
trigger a zombie since those filehandles are global.  if you at least
local-ize them, or use a lexical glob (like Symbol::gensym or 'open my
$fh, ...' w/ 5.6.0), Perl will take care to cleanup for you.




Re: Apache::DBI-connect_on_init in BEGIN?

2000-05-16 Thread svante sörmark

Doug MacEachern wrote:
 
 
 connect_on_init was written to be a PerlChildInitHandler, it doesn't make
 sense to use it anywhere else.

ok, that would accomplish pretty much the same thing i guess. 

the problem is i can't seem to find a way to get configration variables 
from httpd.conf inside a BEGIN or a PerlChildInitHandler. i set the 
variables with  PerlSetVar inside Location ... sections.

is there any way to do this?

-- 

Svante Sörmark | Chalmers University IT systems  services | 031-7728665




Re: Apache::DBI-connect_on_init in BEGIN?

2000-05-16 Thread Doug MacEachern

 the problem is i can't seem to find a way to get configration variables 
 from httpd.conf inside a BEGIN or a PerlChildInitHandler. i set the 
 variables with  PerlSetVar inside Location ... sections.

use Apache-server-dir_config as eric already suggested to you.  you'll
have to move the PerlSetVar outside of Location ... though.
you can use PerlSetEnv too.




Help me to learn...

2000-05-16 Thread Alexei V. Alexandrov

Dear mod_perl users,

  I`m new to programming using mod_perl just for learning i wrote some
  simple modules and i want to write a more complex module for solving
  the following task:

  There are many .zip files on our server in the web root directory. I
  want to write a kind of module to view the contents of the zip file
  using unzip program. I don`t want to place zip files in a spechial
  folder and so on... What is the best way to do it.

  Thank you for any help.

Best regards,
Alexei V. Alexandrov   [AA4460, AVA32-RIPN, AA1829-RIPE]

*** Alexei V. Alexandrov --- www.elcomsoft.com --- [EMAIL PROTECTED] ***






Re: KHTTPD for static and Apache/mod_perl for dynamic??

2000-05-16 Thread shane

 ]- I'm not sure but I think phttpd is included in RH6.2

Wow..., you're right.  What a trip.  Okay, I'm going to grab the srpm
for RH's site, and extract it into a tarball.  It'll be on my anonymous
ftp under the pub/matofali directory if anyone's interested.

Thanks,
Shane.
(Thanks BTW :-)

(Ftp to isupportlive.com, and cd into pub/matofali)



RE: CGI::Delete for Apache::Request

2000-05-16 Thread Geoffrey Young



 -Original Message-
 From: Doug MacEachern [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 16, 2000 2:27 AM
 To: Geoffrey Young
 Cc: Michael Blakeley; [EMAIL PROTECTED]
 Subject: RE: CGI::Delete for Apache::Request
 
 
  +=item parms
 
 thanks.  the reason i've been holding off though, was because i wanted
 to rename parms() to be something a little more different 
 from param().
 i've asked for suggestions a few times, got any? :)

well, form_fields() is descriptive and would fit nicely with the other
Apache::Table methods (headers_in, etc)...

will you keep parms() around for folks who already have functions built
around it?  maybe making a clean break with 2.0?


 
 p.s.
 from cvs Changes:
 Apache::Table-unset can now be called with an array reference

yeah, I saw that - cool...

--Geoff

 



Re: Access to userland objects in different phases

2000-05-16 Thread Ken Miller

At 05:28 PM 5/15/00 -0400, you wrote:

I use Class::Singleton in mod_perl apps with *no* problem
whatsoever. In fact, it's pretty nifty to simply say:

 my $obj = $class-instance;

anywhere in my application and have the object (whatever it is) simply
pop up.

Well, after looking at the Class::Singleton class, I gave it a shot.  After
hacking away at a ChildInitHandler, this is what I ended up with:

package X::Y::Apache::ChildInit;

use strict;
use X::Y::DB::SingletonServices;
use Apache;

##--
-
sub handler
{
my $s = Apache-server;

my $dbs = X::Y::DB::SingletonServices-instance(
{ uri  = $s-dir_config( 'DATABASE_URI' ),
 userid   = $s-dir_config( 'DATABASE_USERID' ),
 password = $s-dir_config( 'DATABASE_PASSWORD' ),
 options  = { AutoCommit = 0,
   RaiseError = 1,
   PrintError = 0,
   ChopBlanks = 1 } } );

$s-log_error( "$$: Services object allocated, handle=$dbs" );
}

1;

Perfect!  I now have access to my services object everywhere!

Thanks for the point at Class::Singleton.  I would have eventually written
my own, but with CPAN, what's the point?


Cheers!

-klm.

---
Ken Miller, Consultant
Shetland Software Services Inc.




CGI scripts not executing.Re: works on linux, doesn't work on sun.

2000-05-16 Thread scotta

Actually,  as I found out yesterday, it didn't fix it.  
I still just get the source.  Further information.
The symptoms were that I wasn't getting redirected properly.  Yesterday
some pieces finally came together which put me to the following point.
Scripts are still not executing.  The script that i was getting, was an
error in the way i trapped the domain names.  Ie, what I was getting,
was one where the host was www rather then the fqdn. 
So this leaves me back at the origianl point,  CGI scripts that are
under the handler are not being ran. I've checked, and I do return
DECLINED when my handler doesn't need to work with the content.

Scott

Doug MacEachern wrote:
 
Location /
SetHandler  perl-script
PerlSendHeader on
PerlHandler Mf7
  
  Options +ExecCGI
 
 strange that would fix things, unless your Mf7 module is testing for
 $r-allow_options  OPT_EXECCGI
 mod_perl never checks that bit, it's up to modules, e.g. Apache::Registry
 make that check.



developer wanted

2000-05-16 Thread Adi


We are looking for one good developer.  We are a very small ASP,
facilitating a certain type of payer-provider transaction in the healthcare
industry.

It is a software developer position, but since we are fairly small, we can
offer a significant amount of company equity to the right person.

We are very pro open-source, and encourage our developers to work on general
solutions that would be valuable not only to us, but to the community as a
whole.  Needless to say, you won't run into any legal problems trying to
release something you developed for us to the free software community.

Experience in one or more of the following desired:

  - Apache, perl, mod_perl
  - CGI.pm
  - DBI
  - XML
  - FreeBSD and/or Linux kernel
  - Oracle, Postgres, or MySQL

We are located in Raleigh, NC.

Please forward inquiries to [EMAIL PROTECTED]

-Adi




O'Reilly Con 2000 Rooms and Travel

2000-05-16 Thread Jeffrey W. Baker

I just registered for this year's O'Reilly Open Source Conference.  I
reserved a double occupancy room, even though I haven't planned to go with
anyone else.  If someone on this list is going and doesn't have a room,
please email me and we can share.  I reserved a non-smoking room in the
Doubletree.

Also I will be getting to Monterey by motorcycle from San Francisco.  I'd
love to ride with anyone from the SF Bay Area.  Mail me.

-jwb




Re: Help me to learn...

2000-05-16 Thread Randy Kobes

On Tue, 16 May 2000, Alexei V. Alexandrov wrote:

 Dear mod_perl users,
 
   I`m new to programming using mod_perl just for learning i wrote some
   simple modules and i want to write a more complex module for solving
   the following task:
 
   There are many .zip files on our server in the web root directory. I
   want to write a kind of module to view the contents of the zip file
   using unzip program. I don`t want to place zip files in a spechial
   folder and so on... What is the best way to do it.
 

Hi,
You could start by taking a look at Apache::Archive, in
$CPAN/authors/id/J/JP/JPETERSON/, which sounds like it does
what you want, but for .tar and .tar.gz files. For an interface
to zip files, check out Archive::Zip, under 
$CPAN/authors/id/N/NE/NEDKONZ/.

best regards,
randy kobes





Re: Problem with @INC

2000-05-16 Thread Robert Nice

Doug MacEachern wrote:
 
 On Sat, 13 May 2000, Robert Nice wrote:
 
  use lib '../site_perl';
 
 it's been explained, 'use lib' happens at compile time (once per-script)
 and @INC is reset to whatever it was startup time after each request.  the
 simple solution for you, which i didn't see mentioned, is to modify @INC
 at runtime, e.g.

This was one of those times where the cause was understood, I was
just looking for a solution. It's quite interesting some of the
private discussions and solutions that I've been engaged in. Some
people have sent me sizeable chunks of code to get around it. I'm
currently using a startup script with a use lib which is fine,
however 

 unshift @INC, '../site_perl';

... if this works (and I can't see why it wouldn't) all I can say
is "Damn, why didn't I think of that!". Why didn't anybody else?
For some reason I thought 'use lib' did something special, too much
faith that's my problem. Someone put it in the guide please ;-)

On another speculative note seeing as 'use strict' changes compiler
behaviour somewhat is it feasable to write a module that would
convert or modPerlise a script to catch half the stuff that comes
up on this list every week? H?

Thanks,
-- 
Robert Nice



mod_perl + any other DSO module returns no data

2000-05-16 Thread Asghar Nafarieh


I have a linux machine with ssl, php, mod_perl + apache 1.3.12.
If I load mod_perl module by idself it works fine. But if
I add any other module in conjunction with mod_perl in httpd.conf 
I get "document has no data". I used both mod_perl 1.21 and mod_perl 1.23 
with either perl 5.005_03 and perl 5.6.0 and I still get the same result.
I changed the apache to 1.3.9 and I still get the same result. 

Anybody has any answer?


Thanks,

-Asghar






Apache::Sandiwch and cookies?

2000-05-16 Thread Jim Serio

Right now I have Sandwich calling a script which is
just a wrapper for some functions in a module that 
print out the headers/footers. In my module, I do
cookie checking and if no cookie exists, I attempt to
write out a cookie. This is done before any content is
passed to the client.

Unfortunately nothign is happening. I can run the 
wrapper script and it works fine so I'm inclined to
think thatSandwich emits a header before even processing
the header file.

Am I correct and is ther ea way around this? I guess I
could write a handler to process every request.

Jim



Apache::DBI and autocommit

2000-05-16 Thread William Deegan

Greetings,

from the various perldocs and web pages I understand the following
to be true.

If autocommit is not set and a script exits the transaction will be
rolled
back.

The question I have is when the database handle is re-used will the
autocommit still be unset if the script that set it errors out?

-Bill

begin:vcard 
n:Deegan;William
tel;fax:650-413-1355
tel;work:650-598-3858
x-mozilla-html:FALSE
url:http://www.iescrow.com
org:iEscrow,Inc.
version:2.1
email;internet:[EMAIL PROTECTED]
title:Web Site Operations Manager
adr;quoted-printable:;;2600 Bridge Parkway=0D=0ASuite 201;Redwood Shores;CA;94065;
note;quoted-printable:Work:=0D=0Ahttp://www.iescrow.com=0D=0A=0D=0APersonal:=0D=0Ahttp://www.hitmyspot.com
x-mozilla-cpt:;-19264
fn:William Deegan
end:vcard



Re: Apache::DBI and autocommit

2000-05-16 Thread Perrin Harkins

On Tue, 16 May 2000, William Deegan wrote:
 If autocommit is not set and a script exits the transaction will be
 rolled back.
 
 The question I have is when the database handle is re-used will the
 autocommit still be unset if the script that set it errors out?

Yes, Apache::DBI doesn't touch your autocommit settings.

- Perrin




Apache::URI doesn't work for me

2000-05-16 Thread Rob Tanner

Hello,

I do the following:

my $parsed_uri = $r-parsed_uri;
my $r_scheme   = $parsed_uri-scheme;
my $r_host = $parsed_uri-hostinfo;
my $r_rpath= $parsed_uri-rpath;
my $r_path = $parsed_uri-path;


The result is that the scalars $r_scheme and $r_host are empty, and
only $r_path and $r_rpath have data in them (and the data is correct).

But, if instead I do,

my $me = Apache::URI-parse($r);
my $r_scheme   = $parsed_uri-scheme;
my $r_host = $parsed_uri-hostinfo;
my $r_rpath= $parsed_uri-rpath;
my $r_path = $parsed_uri-path;

I get valid data back for each request.  What am I missing?

I'm using mod_perl 1.23 and Apache 1.3.12 on Caldera LINUX if that's of 
any help.

Thanks,
Rob


   _ _ _ _   __ _ _ _ _
  /\_\_\_\_\/\_\ /\_\_\_\_\_\
 /\/_/_/_/_/   /\/_/ \/_/_/_/_/_/  QUIDQUID LATINE DICTUM SIT,
/\/_/__\/_/ __/\/_//\/_/  PROFUNDUM VIDITUR
   /\/_/_/_/_/ /\_\  /\/_//\/_/
  /\/_/ \/_/  /\/_/_/\/_//\/_/ (Whatever is said in Latin
  \/_/  \/_/  \/_/_/_/_/ \/_/  appears profound)
  
  Rob Tanner
  McMinnville, Oregon
  [EMAIL PROTECTED]



RE: CGI::Delete for Apache::Request

2000-05-16 Thread Doug MacEachern

 well, form_fields() is descriptive and would fit nicely with the other
 Apache::Table methods (headers_in, etc)...

something like that, i was thinking post_data, but that table also has
query string data in it, which might from a get.  phooey.
 
 will you keep parms() around for folks who already have functions built
 around it?  maybe making a clean break with 2.0?

sure, i'll make an alias for it.




Re: CGI scripts not executing.Re: works on linux, doesn't work onsun.

2000-05-16 Thread Doug MacEachern

On Tue, 16 May 2000 [EMAIL PROTECTED] wrote:

 Actually,  as I found out yesterday, it didn't fix it.  
 I still just get the source.  Further information.
 The symptoms were that I wasn't getting redirected properly.  Yesterday
 some pieces finally came together which put me to the following point.
 Scripts are still not executing.  The script that i was getting, was an
 error in the way i trapped the domain names.  Ie, what I was getting,
 was one where the host was www rather then the fqdn. 
 So this leaves me back at the origianl point,  CGI scripts that are
 under the handler are not being ran. I've checked, and I do return
 DECLINED when my handler doesn't need to work with the content.

ok, you need to describe what Mf7 does.  and what is supposed to handle
things if you return DECLINED.  when you say 'CGI scripts', do you mean
Apache::Registry scripts?  even you mean mod_cgi, i didn't see any
config to handle either if you return DECLINED from Mf7.




Re: mod_perl + any other DSO module returns no data

2000-05-16 Thread Doug MacEachern

On Tue, 16 May 2000, Asghar Nafarieh wrote:

 
 I have a linux machine with ssl, php, mod_perl + apache 1.3.12.
 If I load mod_perl module by idself it works fine. But if
 I add any other module in conjunction with mod_perl in httpd.conf 
 I get "document has no data". I used both mod_perl 1.21 and mod_perl 1.23 
 with either perl 5.005_03 and perl 5.6.0 and I still get the same result.
 I changed the apache to 1.3.9 and I still get the same result. 
 
 Anybody has any answer?

i can only ask again what i asked for last night (below), it may seem
painful, but it's faster than guessing.  the other solution is for you to
link mod_perl static.

Date: Mon, 15 May 2000 23:29:35 -0700 (PDT)
From: Doug MacEachern [EMAIL PROTECTED]
To: Asghar Nafarieh [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
Subject: Re: mod_perl-perl5.6.0

On Mon, 15 May 2000, Asghar Nafarieh wrote:

 I did it and still I get the same error.

ok, then you'll have to get a stacktrace (see SUPPORT doc for tips),
assuming this is a core dump.




Re: Apache::URI doesn't work for me

2000-05-16 Thread Doug MacEachern

On Tue, 16 May 2000, Rob Tanner wrote:

 Hello,
 
 I do the following:
 
 my $parsed_uri = $r-parsed_uri;
 my $r_scheme   = $parsed_uri-scheme;
 my $r_host = $parsed_uri-hostinfo;
 my $r_rpath= $parsed_uri-rpath;
 my $r_path = $parsed_uri-path;
 
 
 The result is that the scalars $r_scheme and $r_host are empty, and
 only $r_path and $r_rpath have data in them (and the data is correct).

that's because $r-parsed_uri is the parse uri from the http request,
which does not contain scheme/hostname/port, unless the request is a proxy
request.

 But, if instead I do,
 
 my $me = Apache::URI-parse($r);

that's a shortcut for building "self urls", if you don't specify a url,
the Apache::URI is filled in with everything it can dig out of the
request object (including scheme/hostname/port)




[ANNOUNCE] B-Size-0.04

2000-05-16 Thread Doug MacEachern

if you're not familar with B::Size, it was written a while back to answer
the question 'why are my httpds so damn BIG?'  there are hooks in
Apache::Status to measure the size of global/lexical variables and the
syntax tree.  this is a debugging/educational module, for best results,
run httpd in -X mode.  and, do not enable on a production server, the code
to measure the syntax tree can burn lots of cpu.

Changes since 0.03:

OnMouseOver displays opcode description in the status window
thanks to Charles Lee [EMAIL PROTECTED] for the link attribute
magic

source code is displayed in its own window

use a reasonable size code window instead of the entire file when
viewing source code linked to from opcodes

number lines in source code windows

fixes for 5.6.0

fix for threaded perl [Daniel Sully [EMAIL PROTECTED]]





[ANNOUNCE] mod_perl-1.24

2000-05-16 Thread Doug MacEachern

The URL

http://perl.apache.org/dist/mod_perl-1.24.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/D/DO/DOUGM/mod_perl-1.24.tar.gz
  size: 353562 bytes
   md5: 08d0ac4c9e2436fdb038021ae8826a8c

Changes since 1.23:

'sub handler : method {}' is now treated as a method handler

variable $Apache::Server::ConfigTestOnly is set to 1 if Apache
is running in configuration test mode (httpd -t)
[Eric Cholet [EMAIL PROTECTED]]

add PerlAddVar directive, like PerlSetVar, but uses ap_table_add
instead of ap_table_set

Makefile.PL warns about 5.6.0+uselargefiles if USE_APXS

Apache::Table-unset can now be called with an array reference

Apache::PerlRun::flush_namespace fixes, so aliased (imported)
code/hash/array/scalar are undefined without undef-ing the pointed-to
data and without using B.pm, thanks to Richard Chen for the suggestion

document Apache::print's special behavior wrt references
[Jeffrey W. Baker [EMAIL PROTECTED]]

fix core dump triggered by Perldo 'foo.pl'/Perl,
thanks to Robert S. Thau for the spot

pass $Config{ccflags} to apache for 5.6.0+

fix Apache-httpd_conf, thanks to Will Trillich for the spot

fixed 'make clean' to remove FILES = passed to MakeMaker

---

enjoy,
-Doug




cvs commit: modperl/lib mod_perl.pm

2000-05-16 Thread dougm

dougm   00/05/16 22:44:26

  Modified:.Changes
   lib  mod_perl.pm
  Log:
  bump version
  
  Revision  ChangesPath
  1.486 +2 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.485
  retrieving revision 1.486
  diff -u -r1.485 -r1.486
  --- Changes   2000/05/17 05:25:59 1.485
  +++ Changes   2000/05/17 05:44:25 1.486
  @@ -8,6 +8,8 @@
   
   =over 3
   
  +=item 1.24_01-dev
  +
   =item 1.24 - May 16, 2000
   
   'sub handler : method {}' is now treated as a method handler
  
  
  
  1.47  +1 -1  modperl/lib/mod_perl.pm
  
  Index: mod_perl.pm
  ===
  RCS file: /home/cvs/modperl/lib/mod_perl.pm,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- mod_perl.pm   2000/05/17 05:26:01 1.46
  +++ mod_perl.pm   2000/05/17 05:44:26 1.47
  @@ -4,7 +4,7 @@
   use DynaLoader ();
   
   BEGIN {
  -$mod_perl::VERSION = "1.24";
  +$mod_perl::VERSION = "1.2401";
   }
   
   sub boot {