Re: capturing subrequest output (have things changed)

2001-05-10 Thread araman

Hi James

Thanks for the suggestion but a code snippet will really help since i am
a complete new bie out here..

Thanks
Anand

On Tue, May 08, 2001 at 01:53:48PM -0500, James G Smith wrote:
Anand Raman [EMAIL PROTECTED] wrote:
hi guys
I just started off using modperl so excuse me if this has been answered.

Is there a way to capture output from a subrequest.. rather than
allowing the subrequest to directly output the response to the client
browser. 

I need to be able to parse the output of the subrequest before
outputting it to the browser.

I'm not positive on fd 0 being stdout -- stdout, stdin, and stderr are fd 0-2, 
I believe.  Just not sure of the ordering (I don't use them by number very 
often...).
-- 
James Smith [EMAIL PROTECTED], 979-862-3725
Texas AM CIS Operating Systems Group, Unix




mod_perl and 700k+ files?

2001-05-10 Thread Morbus Iff

Hey there, wondering if anyone could help me with this.

I'm relatively new to mod_perl... I've got a 700k file that is loaded each 
time I run a CGI script, so I'm hoping to cache the file using mod_perl 
somehow. The file will change occasionally (maybe once a week) - the reload 
of a few seconds isn't worrisome, but it has to be done without restarting 
the server.

Any suggestions on exactly the best way to do this? I've going to:

  - PerlSetupEnv Off
  - PerlModule and PerlRequre
  - Remove buffering.
  - Cache from XML::Simple **

** The 700k file is an XML file, read in by XML::Simple. XML::Simple can 
cache that file into memory. Is this how I should do it? Or should I load 
the file from my startup.pl script so that the file is shared amongst all 
the apache children? If that's the case, how would I dynamically reload it?


Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/




crash on exit with -X

2001-05-10 Thread Greg Wilson

Hi.  We're getting a segfault when httpd shuts down
when using mod_perl on Red Hat 6.2, and I'd like to
know whether anyone else has seen this as well. If I
run httpd -X -f /home/gvwilson/httpd.conf under gdb,
the stack trace is:

#0  0x4000af21 in _dl_debug_state () at dl-debug.c:56
#1  0x40183156 in _dl_close (map=0x853bb78) at dl-close.c:195
#2  0x400a1430 in dlclose_doit (handle=0x853bb78) at dlclose.c:26
#3  0x4000ac3b in _dl_catch_error (errstring=0x400a3080, operate=0x400a1418
dlclose_doit, args=0x853bb78) at dl-error.c:141
#4  0x400a18b9 in _dlerror_run (operate=0x400a1418 dlclose_doit,
args=0x853bb78) at dlerror.c:125
#5  0x400a13fe in dlclose (handle=0x853bb78) at dlclose.c:32
#6  0x806748c in ap_os_dso_unload ()
#7  0x4026c3ec in unload_xs_so () from /etc/httpd/modules/libperl.so
#8  0x4026c42b in mp_dso_unload () from /etc/httpd/modules/libperl.so
#9  0x8051068 in ap_run_cleanup ()
#10 0x804fe59 in ap_clear_pool ()
#11 0x805bf76 in ap_child_terminate ()
#12 0x805c65f in main ()
#13 0x400bc9cb in __libc_start_main (main=0x805c3e0 main, argc=4,
argv=0xbb54, init=0x804f014 _init, fini=0x807b99c _fini,
rtld_fini=0x4000ae60 _dl_fini, stack_end=0xbb4c) at
../sysdeps/generic/libc-start.c:92

perl -V gives:

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=linux, osvers=2.2.5-22smp, archname=i386-linux
uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2
09:11:51 edt 1999 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-O2 -m486 -fno-strength-reduce',
gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under linux
  Compiled at Feb  2 2000 15:35:58
  @INC:
/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005
.

/usr/sbin/httpd -V gives:

Server version: Apache/1.3.12 (Unix)  (Red Hat/Linux)
Server built:   Mar  1 2000 13:37:34
Server's Module Magic Number: 19990320:7
Server compiled with
 -D EAPI
 -D HAVE_MMAP
 -D HAVE_SHMGET
 -D USE_SHMGET_SCOREBOARD
 -D USE_MMAP_FILES
 -D USE_FCNTL_SERIALIZED_ACCEPT
 -D HTTPD_ROOT=/usr
 -D SUEXEC_BIN=/usr/sbin/suexec
 -D DEFAULT_PIDLOG=/var/run/httpd.pid
 -D DEFAULT_SCOREBOARD=/var/run/httpd.scoreboard
 -D DEFAULT_LOCKFILE=/var/run/httpd.lock
 -D DEFAULT_XFERLOG=/var/log/httpd/access_log
 -D DEFAULT_ERRORLOG=/var/log/httpd/error_log
 -D TYPES_CONFIG_FILE=/etc/httpd/conf/mime.types
 -D SERVER_CONFIG_FILE=/etc/httpd/conf/httpd.conf
 -D ACCESS_CONFIG_FILE=/etc/httpd/conf/access.conf
 -D RESOURCE_CONFIG_FILE=/etc/httpd/conf/srm.conf

uname -a and cat /etc/redhat-release give:

Linux snuff.testbed.private 2.2.14-5.0 #1 Tue Mar 7 20:53:41 EST 2000 i586
unknown
Red Hat Linux release 6.2 (Zoot)

respectively.

Is this a known issue?  If so, I'd be grateful for pointers to a solution.

Thanks,
Greg




installating mod_perl-1.25/apache_1.3.19/perl 5.005_02/solaris 5.6

2001-05-10 Thread qazi Ahmed

Hi.
I have been trying to install mod_perl from past one day but am turning up with no 
results.
The source configuration part of the installation is 
working fine, 

perl Makefile.PL APACHE_SRC=../apache_1.3.19/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1

but when trying to build, i am getting the errors like:

make[5]: warning:  Clock skew detected.  Your build may be incomplete
=== src/modules/standard
=== src/modules/perl
gcc -O -I/usr/local/lib/perl5/sun4-solaris/5.004/CORE 
-I/usr/local/inusr/local/lib/perl5/sun4-solaris/5.004/CORE -I../../os/unix 
-I../../i/../apaci` -c Apache.c
perl /usr/local/lib/perl5/ExtUtils/xsubpp -nolinenumbers -typemap /us
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck] [
make[5]: *** [Constants.o] Error 2
make[4]: *** [all] Error 1 
make[3]: *** [subdirs] Error 1
make[3]: Leaving directory `/export/home/ats/test-tools/ats/guts/apac
make[2]: *** [build-std] Error 2
make[2]: Leaving directory `/export/home/ats/test-tools/ats/guts/apac
make[1]: *** [build] Error 2
make[1]: Leaving directory `/export/home/ats/test-tools/ats/guts/apac
make: *** [apaci_httpd] Error 2





Can anyone help me, it is very important for me.
Thanks and regards
Firdous


_
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.com







a module to allow a windows user to manage per-directory access rights

2001-05-10 Thread Louis-David Mitterrand

Hello,

