Re: [request] modperl mailing lists searchable archives wanted

2001-10-16 Thread Stas Bekman

Joshua Chamas wrote:

 Stas Bekman wrote:
 
dev@@perl.apache.org - 2.5, but their search engines suck
[EMAIL PROTECTED] - none
[EMAIL PROTECTED] - none
[EMAIL PROTECTED]  - none
[EMAIL PROTECTED]   - 1


 
 Hey Stas, 
 
 I have the asp list getting archived at:
 
   http://www.mail-archive.com/asp%40perl.apache.org/


Added. Thanks Joshua

 
 Thanks for keeping up on this.  It would be nice to 
 have another search archive for the asp list too.

:)

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




Re: search engine module?

2001-10-16 Thread Ged Haywood

Hi all,

On Mon, 15 Oct 2001, Ask Bjoern Hansen wrote:

 On Fri, 12 Oct 2001, Perrin Harkins wrote:
 
 [...]
  Plus lots of other stuff like Glimpse and Swish which interface to C-based
  engines.
 
 I've had good luck with http://swish-e.org/2.2/

Please make sure that it's possible to do a plain ordinary literal
text string search.  Nothing fancy, no case-folding, no automatic
removal of puctuation, nothing like that.  Just a literal string.

Last night I tried to find perl -V on all the search engines
mentioned on the mod_perl home page and they all failed in various
interesting ways.

If somebody knows what I'm doing wrong, please post.

73,
Ged.




RE: search engine module?

2001-10-16 Thread Matt Sergeant

 -Original Message-
 From: Ged Haywood [mailto:[EMAIL PROTECTED]]
 
 Hi all,
 
 On Mon, 15 Oct 2001, Ask Bjoern Hansen wrote:
 
  On Fri, 12 Oct 2001, Perrin Harkins wrote:
  
  [...]
   Plus lots of other stuff like Glimpse and Swish which 
 interface to C-based
   engines.
  
  I've had good luck with http://swish-e.org/2.2/
 
 Please make sure that it's possible to do a plain ordinary literal
 text string search.  Nothing fancy, no case-folding, no automatic
 removal of puctuation, nothing like that.  Just a literal string.
 
 Last night I tried to find perl -V on all the search engines
 mentioned on the mod_perl home page and they all failed in various
 interesting ways.
 
 If somebody knows what I'm doing wrong, please post.

I've written a RDBMS backed search engine that could do such queries, but it
gets expensive after a while, as you have to do table-scans of the full text
of every page in your DBMS to find the match. One thing I could have done
would be to split up the match so it would try and match perl and -V,
before doing the full text search on the subset of results. Never got around
to doing that though. I suspect most search engines (with the exception of
maybe google) are in the same or similar boat.

Matt.

_
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.



Re: search engine module?

2001-10-16 Thread Perrin Harkins

 Please make sure that it's possible to do a plain ordinary literal
 text string search.  Nothing fancy, no case-folding, no automatic
 removal of puctuation, nothing like that.  Just a literal string.

 Last night I tried to find perl -V on all the search engines
 mentioned on the mod_perl home page and they all failed in various
 interesting ways.

The amazingly fast ht://Dig (http://www.htdig.org/) engine can do phrase
searching, but I'm not certain how well it does with punctuation.
- Perrin




Re: [OT] search engine module?

2001-10-16 Thread Bill Moseley

At 02:04 PM 10/16/2001 +0100, Ged Haywood wrote:
  Plus lots of other stuff like Glimpse and Swish which interface to
C-based
  engines.
 
 I've had good luck with http://swish-e.org/2.2/

Please make sure that it's possible to do a plain ordinary literal
text string search.  Nothing fancy, no case-folding, no automatic
removal of puctuation, nothing like that.  Just a literal string.

Last night I tried to find perl -V on all the search engines
mentioned on the mod_perl home page and they all failed in various
interesting ways.

I assume it's how the search engine is configured.  Swish, for example, you
can define what chars make up a word.  Not sure what you mean by literal
string.  For performance reasons you can't just grep words (or parts of
words), so you have to extract out words from the text during indexing.
You might define that a dash is ok at the start of a word, but not at the
end and to ignore trailing dots, so you could find -V and -V. (at the end
of a sentence).

Some search engines let you define a set of buzzwords that should be
indexed as-is, but that's more helpful for technical writing instead of
indexing code.

Finally, in swish, if you put something like perl -V in quotes to use a
phrase search it will find what you are looking for most likely, even if
the dash is not indexed.



Bill Moseley
mailto:[EMAIL PROTECTED]



Re: Mod_perl component based architecture

2001-10-16 Thread Radovan Semancik

Gargi Bodke wrote:
 
 hi
   i have been asked to suggest an architecture to seperate the business
 logic from the html.
 how is this done in modperl? i guess by using functions for the business
 logic.
 is there any other way?
 
 also does modperl support object oriented programming?

One possible solution:
Jewels Application Framework, http://jewels.bgs.sk/

-- 
Ing. Radovan Semancik ([EMAIL PROTECTED])
 Project Manager, Business Global Systems a.s.



Re: Mod_perl component based architecture

2001-10-16 Thread Brett W. McCoy

On Tue, 16 Oct 2001, Gargi Bodke wrote:

   i have been asked to suggest an architecture to seperate the
 business logic from the html. how is this done in modperl? i guess by
 using functions for the business logic. is there any other way?

