A::Registry vs. mod_perl handler philosophy

2003-06-20 Thread Peter B. Ensch
I'm beginning to develop apps under mod_perl. I'm
curious as to how people decide between coding for
Apache::Registry vs. mod_perl handlers.

It's been suggested to me that content generating
apps should be done under A::R, whereas logging,
authentication Etc. should be implemented as 
mod_perl handlers. 

What is the opinion of the group?

Regards,
P


-- 

^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
Peter Ensch,
[EMAIL PROTECTED]   A-1140   (214) 480 2333
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^


Re: A::Registry vs. mod_perl handler philosophy

2003-06-20 Thread Ged Haywood
Hi there,

On Fri, 20 Jun 2003, Peter B. Ensch wrote:

 I'm beginning to develop apps under mod_perl. I'm
 curious as to how people decide between coding for
 Apache::Registry vs. mod_perl handlers.

Use Apache::Registry only if you have to in order to get legacy CGI
scripts working.

 It's been suggested to me that content generating
 apps should be done under A::R, whereas logging,
 authentication Etc. should be implemented as 
 mod_perl handlers. 

All new code should use handlers.

73,
Ged.



Re: A::Registry vs. mod_perl handler philosophy

2003-06-20 Thread Ken Y. Clark
On Fri, 20 Jun 2003, Ged Haywood wrote:

 Date: Fri, 20 Jun 2003 17:25:23 +0100 (BST)
 From: Ged Haywood [EMAIL PROTECTED]
 To: Peter B. Ensch [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: A::Registry vs. mod_perl handler philosophy

 Hi there,

 On Fri, 20 Jun 2003, Peter B. Ensch wrote:

  I'm beginning to develop apps under mod_perl. I'm
  curious as to how people decide between coding for
  Apache::Registry vs. mod_perl handlers.

 Use Apache::Registry only if you have to in order to get legacy CGI
 scripts working.

  It's been suggested to me that content generating
  apps should be done under A::R, whereas logging,
  authentication Etc. should be implemented as
  mod_perl handlers.

 All new code should use handlers.

 73,
 Ged.

I wouldn't be so strict about such definitions.  If you're only
looking to generate content, then I don't see a problem with writing
standard CGI scripts and running them under A::R.  If you stick with
strict and warnings and follow the gotchas listed in The Guide[1],
you should be fine.  If you also choose to code carefully, you can
use the same script under mod_perl or not without changing anything
(if that's important to you).

Or am I missing something?  At CSHL, all our Apache servers are
compiled with mod_perl, but Lincoln still has us write most everything
as CGI scripts.  It's easy and works just fine for us.  Also saves
having to add Location directives to httpd.conf everytime you want
to add a new script.

Whatever works for you, I say.  But mayhap I'm too permissive.

ky

[1]-http://perl.apache.org/guide


Re: A::Registry vs. mod_perl handler philosophy

2003-06-20 Thread Ged Haywood
Hi Ken,

On Fri, 20 Jun 2003, Ken Y. Clark wrote:

 On Fri, 20 Jun 2003, Ged Haywood wrote:
 
  All new code should use handlers.
 
 I wouldn't be so strict about such definitions.

I didn't say must.  :)

 Or am I missing something?

You will get better performance from handlers and you can do more
with them.  I wouldn't deliberately build unnecessary limitations
into a new system if I had any choice in the matter.

 Whatever works for you, I say.  But mayhap I'm too permissive.

Well I'm probably not permissive enough... :)

73,
Ged.



Error: Dynamic Link Library libxml2.dll could not be found in the specified path

2003-06-20 Thread Lynette Tillner



Hi, this is my first post. I just installed a 
binary distribution for Win32 of Perl 5.8.0 and Apache 2.046 together with 
mod_per-1.99 ( by Randy Kobes, May 29, 2003). 

I installed it on a Windows 98 SE machine 
first. The install seemed to work fine there were some errors when I was 
following the steps to build the .html files. But the Apache server won't 
load. I get the following error when I type apache at the d:\apache2\bin 
window dos prompt: 

d:\apache2\binapache
[Fri Jun 20 08:57:22 2003] [error] Can't load 
'D:/Perl/site/lib/auto/XML/LibXML/Common/Common.dll' for module 
XML::LibXML::Common: load_file:One of the library files needed to run this 
application cannot be found at d:/Perl/lib/DynaLoader.pm line 229.
at D:/Perl/site/lib/XML/LibXML.pm line 
11
Complilation failed in require at 
d:/Perl/site/lib/XML/LibXML.pm line 11.
BEGIN failed--compilation aborted at 
D:/Perl/site/lib/XML/LibXML.pm line 11.
Complilation failed in require at 
D:/Apache2/conf/startup.pl line 18.
Complilation failed in require at (eval 1) line 
1.

[Fri Jun 20 08:57:22 2003] [error] Can't load Perl 
file: D:/Apache2/conf/startup.pl for server localhost:80. 
exiting...

Can anyone please help me resolve this? I 
haven't found anything on the web that addresses this error! I need to get 
this working so that an offline demo can take place on Tuesday! Thanks for 
any help! 

Lynette 
Information TechnologyAssociated Valuation 
Services[EMAIL PROTECTED]


Re: Error: Dynamic Link Library libxml2.dll could not be found inthe specified path

2003-06-20 Thread Randy Kobes
On Fri, 20 Jun 2003, Lynette Tillner wrote:

 Hi, this is my first post.  I just installed a binary
 distribution for Win32 of Perl 5.8.0 and Apache 2.046 together
 with mod_per-1.99 ( by Randy Kobes, May 29, 2003).

 I installed it on a Windows 98 SE machine first.  The install
 seemed to work fine there were some errors when I was following
 the steps to build the .html files.  But the Apache server
 won't load.  I get the following error when I type apache at
 the d:\apache2\bin window dos prompt:

 d:\apache2\binapache [Fri Jun 20 08:57:22 2003] [error] Can't
 load 'D:/Perl/site/lib/auto/XML/LibXML/Common/Common.dll' for
 module XML::LibXML::Common: load_file:One of the library files
 needed to run this application cannot be found at
 d:/Perl/lib/DynaLoader.pm line 229.
  at D:/Perl/site/lib/XML/LibXML.pm line 11 Complilation failed
 in require at d:/Perl/site/lib/XML/LibXML.pm line 11. BEGIN
 failed--compilation aborted at D:/Perl/site/lib/XML/LibXML.pm
 line 11. Complilation failed in require at
 D:/Apache2/conf/startup.pl line 18. Complilation failed in
 require at (eval 1) line 1.

 [Fri Jun 20 08:57:22 2003] [error] Can't load Perl file:
 D:/Apache2/conf/startup.pl for server localhost:80. exiting...

 Can anyone please help me resolve this?  I haven't found
 anything on the web that addresses this error!  I need to get
 this working so that an offline demo can take place on Tuesday!
 Thanks for any help!

I think this is due to some lines in the sample startup.pl script
under D:/Apache2/conf/ supplied in the distribution that preload
some XML::* perl modules. If you don't need these modules, just
delete or comment out these lines. If you intend on using these
modules, then either copy libxml2.dll (found under D:/Perl/bin/)
to a place in your PATH environment variable that Apache
recognizes, or else add D:/Perl/bin/ to your PATH.

Hope this helps.

-- 
best regards,
randy kobes


Does DBD::Pg work w/mp2?

2003-06-20 Thread Marc M. Adkins
Is anyone using PostgreSQL via DBD::Pg in a threaded environment?

I'm getting:

[Fri Jun 20 11:47:57 2003] [error] [client 127.0.0.1]
  DBD::Pg::dr default_user failed: handle 1
  is owned by thread 126e2e4
  not current thread 11df014
  (handles can't be shared between threads and
   your driver may need a CLONE method added)

with DBD::Pg 1.22 (W2K, Apache 2.0.46, Perl 5.8, mod_perl 1.99.10-dev).

It appears as though the DBD::Pg driver hasn't been made thread-safe yet.
However it's possible that I'm misusing it somehow, doing something in my
startup.pl that I shouldn't, whatever.  So I'm asking if anyone else is
using DBD::Pg successfully w/mp2 at the current time???

In the meantime the DBD::PgPP driver works OK, but of course it probably
won't perform as well.

mma



Re: Error: Dynamic Link Library libxml2.dll could not be found in the specified path

2003-06-20 Thread Lynette Tillner
Thank you.  I just copied libxml2.dll to d:\apache2\bin (where apache starts
up) and all is fine now.

Thanks so much!  Have a great weekend!

Lynette

- Original Message - 
From: Randy Kobes [EMAIL PROTECTED]
To: Lynette Tillner [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, June 20, 2003 10:54 AM
Subject: Re: Error: Dynamic Link Library libxml2.dll could not be found in
the specified path


 On Fri, 20 Jun 2003, Lynette Tillner wrote:

  Hi, this is my first post.  I just installed a binary
  distribution for Win32 of Perl 5.8.0 and Apache 2.046 together
  with mod_per-1.99 ( by Randy Kobes, May 29, 2003).
 
  I installed it on a Windows 98 SE machine first.  The install
  seemed to work fine there were some errors when I was following
  the steps to build the .html files.  But the Apache server
  won't load.  I get the following error when I type apache at
  the d:\apache2\bin window dos prompt:
 
  d:\apache2\binapache [Fri Jun 20 08:57:22 2003] [error] Can't
  load 'D:/Perl/site/lib/auto/XML/LibXML/Common/Common.dll' for
  module XML::LibXML::Common: load_file:One of the library files
  needed to run this application cannot be found at
  d:/Perl/lib/DynaLoader.pm line 229.
   at D:/Perl/site/lib/XML/LibXML.pm line 11 Complilation failed
  in require at d:/Perl/site/lib/XML/LibXML.pm line 11. BEGIN
  failed--compilation aborted at D:/Perl/site/lib/XML/LibXML.pm
  line 11. Complilation failed in require at
  D:/Apache2/conf/startup.pl line 18. Complilation failed in
  require at (eval 1) line 1.
 
  [Fri Jun 20 08:57:22 2003] [error] Can't load Perl file:
  D:/Apache2/conf/startup.pl for server localhost:80. exiting...
 
  Can anyone please help me resolve this?  I haven't found
  anything on the web that addresses this error!  I need to get
  this working so that an offline demo can take place on Tuesday!
  Thanks for any help!

 I think this is due to some lines in the sample startup.pl script
 under D:/Apache2/conf/ supplied in the distribution that preload
 some XML::* perl modules. If you don't need these modules, just
 delete or comment out these lines. If you intend on using these
 modules, then either copy libxml2.dll (found under D:/Perl/bin/)
 to a place in your PATH environment variable that Apache
 recognizes, or else add D:/Perl/bin/ to your PATH.

 Hope this helps.

 -- 
 best regards,
 randy kobes



Invalid method in request

2003-06-20 Thread Oskar



Hi,
everytime I am trying post form with 
enctype="multipart/form-data" it does not send any data and Apache reports 
errror: Invalid method in request -some boundary 
key.
All methods of request arepermittedon 
that directory.
Single post works ok.
Any solution?
Oskar


win32 + apache2 + mysql

2003-06-20 Thread Joshua Burley
Hey all,

I'm having some trouble with mod_perl and mysql on Win32 and Apache2 (used 
the all-in-one package to install). 

Our app stores the user's session data into mysql with Apache::Session, 
with the session id stored as a cookie. Standard stuff... When we're testing
it with our browsers, it seems to run fine. We immediately run into problems
when we test it under load with flood. Right away the server become 
unresponsive to our browsers, and the apache server goes so far as to restart
itself!

I've pasted some of the errors from the logs, below.

Has anyone seen behavior like this before?  

[Wed Jun 11 12:46:32 2003] [error] 3980: ModPerl::Registry: Storable binary image v3.3 
more recent than I am (v2.6) at blib\lib\Storable.pm (autosplit into 
blib\lib\auto\Storable\thaw.al) line 358, at 
C:/services/Perl/site/lib/Apache/Session/Serialize/Storable.pm line 27
[Wed Jun 11 12:46:32 2003] [error] 3980: ModPerl::Registry: Object #4618 should
have been retrieved already at blib\lib\Storable.pm (autosplit into 
blib\lib\auto\Storable\thaw.al) line 358, at 
C:/services/Perl/site/lib/Apache/Session/Serialize/Storable.pm line 27
[Wed Jun 11 14:08:04 2003] [error] 3980: ModPerl::Registry: Object #788994 should have 
been retrieved already at blib\lib\Storable.pm (autosplit into 
blib\lib\auto\Storable\thaw.al) line 358, at 
C:/services/Perl/site/lib/Apache/Session/Serialize/Storable.pm line 27
[Wed Jun 11 14:08:46 2003] [notice] Parent: child process exited with status 
3221225477 -- Restarting.
[Wed Jun 11 14:08:51 2003] [notice] Parent: Created child process 4068
[Wed Jun 11 14:08:57 2003] [notice] Child 4068: Child process is running
[Wed Jun 11 14:08:57 2003] [notice] Child 4068: Acquired the start mutex.
[Wed Jun 11 14:08:57 2003] [notice] Child 4068: Starting 200 worker threads.


Thanks! 
.josh


 Josh Burley
 [EMAIL PROTECTED]



Re: mod_perl PerlTransHandler weirdness

2003-06-20 Thread Aaron Ross
just fyi, mod_rewrite should be capable of handling those tests. See the
file tests under
http://httpd.apache.org/docs-2.1/en/mod/mod_rewrite.html#rewritecond

HTH, Aaron


On Tue, 2003-06-17 at 08:56, Joel Bernstein wrote:
 Alternatively, can anybody suggest a different way to offer this
 functionality? I don't think mod_rewrite applies, since the tests are
 too complicated, but would stand corrected if somebody knows
 different...
 
 I posted this to london.pm earlier and had no joy.
 
 /joel, getting a bit desperate.
-- 
Aaron Ross  
   company . Alias I, Inc 
  mail . 10 East 39th Street
 New York, NY 10016
 email . [EMAIL PROTECTED]
 phone . 212 696 0690
   fax . 212 696 0626
  cell . 917 753 2323




Re: puzzle of split() running under mod_perl

2003-06-20 Thread Raf
Ok, before heading off for the evening, here's a guess which may be
totally wrong.

JY - June Young said:

 We are running CSWS1.2 (based on Apache 1.3.6) on Open VMS V7.3-1 and
 CSWS_PERL V1.1 based on Mod_Perl V1.25.

Main assumption ( this is buggy and not real apache/mod_perl ) - (as buggy
as compaq (on disk) bioses, and all the compaq hardware, I've ever used,
with the exception of the Dec Alpha (which was DEC at the time)).

 We have a function that changes the directory format from Unix to VMS,
 and this function is used in almost every script of our CGIs. Whenever
 the CGI that invokes this function get requested twice, the server
 process dies after the page comes out.
Only on the second request?


 We noticed that it is the regex argument of function split causes the
 problem.
 We took this split statement out into a simple CGI script, and that CGI
 script works fine in mod_perl.

Not sure about the syntax, by the outermost symbols should become
delimiters for your reg.exp. (ie the quotes in your case)

 After adding quotes outside of the regex of split function in sub
 VMSify, the error went away. We could not figure out why the statement
 bombs out in our VMSify function and why adding quotes fixed it.  The
 following are the test script and output in the browser.

Adding the 's, simply makes it try and split on the symbol sequence /\//
which doesn't exist in the string you're matching against, returning the
whole string again.  At least, that is my observed behaviour in 5.6.1. and
the way I use them.

My completely unsupported guess, which is what I'd look for given the
circumstances, is this:

1) Given that:
  i) The original script segfaults the apache-clone
  ii) Your little cgi doesn't segfault anything.