Is there a mod_perl module or Mason component (best) somewhere that
would allow a non-technical user to manage Apache per-directory access
rights (basic auth or otherwise) from a web interface?

Thanks in advance,

-- 
OENONE: Songez-vous qu'en naissant mes bras vous ont reçue ?
Mon pays, mes enfants, pour vous j'ai tout quitté.
  (Phèdre, J-B Racine, acte 1, scène 3)



Re: crash on exit with -X

2001-05-10 Thread G.W. Haywood

Hi there,

On Wed, 9 May 2001, Greg Wilson wrote:

 Hi.  We're getting a segfault when httpd shuts down when using
 mod_perl on Red Hat 6.2
[snip]
 perl -V gives:
 
 Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
   Platform:
 osname=linux, osvers=2.2.5-22smp, archname=i386-linux
 uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2
[snip]
 Characteristics of this binary (from libperl):
   Built under linux
   Compiled at Feb  2 2000 15:35:58
[snip]
 /usr/sbin/httpd -V gives:
 
 Server version: Apache/1.3.12 (Unix)  (Red Hat/Linux)
 Server built:   Mar  1 2000 13:37:34
[snip]
 uname -a and cat /etc/redhat-release give:
 
 Linux snuff.testbed.private 2.2.14-5.0 #1 Tue Mar 7 20:53:41 EST 2000 i586

Looks like you didn't compile your own Perl, mod_perl and Apache.
It's well worth the trouble, it only takes a few minutes when you get
the hang of it.  I'd try getting the sources for Perl 5.005_03, Apache
1.3.19 and mod_perl 1.25 and compiling the lot.  I'd also try building
static as there can be problems with DSO (*).

You may see other, more informative replies if you're patient... :)

73,
Ged.

(*) Extract from .../mod_perl-1.25/INSTALL.apaci:
--
=head1 NAME

INSTALL.apaci - Installing mod_perl under Unix with the new hybrid
build environment for Apache 1.3

[snip]
=head1 EXPERIMENTAL

With Apache 1.3 there is support for building modules as Dynamic
Shared Objects (DSO).  So there is support for DSO in mod_perl now,
too.  IBUT THIS IS STILL EXPERIMENTAL, SO BE WARNED!
--




Re: installating mod_perl-1.25/apache_1.3.19/perl 5.005_02/solaris 5.6

2001-05-10 Thread G.W. Haywood

Hi there,

On 10 May 2001, qazi Ahmed wrote:

 but when trying to build, i am getting the errors like:
 
 make[5]: warning:  Clock skew detected.  Your build may be incomplete
 
Have you checked your system clock?
Do you really mean 5.005_02?

73,
Ged.




Re: mod_perl and 700k files...

2001-05-10 Thread Morbus Iff

The above code asigns a signal handler for the USR2 signal.
This signal has been chosen because it's least likely to be
used by the other parts of the server.

 That, unfortunately doesn't tell me what causes a USR2 signal to be sent to
 Apache. Or when it's caused. I only want to reload the file when said file
 has changed. Am I supposed to do some checking against the file -M time
 myself, and then send a USR2 signal myself?

You didn't search the guide, even if you try to make everyone believe that

Sigh. What the frel is your problem, binky?

talking about using USR2, not the caching technique). The first hit in the
http://thingy.kcilink.com/modperlguide/debug/Using_the_Perl_Trace.html

Actually, no, not really. That's the same exact page I got when I didn't
search the search engine (thus pulling the wool over your elite mod_perl
eyes) before. Strangely, enough, the same quoted sentence in my email, is
golly gosh darn, the second sentence on that page.

And my comments to that page still apply. I will agree, in some sense,
however, that my comments about not tell[ing] me what causes a USR2
signal are incorrect. I was looking for a solution in all perl, so when I
saw the kill command, I just stopped reading, since it wasn't what I'm
looking for.

http://perl.apache.org/guide/porting.html#Configuration_Files_Writing_Dy
http://perl.apache.org/guide/porting.html#Using_Apache_Reload

The first was more helpful than the second (ignorantly speaking). The thing
that worries me the most is about the 700k file being passed around to all
the children during a ::Reload or other solution. More specifically, is
there anyway to reload a file into the parent, which would automatically be
shared with existing children, and all newly spawned children? Without
restarting the server?

Thanks for the help...

-- 
  ICQ: 2927491  /  AOL: akaMorbus
   Yahoo: morbus_iff/  Jabber: [EMAIL PROTECTED]
   [EMAIL PROTECTED]   /   http://www.disobey.com/



Re: mod_perl and 700k files...

2001-05-10 Thread Dave Hodgkinson

Morbus Iff [EMAIL PROTECTED] writes:

 Well, it's a big deal if you've no in with the place you're webhosting
 with, sure... No one wants to be told that some lowly customer wants to
 restart the server that's running 200 other vhosts...
 
 Granted, I work at the damn webhost, but it's gotten to the point where all
 the gizmo's and crap I've added have slowly been dipping the stop touching
 the server, you feature freak - I'd rather not stress the relationship.

Sounds like you need to start running multiple Apaches. Get to know
the architecture sections of the guide, get familiar with mod_rewrite
and start dividing up your servers.


-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Interim CTO, web server farms, technical strategy
   



Apache Oracle and Perl

2001-05-10 Thread Harnish, Joe
Title: Apache Oracle and Perl





When I start getting this error, I can shutdown the httpd server, and the
machine and it will still give this error. If I wait a while(sometimes hours, sometimes days) it will come
back. Sometimes it is a few hours. Sometimes it is days. I have installed
Apache::DBI in hopes of a possible fix. 

The error I get is:
Software error:


Can't load
'/usr/lib/perl5/site_perl/5.6.0/i386-linux/auto/DBD/Oracle/Oracle.so' for
module DBD::Oracle: libclntsh.so.8.0: cannot open shared object file: No
such file or directory at /usr/lib/perl5/5.6.0/i386-linux/DynaLoader.pm line
200. at (eval 13) line 3 


For help, please send mail to the webmaster (root@localhost
mailto:root@localhost), giving this error message and the time and date of
the error. 



__


This is on a Dell running RedHat Linux 7. The file is there and it readable
by everyone (along with the path to get there). Is there a way I can
compile it statically? Because 95% of my scripts access the Oracle
Database. I have put the so files in their proper places. 


I really need to solve this to prove that my choice of using Apache/Perl for our
development is actually worth it. Has anyone ever seen this problem? 


Thanks





Joe





Re: Apache Oracle and Perl

2001-05-10 Thread Robert Landrum

At 8:34 AM -0400 5/10/01, Harnish, Joe wrote:
When I start getting this error, I can shutdown the httpd server, and the
machine and it will still give this error.  If I wait a 
while(sometimes hours, sometimes days) it will come
back.  Sometimes it is a few hours.  Sometimes it is days.  I have installed
Apache::DBI in hopes of a possible fix. 

The error I get is:
Software error:

Can't load
'/usr/lib/perl5/site_perl/5.6.0/i386-linux/auto/DBD/Oracle/Oracle.so' for
module DBD::Oracle: libclntsh.so.8.0: cannot open shared object file: No
such file or directory at /usr/lib/perl5/5.6.0/i386-linux/DynaLoader.pm line
200. at (eval 13) line 3