There are several solutions you can explore, that are optimized for
mod_perl.  I personally favor Mason (http://masonhq.com), which uses a
component-based architecture with some object-oriented extensions, but
there are others like EmbPerl and various templating solutions that
achieve similar goals.

You can start here for more information (most, if not all, of these are
also open source/free software):

http://perl.apache.org/#appservers

-- Brett
  http://www.chapelperilous.net/

I'm always looking for a new idea that will be more productive than its cost.
-- David Rockefeller




Re: Mod_perl component based architecture

2001-10-16 Thread Jim Smith

On Tue, Oct 16, 2001 at 07:41:46PM +0530, Gargi Bodke wrote:
 hi
   i have been asked to suggest an architecture to seperate the business
 logic from the html.
 how is this done in modperl? i guess by using functions for the business
 logic.
 is there any other way?

There are a large number of solutions to this.  A few are:

   Apache::ASP
   HTML::Embperl
   HTML::Mason
   Template::Toolkit and Apache::Template

For a list of modules involving templates:

   http://search.cpan.org/search?mode=modulequery=template

   139 modules found in 52 distributions matching 'template' 
 
 also does modperl support object oriented programming?

mod_perl is but Perl embedded in Apache.  mod_perl supports the full
expressiveness of Perl.



RE: Mod_perl component based architecture

2001-10-16 Thread Matt Sergeant

 -Original Message-
 From: Gargi Bodke [mailto:[EMAIL PROTECTED]]
 
 hi
   i have been asked to suggest an architecture to seperate 
 the business
 logic from the html.
 how is this done in modperl? i guess by using functions for 
 the business
 logic.
 is there any other way?

There's loads of ways. Off the top of my head:

- EmbPerl with EmbPerlObject
- OpenInteract
- Apache::PageKit
- Apache::ASP using XML-Subs
- AxKit
- Mason (aka HTML::Mason)

All allow some form of separation of content/logic from presentation (but
AxKit is the BEST of them all! :-)

 also does modperl support object oriented programming?

Yes. mod_perl isn't like PHP or Cold Fusion or ASP or Java Servlets. It's
more of a framework for building things like the above using Perl. As you
can see, the community has built quite a number of different ways of doing
things over the years!

Matt.

PS: AxKit at the moment is at http://217.158.50.178/ - the email lists are
down, but I'm happy to answer questions on the mod_perl list for now.

_
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.



Re: Mod_perl component based architecture

2001-10-16 Thread Dominique Quatravaux

 also does modperl support object oriented programming?

  Well yes it does indeed (see any good book on Perl, such as
«advanced Perl programming» from O'Reilly).

  As for the remaining of the question, I've been wondering for myself if
there is a MVC (model-view-controller) framework for WWW publishing in
Perl ? I gather there exist quite a few for Java, but I couldn't find
anything significant under Perl.

-- 
 Tout n'y est pas parfait, mais on y honore certainement les jardiniers 

Dominique Quatravaux [EMAIL PROTECTED]



Re: Mod_perl component based architecture

2001-10-16 Thread Scott Lanning

On Tue, 16 Oct 2001, Gargi Bodke wrote:
  i have been asked to suggest an architecture to seperate the
business logic from the html. how is this done in modperl? i guess
by using functions for the business logic.
is there any other way?

Maybe HTML::Mason, http://www.masonhq.com/

also does modperl support object oriented programming?

Yes. Good luck. http://perl.apache.org/#docs




Re: Mod_perl component based architecture

2001-10-16 Thread kyle dawkins

Gargi

On October 16, 2001 10:11 am, Gargi Bodke wrote:
   i have been asked to suggest an architecture to seperate the business
 logic from the html.
 how is this done in modperl? i guess by using functions for the business
 logic.
 is there any other way?

Absolutely; mod_perl fully supports OO programming and all of the techniques 
for separating business logic from display logic that you might use in, say, 
a Java-based web application will work fine in mod_perl.  It's very very easy 
to build a MVC-style application with mod-perl, as a number of different 
mod_perl based platforms have shown (I always point out smartworker for this 
but there are many others too).

Right now I have an enormous mod_perl based site.  Its business logic is 
entirely separate from its application logic;  there is not a single line of 
SQL anywhere in the application layer and it uses standard design patterns to 
solve many typical problems.  All HTML components are reusable and embeddable 
in other HTML components.

When it's used right, mod_perl is pretty much unbeataable.

Cheers

Kyle Dawkins
Systems Engineer
Central Park Software



Re: Mod_perl component based architecture

2001-10-16 Thread Dave Hodgkinson

Gargi Bodke [EMAIL PROTECTED] writes:

 hi
   i have been asked to suggest an architecture to seperate the business
 logic from the html.
 how is this done in modperl? i guess by using functions for the business
 logic.
 is there any other way?

By using one of the many available templaters, my preference being the
Template Toolkit. you can fake up a pretty decent
Model-View-Controller patterm from that.


 
 also does modperl support object oriented programming?

As much as perl does.

-- 
David Hodgkinson, Wizard for Hirehttp://www.davehodgkinson.com
Editor-in-chief, The Highway Star   http://www.deep-purple.com
All the Purple Family Tree news   http://www.slashrock.com
   Interim Technical Director, Web Architecture Consultant for hire



cgi to mod_perl question

2001-10-16 Thread Brice D Ruth

  I have a perl script that was running fine under IIS/5.0 with 
ActivePerl 6xx - I'll put the salient parts here:

use IO::Socket;
use CGI;

$in = new CGI;

$server = IO::Socket::INET-new( PeerAddr= ...,PeerPort= 
...,Proto=tcp,Type= SOCK_STREAM) or die Error message ... $@;

$server-autoflush(1);

... (information is gotten from $server via $server)
... (information is sent to $server via 'print $server ...')

... (server's response is read via $server and printed to browser via 
'print')

close ($server);

That's it - a very simple Perl script that basically takes information 
from the GET or POST strings, sends it to a server process and reads its 
response, printing it out to the browser.

I've now moved the script to Apache 1.3.20 w/ mod_perl 1.25 (I think its 
1.25, but it may be 1.26 - the server's not running at the moment, else 
I'd find out for sure).  It *seems* that the script can run once, but 
that the next time it is accessed, it cannot connect to the $server 
anylonger, it dies with a 'connection timed out' message ... What 
'gotcha' is causing this?

Any help on this would be greatly appreciated!!

Sincerely,
Brice D Ruth

-- 
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/





Re: Mod_perl component based architecture

2001-10-16 Thread Robin Berjon

On Tuesday 16 October 2001 17:13, Dominique Quatravaux wrote:
   As for the remaining of the question, I've been wondering for myself if
 there is a MVC (model-view-controller) framework for WWW publishing in
 Perl ? I gather there exist quite a few for Java, but I couldn't find
 anything significant under Perl.

Depending on the kind and degree of MVC-ness, Apache::PageKit or AxKit can 
fit within that approach, perhaps others as well.

-- 
___
Robin Berjon [EMAIL PROTECTED] -- CTO
k n o w s c a p e : // venture knowledge agency www.knowscape.com
---
Does the name Pavlov ring a bell?




Re: mod_perl 2 apache 2?

2001-10-16 Thread Stas Bekman

Michael Wojcikiewicz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Has anyone tried getting mod_perl to work in Apache v2 (the latest
 beta?)... Just a quick try resulted in mod_perl2 trying to compile against
 apache 1.3.20... Wasnt mod_perl v2 supposed to be for Apache v2?...


modperl 2.x is in development and if you want to play with it, you have 
to read *its* docs to figure out how to install it. modperl 1.x won't 
work with httpd 2.x. So either use 1x's or 2x's but don't mix the two.



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




Re: PerlModule not updating %INC

2001-10-16 Thread Stas Bekman

David Pisoni wrote:

At 18.23 -0400 10/11/2001, Perrin Harkins wrote:

At 18.07 -0400 10/11/2001, Perrin Harkins wrote:

We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26.

Are you sure?  There was a problem with %INC and PerlModule, but I

thought

it was fixed in 1.26.

- Perrin

Indeed, like I said, I tested it by dumping %INC myself -- the modules are

indeed missing when loaded with PerlModule.

No, I meant are you sure you're running 1.26?  Please doublecheck it, since
this sounds so much like the bug from the previous release.
- Perrin

Indeed, here's the signature from Apache::Status :

  Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) 
mod_perl/1.26

Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.)

Thanks,
David

 
 So... any ideas on this one?


have you tried 5.6.1? 5.6.0 is very buggy.



-- 


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




Re: Mod_perl component based architecture

2001-10-16 Thread Brett W. McCoy

On Tue, 16 Oct 2001, Dominique Quatravaux wrote:

   As for the remaining of the question, I've been wondering for myself if
 there is a MVC (model-view-controller) framework for WWW publishing in
 Perl ? I gather there exist quite a few for Java, but I couldn't find
 anything significant under Perl.

Quite a few, as the other posts in thread have already made reference to.
In addition, there is also CGI::Application, which supports templating via
HTML::Template and uses an MVC architecture as well.

-- Brett
  http://www.chapelperilous.net/

Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away.
-- Antoine de Saint-Exupery




New Installation...

2001-10-16 Thread El Capitan

I'm trying to install apache 1.3.22 and modperl 1.26 and am running into
some issues.  I tried running:

perl Makefile.PL DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
APACHE_PREFIX=/mydir/apache

and everything looked ok.  Then I ran make test and got this:

...
...
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache_1.3.22/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t 
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
done
/usr/bin/perl t/TEST 0
Can't locate object method new via package URI::URL (perhaps you forgot
to load URI::URL?) at ../blib/lib/Apache/test.pm line 252.

Going to the test program shows that its making a call to URI::URL.  I have
installed URI and it is clearly in the path.  Just for kicks, I put use
URI::URL(); in the file but then it does this:

make[1]: Leaving directory `/home/thecap/mod_perl-1.26/Util'
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache_1.3.22/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t 
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
done
/usr/bin/perl t/TEST 0
still waiting for server to warm up...not ok
server failed to start! (please examine t/logs/error_log) at t/TEST line 95.
make: *** [run_tests] Error 9

The error_log file has:

[Tue Oct 16 11:26:01 2001] [crit] (98)Address already in use: make_sock:
could not bind to port 8529


Anyone have suggestions?






Re: New Installation...

2001-10-16 Thread Ged Haywood

Hi there,

On Tue, 16 Oct 2001, El Capitan wrote:

 The error_log file has:
 
 [Tue Oct 16 11:26:01 2001] [crit] (98)Address already in use: make_sock:
 could not bind to port 8529
 
 
 Anyone have suggestions?

Check to see if you already have an Apache running before you try to
start another one.

Read the Guide:

http://perl.apache.org/guide

73,
Ged.




RE: Mod_perl component based architecture

2001-10-16 Thread Henigan, Timothy
Title: RE: Mod_perl component based architecture





You should really check out OpenInteract (http://www.openinteract.org). It sounds like it has a lot of the hooks you're looking for (user management, templates, online content editing, etc) as well as a few you'll be looking for later (security, session management). It is built on mod_perl and the Template Toolkit as well as many other standard CPAN modules.

Tim



-Original Message-
From: Michael [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 16, 2001 3:55 PM
To: [EMAIL PROTECTED]
Subject: Re: Mod_perl component based architecture



 On Tue, 16 Oct 2001, Dominique Quatravaux wrote:
 
  As for the remaining of the question, I've been wondering for myself if
  there is a MVC (model-view-controller) framework for WWW publishing in
  Perl ? I gather there exist quite a few for Java, but I couldn't find
  anything significant under Perl.
 
 Quite a few, as the other posts in thread have already made
 reference to. In addition, there is also CGI::Application, which
 supports templating via HTML::Template and uses an MVC architecture
 as well.
 
Are any of the packages mentioned particularly suited to client 
content management packages where the client can manage some 
limeted page content text/graphics but not really mess with the 
overall page layout and site content. I'm about to start researching 
this but would like input from the experts.


Michael





Re: Mod_perl component based architecture

2001-10-16 Thread Brett W. McCoy

On Tue, 16 Oct 2001, Michael wrote:

  Quite a few, as the other posts in thread have already made
  reference to. In addition, there is also CGI::Application, which
  supports templating via HTML::Template and uses an MVC architecture
  as well.
 
 Are any of the packages mentioned particularly suited to client
 content management packages where the client can manage some
 limeted page content text/graphics but not really mess with the
 overall page layout and site content. I'm about to start researching
 this but would like input from the experts.

Mason has a content management suite, and I think Smart Worker may also
have something along these lines.  I can't speak for the other ones, as I
have not used them.

-- Brett
  http://www.chapelperilous.net/

Your lucky number is 3552664958674928.  Watch for it everywhere.




Re: cgi to mod_perl question

2001-10-16 Thread Brice D Ruth

  What is the difference between doing the following:

close( $server );
#
$server-close();
#
$server-shutdown();

??

Sincerely,
Brice Ruth

Brice D Ruth wrote:

  I have a perl script that was running fine under IIS/5.0 with 
 ActivePerl 6xx - I'll put the salient parts here:

 use IO::Socket;
 use CGI;

 $in = new CGI;

 $server = IO::Socket::INET-new( PeerAddr= ...,PeerPort= 
 ...,Proto=tcp,Type= SOCK_STREAM) or die Error message ... $@;

 $server-autoflush(1);

 ... (information is gotten from $server via $server)
 ... (information is sent to $server via 'print $server ...')

 ... (server's response is read via $server and printed to browser 
 via 'print')

 close ($server);

 That's it - a very simple Perl script that basically takes information 
 from the GET or POST strings, sends it to a server process and reads 
 its response, printing it out to the browser.

 I've now moved the script to Apache 1.3.20 w/ mod_perl 1.25 (I think 
 its 1.25, but it may be 1.26 - the server's not running at the moment, 
 else I'd find out for sure).  It *seems* that the script can run once, 
 but that the next time it is accessed, it cannot connect to the 
 $server anylonger, it dies with a 'connection timed out' message ... 
 What 'gotcha' is causing this?

 Any help on this would be greatly appreciated!!

 Sincerely,
 Brice D Ruth


-- 
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/






Re: Mod_perl component based architecture

2001-10-16 Thread Chris Winters

* Michael ([EMAIL PROTECTED]) [011016 15:37]:
 Are any of the packages mentioned particularly suited to client
 content management packages where the client can manage some limeted
 page content text/graphics but not really mess with the overall page
 layout and site content. I'm about to start researching this but
 would like input from the experts.

OpenInteract (http://www.openinteract.org/) has page-editing (and
template-editing) capabilities from the browser. Currently you need to
keep all the content in the database to make this work, but I'm
working on being able to edit content in the filesystem as well.

I wouldn't call it a content-management system really, but users find
it pretty useful to see a typo, click on 'Edit this Document', make
the change and see it instantly.

Chris

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



Re: Mod_perl component based architecture

2001-10-16 Thread Bill Moseley

I've been looking at OpenInteract, too.  I've got a project where about 100
people need to edit records in a database via a web-based interface.  And
I'd like history tracking of changes (something like CVS provides, where
it's easy to see diffs and to back out changes).  And I need access control
for the 100 people, along with tracking per user of how many changes they
make, email notification of changes, administrative and super-user type of
user levels, and bla, bla bla, and so on.  Normal stuff.

I'm just bored with html forms.  Seems like I do this kind of project too
often -- read a record, post, validate, update...  Even with good
templating and code reuse between projects I still feel like I spend a lot
of time re-inventing the (my) wheel.  Will an application framework bring
me bliss?  I'm sure this is common type of project for many people.  What
solutions have you found to make this easy and portable from project to
project?



Bill Moseley
mailto:[EMAIL PROTECTED]



OT: Re: cgi to mod_perl question

2001-10-16 Thread ___cliff rayman___

Brice D Ruth wrote:

   What is the difference between doing the following:

 close( $server );

functional interface.  flush and close the file handle for this instance
of the program.


 #
 $server-close();

object interface - same as above.


 #
 $server-shutdown();

object interface.  cause the connection to close at the tcp/ip level.
any other application instance also using this socket will no longer
be able to read/write from it.


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





Re: cgi to mod_perl question

2001-10-16 Thread Brice D Ruth




Why OT? I have a script that works under IIS/5 using CGI Perl that doesn't
work under Apache with mod_perl - I'd say that's on-topic for this list!

-Brice

___cliff rayman___ wrote:
[EMAIL PROTECTED]">
  Brice D Ruth wrote:
  
  What is the difference between doing the following:close( $server );

functional interface.  flush and close the file handle for this instanceof the program.

  #$server-close();
  
  object interface - same as above.
  
#$server-shutdown();

object interface.  cause the connection to close at the tcp/ip level.any other application instance also using this socket will no longerbe able to read/write from it.--___cliff [EMAIL PROTECTED]://www.genwax.com/


-- 
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/





Re: Mod_perl component based architecture

2001-10-16 Thread Nick Tonkin


I do almost nothing but the kind of work you are describing, including a
comprehesive student record management system for a large California
College. I find that providing a custom interface to data is a lot more
like static content than dynamic when it comes to design. My apps tend to
look more like M$ Access than slashdot.org

So, over time, I've built a set of tools that do exactly what I need. It's
an extensible API, of course, so I can add new functionality simply, but
it does just what I need. The reason I've never adopted Mason or
OpenInteract or one of these [amazing] products is that because of their
scope they do far more than I ever need them to. For the same amount of
time and learning curve I would spend on becoming a Mason mason I can
tweak my own API to be 100% to my liking. All the content-generation code
I use is my own. Many people sniff at this and chuckle at another hacker
going through the rite of passage of making his own templating system. But
the toolkit I use has been built over four or five years now, so if I'm
stuck in a rite, well, so be it. Works for me, rather well.

I use a light layer of custom stuff built on top of the hardcore public
APIs for non-content-generation stuff, i.e. Apache::Session- and DBI-based
auth and data-access libraries. I have built an integrated
access/auth/authz layer that gives each user a hash of their own
permissions that follows them around; I use this to govern the output of
the content-generation as to read-write, as you suggested, and logging is
built into the write()s everywhere. I've been thinking of packaging up the
auth/authz stuff ... anybody care to take a look at it?

I guess in general I favor independent component APIs upon which you can
build, a la Apache::Session, rather than the monster Application
Servers ... it seems that you get the same effect but with more
control. Of course, I've had the luxury of afew years' experience; someone
starting out may prefer a canned solution ...

- nick







~~~
Nick Tonkin

On Tue, 16 Oct 2001, Bill Moseley wrote:

 I've been looking at OpenInteract, too.  I've got a project where about 100
 people need to edit records in a database via a web-based interface.  And
 I'd like history tracking of changes (something like CVS provides, where
 it's easy to see diffs and to back out changes).  And I need access control
 for the 100 people, along with tracking per user of how many changes they
 make, email notification of changes, administrative and super-user type of
 user levels, and bla, bla bla, and so on.  Normal stuff.
 
 I'm just bored with html forms.  Seems like I do this kind of project too
 often -- read a record, post, validate, update...  Even with good
 templating and code reuse between projects I still feel like I spend a lot
 of time re-inventing the (my) wheel.  Will an application framework bring
 me bliss?  I'm sure this is common type of project for many people.  What
 solutions have you found to make this easy and portable from project to
 project?
 
 
 
 Bill Moseley
 mailto:[EMAIL PROTECTED]
 




OT: Re: cgi to mod_perl question

2001-10-16 Thread ___cliff rayman___

hi brice,
because this particular question is one of basic perl,
and not mod_perl.  this just alerts all mod_perl readers
that they can safely skip this particular question/answer
and not miss any relevant mod_perl content.

u sound upset - no reason to be - u got the answer u were
looking for.
cliff

Brice D Ruth wrote:

 Why OT?  I have a script that works under IIS/5 using CGI Perl that doesn't work 
under Apache with mod_perl - I'd say that's on-topic for this list!

 -Brice

 ___cliff rayman___ wrote:

 Brice D Ruth wrote:


What is the difference between doing the following:
 
  close( $server );
 
 functional interface.  flush and close the file handle for this instance
 of the program.


  #
  $server-close();
 
 object interface - same as above.


  #
  $server-shutdown();
 
 object interface.  cause the connection to close at the tcp/ip level.
 any other application instance also using this socket will no longer
 be able to read/write from it.


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



 --
 WebProjkt, Inc.
 VP, Director of Internet Technology
 http://www.webprojkt.com/



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





Re: Mod_perl component based architecture

2001-10-16 Thread Chris Winters

* Bill Moseley ([EMAIL PROTECTED]) [011016 16:49]:
 I'm just bored with html forms.  Seems like I do this kind of
 project too often -- read a record, post, validate, update...  Even
 with good templating and code reuse between projects I still feel
 like I spend a lot of time re-inventing the (my) wheel.  Will an
 application framework bring me bliss?  I'm sure this is common type
 of project for many people.  What solutions have you found to make
 this easy and portable from project to project?

An application framework *can* bring you bliss -- but like a lot of
solutions that do a lot you need to buy into how it does things or
hope that it's flexible enough for you to change it. 

In addition, a framework should be able to encourage reuse because you
can concentrate on the interesting things (what is the data? how does
it act?) rather than the boring things (security, user/group
management, templating stuff). The boring things are there to be used,
but they're a given.

Good frameworks should IMO also make it easy to package up the
interesting things and keep them separate from one another, so you can
run as many code-test iterations as you need in your development
environment, bundle up the interesting code (object definitions,
schemas, business logic, display logic) and install it to the
production environment without much hassle.

Chris

PS - (plug plug) OpenInteract has as of 1.30 a new module
(OpenInteract::CommonHandler) to make the typical
search/display/edit/remove functinonality extremely easy.

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



Re: cgi to mod_perl question

2001-10-16 Thread Perrin Harkins

 It *seems* that the script can run once, but
 that the next time it is accessed, it cannot connect to the $server
 anylonger, it dies with a 'connection timed out' message ... What
 'gotcha' is causing this?

It sounds like this problem:
http://mathforum.org/epigone/modperl/joidwendsmeld/3B30E553.AD3A7DB8@chamas.
com

In the message, Joshua suggests a workaround of running mod_perl
single-threaded (which shouldn't make any difference, since mod_perl on
Win32 is already single-threaded).

- Perrin




Re: Mod_perl component based architecture

2001-10-16 Thread Chris Winters

* Nick Tonkin ([EMAIL PROTECTED]) [011016 17:28]:
 ...
 I guess in general I favor independent component APIs upon which you
 can build, a la Apache::Session, rather than the monster
 Application Servers ... it seems that you get the same effect but
 with more control. Of course, I've had the luxury of afew years'
 experience; someone starting out may prefer a canned solution ...

Sure, and you'd probably find that a lot of application servers -- at
least ones in Perl -- do this as well. For instance, the OpenInteract
session handling is exactly as you describe, a thin interface layer
around Apache::Session. Templating is through Template Toolkit,
etc.

Leveraging the work of all the smart people in the community is, to
me, a no-brainer. My view is that an application server makes all this
stuff work together, consistently, and then adds functionality on top
of it rather than in place of it.

But if you've been working on and building up a platform for 4+ years
that already does this, then there's very little to be gained and lots
to be lost by moving to an application server. :-)

Chris

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



Re: cgi to mod_perl question

2001-10-16 Thread Brice D Ruth




Yeah, I thought about that earlier today ... I did that and the script is
still crappin' out ... basically, the first time through, it works. The
next time, it doesn't seem to be able to build the connection, but it doesn't
'die' at that line, either.

I'll go check out the links you sent me (again :)) and see if anything else
catches my eye. If you have any other clues, please let me know!

-Brice

Edward Moon wrote:

  You're problem is pretty basic. You should read up on issues on movingfrom CGI to mod_perl (http://perl.apache.org/dist/cgi_to_mod_perl.html)and the mod_perl guide (http://perl.apache.org/guide/).You need to declare your variables with 'my' in order to avoid the problemyou are encountering.'use strict' will help catch many issues that can trip you up undermod_perl.On Tue, 16 Oct 2001, Brice D Ruth wrote:
  
  I have a perl script that was running fine under IIS/5.0 withActivePerl 6xx - I'll put the salient parts here:use IO::Socket;use CGI;$in = new CGI;$server = IO::Socket::INET-new( PeerAddr= "...",PeerPort=...,Proto="tcp",Type= SOCK_STREAM) or die "Error message ... $@";$server-autoflush(1);... (information is gotten from $server via $server)... (information is sent to $server via 'print $server ...')... (server's response is read via $server and printed to browser via'print')close ($server);That's it - a very simple Perl script that basically takes informationfrom the GET or POST strings, sends it to a server process and reads itsresponse, printing it out to the browser.I've now moved the script to Apache 1.3.20 w/ mod_perl 1.25 (I think its1.25, but it may be 1.26 - the server's not running at the moment, elseI'd find out for sure).  It *seems* that the script can run once, butthat the next time it is accessed, it cannot connect to the $serveranylonger, it dies with a 'connection timed out' message ... What'gotcha' is causing this?Any help on this would be greatly appreciated!!Sincerely,Brice D Ruth--WebProjkt, Inc.VP, Director of Internet Technologyhttp://www.webprojkt.com/




-- 
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/





IPC::Shareable

2001-10-16 Thread Rasoul Hajikhani

Pardon the off topic thread,
I am trying to make IPC::Shareable work with my script, however I get
this error:
IPC::Shareable::SharedMem: shmget: Permission denied
 at /usr/local/lib/perl5/site_perl/5.005/IPC/Shareable.pm line 456
[Tue Oct 16 14:44:15 2001] [error] Could not create shared memory
segment: Permission denied
Does any one know what's up?

Here is how I am using it to set:

unless (defined(%WEBACCESS)  tied(%WEBACCESS))
{
die Could not bind shared memory: $! unless
tie %WEBACCESS, 'IPC::Shareable', 'randh_webaccess', {create =1, mode
= 0666};  }

tied(%WEBACCESS)-shlock;

my $user= $WEBACCESS{$code};
unless ($user)
{

 $WEBACCESS{$code}   = {access_level = $status, access =
$entities, time =$time};
}

tied(%WEBACCESS)-shunlock;

And to read it:

tie %WEBACCESS, 'IPC::Shareable', 'randh_webaccess' unless
(defined(%WEBACCESS)  tied(%WEBACCESS));

tied(%WEBACCESS)-shlock;

my $info= $WEBACCESS{$user};

tied(%WEBACCESS)-shunlock;

Any help will be greatly appreciated.
Thanks
-r



[OT] Re: IPC::Shareable

2001-10-16 Thread Stephen Adkins

Hi,

The shared memory segment was already created by another user,
and it was created without permissions for you to write to it.

Try the ipcs command to view existing shared memory segments.
Try the ipcrm command to remove an old one.

Stephen

At 03:02 PM 10/16/2001 -0700, Rasoul Hajikhani wrote:
Pardon the off topic thread,
I am trying to make IPC::Shareable work with my script, however I get
this error:
IPC::Shareable::SharedMem: shmget: Permission denied
 at /usr/local/lib/perl5/site_perl/5.005/IPC/Shareable.pm line 456
[Tue Oct 16 14:44:15 2001] [error] Could not create shared memory
segment: Permission denied
Does any one know what's up?





Re: IPC::Shareable

2001-10-16 Thread Luciano Miguel Ferreira Rocha


Make sure that you're not creating a too big shared memory segment and
that you're (apache) running with an uid that is allowed to create
shared memory segments.

From the apache configuration file:
#  . On HPUX you may not be able to use shared memory as nobody, and the
#suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 6; 

hugs
  Luciano Rocha

-- 
Luciano Rocha, [EMAIL PROTECTED]

The trouble with computers is that they do what you tell them, not what
you want.
-- D. Cohen



Re: IPC::Shareable

2001-10-16 Thread Perrin Harkins

 I am trying to make IPC::Shareable work with my script, however I get
 this error:
 IPC::Shareable::SharedMem: shmget: Permission denied
  at /usr/local/lib/perl5/site_perl/5.005/IPC/Shareable.pm line 456
 [Tue Oct 16 14:44:15 2001] [error] Could not create shared memory
 segment: Permission denied
 Does any one know what's up?

In the time it takes you to debug it, you could switch your code to
MLDBM::Sync and forget about all these annoying shared memory issues.  It
would probably be faster too.
- Perrin




Re: Mod_perl component based architecture

2001-10-16 Thread Gunther Birznieks

At 11:13 PM 10/16/01, Dominique Quatravaux wrote:
  also does modperl support object oriented programming?

   Well yes it does indeed (see any good book on Perl, such as
«advanced Perl programming» from O'Reilly).

   As for the remaining of the question, I've been wondering for myself if
there is a MVC (model-view-controller) framework for WWW publishing in
Perl ? I gather there exist quite a few for Java, but I couldn't find
anything significant under Perl.

Our eXtropia toolkit is just about the only one out there that caters to 
all CGI environments with MVC architecture (action objects and action 
manager for controller, normal DB objects for model, and template toolkit 
for view)...

If you go to http://www.extropia.com/ you can download any Perl WebDB app, 
WebCal, or WebBBS to see an example. We are still in a mode where we are 
distributing apps built around the framework rather than the framework 
itself but you can get the idea.

WebDB in particular has a lot of documentation itself for free.

If you are really interested in toolkit docs, we have an 800 page book out 
by McGraw-Hill whose later half 400 pages discusses in raw detail the 
architecture of the toolkit itself and how all the pieces fit together.

One of the sad things is that the intelligent people on this list tend to 
have their head a bit in the ground when it comes to alternative 
environments other than mod_perl. mod_perl's a great tool but there's a lot 
of other Perl environments out there not the least of which is just plain 
old CGI. This is why our toolkit specifically caters to all.

The other thing is that many (although not all) Perl people tend to have 
their head in the ground related to dealing with other environments such as 
Java. Our toolkit also plugs into Java environments. For example, we have a 
completely interoperaple Perl - Java persistence layer (via SOAP) if you 
wish to use a Java driver for a Perl front-end.

We also spent considerable time porting our toolkit and several apps to 
Java MVC framework so we have Java Servlet/JSP equivalents of everything.

Yet another thing is that many Perl people also have their head in the 
ground about Win32 compatibility. We've strived to make sure our entire 
toolkit will work reasonably well on Win98 and Win2000. A toolkit that only 
works on mod_perl will by definition not work well on Win2000 except as a 
toy because Win32 mod_perl is a single blocking thread. Great for 
development, not so great for production (unless the site is really small).

I would venture to say that some of the mod_perl-only toolkits have some 
cases of being better designed than ours, but they are mostly mod_perl 
only.  In fact, I don't know if I know any other toolkits than ours that 
are not mod_perl only of the ones that were advertised on the list.

Of course, this may be what you are looking for.  But since you mentioned 
Perl MVC and not specifically mod_perl-only MVC, I figured I would jump in 
and mention the alternative since we are much more open to alternative 
environments and not being closed in to just mod_perl.

Later,
Gunther





Re: IPC::Shareable

2001-10-16 Thread Rasoul Hajikhani

Perrin Harkins wrote:
 
  I am trying to make IPC::Shareable work with my script, however I get
  this error:
  IPC::Shareable::SharedMem: shmget: Permission denied
   at /usr/local/lib/perl5/site_perl/5.005/IPC/Shareable.pm line 456
  [Tue Oct 16 14:44:15 2001] [error] Could not create shared memory
  segment: Permission denied
  Does any one know what's up?
 
 In the time it takes you to debug it, you could switch your code to
 MLDBM::Sync and forget about all these annoying shared memory issues.  It
 would probably be faster too.
 - Perrin

Cool, it is really fast... and very easy to implement... Curious though,
is there a delete method/operation any where? Could not find anything in
the perldoc docs indicating a method like that! Any ideas??
Thanks in advance.
-r



Re: mod_perl-1.2.6 for Cygwin 1.x (using apache_1.3.22, perl-5.6.1)

2001-10-16 Thread Gerrit P. Haase

 Stipe Tolj schrieb am 2001-10-16 13:19:

--- src/modules/perl/Makefile  Tue Oct 16 10:57:46 2001
+++ src/modules/perl/Makefile.cygwin   Tue Oct 16 10:56:40 2001
@@ -13,7 +13,7 @@
 EXTRA_CFLAGS=-DUSEIMPORTLIB -DPERL_USE_SAFE_PUTENV -DHAS_SBRK_PROTO
 -fno-strict-aliasing `$(SRCDIR)/apaci` EXTRA_LDFLAGS= EXTRA_LIBS=
-EXTRA_INCLUDES=
+EXTRA_INCLUDES=-I/usr/lib/perl5/5.6.1/cygwin/CORE
   ^^^
You are using perl-5.6.1-1, 5.6.1-2 was build with multiplicity.

-PERL_LD=ld2
-PERL_LDFLAGS= -s -L/usr/local/lib
-PERL_LDDLFLAGS= -s -L/usr/local/lib
-PERL_LIBS= -s  -s -L/usr/local/lib 
/usr/lib/perl5/5.6.1/cygwin/auto/DynaLoader/DynaLoader.a 
-L/usr/lib/perl5/5.6.1/cygwin/CORE -lperl -lcrypt 
+PERL_LD=gcc
+PERL_LDFLAGS= --shared -L/usr/local/lib
+PERL_LDDLFLAGS= --shared -L/usr/local/lib
+PERL_LIBS= --shared -L/usr

What is the problem with ld2?

Gerrit


-- 
=^..^=



mod_perl-1.2.6 for Cygwin 1.x (using apache_1.3.22, perl-5.6.1)

2001-10-16 Thread Stipe Tolj

Hi,

I'm the maintainer of the Apache for Cygwin port, various apache
modules and the CAMP binary distribution. After releasing the latest
CAMP package which contains many popular modules (mod_php, mod_ssl,
mod_dav, etc) there have been requests from Apache for Cygwin users to
included mod_perl if possible. 

There are two alternatives to use mod_perl:

1. Static apache module:

   Please follow the instructions from Alexander Solovey at
   http://www.mail-archive.com/modperl@apache.org/msg21136.html

   Special thanks to Alexander Solovey for figuring this out!
 
2. DSO/DLL shared apache module:

   This is possible for the apache_1.3.22-i686-whatever-cygwin.tar.gz
   binary distribution found at http://apache.dev.wapme.net

   step 1: follow the instructions for the static apache module
   step 2: use the following Makefile construction instead:

 $ perl Makefile.PL USE_APACI=1 EVERYTHING=1 \
 PERL_EXTRA_CFLAGS=-DUSEIMPORTLIB DO_HTTPD=1 USE_DSO=1

   step 3: patch src/modules/perl/Makefile as defined in the attached
   Makefile.diff patch.

   step 4: now run make within mod_perl-1.2.6.
   The first run will claim about no libhttpd.dll. Please 
   touch src/modules/perl/libperl.dll and re-run make after
   libhttpd.dll has been build. 
   (see src/modules/standard/Makefile.Cygwin for more info)

   step 5: place the libperl.dll into /usr/local/apache/libexec and
   add the required directives to httpd.conf.


Unfortunatly the libperl.dll _breaks_ apache's httpd process if
configured ok. When trying to start httpd it troughts a
STATUS_ACCESS_VIOLATION exception.

Attached is the error_log file and a tailed output of strace
httpd.exe.

If there is someone who can explain me how to use the information to
find the resulting error, I would be very thankfull.   

BTW, a shared DLL version of mod_perl is working using httpd -X, 
apache's single process mode.

Stas, can we include necessary changes to mod_perl when we fix this,
so we have out-of-the-box support?


Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are

--- src/modules/perl/Makefile   Tue Oct 16 10:57:46 2001
+++ src/modules/perl/Makefile.cygwinTue Oct 16 10:56:40 2001
@@ -13,7 +13,7 @@
 EXTRA_CFLAGS=-DUSEIMPORTLIB -DPERL_USE_SAFE_PUTENV -DHAS_SBRK_PROTO 
-fno-strict-aliasing `$(SRCDIR)/apaci`
 EXTRA_LDFLAGS=
 EXTRA_LIBS=
-EXTRA_INCLUDES=
+EXTRA_INCLUDES=-I/usr/lib/perl5/5.6.1/cygwin/CORE
 EXTRA_DEPS=
 CC=env LD_RUN_PATH=/usr/lib/perl5/5.6.1/cygwin/CORE gcc
 LDFLAGS_SHLIB_EXPORT=-s
@@ -32,10 +32,10 @@
 PERL_CCCDLFLAGS= 
 PERL_DEFS= -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ 
-DNO_PERL_SSI=1
 PERL_INC=/usr/lib/perl5/5.6.1/cygwin/CORE
-PERL_LD=ld2
-PERL_LDFLAGS= -s -L/usr/local/lib
-PERL_LDDLFLAGS= -s -L/usr/local/lib
-PERL_LIBS= -s  -s -L/usr/local/lib 
/usr/lib/perl5/5.6.1/cygwin/auto/DynaLoader/DynaLoader.a 
-L/usr/lib/perl5/5.6.1/cygwin/CORE -lperl -lcrypt 
+PERL_LD=gcc
+PERL_LDFLAGS= --shared -L/usr/local/lib
+PERL_LDDLFLAGS= --shared -L/usr/local/lib
+PERL_LIBS= --shared -L/usr/local/lib 
+/usr/lib/perl5/5.6.1/cygwin/auto/DynaLoader/DynaLoader.a 
+-L/usr/lib/perl5/5.6.1/cygwin/CORE -lperl -lcrypt ../../libhttpd.dll
 PERL_XSINIT=perl -MExtUtils::Embed -e xsinit
 PERL_XSUBPP=perl /usr/lib/perl5/5.6.1/ExtUtils/xsubpp -nolinenumbers -typemap 
/usr/lib/perl5/5.6.1/ExtUtils/typemap
 PERL_AR=ar
@@ -140,6 +140,10 @@
$(MP_RANLIB) $@
 
 libperl.so: $(MP_OBJS_PIC)
+   $(MP_RM) $@
+   $(MP_LD) $(MP_LDFLAGS_SHLIB) -o $@ $(MP_OBJS_PIC) $(MP_LIBS)
+
+libperl.dll: $(MP_OBJS_PIC)
$(MP_RM) $@
$(MP_LD) $(MP_LDFLAGS_SHLIB) -o $@ $(MP_OBJS_PIC) $(MP_LIBS)
 




[Tue Oct 16 10:42:40 2001] [error] [client 127.0.0.1] File does not exist: 
/usr/local/apache/htdocs/server-info
[Tue Oct 16 10:43:31 2001] [warn] pid file /usr/local/apache/logs/httpd.pid 
overwritten -- Unclean shutdown of previous Apache run?
 221784 [main] httpd 1020 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
 252711 [main] httpd 1020 stackdump: Dumping stack trace to httpd.exe.stackdump
[Tue Oct 16 10:44:50 2001] [warn] pid file /usr/local/apache/logs/httpd.pid 
overwritten -- Unclean shutdown of previous Apache run?
 226194 [main] httpd 368 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
 258748 [main] httpd 368 stackdump: Dumping stack trace to httpd.exe.stackdump
[Tue Oct 16 10:44:59 2001] [warn] pid file /usr/local/apache/logs/httpd.pid 
overwritten -- Unclean shutdown of previous Apache run?
 225297 [main] httpd 1252 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
 262393 [main] httpd 1252 stackdump: Dumping stack trace to httpd.exe.stackdump




  193  

Re: IPC::Shareable

2001-10-16 Thread Perrin Harkins

 is there a delete method/operation any where? Could not find anything
in
 the perldoc docs indicating a method like that!

It supports the same interface as normal hashes, so you can delete keys
in the same way.  You may also want to read the MLDBM documentation if
you haven't already.
- Perrin




Re: cgi to mod_perl question

2001-10-16 Thread Brice D Ruth




Perrin Harkins wrote:
00a601c1568c$224f0a20$18020c0a@PerriHar">
  
It *seems* that the script can run once, butthat the next time it is accessed, it cannot connect to the $serveranylonger, it dies with a 'connection timed out' message ... What'gotcha' is causing this?

It sounds like this problem:http://mathforum.org/epigone/modperl/joidwendsmeld/3B30E553.AD3A7DB8@chamas.comIn the message, Joshua suggests a workaround of running mod_perlsingle-threaded (which shouldn't make any difference, since mod_perl onWin32 is already single-threaded).- Perrin

It certainly seems that this is part of the problem. Making mod_perl single-threaded
fixed my problem *partially* - now at least I can renew the socket connection
on subsequent requests. But, the connection still isn't being taken down
properly ... when the page finishes being served, and after 'close( $server
);' has been called, the socket on the server side (what the mod_perl script
is connecting to) show 'TIME_WAIT' - the server runs five threads to accept
connections, once all of them have been connected to once, I can no longer
connect to them - what's going on? Why is the connection not being dismantled
properly??

Sincerely (and frustrated),
Brice Ruth
-- 
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/





Re: cgi to mod_perl question

2001-10-16 Thread Brice D Ruth




Brice D Ruth wrote:
[EMAIL PROTECTED]">
  
   Perrin Harkins wrote:
  00a601c1568c$224f0a20$18020c0a@PerriHar">

  It *seems* that the script can run once, butthat the next time it is accessed, it cannot connect to the $serveranylonger, it dies with a 'connection timed out' message ... What'gotcha' is causing this?
  
  It sounds like this problem:http://mathforum.org/epigone/modperl/joidwendsmeld/3B30E553.AD3A7DB8@chamas.comIn the message, Joshua suggests a workaround of running mod_perlsingle-threaded (which shouldn't make any difference, since mod_perl onWin32 is already single-threaded).- Perrin
  
 It certainly seems that this is part of the problem. Making mod_perl single-threaded 
fixed my problem *partially* - now at least I can renew the socket connection 
on subsequent requests. But, the connection still isn't being taken down 
properly ... when the page finishes being served, and after 'close( $server 
);' has been called, the socket on the server side (what the mod_perl script 
is connecting to) show 'TIME_WAIT' - the server runs five threads to accept 
connections, once all of them have been connected to once, I can no longer 
connect to them - what's going on? Why is the connection not being dismantled 
properly??
  
 Sincerely (and frustrated),
 Brice Ruth
  
  
Unfortunately, I've now noticed that my server is unbearably slow - setting 
'ThreadsPerChild 1' in my httpd.conf made my server slow to a snails pace 
(and it really is a pretty quick server on a T1 line dedicated to it, pretty 
much). Have I missed something here? Certainly this isn't the only way mod_perl
can run if it needs to make IO::Socket::INET connections???
  
 Please help me out here - I'm truly just a Linux/*BSD guy trying to get
a poor Win2K box w/ Apache to run the Perl scripts right ... 
  
 -Brice
  -- 
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/
  
  
  


Re: Mod_perl component based architecture

2001-10-16 Thread Dave Rolsky

On Wed, 17 Oct 2001, Gunther Birznieks wrote:

 I would venture to say that some of the mod_perl-only toolkits have some
 cases of being better designed than ours, but they are mostly mod_perl
 only.  In fact, I don't know if I know any other toolkits than ours that
 are not mod_perl only of the ones that were advertised on the list.

I don't know if Mason counts as a full toolkit (its not really an app
server) but you can certainly run Mason as a vanilla CGI, and if you can
do that I'm sure you can run it in FastCGI and whatnot.

-dave

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




Re: cgi to mod_perl question

2001-10-16 Thread Perrin Harkins

 Unfortunately, I've now noticed that my server is unbearably slow -
 setting 'ThreadsPerChild 1' in my httpd.conf made my server slow to a
 snails pace (and it really is a pretty quick server on a T1 line
 dedicated to it, pretty much).

That's odd.  On Win32, mod_perl runs as a single blocking thread.  I
wouldn't expect changing that setting to affect anything.  Are you sure
you were running your script under Apache::Registry?  (Maybe someone who
actually uses Win32 could supply some help here?)

 Have I missed something here?  Certainly
 this isn't the only way mod_perl can run if it needs to make
 IO::Socket::INET connections???

I do my mod_perl development on Linux, so I'm just repeating what others
have posted before.  I've never heard of an actual solution for this
problem, just the workaround.

 Please help me out here - I'm truly just a Linux/*BSD guy trying to
get
 a poor Win2K box w/ Apache to run the Perl scripts right ...

You would certainly get better performance on Linux or BSD.  If you have
to use Win32 and need better performance, you may have to look at other
options like ActiveState's PerlEx.

- Perrin




Re: Mod_perl component based architecture

2001-10-16 Thread Ilya Martynov

 On Tue, 16 Oct 2001 22:07:47 -0500 (CDT), Dave Rolsky [EMAIL PROTECTED] said:

DR On Wed, 17 Oct 2001, Gunther Birznieks wrote:
 I would venture to say that some of the mod_perl-only toolkits have some
 cases of being better designed than ours, but they are mostly mod_perl
 only.  In fact, I don't know if I know any other toolkits than ours that
 are not mod_perl only of the ones that were advertised on the list.

DR I don't know if Mason counts as a full toolkit (its not really an app
DR server) but you can certainly run Mason as a vanilla CGI, and if you can
DR do that I'm sure you can run it in FastCGI and whatnot.

Moreover I have seen it being used in command line tool which
generates static HTML pages from a set of templates.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Apache::Session WindowsNT File Locking problems

2001-10-16 Thread Chui G. Tey



Hi,

I'm using the 
precompiled binaries of Apache 1.3.20 + mod_perl on WinNT. 
I have grabbed 
Apache::Session 1.54 and nmake test fails at 99dbfile.t.
The test routine 
basically hangs, and the culprit is in one of the last 
lines:

tied(%$s)-delete;

It seems to be some 
kind of file locking problem. I stepped through the code and I seem to 
have a 
problem with Autoloader loading Fcntl.
Has anyone else 
experienced this, and could perhaps suggest a way to resolve 
this?

Thanks.

Chui Tey
Software Engineer
Advanced Data Integration
PO Box 660
Spring Hill QLD 4004
AUSTRALIA
Ph:07 3250 5300
Fax: 07 3250 5399
[mailto: [EMAIL PROTECTED]]




Re: Mod_perl component based architecture

2001-10-16 Thread Gunther Birznieks

At 01:28 PM 10/17/01, Ilya Martynov wrote:
  On Tue, 16 Oct 2001 22:07:47 -0500 (CDT), Dave Rolsky 
 [EMAIL PROTECTED] said:

DR On Wed, 17 Oct 2001, Gunther Birznieks wrote:
  I would venture to say that some of the mod_perl-only toolkits have some
  cases of being better designed than ours, but they are mostly mod_perl
  only.  In fact, I don't know if I know any other toolkits than ours that
  are not mod_perl only of the ones that were advertised on the list.

DR I don't know if Mason counts as a full toolkit (its not really an app
DR server) but you can certainly run Mason as a vanilla CGI, and if you can
DR do that I'm sure you can run it in FastCGI and whatnot.

Moreover I have seen it being used in command line tool which
generates static HTML pages from a set of templates.

Well so is Template Toolkit but it's still basically a content 
management/template engine not really an application framework. It's 
possible that Mason has applications written in Mason, just as you could 
write applications in ActiveServerPage or Cold Fusion pages, but that 
doesn't make ASP or Cold Fusion an Application Framework either. Or at 
least not a balanced MVC one.

Open Interact, Smart Worker, and ours do not handle templating at all. We 
integrate with other packages to do that sort of management. We have 
frameworks that handle application logic in a fairly consistent way and 
this is what is meant by app framework (as opposed to template framework).

Of course, I am not saying that the line isn't fuzzy especially if the 
template engine is quite powerful (as is the case with Mason or AxKit). But 
there is a line nonetheless, no??

Later,
Gunther




Re: Mod_perl component based architecture

2001-10-16 Thread Rob Nagler

   As for the remaining of the question, I've been wondering for myself if
 there is a MVC (model-view-controller) framework for WWW publishing in
 Perl ? I gather there exist quite a few for Java, but I couldn't find
 anything significant under Perl.

Check out http://www.bivio.net/hm/why-bOP and http://petshop.bivio.net
The former motivates the MVC architecture.  The latter URL is a demo
of Sun's J2EE blueprint demo of a Pet Store implemented using bOP, a
perl application framework.  It's freeware and we use it to run a
large commercial website.

When you visit petshop.bivio.net, at the bottom of the page, you'll
see Control Logic for This Page.  This is what the bOP agent
(controller) uses to determine if the incoming user can access the
page, what the page actually does (models and views), and any state
transitions (form next or cancel).  The links at the bottom of the
page go to the source of this application.

bOP also allows you to change the look-and-feel quite easily.  Compare
these two pages:

http://www.bivio.com/club_cafe/mail-msg?t=1934163
http://ic.bivio.com/club_cafe/mail-msg?t=1934163

They render the same content, but in two entirely different contexts.
Each look-and-feel is described in a single file, which contains
color, font, URL, text, and view mappings.

bOP is about 250 classes including the Pet Shop demo.  It uses Oracle
or Postgres, but it should be easy to port to other databases. You can
also build a static site, e.g. http://www.bivio.net which doesn't 
require a database.

SOAPBOX
The J2EE architecture implements MV, not MVC imiho.  Here's one of my
favorite quotes from Sun's site:

  It is important to understand that Model, View, and Controller are 
  usually not represented by individual classes; instead, they are 
  conceptual subdivisions  of the application. 

This is true for J2EE, but not true for MVC frameworks.  J2EE's
control flow is not a distinct element.  JSPs are usually full of
business logic.  The whole MVC concept passed J2EE by.

Even when you look at Model 2 Methodology (promoted by Apache
Jakarta Turbine), the code is a mess.  Here's a snippet from the
reference article on Model 2:

  public void doPost (HttpServletRequest req, HttpServletResponse res)
  throws ServletException, IOException {
  HttpSession session = req.getSession(false);
  if (session == null) {
   res.sendRedirect(http://localhost:8080/error.html;);
  }
  Vector buylist= (Vector)session.getValue(shopping.shoppingcart);
  [...]
  if (!action.equals(CHECKOUT)) {
  if (action.equals(DELETE)) {
  [...]
  String url=/jsp/shopping/EShop.jsp;
  [...]
  String url=/jsp/shopping/Checkout.jsp;

The excerpt is from a single method in which they mix sessions, port
numbers, hosts, error pages, URLs, button values, etc.

The JSP is no better and contains lines like:

  optionYuan | The Guo Brothers | China | $14.95/option
  bQuantity: /binput type=text name=qty SIZE=3 value=1
  input type=submit value=Delete  
  input type=hidden name=action value=DELETE

Note that DELETE in the JSP must be the same as DELETE in the
Java.  Nothing is checking that.  You only know that the code doesn't
work when someone hits the page.  In this particular example, if you
mispell DELETE in either place, the code does something, and 
doesn't issue an error.

So much for Model 2.  I wonder what Model 3 will be like. ;-)

Sorry, had to get that off my chest...
/SOAPBOX

Cheers,
Rob



cvs commit: modperl-site index.html

2001-10-16 Thread stas

stas01/10/16 01:16:36

  Modified:.index.html
  Log:
  - add the link to the asp mail archive
  
  Revision  ChangesPath
  1.90  +1 -0  modperl-site/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/modperl-site/index.html,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- index.html2001/10/16 04:52:32 1.89
  +++ index.html2001/10/16 08:16:35 1.90
  @@ -1047,6 +1047,7 @@
  ul   
   
li
  +at a 
href=http://www.mail-archive.com/asp%40perl.apache.org/;mail-archive.com/a.
/li
   
  /ul
  
  
  



cvs commit: modperl-2.0/t/response/TestModperl interp.pm

2001-10-16 Thread dougm

dougm   01/10/16 20:20:02

  Added:   t/modperl interp.t
   t/response/TestModperl interp.pm
  Log:
  add a test that uses the same interpreter each time
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/modperl/interp.t
  
  Index: interp.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  
  use constant INTERP = 'X-PerlInterpreter';
  
  plan tests = 3, \have_lwp;
  
  my $url = /TestModperl::interp;
  
  #request an interpreter instance
  my $res = GET $url, INTERP, 'init';
  
  #use this interpreter id to select the same interpreter in requests below
  my $interp = $res-header(INTERP);
  
  print using interp: $interp\n;
  
  print $res-content;
  
  my $found_interp = ;
  my $find_interp = sub {
  $res-code == 200 and (($found_interp = $res-header(INTERP)) eq $interp);
  };
  
  for (1..2) {
  my $times = 0;
  
  do {
  #loop until we get a response from our interpreter instance
  $res = GET $url, INTERP, $interp;
  
  #trace info
  unless ($find_interp-()) {
  print $found_interp ?
wrong interpreter: $found_interp\n :
no interpreter\n;
  }
  
  if ($times++  15) { #prevent endless loop
  die unable to find interp $interp\n;
  }
  } while (not $find_interp-());
  
  print $res-content; #ok $value++
  }
  
  
  
  
  1.1  modperl-2.0/t/response/TestModperl/interp.pm
  
  Index: interp.pm
  ===
  package TestModperl::interp;
  
  use warnings FATAL = 'all';
  use strict;
  
  use APR::UUID ();
  use Apache::Const -compile = qw(OK NOT_FOUND SERVER_ERROR);
  
  use constant INTERP = 'X-PerlInterpreter';
  
  my $interp_id = ;
  my $value = 0;
  
  sub fixup {
  my $r = shift;
  my $interp = $r-headers_in-get(INTERP);
  my $rc = Apache::OK;
  
  unless ($interp) {
  #shouldn't be requesting this without an INTERP header
  return Apache::SERVER_ERROR;
  }
  
  my $id = $interp_id;
  if ($interp eq 'init') { #first request for an interpreter instance
  #unique id for this instance
  $interp_id = $id = APR::UUID-new-format;
  $value = 0; #reset our global data
  }
  elsif ($interp ne $interp_id) {
  #this is not the request interpreter instance
  $rc = Apache::NOT_FOUND;
  }
  
  #so client can save the created instance id or check the existing value
  $r-headers_out-set(INTERP, $id);
  
  return $rc;
  }
  
  sub handler {
  my $r = shift;
  
  #test the actual global data
  $value++;
  $r-puts(ok $value\n);
  
  Apache::OK;
  }
  
  1;
  __END__
  PerlFixupHandler TestModperl::interp::fixup
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm

2001-10-16 Thread stas

stas01/10/16 22:35:34

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
  Log:
  - add a D_NONE const
  - now the DEBUG const can be overriden from httpd.conf
  
  Revision  ChangesPath
  1.2   +10 -7 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryCooker.pm 2001/10/09 12:47:38 1.1
  +++ RegistryCooker.pm 2001/10/17 05:35:34 1.2
  @@ -49,20 +49,23 @@
   # - see META's accross the file
   
   #
  -# debug flag constants
  +# debug constants
   #
   #
  +use constant D_NONE= 0;
   use constant D_ERROR   = 1;
   use constant D_WARN= 2;
   use constant D_COMPILE = 4;
   use constant D_NOISE   = 8;
   
  -# use ModPerl::RegistryCooker::DEBUG constant if defined elsewhere
  -# before the compilation of this package: D_NOISE devel mode (prod==0)
  -#use constant DEBUG = ModPerl::RegistryCooker-can('DEBUG') || D_NOISE;
  -#use Apache::ServerUtil;
  -#use constant DEBUG = defined 
Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG') ? 
Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG') : D_NOISE;
  -use constant DEBUG = D_NOISE;
  +# can override the debug level in httpd.conf with:
  +#   PerlSetVar ModPerl::RegistryCooker::DEBUG 4
  +# on the server level 
  +use Apache::ServerUtil ();
  +use constant DEBUG =
  +defined Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG')
  +? Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG')
  +: D_NONE;
   
   #
   # object's array index's access constants