2) Assuming:
   i) You're using 's in your 'original' live script

  ii) The split is returning an array of size 1, containing the original
string in an your 'original' live script (because of the /\//).

 iii) Your test cgi script, as stated, is only trying to test out the SPLIT.

  iv) *the major assumption* You take this converted path on your vms
system (as generated in step 2.ii) and are trying to access some 'real'
file path with it / and open or stat or something.

3) Results in: (Complete Assumption)

  i) The apache-'clone' segfaulting/throwing a fatal/exploding
 on some attempt to read this real file path, which 'wasn't'
 really split in your live application and is still a unix path.

  ii) Compaq do it again and it's all their fault.

  iii) On a second read of your mail, 'adding' the quotes may have done
this in reverse somehow and may still lead to either avoiding a syscall
to open/read/stat/whatever a real file path.



Although this is based on lots of assumptions, I think it might explain
the segfault, which was fixed by removing(or was it adding?) your quotes. 
My thought was that fixing the server crash (which is what you wanted to
explain?) came out of your avoiding a system call with a weird path to a
real file.  I don't know VMS, so I'm assuming nasties.  I'm probably 90%
wrong and it's that 10% of hope (and hmmm.. the I'd look 'there' factor)
which I offer you.  Hmmm.  I'd also look at unclearly scroped variables
which remain persistent between hits (given your two hit problem - if that
really is the case).