For help, please send mail to the webmaster (root@localhost
mailto:root@localhostmailto:root@localhost), giving this error 
message and the time and date of
the error.


__

This is on a Dell running RedHat Linux 7.  The file is there and it readable
by everyone (along with the path to get there).  Is there a way I can
compile it statically?  Because 95% of  my scripts  access the Oracle
Database.  I have put the so files in their proper places.

I had a CGI that became a mod perl app and it was doing a chroot.  As 
a CGI, chroot is fine.  As an Apache::Registry script, it will cause 
these errors.

Rob



--
As soon as you make something foolproof, someone will create a better fool.



Object - RDBMS mapping tools and mod_perl

2001-05-10 Thread Ray Zimmerman

I'm looking for a good package to use for Object - RDBMS mapping in 
the context of mod_perl and Mason. Something that will handled object 
inheritance and nested objects, etc.

I'm aware of Tangram, Alzabo and SPOPS (not sure all these do what I 
need) ... are there any others? Any particular reasons why any of 
these may not play with with mod_perl/Mason?

Thanks,
-- 
  Ray Zimmerman  / e-mail: [EMAIL PROTECTED] / 428-B Phillips Hall
   Sr Research  /   phone: (607) 255-9645  /  Cornell University
Associate  /  FAX: (815) 377-3932 /   Ithaca, NY  14853



Re: [Mason] Object - RDBMS mapping tools and mod_perl

2001-05-10 Thread Dave Rolsky

On Thu, 10 May 2001, Ray Zimmerman wrote:

 I'm aware of Tangram, Alzabo and SPOPS (not sure all these do what I
 need) ... are there any others? Any particular reasons why any of
 these may not play with with mod_perl/Mason?

Well, I wrote Alzabo and it plays just fine with mod_perl and Mason.  In
fact, the schema creation interface is a set of Mason components.  The
caching/syncing architecture was specifically created to allow syncing of
objects between multiple processes (ala mod_perl) and I will be creating a
syncing module sometime that sync between multiple machines as well.

I think the author of SPOPS is also a mod_perl user (I'm pretty sure he's
posted to the mod_perl list in the past) so I'd expect it to play nice.

Tangram I don't know much about in relation to mod_perl.

However, these are all fairly different systems.  I often descrive Alzabo
as the opposite of Tangram, for instance.  Alzabo is an RDBMS-OO mapper
and Tangram is an OO-RDBMS mapper.  Tangram is aimed at letting you have
transparent OO persistence in an RDBMS without worrying about the schema
too much.  Alzabo is about taking an RDBMS and giving you access to it
through convenient object methods.

I'm not sure exactly what the goal of SPOPS is, so I'll let the author
speak for himself.


-dave

/*==
www.urth.org
We await the New Sun
==*/





Re: install perl-win32-bin-0.6.exe on win98

2001-05-10 Thread David Lanzarote García


Is there a message after the
 cannot load /apache/modules/ApacheModulePerl into server:
indicating why the module can't be loaded?

 I'm afraid nothing else appears after this line to indicate which can be
the problem...
 Apache is on c:\Apache, perl is on c:\perl, ApacheModulePerl.dll is on
c:\Apache\modules\ , the paths are ok, What else can I check??

 thanks for your ideas...




Re: Object - RDBMS mapping tools and mod_perl

2001-05-10 Thread Nathan Stitt

Ray Zimmerman wrote:

 I'm looking for a good package to use for Object - RDBMS mapping in the 
 context of mod_perl and Mason. Something that will handled object 
 inheritance and nested objects, etc.
 


One that I've been meaning to try out when I get a chance is GOODS at:
http://www.ispras.ru/~knizhnik/goods.html  I've never used it and have 
never heard of anyone useing it either, but it looks intriging and has 
perl bindings.  I want to attempt to store XML trees in it, as I've yet 
to find a good free sytem for storing arbitrary XML data.


If you do attempt to use it, please let me know how it works out.


Nathan







Re: mod_perl and 700k files...

2001-05-10 Thread G.W. Haywood

Hi there,

On Thu, 10 May 2001, Morbus Iff wrote:

 You didn't search the guide, even if you try to make everyone believe that
 
 Sigh. What the frel is your problem, binky?

Stas' problem, which apparently your researches have not discovered,
is that he WROTE the guide and when somebody starts spamming fifteen
hundred mailboxes because he didn't read it he's understandably a
little irritated.

Please try to understand that a lot of people have put a lot of work
into the stuff you are using for free.  Try to remain polite.

We're doing our best to help.  Some of us are very busy.  Stas is very busy.
Please respect that.

73,
Ged.




Re: Re: installating mod_perl-1.25/apache_1.3.19/perl 5.005_02/solaris 5.6

2001-05-10 Thread G.W. Haywood

Hi there,

On 10 May 2001, qazi Ahmed wrote:

 I dont have any idea regarding the clock skew detected error.

In this case it just means that 'make' has noticed something odd about
the various dates and times in your system.  It is very important for
several reasons that you keep the computer clock as accurate as you
can.  There are free utilities such as 'ntpd' to help you to do that.

One reason for needing an accurate clock is that the 'make' utility
uses the time and date information which your system keeps about its
files to decide whether or not to recompile (or whatever other action
may be necessary for a 'target').

Another reason is that when a machine is used to serve Web content the
'latest modification' stamps on files are used to decide whether or not
it is necessary to download fresh copies of the files to the client.

Your system seems to have confusing information about the datestamps on
files or about the system time itself.  If a file was copied when the
system time was wrong, and the system time was subsequently corrected,
then this error could appear.  If the system time is wrong and a file
appears to have a date/time later than the current system time, the
same problem can appear.

Please keep your replies on the List so that everyone has a chance to
read them and comment.

73,
Ged.




avoiding authentication w/ mod_perl

2001-05-10 Thread Mark Holt

Hi,
I am running a hosting service, and I use mod_perl to filter pages and add
banners.  For my paid users, I would like to offer the option of using
.htaccess files for password protection, but I can't afford to check these
files on every hit, only hits to paid sites.  I can determine if the user is
paid with a couple of lines of perl, but I don't know how to get apache to
only authenticate in those cases, and otherwise to ignore the existence of
.htaccess files.  Does any mod_perl guru out there have some insight on
this?




Re: mod_perl and 700k files...

2001-05-10 Thread Morbus Iff

  Sigh. What the frel is your problem, binky?
 
 Stas' problem, which apparently your researches have not discovered,
 is that he WROTE the guide and when somebody starts spamming fifteen
 hundred mailboxes because he didn't read it he's understandably a
 little irritated.

Oh, no, don't get me wrong. I know he wrote the manual. I've even been to 
his website and seen his credentials (unknowingly enough, I've had his perl 
pages bookmarked for quite a while). I totally understand the whole RTFM 
thing. I did RTFM - how else would I have known all the other things to try 
in my original message (reproduced below)?:

  - PerlSetupEnv Off
  - PerlModule and PerlRequre
  - Remove buffering.
  - Cache from XML::Simple **

It wouldn't have been that big of a deal if he didn't point me to the exact 
same page that I had quoted from in my return email. And now, all of a 
sudden, I'm spamming?

 Please try to understand that a lot of people have put a lot of work
 into the stuff you are using for free.  Try to remain polite.

I'm not the one who initially accused me of not reading the manual and then 
trying to pull a fast one over on everyone else (You didn't search the 
guide, even if you try to make everyone believe that you did).

 We're doing our best to help.  Some of us are very busy.  Stas is very busy.

You don't think I'm busy? I code large projects, run an ISP/webhost, 
maintain a content site called Disobey.com which get a million hits a 
month, and have been doing it for the past four years. Disobey brought the 
world Ghost Sites and NetSlaves, and gets press 
(disobey.com/about/presspit.shtml) frequently enough that it's becoming 
flippin' annoying. But I digress.

I know what it's like to busy. I know what it's like to say Hey! RTFM!. 
But I don't like being sent to the same page that I quoted from, with 
solutions outside of perl (which I had already said in another reply was 
not what I was looking for), and then to be given an elitism attitude at 
the same time.

If the list feels it best that I unsubscribe, then by all means, say so 
offlist. For the record, however, I'm not the clueless newbie, I did RTFM 
(although, as admitted in another post, skipped the explanation of 
triggering the USR2 signal due to it being related to 'kill' and not a perl 
solution), and was only impolite after the golden rule came into effect.

I hope ya understand.

Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/




Re: Apache Oracle and Perl

2001-05-10 Thread G.W. Haywood

Hi there,

On Thu, 10 May 2001, Harnish, Joe wrote:

 When I start getting this error, I can shutdown the httpd server, and the
 machine and it will still give this error.  If I wait a while(sometimes
 hours, sometimes days) it will come
 back.  Sometimes it is a few hours.  Sometimes it is days.  I have installed
 Apache::DBI in hopes of a possible fix.  
  
 The error I get is:
 Software error:
 
 Can't load
 '/usr/lib/perl5/site_perl/5.6.0/i386-linux/auto/DBD/Oracle/Oracle.so' for
 module DBD::Oracle: libclntsh.so.8.0: cannot open shared object file: No
 such file or directory at /usr/lib/perl5/5.6.0/i386-linux/DynaLoader.pm line
 200. at (eval 13) line 3 