Might help, who knows?  Not I.

Byebye.









Installation Problem

2003-06-20 Thread Ankur Jain
Hi,
  I have RHL 8.0 and Apache2.0 running and perl
5.8.0. I am trying to install the modperl2.0 It's
going fine till the make procedure but when I run the
make test it prompts that no test server configured
please specify a httpd or apxs or put either in your
path. Eg: t/TEST -httpd /path/to/bin/httpd

I tried that and it ended with an error server
server_name:8529 error running tests please examine
t/logs/error_log.

The error_log file contains the following error:

failed to resolve handler 'TestHooks::trans' and
several others.

Please tell me what could be the issue??

Thank you.


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


RE: puzzle of split() running under mod_perl

2003-06-20 Thread Raf
Hi June,

JY - June Young said:

 with/without double quotes on the regexp. The print of the dir after=
 shows that split correctly parsed the input string. The only difference
 is that the server dies upon global destruction?

 As a matter of fact, I am very confused by the error message of global
 destruction. When does global destruction happen in mod_perl? Does my
 code causes server process die and then the process tries to do global
 destruction ? Or global destruction at some stage causes the process
 die. I thought mod_perl provide persistent environment, and no global
 destruction should happen until a process served enough requests and
 reached the end of lifecycle.

My understanding was that it happend with a child process exiting after it
hit its max requests .. of if you shutdown.  What I might try if you're
really curious is trying to run it through strace or truss (well your vms
equivs) with httpd -X, unless someone else can give you an immediate
answer, it often proved itself a useful approach.  Might give you an idea
of what is causing the process to die.

Last night's enthusiasm has worn off. :)

All the best.

R.






Re: Perl 6 + mod_perl

2003-06-20 Thread Leon Brocard
Nigel Hamilton sent the following bits through the ether:

   While reading this section I wondered how Parrot would fit 
 into the interpreter pool scheme available in mp2? Has anyone got any 
 theories on how Perl 6 and mod_perl may merge in the future?

This is a little speculative as Parrot doesn't really have decent IO
and Perl 6 is a couple of years off. However, that said, we already
have mod_parrot:

http://cvs.perl.org/cvsweb/mod_parrot/

I suggest concentrating on mod_perl2 instead for now ;-)

Leon
-- 
Leon Brocard.http://www.astray.com/
scribot.http://www.scribot.com/

... I'd love to go out with you, but I have to floss my cat