I think I read somewhere that this error sometimes happens as a kind
of catch-all, and doesn't really mean what it says.  I think it can
mean that an executable wouldn't run, or couldn't be found in the
search paths currently in use by the app (and not that it wasn't there).

You seem to have two files in this message, (Oracle.so and libclntsh.so.8.0).
Have you checked both?  There should have a symlink libclntsh.so pointing to
libclntsh.so.8.0 I think.

Have you checked that the paths are correct when this happens?
Check especially LD_LIBRARY_PATH.

HTH

73,
Ged.







Re: mod_perl and 700k files...

2001-05-10 Thread G.W. Haywood

Hi there,

On Thu, 10 May 2001, Morbus Iff wrote:

 I hope ya understand.

Well, I hope we've all got that off our chests.

Now, have you got enough to get you going OK?

73,
Ged.





Re: mod_perl and 700k files...

2001-05-10 Thread Morbus Iff

  I hope ya understand.
 
 Well, I hope we've all got that off our chests.

I'm really hoping so - I *hate* this sort of stuff.

 Now, have you got enough to get you going OK?

I'm thinking I do, yes. Thanks for asking.


Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/




RE: Apache Oracle and Perl

2001-05-10 Thread Rob Bloodgood

 When I start getting this error, I can shutdown the httpd server, and the
 machine and it will still give this error. If I wait a while(sometimes
hours,
 sometimes days) it will come
 back. Sometimes it is a few hours. Sometimes it is days. I have installed
 Apache::DBI in hopes of a possible fix.

 The error I get is:
 Software error:
 Can't load
 '/usr/lib/perl5/site_perl/5.6.0/i386-linux/auto/DBD/Oracle/Oracle.so' for
 module DBD::Oracle: libclntsh.so.8.0: cannot open shared object file: No
 such file or directory at /usr/lib/perl5/5.6.0/i386-linux/DynaLoader.pm
line

When I see this problem, I automatically think, Oh, the Oracle libs aren't
being located by the system.  Edit /etc/ld.so.conf and add the value of
$ORACLE_home/lib (the directory that has libclntsh.so.8 in it)
e.g.
/usr/local/oracle/8.1.5/lib

the run /sbin/ldconfig to update Linux's idea of where things are, and stop
and start the server.

ALSO, ensure that ORACLE_HOME is explicitly provided to your perl stuff:

in httpd.conf
PerlPassEnv ORACLE_HOME

THIS CAN BITE YOU! If your httpd startup script doesn't have the oracle
environment loaded, you may have to fix that as well:

at the beginning of /etc/rc.d/init.d/httpd:

# Source function library.
. /etc/rc.d/init.d/functions !-- original code --

# Source Oracle environment !-- you add these lines --
ORAENV_ASK=NO
ORACLE_SID=stats
. /usr/local/bin/oraenv

# See how we were called. !-- original code --
case $1 in


HTH!

L8r,
Rob

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





Re: Re: installating mod_perl-1.25/apache_1.3.19/perl 5.005_02/solaris 5.6

2001-05-10 Thread Paul Lindner

On Thu, May 10, 2001 at 07:51:05PM +0100, G.W. Haywood wrote:
 Hi there,
 
 On 10 May 2001, qazi Ahmed wrote:
 
  I dont have any idea regarding the clock skew detected error.
 
 In this case it just means that 'make' has noticed something odd about
 the various dates and times in your system.  It is very important for
 several reasons that you keep the computer clock as accurate as you
 can.  There are free utilities such as 'ntpd' to help you to do that.

Another source of trouble is compiling on an NFS mounted partition
where.  If the time or timezone on the server does not agree with the
time on the client you will end up with these problems.

I had to deal with this all the time when I used a NetApp Filer with
an old firmware that didn't support ntp..

-- 
Paul Lindner
[EMAIL PROTECTED]



Re: avoiding authentication w/ mod_perl

2001-05-10 Thread John Saylor

Hi

( 01.05.10 13:07 -0600 ) Mark Holt:
 For my paid users, I would like to offer the option of using
 .htaccess files for password protection, but I can't afford to check these
 files on every hit, only hits to paid sites.  I can determine if the user is
 paid with a couple of lines of perl, but I don't know how to get apache to
 only authenticate in those cases, and otherwise to ignore the existence of
 .htaccess files.

What comes to mind is a handler for these locations. The handler runs
the few lines of perl to determine if the user is paid, then can call
another handler [or subroutine] if the .htaccess should get read and
parsed.

Also, usually authentication/authorization happens much earlier in
Apache response cycle, so you may need to use redirects or custom
'Access Denied' pages to get the effect you want.

There may be other ways to do this, and I'm only guessing at what effect
you want.

Good luck.

-- 
\js

For the record, pot, like the _Reader's Digest_, is not necessarily habit-
 forming, but both can lead to hard-core addiction: heroin, in one case,
 abridged bad books in the other.  Either way you look at it, a withdrawal
 from a meaninful life.
-- Mordecai Richler, Going Home Again



Where exactly is the Perl interpreter?

2001-05-10 Thread Issac Goldstand



I was just wondering- where exactly is the Perl 
interpreter in mod_perl 1.25 (for Apache 1.3) and where will it be in mod_perl 2 
(Apache 2.0)? I assume in Apache 1.3 it's in shared memory, but I want to 
double check...

 Issac

Internet is a wonderful mechanism for making a fool 
ofyourself 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






looking for a functin to move %fdat to the symbol table..

2001-05-10 Thread jason n perkins

php has a function called extract which takes an array (no distinction
between arrays and hashes in php. in this case in perl, it'd actually be a
hash). extract takes the key values of the array (and optionally prepends a
user specified prefix to each of the values to avoid clobbering other values
in the symbol table), sets each of them up as a variable with that name and
sets the variable's value equal to the value of that associated key in the
hash. the beauty of extract comes into play when you want to use each of the
key/value pairs in the array. instead of setting them up one at a time, pass
the array to extract and voila, you have all of the key/value elements
available as variables. if my description is too unclear, you can check the
extract functions info at http://www.php.net/manual/en/function.extract.php.

does embedded perl sport a similar function?

my apologies if i've posted to the wrong list. i did cross post to the
embperl list, to cover all of the bases.

:: jason n perkins
:: email - [EMAIL PROTECTED]
:: web - www.somebodydial911.com






Re: Where exactly is the Perl interpreter?

2001-05-10 Thread Jeffrey W. Baker



On Thu, 10 May 2001, Issac Goldstand wrote:

 I was just wondering- where exactly is the Perl interpreter in
 mod_perl 1.25 (for Apache 1.3) and where will it be in mod_perl 2
 (Apache 2.0)?  I assume in Apache 1.3 it's in shared memory, but I
 want to double check...

This depends strongly on how your platform works.  On Unix and friends,
the Perl interp is in each Apache process.  However, the various interps
may actually reside in the same physical memory on your computer, because
of a kernel feature called copy-on-write.  Look it up on Google if
interested.

It would be incorrect to say that Perl is in shared memory on Apache
1.3/Unix.  Although the memory may in fact be shared, it is not shared
memory in the sense of shmctl, shmget, and shmop(2).

-jwb




Re: looking for a functin to move %fdat to the symbol table..

2001-05-10 Thread Joshua Chamas

jason n perkins wrote:
 
 php has a function called extract which takes an array (no distinction
 between arrays and hashes in php. in this case in perl, it'd actually be a
 hash). extract takes the key values of the array (and optionally prepends a
 user specified prefix to each of the values to avoid clobbering other values
 in the symbol table), sets each of them up as a variable with that name and
 sets the variable's value equal to the value of that associated key in the
 hash. the beauty of extract comes into play when you want to use each of the
 key/value pairs in the array. instead of setting them up one at a time, pass
 the array to extract and voila, you have all of the key/value elements
 available as variables. if my description is too unclear, you can check the
 extract functions info at http://www.php.net/manual/en/function.extract.php.
 
 does embedded perl sport a similar function?
 

%fdat = qw(var1 2 var2 4); 
map { eval qq(\$$_ = \$fdat{$_}) } keys %fdat; 
print join(qq(\n), $var1, $var2, undef)

You could roll your own extract() with line 2, but
if you want to put it in a module, you might have to
make it smarter about what package its extracting into
with a call to caller().

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



Re: looking for a functin to move %fdat to the symbol table..

2001-05-10 Thread Perrin Harkins

It's not hard to do, but it is potentially dangerous since you could
overwrite globals like $/ and change the behavior of your program.  In
general, it's best to avoid cluttering the symbol table.
- Perrin




Re: Cutting down on the DEBUG bloat...

2001-05-10 Thread Doug MacEachern

On Tue, 10 Apr 2001, Paul Lindner wrote:

 Hi,
 
 As part of my ongoing effort to streamline my mod_perl apps, I've come
 to discover the joy of constant subroutines and perl's ability to
 inline or eliminate code at compile time.  I have a solution that
 works, but would be interested in seeing if others had better
 syntactic sugar..  Anyway:
 
 We have a module CP::Util, with this begin block:
 
   BEGIN {
 $ENV{CP_DEBUG} ||= 0;
 if ($ENV{CP_DEBUG} == 1) {
   *{CP::Util::DBG} = sub () {1;};
 } else {
   *{CP::Util::DBG} = sub () {0;};
 }
   }
   @EXPORT_OK = qw(DBG);
 
 
 Then, in another module I do:
 
   use CP::Util qw(DBG);
 
   DBG  debug('whoa there boy');
 
 
 The end result is, when CP_DEBUG=1, the code is in there.  When
 CP_DEBUG=0, the code is trimmed out at compile time (because DBG is a
 constant subroutine, see perldoc perlsub for more info)
 
 This is a real win compared to our old way of using a subroutine
 called debug that did a no-op.  Consider:
 
debug 'whoa there' . $foo . join(keys(%bar));
 
 The args to debug are still computed, passed on the stack, etc..
 
 Now, my question is: Is there some trick I could use to retain the simple syntax:
 
   debug foo bar;

it is possible, and has been on the optimizations slide for the 2.0
talks i've been giving.  one idea i had in mind was:

$r-log-debug(...);

would be nulled out unless LogLevel is configured to debug.

i have fiddled with it, you can try this:
http://perl.apache.org/~dougm/condsub-0.01.tar.gz

see test.pl for the examples.
i'm open to names/interface changes, the module is just a
proof-of-concept.





Re: mod_perl and 700k files...

2001-05-10 Thread Perrin Harkins

on 5/9/01 5:45 PM, Morbus Iff at [EMAIL PROTECTED] wrote:
 Keep in mind, if you load this data during startup (in the parent) it will
 be shared, but reloading it later will make a separate copy in each child,
 chewing up a large amount of memory.  You might have better luck using dbm
 
 That is something I was hoping I wouldn't here ;) ... Even reloading the
 file into the same variable in my startup.pl wouldn't cause the parent to
 share it with new children?

No, that won't work.  You could try one of the IPC:: modules like
IPC::ShareLite or IPC::MM, but I think you'll still end with a scalar that
takes up more than 700K in each child.  If you can't live with that, you
might try breaking up the file more so that you can access it in smaller
chunks.

- Perrin




8-bit characters and mod_perl/Apache-ASP

2001-05-10 Thread Carl Lipo


Im having an odd (and annoying) problem with text data being returned via
Oracle::DBD (10.7) to an Apache::ASP (2.09) script. Essentially, perl that
returns perfectly valid characters in both cgi and as a .pl file fails to
return valid characters in the context of an Apache::ASP file. The issue,
I think has to do with the fact that the Oracle database (8.0.6) is
returning 8-bit characters. I can confirm this because I can repoint my
application to a version of the database set with 7bit characters and
everything works. While this shouldnt really be a problem (and isnt in the
normal 'perl' setting), Apache::ASP/mod_perl seems to be barfing on these
characters.

Here's some sample code:

use PNAP::Database::Query; ## a simplified database connection module
use CGI qw/:standard/;  ## for CGI output 
print header,
start_html('A Simple Example'),

## make a database connection
my $dbconn= new PNAP::Database::Query(Connection=NSPFinance, Debug=0);

## the sql statementA
my $orgSQL = select o.FULLNAME;
$orgSQL .=  from ORGANIZATION o, PARTY_ROLE pr, PARTY_ROLE_TYPE prt;
$orgSQL .=  where o.ORGANIZATIONOID = pr.SubjectPartyOID and;
$orgSQL .=  pr.PartyRoleTypeOID = prt.PartyRoleTypeOID and prt.ShortName = 
'NSP' and;
$orgSQL .=  pr.StartDate = sysdate and (pr.EndDate is null or pr.EndDate  
sysdate);
$orgSQL .=  order by FULLNAME;
my $rs = $dbconn-query(Sql=$orgSQL, UseCursor=0);
if ($rs)
{
 while ($rs-next())
 {
   my $fullname = $rs-FULLNAME; ## get the value from therecordset
   print Fullname: , $fullname,BR\n; ## output the value
  }
  $dbconn-finish($rs);
}


What is odd is that if I run this as a cgi (or from the command line), I
get this output:

Fullname: ATT
Fullname: Agis
Fullname: At Home
Fullname: CW
Fullname: CW/IDC
Fullname: Digex
Fullname: EBONE
...

However, the exact same code run as an Apache::ASP page results in this
output (on netscape for linux 4.76). 

Fullname: 
Fullname: 
Fullname: 
Fullname: 
Fullname: 
Fullname: 
...

On IE, however, I get this as output (viewed as source):

Fullname:  A T  T
Fullname:  A g i s
Fullname:  A t  H o m e
Fullname:  C  W
Fullname:  C W / I D C
Fullname:  D i g e x
Fullname:  E B O N E
...

This implies that the 8-bit characters are being rendered/dealt with
*differently* for the cgi version and the Apache::ASP version (and that
the Apache::ASP version honks up the 8-bit characters somehow). IE seems
to deal with the odd characters better than netscape. 

In order to address this problem, Ive tried all the standard approaches to
dealing with 8bit characters and Oracle databases (setting NLS_LANG, etc)
and have tried using Convert::Translit module to do the conversion..
However, none of those actions seem to make any difference. I still get
wonky output with the mod_perl/Apache::ASP version (but not the normal
Perl/cgi version). 

What I am wondering is:  

(1) is there a known problem with mod_perl and 8-bit character
sets? The version of apache I am running is 1.3.19 and mod perl 1.25, and
Apache 2.09.

(2) Is there any problem with this from the Apache::ASP side in either the
way the Response-Write is done or the way in which these character sets
are handled? Ive looked at the Response-Write and Response-WriteRef but
dont see anything obvious that could cause this.

(3) Has anyone seen this kind of behavior before?

Any help would be appreciated (it will beat having to export and re-import
the production database)...

Carl


Carl Lipo   EMAIL: [EMAIL PROTECTED]
IT Systems ArchitectPAGER: 206.570.2086
Internap Network Services   OFFICE: 206.504.5442
601 Union Street, Suite 1000FAX: 206.654.5684
Seattle, WA  98101  CELL: 206.579.0163

Unauthorized use, disclosure, or distribution of information within
this message is prohibited.




Re: 8-bit characters and mod_perl/Apache-ASP

2001-05-10 Thread Joshua Chamas

Difference like this, where cgi  perl scripts work fine, but mod_perl/ASP
doesn't, often has to do with %ENV where mod_perl is concerned.
This is because Apache clears %ENV.  The best way I have found to know
what is in your %ENV for Oracle connections is to explicitly set it
before the connect like:

$ENV{'ORACLE_HOME'} = '/path/to/oracle/home';
$ENV{'NLS_LANG'} ='american_america.WE8ISO8859P1';
$ENV{'ORA_NLS33'} = $ENV{ORACLE_HOME}.'/ocommon/nls/admin/data'; 

DBI-connect('dbi:Oracle:' ...);

This likely has nothing to do with Apache::ASP

You can also try PerlPassEnv  PerlSetEnv for things like the 
above, but explicitly setting has always given me the most mileage.

--Josh

Carl Lipo wrote:
 
 Im having an odd (and annoying) problem with text data being returned via
 Oracle::DBD (10.7) to an Apache::ASP (2.09) script. Essentially, perl that
 returns perfectly valid characters in both cgi and as a .pl file fails to
 return valid characters in the context of an Apache::ASP file. The issue,
 I think has to do with the fact that the Oracle database (8.0.6) is
 returning 8-bit characters. I can confirm this because I can repoint my
 application to a version of the database set with 7bit characters and
 everything works. While this shouldnt really be a problem (and isnt in the
 normal 'perl' setting), Apache::ASP/mod_perl seems to be barfing on these
 characters.
 
 Here's some sample code:
 
 use PNAP::Database::Query; ## a simplified database connection module
 use CGI qw/:standard/;  ## for CGI output
 print header,
 start_html('A Simple Example'),
 
 ## make a database connection
 my $dbconn= new PNAP::Database::Query(Connection=NSPFinance, Debug=0);
 
 ## the sql statementA
 my $orgSQL = select o.FULLNAME;
 $orgSQL .=  from ORGANIZATION o, PARTY_ROLE pr, PARTY_ROLE_TYPE prt;
 $orgSQL .=  where o.ORGANIZATIONOID = pr.SubjectPartyOID and;
 $orgSQL .=  pr.PartyRoleTypeOID = prt.PartyRoleTypeOID and prt.ShortName = 
'NSP' and;
 $orgSQL .=  pr.StartDate = sysdate and (pr.EndDate is null or pr.EndDate  
sysdate);
 $orgSQL .=  order by FULLNAME;
 my $rs = $dbconn-query(Sql=$orgSQL, UseCursor=0);
 if ($rs)
 {
  while ($rs-next())
  {
my $fullname = $rs-FULLNAME; ## get the value from therecordset
print Fullname: , $fullname,BR\n; ## output the value
   }
   $dbconn-finish($rs);
 }
 
 What is odd is that if I run this as a cgi (or from the command line), I
 get this output:
 
 Fullname: ATT
 Fullname: Agis
 Fullname: At Home
 Fullname: CW
 Fullname: CW/IDC
 Fullname: Digex
 Fullname: EBONE
 ...
 
 However, the exact same code run as an Apache::ASP page results in this
 output (on netscape for linux 4.76).
 
 Fullname:
 Fullname:
 Fullname:
 Fullname:
 Fullname:
 Fullname:
 ...
 
 On IE, however, I get this as output (viewed as source):
 
 Fullname:  A T  T
 Fullname:  A g i s
 Fullname:  A t  H o m e
 Fullname:  C  W
 Fullname:  C W / I D C
 Fullname:  D i g e x
 Fullname:  E B O N E
 ...
 
 This implies that the 8-bit characters are being rendered/dealt with
 *differently* for the cgi version and the Apache::ASP version (and that
 the Apache::ASP version honks up the 8-bit characters somehow). IE seems
 to deal with the odd characters better than netscape.
 
 In order to address this problem, Ive tried all the standard approaches to
 dealing with 8bit characters and Oracle databases (setting NLS_LANG, etc)
 and have tried using Convert::Translit module to do the conversion..
 However, none of those actions seem to make any difference. I still get
 wonky output with the mod_perl/Apache::ASP version (but not the normal
 Perl/cgi version).
 
 What I am wondering is:
 
 (1) is there a known problem with mod_perl and 8-bit character
 sets? The version of apache I am running is 1.3.19 and mod perl 1.25, and
 Apache 2.09.
 
 (2) Is there any problem with this from the Apache::ASP side in either the
 way the Response-Write is done or the way in which these character sets
 are handled? Ive looked at the Response-Write and Response-WriteRef but
 dont see anything obvious that could cause this.
 
 (3) Has anyone seen this kind of behavior before?
 
 Any help would be appreciated (it will beat having to export and re-import
 the production database)...
 
 Carl
 
 
 Carl Lipo   EMAIL: [EMAIL PROTECTED]
 IT Systems ArchitectPAGER: 206.570.2086
 Internap Network Services   OFFICE: 206.504.5442
 601 Union Street, Suite 1000FAX: 206.654.5684
 Seattle, WA  98101  CELL: 206.579.0163
 
 Unauthorized use, disclosure, or distribution of information within
 this message is prohibited.



Re: Cutting down on the DEBUG bloat...

2001-05-10 Thread barries

On Thu, May 10, 2001 at 03:28:16PM -0700, Doug MacEachern wrote:
 On Tue, 10 Apr 2001, Paul Lindner wrote:
  
DBG  debug('whoa there boy');

FWIW, you may find the opcode-identical

   debug 'whoa there boy' if DBG ;

more readable.  Don't go to values other than 0 or 1 (not even 0 or
1) for DBG for either or you'll get Useless use of a constant in void
context warnings...

 http://perl.apache.org/~dougm/condsub-0.01.tar.gz

Very cool.

- Barrie



Re: Where exactly is the Perl interpreter?

2001-05-10 Thread Stas Bekman

On Thu, 10 May 2001, Jeffrey W. Baker wrote:



 On Thu, 10 May 2001, Issac Goldstand wrote:

  I was just wondering- where exactly is the Perl interpreter in
  mod_perl 1.25 (for Apache 1.3) and where will it be in mod_perl 2
  (Apache 2.0)?  I assume in Apache 1.3 it's in shared memory, but I
  want to double check...

 This depends strongly on how your platform works.  On Unix and friends,
 the Perl interp is in each Apache process.  However, the various interps
 may actually reside in the same physical memory on your computer, because
 of a kernel feature called copy-on-write.  Look it up on Google if
 interested.

You may also try to look at my attempt to explain this:
http://perl.apache.org/guide/performance.html#Sharing_Memory

For 2.0 you want to read:
http://perl.apache.org/~dougm/modperl_2.0.html#perl

_
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://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: Object - RDBMS mapping tools and mod_perl

2001-05-10 Thread Chris Winters

* Ray Zimmerman ([EMAIL PROTECTED]) [010510 11:39]:
 I'm looking for a good package to use for Object - RDBMS mapping in 
 the context of mod_perl and Mason. Something that will handled object 
 inheritance and nested objects, etc.
 
 I'm aware of Tangram, Alzabo and SPOPS (not sure all these do what I 
 need) ... are there any others? Any particular reasons why any of 
 these may not play with with mod_perl/Mason?

SPOPS plays very well with mod_perl -- it's an integral part of the
OpenInteract web application framework which (currently) depends on
mod_perl.

If you wind up using it, there's some initialization you'll probably
want to do at server startup and in the child init phase -- let me
know if you're interested and I'll pull the SPOPS-specific stuff out
of OpenInteract.

Chris

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.



Re: [Mason] Object - RDBMS mapping tools and mod_perl

2001-05-10 Thread Chris Winters

* Dave Rolsky ([EMAIL PROTECTED]) [010510 12:43]:
 ...
 I think the author of SPOPS is also a mod_perl user (I'm pretty sure he's
 posted to the mod_perl list in the past) so I'd expect it to play nice.

Mostly one of the 'silent majority', tho :-) (Plus, we met at last
year's YAPC -- sheesh, the memories on some people! ;-)

(Sidenote: how many folks are going to YAPC this year?)

 ...
 I'm not sure exactly what the goal of SPOPS is, so I'll let the author
 speak for himself.

(gee, that sounds like an invitation to get out the...)

soapbox
SPOPS is built to map objects to relational databases, or other data
stores. If you're just getting/setting object properties and
persistence (create/update/fetch/remove) along with relationships
among the objects, you don't even need to write any Perl code. Just
some fairly simple configuration info. Plus you can (if you wish) get
per-object security for free.

IMO, it also works quite well in an environment where you need to
retrofit a framework onto an existing datastore, since SPOPS doesn't
require special fields or tables (unless you're using security).
/soapbox

More upon request, or on the OpenInteract
(sourceforge.net/projects/openinteract/) mailing lists.

Chris

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.



perl-based authentication

2001-05-10 Thread Mark Holt

OK, let me be more specific.  Here is the problem I face:

Hosting of (potentially) millions of websites in a single framework.
Clients are not given their own VirtualHost tag in the config file
(there are too many), but instead their document root is derived from
their hostname.  Clients can fluctuate between free and paid users.  A
mod_perl filter script currently inserts a banner on each HTML page or
does nothing, for free and paid users, respectively.

Now we want to add Basic HTTP authentication to our paid service.  We
want to do this using .htaccess files, since this is the method
supported by Microsoft FrontPage and improved mod_frontpage on UNIX.
This is impossible to do for everyone, since we would take a serious
performance loss checking for .htaccess files in the entire directory
tree on every hit.  I have written some code that will interpret a
simple require valid-user statement, parse the indicated password
file, and grant or deny access.  I added this to the filter script and
it works fine, and is only executed when the website is a paid one.

The problem with this is I'm realizing how complex the .htaccess-based
authentication scheme is, and I don't feel like coding the rest of it
when it's already done.  I want a mod_perl solution to enable .htaccess
authentication in the case of a paid user.  There is no trivial (i.e.
standard apache) way to tell whether a user is paid, it takes a couple
of lines of perl code (let's say a file stat or DB lookup).

Now to my question:  Is it possible, using mod_perl, to activate
Apache's standard .htaccess-based authentication scheme on a per-hit
basis, based on the results of perl code to determine whether the user
is a paying one?  Will this solution avoid checking for the existence of
.htaccess files on every hit that is not a paid one?  If so, how is this
to be done?  (Please give code or at least pseudocode where possible.)
For those who have read this far, I appreciate your time and I thank you
for all of your contributions in advance.

Mark Holt




Re: looking for a functin to move %fdat to the symbol table..

2001-05-10 Thread Ken Williams

[EMAIL PROTECTED] (jason n perkins) wrote:
php has a function called extract which takes an array (no distinction
between arrays and hashes in php. in this case in perl, it'd actually
be a hash). extract takes the key values of the array (and optionally
prepends a user specified prefix to each of the values to avoid
clobbering other values in the symbol table), sets each of them up as a
variable with that name and sets the variable's value equal to the
value of that associated key in the hash. the beauty of extract comes
into play when you want to use each of the key/value pairs in the
array. instead of setting them up one at a time, pass the array to
extract and voila, you have all of the key/value elements available as
variables. if my description is too unclear, you can check the extract
functions info at http://www.php.net/manual/en/function.extract.php.

does embedded perl sport a similar function?

You do know about the built-in Perl function 'each', right?

As others have pointed out, what you're asking for can be done, but it
shouldn't be done.  You can almost always write much much cleaner code
by dealing with the hashes as hashes and not converting all its parts to
individual scalar variables.  I've seen a lot of [bad] code like this:

  $name = $data{name};
  $address = $data{address};
  $phone = $data{phone};
  
  $dbh-do(UPDATE users SET address='$address', phone='$phone'
WHERE name='$name');

It's much better (shorter, faster, safer) to let the hash do the work:

  $dbh-do(UPDATE users SET address=?, phone=? WHERE name=?, undef,
   @data{'address','phone','name'});

In addition, in a mod_perl environment you don't want any of your
data-carrying variables to be in the runtime symbol table.  Lexical
variables ('my') are much safer and guard against variables leaking out
of the scope you thought they were supposed to be in.


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



Re: perl-based authentication

2001-05-10 Thread Stas Bekman

On Thu, 10 May 2001, Mark Holt wrote:

[snipped the situation explanation]

 Now to my question:  Is it possible, using mod_perl, to activate
 Apache's standard .htaccess-based authentication scheme on a per-hit
 basis, based on the results of perl code to determine whether the user
 is a paying one?

Not really, the current Apache doesn't let you decide on the fly whether
to challenge the client with basic auth or not unless you use .htaccess.
You can hook different handlers to process the submitted log/password, but
not to decide whether to ask for log/passwd (for the first time).

But you can write your auth with HTML coded login-form screen. Make sure
to enforce running it over https, to make it more secure. Look at
http://www.modperl.com/book/chapters/ch6.html#Cookie_Based_Access_Control
for an example. Once you do it on your own you can do whatever you want.

 Will this solution avoid checking for the existence of
 .htaccess files on every hit that is not a paid one?  If so, how is this
 to be done?  (Please give code or at least pseudocode where possible.)
 For those who have read this far, I appreciate your time and I thank you
 for all of your contributions in advance.

.htaccess is not used only for auth!!! it's used for adding per-directory
extra configuration (usually to override the defaults). So if you don't
have AllowOverride None it'll be *always* looked up, see also:
http://perl.apache.org/guide/performance.html#Reducing_the_Number_of_stat_Ca

So your second question has nothing to do with the first one :)

You can specify the Auth data in your httpd.conf and avoid creating
.htaccess, saving processing time, but making it harder to maintain
(requires server restart for each modification, whereas .htaccess allows
to do 'hot' modifications without restarting the server.

_
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://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: perl-based authentication

2001-05-10 Thread Mark Holt



 Not really, the current Apache doesn't let you decide on the fly whether
 to challenge the client with basic auth or not unless you use .htaccess.

If I wrote my own PerlAuthHandler, could it then choose whether to pass through
to the standard AuthHandler?

 .htaccess is not used only for auth!!! it's used for adding per-directory
 extra configuration (usually to override the defaults).

Yes I was envisioning something along these lines in the config file:
Perl
#code to determine paid status
if ($paid) { $AllowOverride = AuthConfig }
/Perl
Or something like that.  Not being a mod_perl guru I don't know the syntax, but
I wondered if a construct like this would work on a per-hit basis, or if not, if
someone knew a better one.

 So your second question has nothing to do with the first one :)

You're right. one dealing with feasibility of checking for .htaccess files based
on perl code, and one with scalability--not checking for .htaccess files when
not necessary.


 You can specify the Auth data in your httpd.conf and avoid creating
 .htaccess, saving processing time, but making it harder to maintain
 (requires server restart for each modification, whereas .htaccess allows
 to do 'hot' modifications without restarting the server.

That is not feasible, because if we can't even afford to put a VirtualHost tag
in for every user, how much less could we afford auth data and server restarts?
But you may be on the right track.  Can we use perl code in the global config
file to control auth?  I just want a way to activate the standard auth handler
per-hit.  It has to be possible in mod_perl.  Someone out there has to be wizard
enough to know how.  Hopefully that person will be reading this soon.

Thanks,
Mark




Re: perl-based authentication

2001-05-10 Thread Clayton Cottingham aka drfrog

hello

is this not something like what Apache::AuthCookie 
or some other Auth scheme does?
 or am i just missing the boat?

you could use something 
like AuthCookie in a dummy situation
get $r-uri
grab the .htaccess from that location and parse?


Time Co-Ordinate Thu, 10 May 2001 23:16:29 -0600, The Organism labeled Mark
Holt said:

 
  
   Not really, the current Apache doesn't let you decide on the fly whether
   to challenge the client with basic auth or not unless you use .htaccess.
  
  If I wrote my own PerlAuthHandler, could it then choose whether to pass through
  to the standard AuthHandler?
  
   .htaccess is not used only for auth!!! it's used for adding per-directory
   extra configuration (usually to override the defaults).
  
  Yes I was envisioning something along these lines in the config file:
  Perl
  #code to determine paid status
  if ($paid) { $AllowOverride = AuthConfig }
  /Perl
  Or something like that.  Not being a mod_perl guru I don't know the syntax, but
  I wondered if a construct like this would work on a per-hit basis, or if not, if
  someone knew a better one.
  
   So your second question has nothing to do with the first one :)
  
  You're right. one dealing with feasibility of checking for .htaccess files based
  on perl code, and one with scalability--not checking for .htaccess files when
  not necessary.
  
  
   You can specify the Auth data in your httpd.conf and avoid creating
   .htaccess, saving processing time, but making it harder to maintain
   (requires server restart for each modification, whereas .htaccess allows
   to do 'hot' modifications without restarting the server.
  
  That is not feasible, because if we can't even afford to put a VirtualHost tag
  in for every user, how much less could we afford auth data and server restarts?
  But you may be on the right track.  Can we use perl code in the global config
  file to control auth?  I just want a way to activate the standard auth handler
  per-hit.  It has to be possible in mod_perl.  Someone out there has to be wizard
  enough to know how.  Hopefully that person will be reading this soon.
  
  Thanks,
  Mark
  
  
  




Re: perl-based authentication

2001-05-10 Thread Mark Holt

parsing the .htaccess files is what I'm trying to avoid.  I want the standard apache
module to do that.  I just want to control *when*.

Clayton Cottingham aka drfrog wrote:

 hello

 is this not something like what Apache::AuthCookie
 or some other Auth scheme does?
  or am i just missing the boat?

 you could use something
 like AuthCookie in a dummy situation
 get $r-uri
 grab the .htaccess from that location and parse?