RE: Process exiting prematurely

2003-09-03 Thread Flowers, Jay
Title: Re: Process exiting prematurely





Do you get this behavior with some particular script or 
just any kind? Doesthe same script work fine as mod_cgi?All scripts, 
work the same.  They work fine under 
mod_cgi.




RE: Process exiting prematurely

2003-09-03 Thread Flowers, Jay








> Possibly change the MaxRequestsPerChild
to 100 and see if it still restarts?

> Roger

 

no joy.

 

Thanks

 



Jay Flowers

Systems Engineer

Integic Corp.










RE: Process exiting prematurely

2003-09-03 Thread Flowers, Jay

> Jay, I can't see from your error_log what problem you are talking
about. 
> Apache always starts and immediately restarts, so what you see is
normal.

It does not work this way on my Windows 2000 server machines.  After
every request it restarts the Apache Child Process, even though the
config file has MaxRequestsPerChild set to 0.

> What shows up in the error_log when you issue a request to a registry
> script? 

Just what I showed, the log would just be a repetition of the restart
for each request.

> I suppose nothing? There is no segfault, no nothing? What's the exact 
> error message that you get from the system? (I suppose it does that
via a 
> pop up window, right?)

That is the bugger of it, there is no error, it's a behavior that I
noticed.  Every request is slow because it needs to restart the Apache
Child process.  It feels much slower than CGI on IIS.




--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Process exiting prematurely

2003-09-03 Thread Flowers, Jay
odPerl::Registry
PerlOptions +ParseHeaders






[Tue Sep 02 13:41:35 2003] [notice] Parent: Created child process 1172
[Tue Sep 02 13:41:35 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(505):
Parent: Sent the scoreboard to the child
[Tue Sep 02 13:41:43 2003] [notice] Child 1172: Child process is running
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(426):
Child 1172: Retrieved our scoreboard from the parent.
[Tue Sep 02 13:41:43 2003] [info] Parent: Duplicating socket 188 and
sending it to child process 1172
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(623):
Parent: Sent 1 listeners to child 1172
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(582):
Child 1172: retrieved 1 listeners from parent
[Tue Sep 02 13:41:43 2003] [notice] Child 1172: Acquired the start
mutex.
[Tue Sep 02 13:41:43 2003] [notice] Child 1172: Starting 10 worker
threads.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 0 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 1 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 2 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 3 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 4 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 5 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 6 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 7 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 8 starting.
[Tue Sep 02 13:41:43 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1172: Worker thread 9 starting.
[Tue Sep 02 13:42:19 2003] [notice] Child 1172: Process exiting because
it reached MaxRequestsPerChild. Signaling the parent to restart a new
child process.
[Tue Sep 02 13:42:19 2003] [notice] Parent: Received restart signal --
Restarting the server.
[Tue Sep 02 13:42:20 2003] [info] Child 1172: Accept thread exiting.
[Tue Sep 02 13:42:20 2003] [notice] Child 1172: Released the start mutex
[Tue Sep 02 13:42:20 2003] [info] Child 1172: 10 threads blocked on the
completion port
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 1 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 2 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 3 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 4 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 5 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 6 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 7 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 8 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 9 exiting.
[Tue Sep 02 13:42:20 2003] [debug] .\server\mpm\winnt\child.c(746):
Child 1172: Worker thread 0 exiting.
[Tue Sep 02 13:42:21 2003] [notice] Child 1172: Waiting for 10 worker
threads to exit.
[Tue Sep 02 13:42:21 2003] [notice] Child 1172: All worker threads have
exited.
[Tue Sep 02 13:42:22 2003] [notice] Child 1172: Child process is exiting
[Tue Sep 02 13:42:22 2003] [notice] Parent: Created child process 1752
[Tue Sep 02 13:42:22 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(505):
Parent: Sent the scoreboard to the child
[Tue Sep 02 13:42:30 2003] [notice] Child 1752: Child process is running
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(426):
Child 1752: Retrieved our scoreboard from the parent.
[Tue Sep 02 13:42:30 2003] [info] Parent: Duplicating socket 188 and
sending it to child process 1752
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(623):
Parent: Sent 1 listeners to child 1752
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\mpm_winnt.c(582):
Child 1752: retrieved 1 listeners from parent
[Tue Sep 02 13:42:30 2003] [notice] Child 1752: Acquired the start
mutex.
[Tue Sep 02 13:42:30 2003] [notice] Child 1752: Starting 10 worker
threads.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 0 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 1 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 2 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 3 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 4 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 5 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 6 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 7 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 8 starting.
[Tue Sep 02 13:42:30 2003] [debug] .\server\mpm\winnt\child.c(695):
Child 1752: Worker thread 9 starting.



Jay Flowers
Systems Engineer
Integic Corp.



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: Installing Apache::AuthCookie

2003-06-11 Thread Jay Strauss
I installed it anyway.  It seems to be working.  I can still send you the
httpd.conf if you'd still like

jay
- Original Message -
From: "Michael Schout" <[EMAIL PROTECTED]>
To: "Jay Strauss" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 11, 2003 11:26 AM
Subject: Re: Installing Apache::AuthCookie


> On Tue, 10 Jun 2003, Jay Strauss wrote:
>
> > I'm running into a problem during the make test while installing the
current
> > version of Apache::AuthCookie.  I'm not sure where to go.  I looked at
tests
> > 10 and 15:
>
> Hrm.  You are supposed to get "ok" for all of the tests.
>
> If I had to guess from this I would say that there is something in your
> httpd.conf (that Apache::test is pulling the config from) that is
> screwing up the tests.  Can you send me your t/httpd.conf? (privately,
> no need to send it to the list).
>
> Regards
> Michael
> --
> Hal 9000 - "Put down those Windows disks Dave  Dave?  DAVE!!"
>
>
>



Installing Apache::AuthCookie

2003-06-10 Thread Jay Strauss
Hi,

I'm running into a problem during the make test while installing the current
version of Apache::AuthCookie.  I'm not sure where to go.  I looked at tests
10 and 15:

Test 10 is supposed to fail:  and it did
Test 15 is supposed to be FORBIDDEN

Should I go ahead and do "make install"?

Jay

I installed apache, mod_ssl... via apt-get install

Apache/1.3.26 (Unix) Debian GNU/Linux mod_ssl/2.8.9 OpenSSL/0.9.6g
mod_perl/1.26 conf

meir:/usr/local/cpan/build/Apache-AuthCookie-3.04# make test TEST_VERBOSE=1
t/httpd -f `pwd`/t/httpd.conf
PERL_DL_NONLAZY=1 PORT=8228
/usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/per
/5.6.1 -I/usr/share/perl/5.6.1 -e 'use Test::Harness qw(&runtests $verbose);
$v
rbose=1; runtests @ARGV;' t/*.t
t/real1..17
ok 1
ok 2
ok 3
ok 4
code: 302
ok 5
ok 6
ok 7
ok 8
ok 9
code: 401
not ok 10
Result: Connection: close
Date: Tue, 10 Jun 2003 19:16:26 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_ssl/2.8.9 OpenSSL/0.9.6g
mod_
erl/1.26
Content-Type: text/html; charset=iso-8859-1
Client-Date: Tue, 10 Jun 2003 19:16:26 GMT
Client-Peer: 127.0.0.1:8228
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Client-Warning: Missing Authenticate header
Title: 401 Authorization Required
X-Pad: avoid browser bug


Expected:
Location: /docs/protected/get_me.html
Set-Cookie: Sample::AuthCookieHandler_WhatEver=programmer:Heroo; path=/
Code: 302
ok 11
ok 12
ok 13
Location: /docs/authany/get_me.html
Set-Cookie: Sample::AuthCookieHandler_WhatEver=some-user:mypassword; path=/
Code: 302
ok 14
code: 200
not ok 15
Result: Connection: close
Date: Tue, 10 Jun 2003 19:16:26 GMT
Accept-Ranges: bytes
ETag: "1a4039-a8-3ce29115"
Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_ssl/2.8.9 OpenSSL/0.9.6g
mod_
erl/1.26
Content-Length: 168
Content-Type: text/html
Last-Modified: Wed, 15 May 2002 16:47:17 GMT
Client-Date: Tue, 10 Jun 2003 19:16:26 GMT
Client-Peer: 127.0.0.1:8228
Client-Response-Num: 1
Title: Congratulations


Expected:
ok 16
ok 17
FAILED tests 10, 15
Failed 2/17 tests, 88.24% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed

---
t/real.t  172  11.76%  10 15
Failed 1/1 test scripts, 0.00% okay. 2/17 subtests failed, 88.24% okay.
make: *** [run_tests] Error 11



Re: Does perl have Failover with Open Source Web Platforms?

2003-03-13 Thread Jay Thorne
On March 13, 2003 11:48 am, Richard Heintze wrote:
> My client is partial to perl so I installed mod_perl
> on Apache HTTPD on his windows servers.
>
> Now, however, he wants to price a linux cluster with
> raid to replace his windows servers.
>
> He needs declarative role based authorization and
> authentication for his web site -- and maybe fault
> tolerance too depending on the price of the hardware
> for a linux server.
>
> JBoss is cheap and open source with these features.

And its java and may not perform as well as well formed mod_perl, but I'm 
probably opining from my impressions based on BEA on slowlaris compared to 
mod_perl on linux.

> My client, however, is partial to perl. How can we get
> perl with failover on a linux cluster?

Lots of different ways. Depends on where you want the failover;

If a 30 second delay is acceptable, even round robin dns forms a type of 
failover. If the first ip fails, the browser tries the second, etc. 

Then you separate application server from db, and put the db on some kind of 
redundancy/failover; like a app level retry list, a OS level failover, with 
proxy ARP and whatever to minimize downtime etc.

An overview of OS level failover on linux:
http://www.linuxvirtualserver.org/Documents.html

So in summary, failover is a big fat word with lots of meaning. 

The faster you want it, the more money you spend. A 30 second failover was 
good enough for me, so I used round robin dns. Your mileage my vary.

> Also, what are your favorite hardware vendors for
> linux clusters?

Whitebox hardware with name brand components, but I'm cheap.

This is another question that is too broad. What level of service do you 
require? My local clone shop knows dick about linux but is happy to sell me 
machines with no OS loaded. You may want Scyld.com or one of the other 
cluster specialists if you are talking getting vendor expertise. They tend to 
focus on compute clusters, not web.


-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org



mod_perl and apache 2.x

2002-09-10 Thread Jay Thorne

Are there plans to make the new mod_perl backwards compatible?

I tried a few months ago to move my faily large app to apache 2.x and mod perl 
and far far too many things are different. I'd love to experiment with the 
new code base, but this lack of compatibility is a show stopper for me. I 
don't have the time to re-code the entire thing. 

Failing that, is there a way to at least get print to work? Or have later 
mod_perl releases fixed that?

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org




Re: SSI and mod_perl

2002-08-27 Thread Jay Thorne

On August 27, 2002 03:32 pm, Randy Kobes wrote:
> > Thats close to what I want to do, but as the existing code has its entry
> > already in the webserver config.
> >
> > What I mean is something like "$r->next(mod_include); OK;"
> > or items to that effect.
> >
> > Is there a direct apache api hook I can use to tell the system to call
> > mod_include with the current content?
>
> The Apache-WinBitHack module, available through
> http://www.modperlcookbook.org/download/, may do something
> similar to what you want - after it's through, it does
>$r->handler('server-parsed');
>return OK;
> to let mod_include pick things up from there.

Darn. After reading what handler does, its not quite what I need. It would 
send the whole request to mod_include. as the uri is a virtual one handled 
entirely in the perl module, there's no file for mod_include to jump on.  I 
was trying to avoid Apache::SSI and its brethren, and just jump back into 
mod_include. 

It appears after Yet Another rereading of the apache.pm doc, that since 
mod_perl normally hooks into almost all request phases, this kind of 
functionality is not really there. Its assumed on the part of the mod_perl 
code that if you are in mod_perl you'll want to stay there, not post process 
with other modules.

I'm using mod_gzip and it hooks into a very late phase that mod_perl leaves 
alone. My config includes an item: mod_gzip_item_include   handler 
^perl-script$. Which, if I understand it, instructs gzip to process output of 
that named handler.

I guess I'm kind of asking for a way to tell mod_include to participate after 
the perl handler has returned. And if I understand mod_include, it doesn't 
want to participate that late.

Thanks  for the pointers, all. It looks like I'm stuck with Apache::SSI or 
DIY. Right now I'm DIY, and after getting bitten by a bug I thought I could 
just use mod include and avoid these kind of bugs in the future.


-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org




Re: SSI and mod_perl

2002-08-27 Thread Jay Thorne

On August 27, 2002 02:16 pm, Per Einar Ellefsen wrote:
> At 23:09 27.08.2002, Jay Thorne wrote:
> >In a mod_perl handler, in the m_p1.x/apache1.3 api, Is there a quick way
> > to tell apache
> >"I'm done, here's my content, and I want you to run this through
> > mod_include before you send it to the user"
>
> You might want to try a filter, for example Apache::OutputChain, see
> http://perl.apache.org/docs/1.0/guide/modules.html#Apache__OutputChainC
>hain_Stacked_Perl_Handlers and the Apache::OutputChain manpage formore
> information. The same is true for Apache::Filter:
> http://perl.apache.org/docs/1.0/guide/modules.html#Apache__Filter___Alter_t
>he_output_of_previous_handlers . Both provide approximately the same
> functionality.

Thats close to what I want to do, but as the existing code has its entry 
already in the webserver config.

What I mean is something like "$r->next(mod_include); OK;"
or items to that effect.

Is there a direct apache api hook I can use to tell the system to call 
mod_include with the current content?


-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org




SSI and mod_perl

2002-08-27 Thread Jay Thorne

In a mod_perl handler, in the m_p1.x/apache1.3 api, Is there a quick way to 
tell apache 
"I'm done, here's my content, and I want you to run this through mod_include 
before you send it to the user"

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org




Re: modperl and SQL db select

2002-03-21 Thread Jay Thorne

On March 21, 2002 01:05 pm, Dave Rolsky wrote:
> On Thu, 21 Mar 2002, Jay Thorne wrote:
> > The first one I noted was that he assumes that a high performance app has
> > several joins. I think everyone here who's developed a few db apps will
> > tell you that joins are hugely costly and should be avoided for an
> > application's most common cases.
>
> Actually, I've developed _more_ than a few DB apps and I'd tell you that
> joins are not only _not_ hugely costly, but can sometimes be a performance
> improvement.
>
> It really depends on a lot of factors including what RDBMS you are using,
> how many connections you have, ratio of reads to writes, how complicated
> the joins are.
>
> But a blanket statement like that is flat out wrong.

Okay, now I need an example. I've never seen a query on any db where a single 
table query was slower than a two table join. Of course, I'm biased here, 
since my knowledge of the more bizarre db's is limited. I've only seen things 
like sybase, oracle, mysql, postgres and mssql. 


-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org



Re: modperl and SQL db select

2002-03-21 Thread Jay Thorne

On March 21, 2002 10:37 am, darren chamberlain wrote:
> Quoting Dave Hodgkinson <[EMAIL PROTECTED]> [Mar 21, 2002 13:25]:
> > darren chamberlain <[EMAIL PROTECTED]> writes:
> > > Quoting dreamwvr <[EMAIL PROTECTED]> [Mar 21, 2002 13:10]:
> > > > Is there any issue with using modperl with postgres vs mysql
> > > > for a database driven website? Don't want to bark up the wrong
> > > > tree in a mod_perl project only to discover I picked the wrong
> > > > .db :-/
> > >
> > > Take a look at
> > > http://www.phpbuilder.com/columns/tim2705.php3>, in which the
> > > author discusses why Sourceforge uses postgresql
> > > instead of MySQL.  It's a little dated (the postgres version is
> > > 7.1, for example) but a fun read.

Note that a couple of his assertions in this document would be rather naive.

The first one I noted was that he assumes that a high performance app has 
several joins. I think everyone here who's developed a few db apps will tell 
you that joins are hugely costly and should be avoided for an application's 
most common cases. 

I recoded a mysql/mod_perl web app with a couple of joins to a slightly but 
not horridly denormalized db structure and realized some huge performance 
gains. 

Further on, he was discussing threaded discussion forums and assumed a 
recursive query. While recursing the DATA is probably (though provabably not 
always) necessary, there is no need to storm the db with that many queries, 
since query setup time, queing, and results extraction have noticable time 
penalties. Extracting the data with a single query and recursing it in RAM is 
a much more db and cpu friendly idea. 

So is time dependent caching. How many inserts into a table per second do you 
expect? For your average discussion thing, maybe one new comment per minute. 
With a one minute cache on the db data, suddenly your speed limits are 
removed. Why would you need to requery the db if you don't expect it to 
change? This is the joy of mod_perl, being able to keep some context of your 
_application_ between hits of your _users_.


As for performance, mysql and postgresql are getting pretty similar results, 
_these_ days. With aggressive app level caching of db data, and the innodb 
table handler, I was able to push mysql and mod_perl to 80+ 50kbyte page 
views per second on bog standard 650 mhz intel hardware. 

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org



Re: [ANNOUNCE] The New "mod_perl" logo - results now in...

2002-03-16 Thread Jay Lawrence

DR>I really like the new logo, and in fact I voted for it. However, I just
DR>realized that the logo uses "modperl", whereas mod_perl's name is
DR>"mod_perl", with the underscore. Does anyone else see this as a problem?

BM>It's a graphic design so I don't see that it needs to follow the Apache
BM>module naming convention exactly... It's a design -- it doesn't have to
BM>be accurate to the name.

A thought - what about putting the suggestion of an underscore by
putting bars underneath the d and p of "modperl"? Just a suggestion
to Michael as presumably he is revisting the design for the buttons.

J




FYI Small hints for modules using directives

2002-03-16 Thread Jay Lawrence


If anyone out there's building modules with directives you'll know 
that its a tricky business. I ran across two problems and related 
solutions. (Thanks for nudging me along for #1 Geoff - but #2 I solved 
 all by my lonesome!)
 
 FIRST HINT - Modules compirised of several files and make Apache 
 Directives:
 
  - Apache::ExtUtils is a bit more fussy than the regular ExtUtils 
about paths for loading subfiles of a package.
 
  - Can't load main module to resolve function prototypes at 
perl Makefile.PL
 
 I found I had to take the following approach. Imagine that I have a
sub module to Apache::Clean (see Listing 7.9 as a basis) called, say,
Apache::Clean::Exception. That means in my module's directory I would
have:
 
   Clean.pm
   Clean/Exception.pm
 
 In the module Clean.pm I would load the related Exception module:
 
   use Apache::Clean::Exception;
 
 In modules that I have written where it does not use Apache::ExtUtils
in Makefile.PL this is not a problem - so I know I'm not toally out to 
lunch! Turns out what is happening is that Apache::ExtUtils tries to 
 "use Apache::Clean" which ends up failing because the "use 
 Apache::Clean::Exception" therein fails. The INC path isn't tweaked 
 appropriately.
 
 I tried to structure my packages like:
 
   lib/Apache/Clean.pm
   lib/Apache/Clean/Exception.pm
 
 and
 
   Apache/Clean.pm
   Apache/Clean/Exception.pm
 
 They didn't work either. Hmmm. Odd. Well, I still want that module to 
 load at some point - so what do I do?
 
 Once the module is built and properly installed things go away - so my 
 module isn't really problem - that leaves Makefile.PL and friends. Ah 
 ha! Why not pre-load Apache::Clean::Exception (the problem in the 
 first place) from Makefile.PL?
 
 So put my files back to how I wanted them in the first place:
 
   Clean.pm
   Clean/Exception.pm
   Makefile.PL
 
 And inside of Makefile.PL I put:
 
 package Apache::Clean;
 
 require "Clean/Exception.pm";
# however that doesn't quite do the trick since
# it must show as Apache::Clean::Exception having been loaded
# this is just Clean::Exception - which is not the same
# - solution? Fiddle with %INC
 
 $INC{'Apache/Clean/Exception.pm'}=$INC{'Clean/Exception'};
 
 # Of course you could change your module's directory structure to
# feature Apache in the path to begin with.
 
 __END__
 Now things work nicely for me!
 
 
 --
 SECOND HINT - Modules that use directives are testy about being tested
 
 If you reference one of these modules via PREREQ_PM or try some tests 
 outside of Apache (it IS possible after all) they will fail at the 
 bootstrap method.
 
 in your module (ie/ Clean.pm) change:
 
 PACKAGE__->bootstrap($VERSION);
 
 to
 
 PACKAGE__->bootstrap($VERSION) if $ENV{'mod_perl'};
 
 Voila - at least now you should have no complaints via MakeMaker 
 checking for PREREQ_PM and you can even do some tests - which no doubt 
 you've been anxious to write!!
 
 ---
 Did all that make sense? I hope so - if not I shall endevour to 
 clarify.
 
 Cheers,
 Jay
 
 




Re: Storable segfaulting

2002-02-18 Thread Jay Thorne

On February 18, 2002 02:56 am, raptor wrote:
> hi,
>
>
> I have object that inherit Storable... so I store the object.. later
> when I try to "retrieve" the object I get :
>
> Segmentation fault (11)
>
> Mandrake 8.1, Storable 1.012
Have you tried testing the machine's ram with memtest86? you might actually 
have bad ram. Segfault is one of the symptoms. 

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org
MS should publish history books. Each two years, you get a nice revision ;) - 
Jean Francois Pare



Re: mod_perl, mod_gzip, incredible suckage

2002-02-14 Thread Jay Thorne

On February 14, 2002 01:57 pm, Stephen Clouse wrote:
> On Thu, Feb 14, 2002 at 11:59:02AM -0800, Jeffrey W. Baker wrote:
> > Does mod_gzip suck or what?  Some of you claim to use it.  Now is the
> > time to confess.  How do you get it to work?
>
> Compile it.  Install it.  Works brilliantly.
>
> Don't know what your problem might be.  Please share offlist, perhaps I can
> help debug it.

Ditto here. Working quite well on fairly high volume servers.

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org
MS should publish history books. Each two years, you get a nice revision ;) - 
Jean Francois Pare



Re: Cookie as session store

2002-02-14 Thread Jay Lawrence

Jeffrey - interesting point!

What did you have in mind to encrypt the cookie data? Perhaps you could use
Storable to serialize data structure then convert, crypt to scramble and
then MIME64 to text encode?

I agree with you on processing delays - that is probably the biggest
drawback to needing to send cookies as part
of response header. Using Template Toolkit a lot myself, I have to make a
workaround to handle the cookie situation
as well.

I've got a tied interface to Apache::Cookie's mostly completed - it would be
easy to add the encryption that you describe above to
them. See: http://www.infonium.com/perl/  for a link to Apache::Tie::Cookie.
Featuring tied interface and lazy (demand) loading of cookie data.

Jay

- Original Message -
From: "Jeffrey W. Baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 13, 2002 3:00 PM
Subject: Cookie as session store


> I have sometimes proposed or recommended schemes of storing session
> information in an HTTP cookie, encoded and protected by cryptographic
> digest.  I know some people on this list have implemented similar
> schemes, but I have never actually had occasion to do so.  Now I am
> doing that, and I realize the chief drawback to this scheme: all session
> information has to be set before generating any HTML output.  The chief
> advantage is no requirement for server-side storage of session.
>
> For certain applications, saving all output until the session is
> serialized may significantly increase the latency of the first data
> packet in the HTTP response.
>
> -jwb
>
>
>
>




Re: Indentifying dir_config's

2002-02-02 Thread Jay Lawrence

Robert - that's along the lines of what I'm after. My nuance is that I might
have several different configurations for the server - since there are
several
different containers that have different PerlSetVar directives.

In my example below a call to "/test" is going to have a different config
to a call to "/different" or a call to "/". How can I do three different
intializations for these different configurations and then keep track of
them for the remaining requests?

Jay

- Original Message -
From: "Robert Landrum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 01, 2002 5:02 PM
Subject: Re: Indentifying dir_config's


> At 1:39 PM -0800 2/1/02, [EMAIL PROTECTED] wrote:
> >I'm wondering if there is a way that I can mark or remeber that
> >I've seen a particular dir_config during a previous request. The
> >motivation is performance related - so that I can set up for
> >particular set of "PerlSetVar" values only the once. Then
> >subseqeuent requests to that child will use a previously
> >determined value (instanciated object).
> >
> >IE: in my httpd.conf I have -
> >
> >PerlSetVar myvalue 100
> >
> >
> > PerlSetVar myvalue 200
> >
> >
> >
> > PerlSetVar myvalue 300
> >
> >
> >So - request 1 - GET /test
> > I check dir_config("myvalue") and setup.
> > Can I mark that I was here; sorta like the equivalent of
> > 
> > PerlSetVar myvalue   200
> > PerlSetVar signature myvalue_200
> > 
> >
>
> I'm not sure if I understand...
>
> I've done something in one of my modues in the past...
>
> package MyHandler;
>
> our $INITED = 0;
>
> our %CONFIG = ();
>
> sub handler {
>  
>  unless($INITED) {
>  %CONFIG = $self->get_config($r);
>  $INITED = 1;
>  }
>  
> }
>
>
> That way I only have to get_config once per forked process...  This
> is very useful for static (or near static) data.  In this example
> get_config was pulling configuration directives from an Oracle
> database.
>
> Rob
>
>
>
>
> --
> When I used a Mac, they laughed because I had no command prompt. When
> I used Linux, they laughed because I had no GUI.
>




Indentifying dir_config's

2002-02-01 Thread jay

I'm wondering if there is a way that I can mark or remeber that
I've seen a particular dir_config during a previous request. The
motivation is performance related - so that I can set up for
particular set of "PerlSetVar" values only the once. Then
subseqeuent requests to that child will use a previously
determined value (instanciated object).

IE: in my httpd.conf I have -

PerlSetVar myvalue 100


PerlSetVar myvalue 200



PerlSetVar myvalue 300


So - request 1 - GET /test
I check dir_config("myvalue") and setup.
Can I mark that I was here; sorta like the equivalent of

PerlSetVar myvalue   200
PerlSetVar signature myvalue_200


request 2 - GET /test
I want to know I was here before because I see
that signature was set and I'll recall that.

I was hoping that would work but setting a dir_config seems to
go into the server-level and not to the calling container.

Would there be another approach? Perhaps there is already a
signature that would help me uniquely identify which set of
containers made the call?

Worst case scenario I could hash all the dir_config values and
use that as my signature - but I was hoping there would be
something cheaper to do. :)

TIA and if this is unclear let me know and I'll get more detailed.






Re: mod_perl Developer's Cookbook

2002-01-31 Thread Jay Lawrence

For the Canadians out there you can get it at Chapters.Indigo.CA too

Search for "Geoffrey Young" as "mod_perl" does not come up through their
search engine.

Jay

- Original Message -
From: "___cliff rayman___" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 12:29 PM
Subject: Re: mod_perl Developer's Cookbook


> ordered my today through the website (puts a little extra money
> in the hands of mod_perlers:
>
> http://www.modperlcookbook.org/
>
> cliff
>
> Matt Sergeant wrote:
>
> > My copy just arrived! I'll try and get through most of it as fast as I
can
> > and post a review.
> >
> > Congrats Geoff, Paul and Randy. Looks great at first glance.
> >
> > --
> > 
> > <:->Get a smart net
>
> --
> ___cliff [EMAIL PROTECTED]http://www.genwax.com/
>
>
>




RE: New mod_perl Logo

2002-01-30 Thread Jay Lawrence

I looked at some of the candidates at
http://wypug.digital-word.com/mod_perl/
must confess I am partial to
http://wypug.digital-word.com/mod_perl/logos/louise_bramald_1.jpg so far

Thinking camels for Perl and feathers for Apache putting them together all I
could see is "flying camels" - is that too close to "flaming logos"?

That's my 0.02CAD which is substantially less than 0.02USD... ;-)

J




Re: Apache::Session getting DESTROYed in wrong order

2002-01-18 Thread Jay Lawrence

I register a clean up handler to explicitly untie the session variable. I am
not
sure how to do this in the setup you have running...so I can't be of much
explicit help.

Jay

- Original Message - 
From: "Ken Williams" <[EMAIL PROTECTED]>
To: "Perrin Harkins" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, January 18, 2002 1:53 AM
Subject: Re: Apache::Session getting DESTROYed in wrong order


> 
> On Friday, January 18, 2002, at 12:44 AM, Perrin Harkins wrote:
> 
> >> In a Mason context, which is where I'm using it, I do this in my
> >> top-level autohandler (ignore the main:: subroutines, they're just for
> >> pedagogy):
> >>
> >>
> >> <%init>
> >>   # 'local' so it's available to lower-level components
> >>   local *session;
> >>
> >>   my $dbh = &::get_dbh;
> >>   my $session_id = &::get_cookie('_session_id');
> >>   tie %session, 'Apache::Session::MySQL', $session_id,
> >>{Handle => $dbh, LockHandle => $dbh};
> >>   ...
> >> 
> >
> > Geez, that's awfully confusing to look at (local and typeglobs is not a
> > newbie-friendly combo).  Isn't there a simpler way?  What about putting
> > it in pnotes?
> 
> I don't think there's a simpler way.  Putting it in pnotes means that 
> all other components will also have to use $r->pnotes('session'), rather 
> than just using %session.
> 
> Perhaps "local(*session)" is better than "local *session"?  It at least 
> looks less like a "pointer to local".  ;-)
> 
>   -Ken
> 
> 




Re: PREANNOUNCE Tied Request and Cookies Module

2002-01-12 Thread Jay Lawrence

George,

Thanks for your feedback. I got another message of the same nature. *blush*
why didn't I think of this!

I have almost ready to release:

Apache::Tie::Request
and
Apache::Tie::Cookie

J

- Original Message -
From: "George Sanderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Jay Lawrence" <[EMAIL PROTECTED]>
Sent: Saturday, January 12, 2002 10:28 AM
Subject: Re: PREANNOUNCE Tied Request and Cookies Module


> At 10:18 PM 1/7/2002 -0500, Jay Lawrence wrote:
> >
> >I am thinking of names such as:
> >
> >Apache::Request::Tied
> >or Apache::Args::Tied
> >and
> >Apache::Cookies::Tied
> >and
> >Apache::RequestFiles::Tied
> >
> >or possibly:
> >Apache::Tied::Request, etc.
> >
> >Any interest, comments, suggestions,
>
> Personally, I like placing the most significant part first and using a
> verb, so how about:
> Apache::Tie::...
> and so forth?
>
>
> ++
> | George Sanderson <[EMAIL PROTECTED]>
> | http://www.xorgate.com
> ++
>
>




Re: Exception::Handler

2002-01-11 Thread Jay Lawrence

For what it is worth - I would encourage you to check out the Error package
as well.

Rather than:

 eval { };
  if ($@->isa('FooException')) {
  # ...
  } elsif ($@->isa('BarException')) {
  # ...
  } else {
  # ...
  }

You would have:
try {
code;
} catch FooException with {
code for FooExceptions;
} catch BarException with {
code for BarExceptions;
} otherwise {
};

And you can throw exceptions with details on the nature of the exception:

throw FooException ( -text => "You foo'ed at line bar", -value =>
$line );

and in the try block:

try {
do foo;
} catch FooException with {
my $exception=shift;
print "Uh oh, we have a problem with foo: " . $exception->text;
};

Jay

- Original Message -
From: "Tatsuhiko Miyagawa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Dave Rolsky" <[EMAIL PROTECTED]>; "Matt Sergeant" <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 8:07 AM
Subject: RFC: Exception::Handler


> Seeing through Dave Rolsky's Exception::Class and
> Sig::PackageScoped has let me make the following module, called
> Exception::Handler.
>
> In fact I rarely use $SIG{__DIE__} for exception handling, but the
> concept of the module would be a bit interesting. Especially
>
>   eval { };
>   if ($@->isa('FooException')) {
>   # ...
>   } elsif ($@->isa('BarException')) {
>   # ...
>   } else {
>   # ...
>   }
>
> code like this can be greatly simplified.
>
> Any suggestions welcome, escpecially from gurus of exception, Matt
> and Dave ;)  See t/*.t for typical usage.
>
> http://bulknews.net/lib/archives/Exception-Handler-0.01.tar.gz
>
> NAME
> Exception::Handler - Hierarchical exception handling
>
> SYNOPSIS
>   use Exception::Class
>   'MyException',
>   'AnotherException' => { isa => 'MyException' },
>   'YetAnotherException' => { isa => 'AnotherException' },
>   'FooBarException';
>
>   use Exception::Handler
>   MyException => \&my_handler,
>   AnotherException => \&another_handler,
>   __DEFAULT__ => \&default_handler;
>
>   eval { MyException->throw };  # my_handler()
>   eval { AnotherException->throw; };# another_handler()
>   eval { YetAnotherException->throw; }; # another_handler() :
hierarchical
>   eval { FooBarException->throw; }; # default_handler()
>
>   sub my_handler {
>   my $exception = shift;
>   # ...
>   }
>
>   sub another_handler { }
>   sub default_handler { }
>
> DESCRIPTION
> Exception::Handler allows you to handle exception with various subs
each
> of which registered for an appropriate class of exception. This module
> can nicely work with Dave Rolsky's Exception::Class and Grahamm Barr's
> Error module.
>
> TODO
> *   Lexical handler, which may be done via "local".
>
> AUTHOR
> Tatsuhiko Miyagawa <[EMAIL PROTECTED]>
>
> This library is free software; you can redistribute it and/or
modify
> it under the same terms as Perl itself.
>
> SEE ALSO
> Exception::Class, Sig::PackageScoped
>
>
>
> --
> Tatsuhiko Miyagawa <[EMAIL PROTECTED]>
>
>




Re: take23 and what we're doing - EDDS

2002-01-08 Thread jay

EDDS

There are few things more sure in life than death and taxes. Ok,
well I can think of one more - tax forms!

The Canada Customs and Revenue Agency (CCRA - our Federal tax
collection agency - like the infamous IRS) has a collection of
approximate 10,000 forms, guides and other publications that
require management and control.

For the past 6 or 7 years these forms were managed using a
proprietary database software that was costly to maintain and
difficult to extend. As well the system was housed on aging SPARC
processors. In order to meet on going and changing business
requirements the system would need to be upgraded or replaced. It
turns out that by using mod_perl, Linux and MySQL plus some
contracting time the entire system was replaced for the cost of 1
years operation costs.

A customized document management system was created to meet the
unique business requirements of the forms management group at
CCRA. This includes document versioning and multiple document
formats for each document name. The filing and classification
methods are continuously evolving and so the addition and
decomission of some metadata fields is necessary.

New documents are created by either starting a new version of an
existing form or document or creating a new document header
record. Then each document format, PDF, MS Word, Form Flow, etc.,
is uploaded using the file upload feature and the libapreq module
to decode the uploaded files.

Since security is a concern - we cannot place access to this
document collection on the internet. Instead we must report out
files and then use rsync to move our data to a staging server. By
using Perl we have been able to change from a weekly reporting
cycle to a daily reporting cycle. As well, by using Perl we have
been able to fix some really nasty decisions that were made 6 or
7 years ago when publishing to the web was an unknown process to
most. Finally, by dumping the old software CCRA and its clients
were able to chuck out all those modems and go via the web.

Perl is practical for extracting and reporting - the turnaround
time and cost effectiveness of this project is a testimony to
that claim!

Jay Lawrence





Re: take23 and what we're doing - TERMIUMplus

2002-01-08 Thread jay


TERMIUMplus
---

TERMIUMplus (www.termium.com) is a trilingual application that
allows translators and terminologists to search a collection of
1.5 million entries in English, French and Spansih. The system is
freely available to any employee of the Canadian Federal
government as well as by subscription to individuals and
organizations outside. The terms and the user interface are both
trilingual.

mod_perl plays an integral role in the success of this system.
Because the server experiences significant amounts of traffic
during the middle of the day effecient request handling is of
paramount concern. It is not uncommon to be servicing over 100
concurrent requests at 2pm. Not only does the system perform very
well but it is also very stable. I don't think our httpd's have
ever crashed - and almost all requests are in the sub-second
response range.

If great performance and stability were not enough - mod_perl
(Perl) - has allowed us to provide a very easy to use and
enjoyable interface to our database servers. The servers are
actually on NT running a proprietary database software package.
The database software is very good at performing both full text
and exact term searches of the term data. However, the software
interface to the databse engines is weak and unusable at best. By
using Perl to talk to the database server's HTTP interface we
were able to extract the desired results data and then use Perl's
power to reformat the results into something pleasing and
tailored to the user's preferences. Because each record has over
100 fields and each field can have a number of sub components - I
don't think the job would be doable in any other language than
Perl! In addition to reformatting the output of the database we
also employ some processing of search terms. This processing is
unique to our data collection but helps increase recall by
eliminating stopwords such as "a", "an", "le", "les", etc. 

In addition to the fancy user interface TERMIUMplus also offers a
server-to-server term translation service. This allows other
search engines to offer on-the-fly term translation as part of
their service. An excellent feature when dealing with a bi or
tri-lingual document corpus. You are welcome to see this yourself
by visiting:

  http://strategis.ic.gc.ca/engdoc/search.html

Check on Bilingual search and try a word such as "turbofan". As a
note, I am not aware of what software the Strategis search system
was built with.

The entire system runs on a dual processor Sun 250 with 2G of RAM
(We discovered how important lots of RAM is for this level of
concurrent user activity) for the front end of the request
processing. For the database queries we have 2 quad Xeon NT boxes
which we divide between Extranet and Internet traffic. We will be
replacing the Sun 250 with a quad processor Sun 450 with 8G of
RAM.

In addition to mod_perl we use MySQL as our user sessions
database and intend to start replacing many functions of our
proprietary back end database with functions developed using
mod_perl and MySQL. Linux is our front-line development system
and CVS is our versioning management system. We use CVS to then
move our work on to a Sun staging system for pre-release testing
and then finally rsync to push final code on to production
servers. All of our code runs as well on Linux as it does on
Solaris - with no modifications other than compile time options
for the major packages of the application.

I feel that using mod_perl to build TERMIUMplus has allowed for
the construction of a high quality service which is capable of
handling a significant user load. It is very rare (never?) that
we experienced any major problems with the Apache, mod_perl, and
Perl portion of our system. Most of our operational difficulties
are coming from our vendor supplied software at the database
backend where daily server problems are experienced.

Software costs aside I wouldn't build this appliation using
anything but mod_perl, Apache and MySQL!

Jay Lawrence





PREANNOUNCE Tied Request and Cookies Module

2002-01-07 Thread Jay Lawrence

Hello All,

I have written a couple modules to provide tied access to GET/POST arguments
of an Apache request. Basically hides the mechanics of libapreq behind a
tied hash. On a similiar vein I have one for cookies. The nice thing about
the cookies one is that it will set headers automatically for you when you
untie it. I will also be writing one for posted and PUT files.

Both are lazy in that they do not do any processing until the first access
of a hash element. I like this strategy since I often use templates. I want
to make all these features available to the templates but not incur
unnecessary processing overhead if the information is not used.

I am thinking of names such as:

Apache::Request::Tied
or Apache::Args::Tied
and
Apache::Cookies::Tied
and
Apache::RequestFiles::Tied

or possibly:
Apache::Tied::Request, etc.

Any interest, comments, suggestions,

Yours,
Jay




Re: Comparison of different caching schemes

2001-12-14 Thread Jay Thorne

On December 14, 2001 03:53 pm, Robert Landrum wrote:
> At 6:04 PM -0500 12/14/01, Perrin Harkins wrote:
> >That's actually a bit different.  That would fail to notice updates
> > between processes until the in-memory cache was cleared.  Still very
> > useful for read-only data or data that can be out of sync for some period
> > though.
>
> The primary problem with everything mentioned thus far is that they
> are almost entirely based around the concept of a single server.
> Caching schemes that are both fast and work across multiple servers
> and process instances are very hard to find.  After reading the eToys
> article, I decided that BerkeleyDB was worth a look.  We discovered
> that it was very fast and would make a great cache for some of our
> commonly used database queries.  The problem was that we are running
> on 5 different servers, load balanced by Big/IP.  Again, taking my
> que from the eToys article, I began working on a data exchange system
> (using perl instead of C) which multicasts data packets to the
> "listening" servers.  So far, our only problems have been with the
> deadlocking (solved with db_deadlock), and a few corrupt records.
>

We did stuff based on kind of an "Acceptable differences" concept.

Using round robinn dns, with predominantly winXX clients, you tend to get the 
same IP address from one request to tthe next. Changing, IIRC, on the dns 
cache timeout, from the soa record.  With a bigIP or something, you can 
guarantee this user locality.

So that leaves you with *appearing* to be in sync for the one local machine.

Using a database with common connections from multiple machines or the "one 
writer db machine, many read db machines" concept, using replication or what 
have you for updates, you can present a pretty consistent database view, with 
a maximum difference on the read side of the replication time.

We found that the database concept, plus using a local cache with a timeout 
of 5 seconds not only gave us a huge performance increase, but it gave us a 
maximum of about 6 seconds of data difference between machines. And since 
your average human viewer hits pages no faster than once every 20 seconds or 
so, it was pretty much invisible to the individual user. Of course search 
engines will be faster than this, but does being consistent for search 
engines matter all that much?


> I'm considering uploading to CPAN the stuff I've written for the
> caching, but haven't had the time to make it generic enough.  I also
> haven't performed any benchmarks other than the "Wow, that's a lot
> faster" benchmark.  One limitation to the stuff I've written is that
> the daemons (listeners) are non threaded, non forking.  That and it's
> all based on UDP.
>
>
> Rob

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org



Re: Comparison of different caching schemes

2001-12-14 Thread Jay Thorne

On December 14, 2001 03:04 pm, Perrin Harkins wrote:
> > So our solution was caching in-process with just a hash, and using a
> > DBI/mysql persistent store.
> > in pseudo code
> > sub get_stuff {
> > if (! $cache{$whatever} ) {
> > if !( $cache{whatever} = dbi_lookup()) {
> > $cache{$whatever}=derive_data_from_original_source($whatever);
> > dbi_save($cache_whatever);
> > }
> > }
> > $cache{$whatever}
> > }
>
> That's actually a bit different.  That would fail to notice updates between
> processes until the in-memory cache was cleared.  Still very useful for
> read-only data or data that can be out of sync for some period though.
>
> > The filesystem based / time sensitive aging is a nice little thing we
>
> should
>
> > put up in CPAN. We've just not done so yet.
>
> How does it differ from the other solutions like Cache::FileCache?  Is it
> something you could add to an existing module?
>

Performance,and key structure, semantics. Its mostly different, not 
better/worse.

=pod

=head1 NAME

UFMEDIA::CacheOneFile - cache a scalar value in a file on disk

=head1 SYNOPSIS

 use UFMEDIA::CacheOneFile;

 my $cache = new UFMEDIA::CacheOneFile(
 cache_file => '/var/cache/myapp/flurge.cache',
 max_age=> 30,
 refill_sub => sub { recalculate_flurges(31337, 'blue', 42) },
 );

 my $value = $cache->get_value;

=head1 DESCRIPTION

UFMEDIA::CacheOneFile enables you to cache a single scalar value in a file
on disk.  Given a filename under a writable directory, a maximum age, and
a reference to a refill subroutine, a cache object will cache the result
of the refill subroutine in the file the first time B is called,
and use the cached value for subsequent calls to B until 
B the cach
e file is more than B seconds old.

If multiple processes share a single cache file, the first process that
reads the cache file after it has expired will take responsibility for
replacing it with an up-to-date copy.  Other processes needing up-to-date
information will wait for this to finish and will then use the new value.

=head1 AUTHOR

Mike Lyons <[EMAIL PROTECTED]>

=head1 SEE ALSO

perl(1).

=cut


> - Perrin

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org



Re: Comparison of different caching schemes

2001-12-14 Thread Jay Thorne

On December 14, 2001 12:59 pm, Dave Rolsky wrote:
> On Fri, 14 Dec 2001, Perrin Harkins wrote:
> > The thing you were missing is that on an OS with an aggressively caching
> > filesystem (like Linux), frequently read files will end up cached in RAM
> > anyway.  The kernel can usually do a better job of managing an efficient
> > cache than your program can.
>
> Plus for some reason IPC overhead seems to seriously degrade as the size
> of the overall shared memory segment increases.  I'm not sure why this is
> but I think the docs for IPC::Shareable mention this.  Maybe for _very_
> small amounts of data, shared memory might still be a win.
>

Very interesting. We at UF were using IPC caching, in earlier versions of our 
comment system. We turfed it for several reasons.

 - Locking and storage were taking appreciable wall clock time.
 - We had a large memory footprint anyway, and a per-process hash did not 
actually add all that much.
 - IPC was persistent over server instances, but we already had a dbi 
connection, and that is persistent over system reboots as well. 

The earlier version was topping out at about 8 hits per second.

So our solution was caching in-process with just a hash, and using a 
DBI/mysql persistent store. 
in pseudo code
sub get_stuff {
if (! $cache{$whatever} ) {
if !( $cache{whatever} = dbi_lookup()) {
$cache{$whatever}=derive_data_from_original_source($whatever);
dbi_save($cache_whatever);
}
}
$cache{$whatever}
}

Thanks to that and another local content cache implemented with the file 
system with time based aging, UF's latest version of the system can do over 
100 page views per second on a relatively modest machine (P3 700, 256M IDE, 
linux 2.2.x)

The filesystem based / time sensitive aging is a nice little thing we should 
put up in CPAN. We've just not done so yet.

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org



Re: Re(2): Apache::SizeLimit Exit is Delayed

2001-12-11 Thread Jay Thorne

On December 11, 2001 04:25 pm, Mod_perl Mailing List wrote:
>
> Hi Perrin,
>
> That was it.  The child exited immediately when I hit the limit with
> KeepAlive Off.  Now the question is:  Is there a way to force an exit even
> with KeepAlive On?
>
> Thanks!
>
> Bob

For what its worth, I'd recommend KeepAlive Off for almost any mod_perl 
deployment. It basically is a waste of memory and a process slot. Especially 
if you put graphics on a separate server.

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org



Q - Apache::Request->new(undef) works?

2001-12-11 Thread Jay Lawrence



Howdy!
 
In my development I neglected to supply the Apache 
request object when I called Apache::Request->new( $r ). Actually $r was 
undef. It still works! I am just wondering if this is expected behaviour and if 
it will be supported going forward or was this just a 
fluke?Thanks,
J


Re: Do virtual hosts need their own servers?

2001-08-16 Thread Jay Thorne

On Thu, 16 Aug 2001 14:24:50 -0400
Dave Baker <[EMAIL PROTECTED]> wrote:

> Compare the memory requirement two sets of perl scripts against the
> memory requirement of doubling the total number of apache processes.
> 
> My personal opinion is that the latter will be a lot more expensive in
> resources.  You might do better do work to optimize/minimize the total
> number of mod_perl instances (separate, lightweight server for images
> and
> static content; turn off keep_alive unless it's definately giving
> positive
> results; etc).

Yes, do turn OFF keep_alive. 

This has the benefit of freeing up heavyweight mod_perl processes sooner.
I do this, and serve graphics from a separate, lightweight server
(thttpd), so I get the best of both worlds.  I'm able to keep the number
of mod_perl processes under 15, while still serving 40 hit per second,
because the bulk of the hits are on graphics, where a full mod_perl server
process is just a waste.

--
Jay Thorne Manager, Systems & Technology, UserFriendly Media, Inc.
http://www.userfriendly.org/



Using PerlTypeHandler and PerlHandler for the same

2001-08-08 Thread Jay Buffington

Hi,

In my httpd.conf file I have: 

SetHandler perl-script
PerlTypeHandler foo
PerlHandler bar


and then in the foo and bar files I have: 

--file foo.pm-
package foo;

sub handler {
my $r = shift;

$r->log_error("I'm in foo.");
}
1;


--file bar.pm-
package bar; 

sub handler {
my $r = shift;

$r->log_error("I'm in bar.");
}
1;


I would expect this experiment would print out "I'm in foo." followed by "I'm in bar." 
to my apache error log.  It only prints "I'm in foo."  If I remove the PerlTypeHandler 
line from the httpd.conf I get only "I'm in bar."  If I leave the TypeHandler but omit 
the PerlHandler, and add $r->push_handlers(PerlHandler=>\&bar::handler); to foo.pm I 
still only get "I'm in foo."

I'm using Perl 5.6 and mod_perl 1.25 with apache 1.3.19 

Why does this not work as I expected?

Thanks.
Jay Buffington



Re: [VERY OT] Inspired by closing comments from the UBB thread.

2001-08-01 Thread Jay Jacobs

My apologies for beating this dead horse...

I am just unable to get my point across at all today.


On Wed, 1 Aug 2001, Kyle Dawkins wrote:

> Tom et al.
>
> > This is, in my opinion, circular logic. Perhaps the reason that you
> > barely have enough time to go to the bathroom is that you're
> > writing the code the wrong way. :-)
>

...my point with that scenario was that there is just too much work to
spend the time writing highly maintainable code that has only the simplest
of maintance tasks.

> Just because we use free and/or open source tools to build our code, doesn't
> mean we can write crap.  We have an obligation to do our duty to whomever we
> work for, and LEARN and apply that learning to our work.
>
> > > There is always more then one way to do it, and there's usually more
> > > then one right way to do it.  Let's keep that in mind.
> >
> > Agreed. However, Perl + HTML + SQL isn't one of the right ways! :-)
>
> Couldn't agree more.  Just because TMTOWDI doesn't mean that all of those
> ways are equal.  Most ways suck, in fact.

Granted, the world is full of incompetance, but if you spent your time
coding for a perfect world in every situation, you could still be working
on the write-up while the next guy is collecting the check for a finished
project and bidding on the next project, might not be bad code, might be
really good code, might really suck, who cares, it works, the customer is
happy and both businesses do well, the down side is some geek may have to
maintain it but they'll get to complain about crappy code and show their
rightousness on a public mailing list.

Don't get me wrong here, I agree with the perfect code... I'd absolutely
love to see a clean solution to embedded html/perl/sql that has fast
performance, fast development and easy maintainability.  I wish that the
technically best way always matched the right way.  And us righteous
developers decided how the world was run. But my misintrepreted point is
that there are situations in which this version of "perfect code" has no
place, even if I can't write them up in an email.





Re: [VERY OT] Inspired by closing comments from the UBB thread.

2001-08-01 Thread Jay Jacobs

On Wed, 1 Aug 2001, Kyle Dawkins wrote:

> Mixing HTML with Perl with SQL is bad and evil on every single possible
> level.

This bugged me... "TMTOWTDI" applies on so many levels.

The "right" way to do something is not always the technically "best" way
to do something.  If you work in a large corporate enviroment with many
hands in the development pot, then hey, I agree, and there should
probably be a corporate document stating the guidelines and restrictions
of developement.

If however you work in a two person company where you have barely enough
time to go to the bathroom let alone think about creating your own
database abstraction layer for a custom application and "maintaining" code
means changing a link once a month.  Then by all means embed away, and
take the quick development path over performance or maintainability.

On the other hand, if you are completely broke and work on a non-profit
project and the only system you have is a P200 with 64M of Memory, then
you may want to think about avoiding templating systems, and doing nothing
but a single module with embedded SQL with Perl and HTML.

There is always more then one way to do it, and there's usually more then
one right way to do it.  Let's keep that in mind.

Jay










Re: [OT] Inspired by closing comments from the UBB thread.

2001-08-01 Thread Jay Jacobs

I wasn't clear enough... My point was more "six one way, half dozen the
other".  For a public package, keeping dependancies down to a minimum is a
bonus, as well as keeping performance up by not having to pre-process html
looking for perl code.  It can come down to a choice between
maintainability and better performance (to whatever degree).  I don't see
any glue-sniffing symptoms from choosing embedded html in perl over
embedded perl in html.

Jay

On Wed, 1 Aug 2001, Perrin Harkins wrote:

> > "not to mention the HTML embedded all throughout the perl (are they on
> > glue?)"
> >
> > What's the alternative there?  Embed perl in the HTML?
>
> You could do that (Text::Template), or you could use a tool like Template
> Toolkit or HTML::Template.  See
> http://perl.apache.org/features/tmpl-cmp.html for a description of the
> available options.
> - Perrin
>
>





Re: [OT] Inspired by closing comments from the UBB thread.

2001-08-01 Thread Jay Jacobs

I'd second the original question, I've always embedded the SQL (what's the
"S"  for?) in the code, isn't that the point of the wonderful DBD::*
packages?  As far as modularizing database calls, there are a couple
reasons I've had problems with that.  I found the methods being rewritten
to handle about as many options as sql itself. (what if I want to sort
differently? what if I need a slightly different statement?).  My solution
is to embed SQL most of the time, modularize basic calls (get_user,
get_group type stuff).



In addition, I'd like to rebut the original statement:

"not to mention the HTML embedded all throughout the perl (are they on
glue?)"

What's the alternative there?  Embed perl in the HTML?





On Wed, 1 Aug 2001, Barry Hoggard wrote:

> I think a lot of people's approach, including mine, is to have OO Perl
> modules for all database access.  In my code (I use Mason), a web page
> only gets its data through calls like this:
>
> my $obj = NAIC::User->(DBH=>$dbh, EMAIL=>'[EMAIL PROTECTED]');
> $obj->load;
> my $groups_list = $obj->groups();
>
> That way any needed SQL changes, or even ports to a new database,
> don't have to be done everywhere in my code.
>
>
>
> On Wed, Aug 01, 2001 at 10:12:45AM -0500, Joe Breeden wrote:
> > All,
> >
> > In his closing comments about UBB Kyle Dawkins made a statement that got me
> > wondering. He said "there's SQL embedded all throughout the Perl everywhere
> > (who does this?! oh my god, are they on crack?)".
>
> ...
>
> > It would be interesting to know how other people have solved that problem.
> > Currently, we are essentially using embedded SQL in our apps.
>
> --
> Barry Hoggard
>
>





Using PerlLogHandler to write errors to database

2001-07-16 Thread Jay Buffington

Hi,

I want to write a PerlLogHandler to write all errors to a database.  The database 
table will probably look like this:

CREATE TABLE error_log (
when DATETIME not null,
remotehost VARCHAR (255) not null,
virtualhost VARCHAR (255),
severity ENUM ('emerg', 'alert', 'crit', 'error', 'warn',
   'notice', 'info', 'debug') not null DEFAULT 'error',
error TEXT not null
);

I couldn't find any answers to my three important questions:

Is an error being logged?
What is the severity of the error?
What is the error?

Is there away to get this information from the request object?

Thanks,
Jay



Re: Apache::Upload filehandle

2001-07-13 Thread Jay Buffington

Okay, that didn't fix the problem, but I have figured it out.  

Apache::Upload returns the filehandle as being blessed into Apache::Upload.  Whenever 
I send the filehandle to Image::Magick it thinks that it is a url of type Apache: 
(kind of like file: or http:).  If I bless the filehandle into a class that does not 
have a colon in it, it works.  

Here is my work around:

8<... *snip*

my $fh = $r->upload->fh;
bless $fh, "nonexistantclass";
my $error = $image->Read(file=>$fh);

8<... *snip*


I guess that this is a bug in Apache::Upload and Image::Magick.  Apache::Upload should 
not return the filehandle as blessed (I'm confused why it does this in the first 
place) and Image::Magick should do a better job checking to see if it has been sent a 
filehandle.  

Can this please be fixed in the next release of libapreq?

Thanks,
Jay Buffington 


On Thu, Jul 12, 2001 at 10:03:24AM -0400, darren chamberlain wrote:
> Jay Buffington <[EMAIL PROTECTED]> said something to this effect on 07/11/2001:
> > I'm trying to use image magick to manipulate images that are
> > uploaded via http.  To handle the uploaded images I'm using
> > libapreq's Apache::Upload.
> > 
> > I wrote the below simple example script to help explain my problem.
> > 
> > When an image is uploaded to it I get this error in the apache
> > error log: ImageMagick error: Warning 320: no delegate for this
> > image format (:Upload=GLOB(0x873bcec)) [No such file or
> > directory]
> > 
> > I'm confused why this happens.  Could someone please explain
> > this behaviour to me? 
> 
> This looks like $r->upload->fh is being stringified, probably
> because of the context.  What happens when you assign the glob
> returned by $r->upload->fh to a lexical scalar, and then pass
> that into $image->Read()?  I hit this a few days ago, when
> passing a glob reference into a subroutine (not
> mod_perl-related), and this is the only thing that worked.
> 
> > 
> > package UploadFile;
> > 
> > use Apache;
> > use Apache::Request;
> > use Apache::Constants qw(:common);
> > use CGI qw(-compile :standard);
> > use Image::Magick;
> > 
> > sub handler {
> > my $r = new Apache::Request(shift);
> > 
> > if ($r->param('action') eq "upload") {
> > my $image = new Image::Magick;
> 
> Add these changes: 
> 
>   my $fh = $r->upload->fh;
>   my $error = $image->Read(file => $fh);
> 
> > $r->log_error("ImageMagick error: $error") if $error;
> > $r->print("image geometry: " . join " x ",
> >   $image->Get('width', 'height'));
> > undef $image;
> > }
> > 
> > $r->print(start_html() . start_multipart_form() . "Upload an image: " .
> >   filefield(-name=>"uploadedfile") . submit(-name=>"action",
> >   -value=>"upload") . end_form() . end_html());
> > 
> > return OK;
> > }
> > 
> > 1;
> 
> (darren)
> 
> -- 
> Death to all fanatics!



Apache::Upload filehandle

2001-07-11 Thread Jay Buffington

I'm trying to use image magick to manipulate images that are uploaded via http.  To 
handle the uploaded images I'm using libapreq's Apache::Upload.

I wrote the below simple example script to help explain my problem.

When an image is uploaded to it I get this error in the apache error log: 
ImageMagick error: Warning 320: no delegate for this image format 
(:Upload=GLOB(0x873bcec)) [No such file or directory]

I'm confused why this happens.  Could someone please explain this behaviour to me? 


package UploadFile;

use Apache;
use Apache::Request;
use Apache::Constants qw(:common);
use CGI qw(-compile :standard);
use Image::Magick;

sub handler {
my $r = new Apache::Request(shift);

if ($r->param('action') eq "upload") {
my $image = new Image::Magick;
my $error = $image->Read(file=>$r->upload()->fh());
$r->log_error("ImageMagick error: $error") if $error;
$r->print("image geometry: " . join " x ", $image->Get('width', 'height'));
undef $image;
}

$r->print(start_html() . start_multipart_form() . "Upload an image: " . 
filefield(-name=>"uploadedfile") . submit(-name=>"action", -value=>"upload") . 
end_form() . end_html());

return OK;
}

1;




returning one instance of an object per request

2001-07-06 Thread Jay Buffington

Hi,

I'm building a web application that has a User perl module.  I have several other perl 
modules that need to know the user id of the current logged in user (or 0 for a guest 
user).  I was thinking that I could write the User class in such a way that every time 
(except the first) a constructor was called the same instance of the user object would 
be returned for each apache request.  

Is this the best way to go about solving my problem?  If so what's the best way to 
implement this?  Or maybe I should just pass around the user id to every class?  I'd 
perfer to avoid this if possible. 

Thanks,
Jay 



RE: Solaris mod_perl DSO...

2001-06-22 Thread Jay Thorne

On 21 Jun 2001 19:34:03 -0700, Doug MacEachern wrote:
> On Thu, 21 Jun 2001, Paul G. Weiss wrote:
> 
> > I've done it with 5.6.1.  There was a fairly detailed thread on it last
> > week on how it was done.  In order to avoid a memory leak on restart you
> > need to build with a bleed modperl though.  If you can start and stop your
> > server you're fine with 1.25.
> 
> as you pointed out before, you can configure:
> PerlSetEnv PERL_DESTRUCT_LEVEL 2
> 
> without installing cvs modperl.
> 
> 
Hmm. I've tried this on perl 5.5.x and 1.25 on a linux box, and I still
get the 4meg leak per HUP


--
--
Jay Thorne Manager, Systems & Technology, UserFriendly Media, Inc.




Re: Real Widgets and Template Languages - MOVING THE DISCUSSION

2001-05-31 Thread Jay Lawrence

Dear Mod_Perl & Widget enthusiasts,

Thanks to Stephen Adkins taking the bull by the horns we have a new
Sourceforge project for the development of Perl Widgets strategies and code.
To get the discussion off the mod_perl list - we're encouraging all those
interested to join the perl-widget-developer list at:

http://lists.sourceforge.net/lists/listinfo/perl-widget-developer

In addition, you will be able to track progress and contribute to the cause
directly via Sourceforge:
http://sourceforge.net/projects/perl-widget/

and via two additional lists:
http://lists.sourceforge.net/lists/listinfo/perl-widget-announce
http://lists.sourceforge.net/lists/listinfo/perl-widget-users

I know we all look forward to the results of this development effort and
your valuable contributions.

Jay Lawrence





Re: Content-Disposition to change type and action?

2001-05-29 Thread Jay Jacobs

Ken's right and yeah, I wanted to stay away from Javascript and keep it
simple, it's not the doing of javascript that's bad, it's the redoing.

One thing that appears to work is setting the Content-Disposition header
value to "inline;filename=\"search.csv\"". (instead of "attachment").
IE5 seems to do the right thing with that, it pops up one box saying "what
would like to do with search.csv?".  Doing a redir might be a better
option then to trust IE4 and NS+ to do it correctly... not to mention
trusting IE6 to do anything like IE5.

Thanks for the help,
Jay

On Tue, 29 May 2001, Ken Williams wrote:

> [EMAIL PROTECTED] (Steve Piner) wrote:
> >My suggestion is to use mod_rewrite to create a mapping so that the
> >actual file name doesn't matter. I have a rule in the Apache conf file:
> >
> >RewriteRule ^/reports/ /bin/report.pl [PT]
> >
> >So going to <http://www.mysite.com/reports/foo.csv?param1=val1> would be
> >the same as going to <http://www.mysite.com/bin/report.pl?param1=val1>
> >except if the page is to be downloaded, the browser will use the name
> >foo.csv.
>
> That doesn't solve the problem, though.  The type of file is chosen in a
> form, and the action of the form is already set by the time that form is
> loaded.  I assume Jay doesn't want to use Javascript to change the
> action dynamically.
>
> My own preference would be to post to some generic script which
> redirects to another URL with the desired filename extension and proper
> disposition headers.
>
>
>   ------
>   Ken Williams Last Bastion of Euclidity
>   [EMAIL PROTECTED]The Math Forum
>




Re: Real Widgets and Template Languages

2001-05-29 Thread Jay Lawrence

James,

Yeh - that idea has merit. We don't always see that concepts map 1:1 between
languages but probably 99% of the time it should be ok. Of course it is the
1% case that drives most people totally nuts.

What might be of interest is a data type that is smart enough to hunt down
its text tag from a text resource dictionary or use a string that is local
just to that widget

I am hesitant to advocate the use dictionaries because I do find them a bit
confusing and unwieldly to think about managing in the context of a big web
site. *

Jay

* I don't know about you guys - but when I am building stuff - I am also
keeping in mind that humons [sic] will be doing much of the tweeking and
managing of the site. Keeping systems simple is a big objective too!




> Something I've seen elsewhere is to have a master table of strings that
the
> widgets can then reference.
>
> Different ways of doing this:
>index strings by number (MicroSoft resources in executables);
>index strings by the string in a particular language (TWIG with English
as
> the indexing language).
>
> This allows for sharing of strings across widgets and memory savings,
always a
> good thing in mod_perl.  It also doesn't slow the system down much if any
> compared to storing the strings in each widget with duplication.
> --
> James Smith <[EMAIL PROTECTED]>, 979-862-3725
> Texas A&M CIS Operating Systems Group, Unix
>
>
>




Content-Disposition to change type and action?

2001-05-29 Thread Jay Jacobs

I've got a form that will (should) send various formats back to the client
depending on form values.  They may want the results back in csv, pdf or
plain html.  The form always submits to a .html, and the browser usually
expects an html.

  I've tried setting $r->content_type and even $r->filename to try and get
the browser (ie 5 for now) to see it as a non-html file and "do the
right thing".  Then I came across setting "Content-Disposition":

$r->header_out("Content-Disposition",
"attachment;filename=\"ticket_search.csv\"");

This has an unexpected result, I get a pop-up asking me what I want to do
with the html document (save/exec), if I exec it, it asks me what I want
to do with the csv (save/exec).  I've never run across
Content-Disposition, anyone have a listing of what it does and the
options?

How do other out there return other mime-types when text/html is
requested?

Jay




Re: Real Widgets and Template Languages

2001-05-29 Thread jay

On Tue, 29 May 2001, Stephen Adkins wrote:

> Right. I have many more requirements I eventually want to support
> (such as internationalization).  The trick is making the design such
> that it works in the simple case for simple things, while supporting
> advanced features for those who wish to use them.  I think it is coming
> together pretty well.

I hope you didn't mean to say eventually! ;-) Me - I need I18L'n right off the top. If 
my widgets aren't multilingual then I'll have to go elsewhere. 75% of my apps are bi 
and trilingual.

I think we should bite the bullet and start talkin Unicode and ISO-639 language codes 
right at the beginning.

If a widget has a textual element to be used in rendering (ie/ label) it should have 
as many language forms as the developer requires. If a language form is missing it 
should kick down to a default language (EN-CA for example - otherwise words like 
colour and flavour will be mispelled ;-) ).

Where is this language value coming from? The widget's container. You only care about 
English? Then set it to "EN-US" and forget it.

 $widget->container->language="EN-CA"
 print $widget->label
   "What is your favorite flavour of ice cream?"

  $widget->container->language="EN-US"
  print $widget->label 
   "What is your favorite flavor of ice cream?" 

  $widget->container->language="FR-CA"
  print $widget->label
   ""

I'm sure you see the pattern.

Not every property should be considered polylingual but ones that contain textual or 
language-specific visual elements should be.

Implementation strategies can be as simple as:


sub label {

  my $self=shift;
  my $lang=shift || $self->container->language;

  if (exists $self->{'label'}{$lang}) {
 return $self->{'label'}{$lang};
  }
  return $self->{'label'}{$self->container->language('default');

}

My personal strategy to date is to create meta data describing the class in general. 
Accessor functions for properties are created dynamically via AUTOLOAD mechanism. 
Based on metadata for class in question the AUTOLOADer will setup the accessor using 
one of a few different behaviors.

In closing - although it seems like a drag in the beginning - it really makes sense to 
develop applications and components to support multiple languages. It is a zillion 
times more difficult to cobble in the fucntionality after the fact.

Jay





Re: Real Widgets and Template Languages

2001-05-29 Thread jay

On Tue, 29 May 2001, James G Smith wrote:

> IMHO, having a configuration API is much better than requiring a particular 
> way to do configuration.  If the backend configuration is done via Perl code, 
> then any configuration file format can be supported with an appropriate module 
> handling it.

This is what I am advocating - widgets have properties of various flavours. We 
describe how these properties and their different flavours operate. A lot of the 
runtime functionality of how stuff arrives into existance should be the choice of the 
developer. That includes things like XML, DBI, etc.

I think that the case for Storable as a core format could be made:
  - its fast
  - its reliable
  - it can be translated into Perl code via Data::Dumper or XML through your favorite 
XML module

> These widget configurations will need to be flexible enough that I can 
> construct a page with them without any knowledge of how they will look -- the 
> configurations should be tie-able to an overall theme for the site.  I've 
> always been a champion of themes for websites.  I should be able to select a 
> configuration at run-time without a lot of trouble.


I have not mentioned it yet - but I have been thinking that widgets should check their 
container for the active theme to use. It would be up to the widget as to how it would 
render itsself under different themes. To make that job easier - there are a number of 
rendering elements that could potentially be re-used across widgets for an entire 
theme

ie/ current theme would be:
   $widget->container->theme

just like when a widget goes to render itself it would be checking:
   $widget->container->render_format
to see if it should use "HTML", "WAP", or whatever.

A container could be another widget or something more high level like an application 
handler or template processor.

If a widget is serving as a container it probably won't hold the answer to things like 
theme or format - instead it would pass the request along to its container and so on.

Jay


J





Re: Real Widgets and Template Languages

2001-05-29 Thread Jay Lawrence

My $0.02 on XML config files. Although they may be attractive to some,
personally, I don't like them.

I see XML is merely the expression of the configurable parameters of the
object. IE it is just a means to the end. Personally, I would like to define
my widget properties through a GUI and then will probably use Storable to
dehydrate and rehydrate my widget objects. I would never want to code up XML
data and I don't think I'm alone. :)

Definately when it comes to interchanging your widget data with another
system something like XML really starts to make sense. I don't think it
makes sense necessarily for your internal day-to-day operations.

What I would advocate is that there are a variety of sources for widget
configuration data from something as simple and elegant as Perl code to XML
of some layout to Storable data stored in a blob field of a DBI source.

e.g.
$widget->serialize( [ "Storable" ] )
returns scalar ref to Storable data
$widget->serialize("XML")
returns scalar ref to XML string

$widget->define( \$StorableData [, "Storable" ] )
$widget->define( \$XMLData, "XML")

Then you  can easily write a Widget Controller that can be configured as to
what method to use and where to store it to/from.

Ideally these methods would always be inherited from the base widget class
which will dictate the runtime implementation of widget data.

Jay

- Original Message -
From: "Gunther Birznieks" <[EMAIL PROTECTED]>
To: "Stephen Adkins" <[EMAIL PROTECTED]>; "Jay Lawrence"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, May 29, 2001 9:53 AM
Subject: Re: Real Widgets and Template Languages


> At 05:17 PM 5/28/01 -0400, Stephen Adkins wrote:
> > >
> > >I don't understand the Widget::Controller.  Can you say more about
this?
> > >
> > >Also will we require XML to configure? Or is this also an optional
feature
> > >that you more or less want for yourself but others can choose to not
use?
> > >
> >
> >Hi,
> >
> >Below is running code for the Perl Widget Library.
> >So far, there are only two widgets.
> >
> >   * a generic Widget::HTML::Element
> >   * a drop-down menu Widget::HTML::Select
> >
> >Are there early comments on the interface from Perl?
> >Is this shaping up into what was desired?
> >
> >Stephen
> >
> >shark:/usr/ov/acoc/dev/src/Widget/examples> more Widget.xml Widget.2
> >::
> >Widget.xml
> >::
> >
> >>maxlength='99'/>
> >>tag='input' type='text' size='14' maxlength='99'/>
> >   
> >   
> >   
> >   
> >   
> > 
> > 
> >   
> >
>
> This config seems simple enough that it doesn't seem that necessary to use
XML.
>
> >::
> >Widget.2
> >::
> >#!/usr/local/bin/perl
> >
> >use lib "..";
> >
> >use Widget;
> >
> >my ($wc, $widget, @widgets);
> >$wc = Widget->controller();
>
> Don't you need to provide the controller with a CGI object? I guess this
> part hasn't been necessary yet, so the widget controller is just like a
> hash allowing widgets to be associated by name.
>
> >$widget = $wc->widget("first_name");
> >print "First Name: ", $widget->html(), "\n";
>
> A widget type has already been defined. So I don't see that the method to
> output it's display should be called html() which is, well, HTML specific.
> I prefer
>
> print "First Name: ", $widget->display(), "\n";
>
> Since widgets are components that know how to display themselves whether
> its WML or HTML or whatever.
>
> Thanks,
>  Gunther
>
>




Re: Real Widgets and Template Languages

2001-05-28 Thread Jay Lawrence


> Let's focus a bit.
Specifically on requirements more than implementation - *GOOD*

> All I (just my opinion) really want is a widget library for is to get and
> set data in a widget and have the widget subclass know how to display
> itself. In addition, there should be some mechanism for specifying how the
> widget sets up it's internal state based on CGI.pm, Apache::Request,
> Session data or what have you.

Could I paraphrase or reinterpret what you have said to be base classes
for handling widget properties and data sources?

In the web world I see data coming from:
static widget properties - design/configuration values
user supplied values - Session and Request values
data sources - RDBMS, LDAP, yadda

In addition I do see a variety of flavours for this data: scalar, array,
hash. Me, I want even more exotic flavours such as language sensitive (The
lable property check's user's language choice and will give them back the
lable in the right language). In order for a widget set to be useful we have
to agree on how to pass around a certain set of potentially complex data
types.

READ: robust base object class with potentially fancy strategy for
rationalizing a number of data sources and data structures.

Additionally - when it comes to widget-specific actions - such as rendering,
then you're seeing this as a subclass (or group of methods) that has been
defined by the widget creator.
ie/ widget->render - generic method that checks container and calls
appropriate render subclass for this widget
since container is HTML return widget->render_HTML or whatever.

READ: object hierarchy. Objects check their parents for hints on how to do
things - like pick the form to render themselves, etc.

> 1. Data Validation logic. No, this does not belong there. This is a
> separate library. I already have a rich Data handling library in my
toolkit
> that I intend to plug widgets into. All I need is to be able to get widget
> data from the data handling/validation library.

If I place a widget into my user interface and allow a user to specify a
value how I am I to implement validation?

ie/ Widget has property "choice" which can be "1","2", or "3". If the user
supplies any other value I want choice to be NULL and raise an error.

A - does controlling application logic enforce choice validation
B - does widget have property information to say that choice property
must pass some validation process?

I like B because it further compartmentalizes the behaviors of the widget
within its own specification. The source of the valication routines can be
external to the widget and classes but the validation rules would be
specified within here.

> 2. External display stuff. No, I just want the widget to know how to draw
> itself and only itself. It's up to a template language plugin like TT or
> some other template language to provide the wrappings. Or it can be a
> toolkit like your drawing forms library -- but the widget itself shouldn't
> have to know about external decoration around it. Just how to draw itself.

If one is to create an HTML form on a web page then all of the form elements
should actually be contained within in a FORM container. The FORM container
can then facillitate the correct development of HTML etc.

If the widgets are used within another context then the FORM container might
be necessary or it might not. But it is usually easier to ignore than try to
backpeddle and whack stuff in after its kinda too late.

> It's possible, but I am not quite sure because the primary complexity
seems
> to be the data handling (which I have already in a separate abstraction)
> and the UI generation which I have already in Template Toolkit. So all I
> really want is an object abstract called a Widget along with a
> WidgetCollection to allow grouping widgets together that belong on a given
> HTML page.

The way I am seeing a solution come together is somewhat different. First of
all I am now tending to really really really want to work with persistant
object collections. As my application needs new widgets I instanciate a new
object of that class into the app's collection of objects. Then I can set
its properties as I wish. From that point onwards I can just boss the
widgets around and make 'em do what I want.

If you do not want to work with persistent object system then you can come
up with any number of tactics to define your widget objects as needed: XML,
inline code, Data::Dumper, etc.

A few of my thoughts,
Jay





Re: Real Widgets and Template Languages

2001-05-24 Thread Jay Lawrence

Hey all,

Let me describe what I have been imagining as the ideal widget for what I am
writing:

1 - it can look to its environment to determine how to render itsself
- am I on an HTML page or something else?
2 - it has properties that can be set and remain static no matter who's
using it
- size, shape, colour, max, min
3 - it has properties that are customized by the individual user of the
widget
- current value, theme choice,
4 - it can tell developers and environments what it can do
- switch_on, switch_off, increment, decrement, etc.
5 - it is capable of persisting from invocation to invocation
- user 1 sets current_value to x - which always comes back for user
1
6 - it can look to its environment for interhitable properties
- global theme choice, global font, etc.
7 - templating systems know how to call widgets
- because they always use the same method to display themselves
8 - widget can interact with each other
- increasing value on slider widget changes current record # value
for database record widget
9 - access restrctions
- users can override some values but not others
- not everyone can even use this widget, etc.
10 - multilingual
- some things are language neutral others are not - "size" would
probably be neutral whereas "label" would be language sensitive
11 - above all it is easy to use
- ie/ don't make me set a zillion properties just to make it work!

I am going to throw out a buzzword, gasp, which may serve as a model for
what we are talking about: JavaBeans. I do feel there is a lot of additional
complexity there but it is along the right direction IMHO.

If you translate my wishlist into technologies I think I am talking about:

A - a good persistant object management environment
B - user sessions
C - integration of widgets (objects) to user sessions
D - Object API (properties and methods) which are consistant and
predictable
E - self documenting objects

This is what I have been looking for/writing myself! I am really eager to
chip in on this project and get it going ASAP - but do acknowledge the need
for hearty discussion about what people really want not just my own views.
:))

Jay






Re: Appending Sessionid to all the urls

2001-05-24 Thread Jay Jacobs

Yeah, create a safe link jumping point.  Something that you'd link to
instead of the external link, and pass in the external link, without a
session_id so that the HTTP_REFERER won't have the session ID.

Don't rely on IP address for more reasons then you mentioned...

It might not hurt to implement some kind of "time out" feature too.  It's
you and a dagger against an army.

Jay

On Thu, 24 May 2001, stefan weiss wrote:

> From: <[EMAIL PROTECTED]>
>
> > A better way for session ids is to put them in front of the URI:
> > http://www.nus.edu.sg/dfd3453/some/path/and/file.html
> (...)
> > These session ids are sticky as long as you only use relative paths in your
> > html. Note: You may want to put your images in a directory that's not covered by
> > this handler and use absolute paths...
>
>
> But wouldn't the session ID get sent to other (possible malicious) servers
> as well - in the HTTP_REFERER, if the user clicks on an external link?
> That might enable a script on that other server to grab your user's session.
> I guess you could add an additional check including the original user's IP
> address, but that's not really safe either. People working in the same
> company could spy on each other if they use the same HTTP proxy.
>
> Any known workarounds for this?
>
>
> cheers,
> stefan
>
>
>




Re: Appending Sessionid to all the urls

2001-05-22 Thread Jay Jacobs

there's always more then one way...

DocumentRoot "/usr/local/apache_mp/htdocs"
RewriteEngine On
RewriteCond /usr/local/apache_mp/htdocs/%{REQUEST_FILENAME} !-f
RewriteRule /?S=([^/]+)/(.*) /$2 [E=SESSION_ID:$1]

This sets $ENV{SESSION_ID} to the session ID, but also catches it, if by
some bizarre and unlikely circumstance your have a directory that matches
someone's Session ID.  In this case the session is:
http://host.domain.com/S=asdfasdf/path/requested.pl

Using mod rewrite also munges the $r->filename which helped things like
mason that looked for it (don't know if it still does).

Jay


On Tue, 22 May 2001, Joachim Zobel wrote:

> At 18:06 22.05.2001 +0800, you wrote:
> >
> >For instance when i access url
> ><http://www.nus.edu.sg?sessionid=dfd3453>http://www.nus.edu.sg?sessionid=dfd3453
> >i want all the urls to be appended in all the urls of that website..
> >
> >My qns is everytime i found that the session id is lost... through the
> >many requests and responses.
> >And the new url does not reflect on the client browser..
> >
> >Any one got any idea.. what wrong with my program??
> >
>
> Wrong concept.
> Use a sid in the URL path like
> http://www.nus.edu.sg/sessionid-dfd3453/this/is/it.pl
> Use mod_rewrite to remove /sessionid-\w+
> Use only relative links.
>
> Thats it. You can get the sessionid by parsing $ENV{REQUEST_URI}
>
> Hth,
> Joachim
>
> --
> "... ein Geschlecht erfinderischer Zwerge, die fuer alles gemietet werden
> koennen."- Bertolt Brecht - Leben des Galilei
>
>




Re: Real Widgets and Template Languages

2001-05-22 Thread jay

Hey all,

I have been giving this very subject area a lot of thought myself - I would like to 
really make a push for HTML/interface widgets in Perl. Have done some work to that end 
and have a lot of ideas.

In addition I was thinking about making an investment of time and resources into this 
idea to bring it to something useful and exciting for developers.

Was just starting to solicit opinions from developers myself.

Would be glad to chip in to a common effort here!

Jay

On Tue, 22 May 2001, Adi Fairbank wrote:

> 
> Gunther,
> 
> I have been interested in the concept of an HTML widget module for a while
> now.  The reason being, my application currently generates all HTML using
> CGI.pm in a mod_perl handler OO-style design, and we are starting to notice
> patterns.. similar pieces of HTML that get generated over and over. 
> Needless to say, componentized, reusable widgets would be very useful for
> us.
> 
> Though I can't make the commitment of writing it myself (if I did, it would
> be about 6 months before you saw any code), I would definitely contribute to
> it, if it existed.  And like you said, the hard part is getting people to
> write the widget objects.
> 
> -Adi





Mod_perl and Post Read Request

2001-04-11 Thread Jay Thorne

I'm trying to use mod_perl in conjunction with another module called
mod_adbanners.c

>From our tests, its quite apparent that when a  is handled by
mod_perl, our other apache handler is not called called, though we've
compiled perl to not hook into PostReadRequest

Any suggestions?
Is there a spell we can invoke? Do I need a dead chicken?

--
Jay Thorne Manager, Systems & Technology, UserFriendly Media, Inc.



Re: Shared memory between child processes

2001-03-31 Thread Jay Lawrence

Andrew,

Also check out IPC::Shareable.

This allows you to tie variables to shared memory segments and allow for
safe concurrant access.

You can use Apache::Session to maintain state information across all child
processes as well. If you use the Apache::Session::IPC then you're going to
be using a fairly consistent access mechanism to your tied variables if you
decide you also want to have regular user sessions too (ie/
Apache::Session::File or other).

Jay

- Original Message -
From: "Andrew Ho" <[EMAIL PROTECTED]>
To: "mod_perl List" <[EMAIL PROTECTED]>
Sent: Saturday, March 31, 2001 1:00 AM
Subject: Re: Shared memory between child processes


> Hello,
>
> RR>I'm needing to implement a handler that uses a true Singleton pattern
for
> RR>the class instance. One per server, not just one per process (or
thread).
>
> SL>You'll need to use some form of persistance mechanism such as a
> SL>database, file, or perhaps (assuming you're on a Unix system)
> SL>something like System V shared memory or semaphores.
>
> You can find more information on maintaining server-side state in the
> mod_perl guide or from the mod_perl book (at perl.apache.org and
> www.modperl.com, respectively).
>
> SL>One quick 'n cheap way to implement mutual exclusion between Unix
> SL>processes (executing on the same processor) is to use mkdir, which is
> SL>atomic (ie once a process requests a mkdir, the mkdir will either be
> SL>done or rejected before the requesting process is preempted by any
> SL>other process).
>
> IMO, this is sort of cumbersome; on a single processor, you can just use
> advisory file locking. It's when you get onto NFS mounted systems with
> high concurrency that you have to muck with rolling your own mutexes (I
> find I usually use atomic move for that purpose). But on a single system,
> use flock() and a known lockfile, or sysopen with O_CREAT|O_EXCL if you
> can't put the file there beforehand.
>
> Humbly,
>
> Andrew
>
> --
> Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
> Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
> Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
> --
>
>




Re: DBD-oracle works but not from Mod-perl

2001-03-06 Thread Jay Strauss

Not finding libclntsh.so.1.0 isn't my problem.  Editing the Makefile.PL and
setting LD_RUN_PATH=(oracle_home)/lib took care of that.  I don't have the
ORA_OCI.al file anywhere on my system

Thanks
Jay
- Original Message -
From: "Geoffrey Young" <[EMAIL PROTECTED]>
To: "'Jay Strauss'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 06, 2001 8:49 AM
Subject: RE: DBD-oracle works but not from Mod-perl


>
>
> > -Original Message-
> > From: Jay Strauss [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, March 06, 2001 9:03 AM
> > To: [EMAIL PROTECTED]
> > Subject: DBD-oracle works but not from Mod-perl
> >
> >
> > Hi mod_perl,
> >
> > I have a problem, I've installed DBI & DBD-Oracle.  I have
> > read and searched
> > all over for an answer and have only found one message with
> > the same problem
> > (but no reply).
>
> you should have been able to find a number of threads that address basic
> DBD::Oracle problems under mod_perl, though I haven't seen this particular
> ORA_OCI.al error before.
>
> at any rate,
>
> FAQ of the week
>
>   o I'm trying to use DBD::Oracle under mod_perl on linux - it works
> just fine standalone, but not under mod_perl...
>
> There is a problem with the Makefile produced by DBD::Oracle 1.03
> and above: it does not pass the -R$ORACLE_HOME/lib option to the
> linker.  There are a few solutions, requiring either running
> ldconfig or editing Makefile.PL - all are can be found in the
> mod_perl or DBI users list archives ([16] for example)
>
> [16] http://forum.swarthmore.edu/epigone/modperl/grahsehspor
>
> HTH
>
> --Geoff
>
>
>
> > It all works fine from a regular perl script
> > (i.e. I can
> > connect and query fine).  But when I try to
> > do if from Mod_Perl I get the following:
> >
> > *** Can't locate auto/DBD/Oracle/ORA_OCI.al in @INC (@INC contains:
> > /usr/local/apache/lib/perl /usr/local/lib/perl5/5.6.0/i686-linux
> > /usr/local/lib/perl5/5.6.0
> > /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
> > /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .
> > /usr/local/apache/) at
> > /usr/local/lib/perl5/site_perl/5.6.0/i686-linux/DBD/Oracle.pm
> > line 48 ***
> > DBD::Oracle initialisation failed: at
> > /usr/local/apache/perl/SqlQuery.pl
> > line 84. at /usr/local/apache/perl/SqlQuery.pl line 32


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




DBD-oracle works but not from Mod-perl

2001-03-06 Thread Jay Strauss

Hi mod_perl,

I have a problem, I've installed DBI & DBD-Oracle.  I have read and searched
all over for an answer and have only found one message with the same problem
(but no reply). It all works fine from a regular perl script (i.e. I can
connect and query fine).  But when I try to
do if from Mod_Perl I get the following:

*** Can't locate auto/DBD/Oracle/ORA_OCI.al in @INC (@INC contains:
/usr/local/apache/lib/perl /usr/local/lib/perl5/5.6.0/i686-linux
/usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
/usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .
/usr/local/apache/) at
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux/DBD/Oracle.pm line 48 ***
DBD::Oracle initialisation failed: at /usr/local/apache/perl/SqlQuery.pl
line 84. at /usr/local/apache/perl/SqlQuery.pl line 32

- Linux (RedHat kernel 2.2.16)
- apache - 1.3.19
- mod_perl-1.25
- DBD-Oracle-1.06
- All the oracle software is v8.1.6
- The Apache/mod_perl machine is a client (i.e. my database server sits
along the network)
- Mod_perl WORKS, I can server up dynamic pages
- I edited the DBD-Oracle Makefile and included my LD_RUN_PATH =
(oracle_home)/lib like it says in the doc.
- I don't have an ORA_OCI.al file anywhere on my system, so I can't point it
to it (or copy it to my @INC)

Any Help???
thanks
Jay




_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Re: [OT] Perl Script Source Code...

2001-01-09 Thread Jay Jacobs



On Tue, 9 Jan 2001, G.W. Haywood wrote:

> Hi Allysson,
> 
> On Tue, 9 Jan 2001, Allysson Flavio wrote:
> 
> > Is there a way to put in our client's server only compiled scripts
> > or like???  Or can we change Perl source code to decript our files??
> 
> I think you'd better read a book about C.
> 
> Hi everybody else,
> 
> Just asking, but am I the only one that gets a really bad feeling when
> people want to use Open Source Software to do things like this?  It
> seems kinda counter to the spirit of it all somehow.
> 
> 73,
> Ged.

I'd hope you're the only one, either that or I missed your point.  Do you
get paid for coding in perl?  How is that different then coding in perl
then wanting to sell the software and try to maintain rights and privacy 
on your creation?

I don't think C is a good point to bring up either, isn't gcc open-source
software?  It just so happens that C has built in protections for
source-code theft, and perl doesn't.  I don't think it makes a bit of
difference what tools you use, you should be able to take whatever steps
you think are necessary to protect your work.

as a side note, I've never felt a need to protect my perl source like
aforementioned, but I can think of a few circumstances where "protecting
source" is different the "hording the source".  You may just want to keep
the code covered to make it a little harder for someone (with a lot more
time then you) to figure out how to break it, you may want to hide a
hard-coded password, or just keep things black to stop folks from
wandering through because you wrote the application in 5 minutes between
phone calls and meetings and you're emberrassed you put out such awful
code, but it works, so run it.

Jay





Re: Mod_perl tutorials

2000-12-13 Thread Jay Jacobs




I've seen a few folks say "my tuturial is at http://xxx", etc.  But it
would be great if someone could put them all in a single place (take23?)
with a blurb about each.

I've been trying to keep the email with the links to the various
presentations and tutorials for the moment when I have time to look at
them, but it'd be great to have a single location that I might have in my
memory when time is available.

Jay





Re: [me too] certification [Was: mod_perl advocacy project resurrection]

2000-12-08 Thread Jay Jacobs



> > On Wed, Dec 06, 2000 at 01:22:26PM -0800, Randal L. Schwartz wrote:
> > > 
> > > I mean, until I can demonstrate that people with certs are likely
> > > to get hired faster or make more money, what's the point?  As it is
> > > now, good mod_perl people are hard enough to find that the
> > > jobseeker already has the advantage.

"The jobseeker already has the advantage" is the key phrase.  I think the
general idea is to balance that out and broaden both the job market for
mod_perl folks, and the talent pool of mod_perl programmers.  At this
point, IMO certification is the end of the line, the destination.  What we
need is a path to the destination.  We want to generate enough interest
and (dare I say) marketability of mod_perl to warrant certification.  
Articles are helpful, but when was the last time you saw a corporate
big-wig reading TPJ or Perl Month?  I'm sure it happens, but what about
getting an article in the big trade rags?  Slipping something in
Ziff-Davis rags, the things that sit on their desk and coffee tables...

> > I'd take a list of activities from your website, complete the
> > activities, submit my code back to you, and let you grade me,



Copy and paste works wonders in the web.  You'd need heavy code-commenting
or a detailed explanation from the person (preferably in person) of the
code they "wrote".  It's the right path, just need to prepare for the
lowest common denomenator.

> I'd be a little less eager about the sort of simple multiple choice
> that would be easiest to automate, but even that would suffice.

Or a good combination thereof.

> I would love to be able to list on my resumé that I was Perl and
> mod_perl certified. How about publicity in the form of a page listing
> certified Perl/modPerl coders on take23, with contact info if they
> like? Great for getting those job offers.

From an employer's standpoint, that's an awful statement to read.  If I
hire a certified perl/mod_perl person, I'd like to believe that they're
with my company, and not reviewing other job offers continually, if
the site could evolve to "available certified folks"... that would
be a much better solution.  See point #1 above.

Jay Jacobs


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Certification

2000-12-07 Thread Jay Jacobs



On Thu, 7 Dec 2000, Matt Sergeant wrote:

> On Thu, 7 Dec 2000, J. J. Horner wrote:
> 
> > If I'm way off base, please let me know.  I'm spending considerable
> > brain power on this idea and if I'm wasting it, I need to know.  I
> > don't have much spare brain power and I could use it to try to figure
> > out my wife . . .
> 
> Ask yourself this question: Are you in need of a mod_perl job? If so, I'm
> willing to bet that there are employers who would snap you up in a second.



On the flip side, if you're an employer looking for a good mod_perl
programmer, they're hard to find, and if you do find them, they're
quirky. ;)

I liked the idea of incorporating the local perl mongers groups into the
teaching/training/advocacy process.  I proposed it to my local group as a
possibility.  Perhaps it would help to get some standards though (similiar
to a certification process) that the groups could follow.  Perhaps areas
to cover, standard tests, etc.  Things that would lead a person to getting
really certified when/if such a thing exists.

Jay Jacobs


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: mod_perl advocacy project resurrection

2000-12-05 Thread Jay Jacobs



On Tue, 5 Dec 2000, Stas Bekman wrote:

> What we want is very simple. 
> 
> 1. We want many users, so they will thoroughly test the software and spot
> bugs asap, so we -- current users will get a better product.
> 
> 2. We want more developers, so they will write core mod_perl and 3rd party
> modules, again for us current users to re-use and save development
> time. The first item is directly linked to the second, as new developers
> come out from users.

I think a good first step in that direction is to have mod_perl modules to
do some of the basic things that early web developers want... a few really
well documented and tailored-for-newbies modules.  I think back a few
years to "Matt's Script Archive", and what that did for perl and
CGI. (Anyone for Apache::Formmail?)

Just some stuff to get the new developer interesting in figuring out how
to compile mod_perl, and to see the benefits of it.  It could even be done
with step-by-step examples, with gradually increasing functions.  ( "Now
move on to Guestbook-DBI" ... "Now add in Apache::Session for such-n-such
functions" )  Perhaps even offer the same modules under mason, embperl
axkit, etc. so folks can take a step in those directions too.

I just think back to the time when I started putting smarts-to-web and
these were the first steps I took, and I looked for that kind of hand
holding as I figured out how to make it work.

Jay Jacobs


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Forking in mod_perl?

2000-10-04 Thread Jay Jacobs

I was just going to post that url to the guide also... But another option
I've come up with not listed in the guide is to use the *nix "at" command.  
If I need to run some processor intensive application that doesn't need
apache_anything, I'll do a system call to "at" to schedule it to run
(usually I pass in "now").  However, the drawbacks are that it's a
complete seperate process and passing complicated structures isn't worth
the time to think about using at.

Jay

On Wed, 4 Oct 2000, Geoffrey Young wrote:

> 
> 
> > -Original Message-
> > From: David E. Wheeler [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, October 04, 2000 3:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: Forking in mod_perl?
> > 
> > 
> > Hi All,
> > 
> > Quick question - can I fork off a process in mod_perl? I've 
> > got a piece
> > of code that needs to do a lot of processing that's unrelated to what
> > shows up in the browser. So I'd like to be able to fork the processing
> > off and return data to the browser, letting the forked process handle
> > the extra processing at its leisure. Is this doable? Is forking a good
> > idea in a mod_perl environment? Might there be another way to do it?
> 
> http://perl.apache.org/guide/performance.html#Forking_and_Executing_Subproce
> ss
> 
> the cleanup phase is also a good place to do extended processing.   It does
> tie up the child until the processing finishes, but it at least make the
> client think that the response is finished (so that little moving thingy in
> netscape stops moving around)
> 
> HTH
> 
> --Geoff
> 
> > 
> > TIA for the help!
> > 
> > David
> > 
> > -- 
> > David E. Wheeler
> > Software Engineer
> > Salon Internet ICQ:   15726394
> > [EMAIL PROTECTED]   AIM:   dwTheory
> > 
> 





Apache::Session and Informix

2000-08-25 Thread Jay Jacobs

I've been fighting with Apache::Session and Informix... I've been using
Apache::Session ver 1.03 (knowing that 1.5x isn't "appropriate" for
informix) and Informix Dynamic server 2000 9.2.  Everything else is the
latest version, and on suse 6.4

At first it would hang up when trying to re-tie to a session.  Then I set
AutoCommit=>1 and RaiseError=>0 on the Apache::Session connection, and I
get an error:

execute failed: SQL: -608: Illegal attempt to convert Text/Byte blob type.

...any time the "update" is called from Apache::Session, and nothing is
updated.  I've tried switching the text field to a blob, (always storing
in the table).

Has anyone gotten this to work at all?  There's been a motion to get mysql
running to do sessions, which strikes a bad chord with me...

Jay Jacobs





Re: Producing an error page

2000-08-21 Thread Jay Strauss

Sorry,

I didn't explain my question well.  But thanks for all the response.

I left "my" out of my example on purpose, to illustrate a typical (in my case)
programming error.

To restate what I'm asking:

Is there any way to redirect everything that would normally be sent to the
screen, when I run from the command line, to an HTML page when I call my script
from the browser (on a script by script basis).

I've tried the suggestions so far:

cgi::carp
http://perl.apache.org/guide/snippets.html#Redirecting_Errors_to_the_Client
BEGIN { print "Content-Type: text/plain\n\n"; *STDERR = *STDOUT }

None of these methods will print the diagnostic messages, and typically only
print the line number at which I died.

I'm not in a production environment, so I don't mind getting a bunch of ugly
errors to my browser.

Thanks again
Jay

Jay Strauss
[EMAIL PROTECTED]
(h) 773.935.5326
(c) 312.617.0264

- Original Message -
From: "Jay Strauss" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 21, 2000 8:56 AM
Subject: Producing an error page


>
> Hi,
>
> I'm asking this again, due to lack of response (but I can't believe no one out
> there knows how to do this).
>
> How do I produce an error page (in HTML), when I call the script from a
browser,
> that looks just like the error screen I get when I run a script at the command
> line?
>
> That is, if I run the following script from the command line:
>
> ---
> #!/usr/bin/perl -w
>
> use strict;
> use diagnostics;
>
> ($first, $second) = @ARGV;
>
> exit;
> ---
>
> I'll get a whole bunch of messages telling me I "use strict" and I have
> variables that I didn't define with "my".
>
> But, if I call it from my browser, I just get back a "Internal Server Error"
> page.  Instead I want all the diagnostics messages.
>
> Thanks
> Jay
>
> Jay Strauss
> [EMAIL PROTECTED]
> (h) 773.935.5326
> (c) 312.617.0264
>
>




Producing an error page

2000-08-21 Thread Jay Strauss

Hi,

I'm asking this again, due to lack of response (but I can't believe no one out
there knows how to do this).

How do I produce an error page (in HTML), when I call the script from a browser,
that looks just like the error screen I get when I run a script at the command
line?

That is, if I run the following script from the command line:

---
#!/usr/bin/perl -w

use strict;
use diagnostics;

($first, $second) = @ARGV;

exit;
---

I'll get a whole bunch of messages telling me I "use strict" and I have
variables that I didn't define with "my".

But, if I call it from my browser, I just get back a "Internal Server Error"
page.  Instead I want all the diagnostics messages.

Thanks
Jay

Jay Strauss
[EMAIL PROTECTED]
(h) 773.935.5326
(c) 312.617.0264





Newbie question on Apache::Debug::dump

2000-08-19 Thread Jay Strauss

Sorry if this has been asked before but I have been unable to find the answer
(not in perldoc, apache modules book, searching archives):

I would like my perl compilation and process errors to be written to an HTML
page if/when they occur, in the same way they are written to stdout when I run
from the command line.

I thought that Apache::Debug::dump would do this, am I correct??

I am unable to make it work though.  I can't seem to find any examples of how to
use it, perldoc is too brief for my limited skills, the apache modules book
(eagle) says:

"The three arguments to dump() are the request object, an error code to return
to Apache... and an error message..."

What is a "request object"?

No matter what I do, all I can produce is that "OK" server error page.  My perl
code is a simple: give userid, password, database, sql query, connect to my
database (oracle) and display the results.

Can someone please give me an example of how to use dump()? Or if you have a
different suggestion.

Appended is my simple perl code and HTML error page

Thanks
Jay

Jay Strauss
[EMAIL PROTECTED]
(h) 773.935.5326
(c) 312.617.0264


#!/usr/bin/perl -w

use strict;
use Apache::Constants qw(:common);
use Apache::Registry;
use Apache::Debug;
use DBI;

print "Content-Type: text/html\n\n";
print "\n";
print "\n";

my $r = shift;
my %input = $r->method eq 'POST' ? $r->content : $r->args;

$ENV{ORACLE_HOME} = "/u01/app/oracle/product/8.1.6";

my $dbh =
DBI->connect("dbi:Oracle:$input{servicename}",$input{userid},$input{password})
or Apache::Debug::dump($dbh,SERVER_ERROR,"Can not connect to database $input
{servicename}");

my $sqlh = $dbh->prepare($input{query});
my $rc = $sqlh->execute;

print "\n";

foreach my $ColumnName (@{$sqlh->{NAME}}){
   print "$ColumnName";
}

while (my @row = $sqlh->fetchrow_array()){
   print "\n";
   foreach my $column (@row) {

while (my @row = $sqlh->fetchrow_array()){
   print "\n";
   foreach my $column (@row) {
 print "$column";
   }
   print "\n";
}

warn "Problem in fetchrow_array(): ", $sqlh->errstr(), "\n"
if $sqlh->err();

print "\n";

$dbh->disconnect;

print "\n";
print "\n";

exit;

The error page HTML
---


HTTP/1.1 200 OK
Date: Sat, 19 Aug 2000 16:36:10 GMT
Server: Apache/1.3.12 (Unix) mod_perl/1.24
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1



200 OK

OK
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator,
 [EMAIL PROTECTED] and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.
More information about this error may be available
in the server error log.

Apache/1.3.12 Server at abba.hostdb.com Port 80





RE: Question about $sth->finish;

2000-08-15 Thread Jay Jacobs



On Tue, 15 Aug 2000, Tom Mornini wrote:

> It is my understanding of the DBI docs that you only need to call
> $sth->finish when you DON'T fetch all the rows that the $sth has ready to
> return.
> 

>From "Writing Apache Modules with Perl and C":
  "You should still call finish() at the end of each series of fetches,
even though you are going to reuse the statement handler.  Failure to do
so can lead to memory leaks."

If I remember correctly, it also frees up any resources used by the
database (depending on db) for the query, like for sorting, joining,
etc.  But I can't quote a source for that one.

>From my point of view, it never hurts to call finish()...

Jay Jacobs




Re: mod_perl and perl 5.6.0

2000-06-30 Thread Jay J

[EMAIL PROTECTED] wrote:
> 
> Is there a way to compile Apache 1.3.3 with mod_perl 1.21 and perl 5.6.0 (Solaris 
>2.6)?
> I get Apache compiled with perl 5.004_04 and all works fine. But with perl 5.6.0 the
> compilation stopped and produced the following output:
> 
> mod_perl.c: In function `perl_startup':
> mod_perl.c:663: warning: unused variable `Perl___notused'
> mod_perl.c: In function `perl_handler':
> mod_perl.c:783: `PL_siggv' undeclared (first use in this function)
> mod_perl.c:783: (Each undeclared identifier is reported only once
> mod_perl.c:783: for each function it appears in.)
> mod_perl.c:753: warning: unused variable `Perl___notused'
> mod_perl.c: In function `mod_perl_end_cleanup':
> mod_perl.c:1037: warning: unused variable `Perl___notused'
> mod_perl.c: In function `perl_call_handler':
> mod_perl.c:1327: warning: unused variable `Perl___notused'
> make[2]: *** [mod_perl.o] Error 1
> make[1]: *** [all] Error 1
> make: *** [subdirs] Error 1
> 
> Thanks,
> 
> Winni

Perl 5.6 no longer defines PERL_POLLUTE by default .. this might be the
problem. So perhaps a -DPERL_POLLUTE, or "perl Makefile.PL POLLUTE=1" in
there somewhere.

Just curious, why Apache 1.3.3 .. or even mod_perl 1.21, for that
matter? They're both free ya'know :-)

-Jay J



Re: Virtual Hosts and POST

2000-06-30 Thread Jay J

Jon Wyatt wrote:
> 
> >
> > [EMAIL PROTECTED] wrote:
> > >
> > > Simple first stage question:-
> > >
> > > Your not using mod_rewrite at all (it took me 6 hours to work out that that was 
>causing the same problem for me).
> > >
> >
> > I wasn't but I am now and it's made no difference.
> >
> 
> I'm going to change my mind now. I'm still not using it.
> 
> To use that mod surely I need to do the following:-
> 
> Edit Configure to enable the mod_rewrite
> perl Makefile.PL .{with everything enabled}
> make && make install
> cd apache dir
> make install
> 
> The mod is now statically linked in, right?
> 
> Or am I completely wrong?
> 
> Jon.

--enable-module=rewrite

FYI, unless you have 'RewriteEngine on' and rules/etc .. this really
shouldn't interfere.

Just a hunch, are you using CGI::ReadParse?

When I first used Apache::Registry, ReadParse got me .. for all I know,
it works differently now.

-Jay J



[OT] Cookies and the White House.

2000-06-21 Thread Jay Jacobs

There was a thread over a month ago about sessions and cookies and how
much you can trust them... well, if anyone is keeping track you can count
the white house out of the cookie-users... they just found out what
cookies are.

http://www.pub.whitehouse.gov/uri-res/I2R?um:pdi://oma.eop.gov.us/2000/6/21/17.text.1

Horribly off-topicly yours,

Jay Jacobs





Re: Apache::Session & Math::Currency thawing issue.

2000-06-19 Thread Jay Jacobs

First off, I'm doing this becuase I need to store variables (in
currency) that are generated on a per-user session, for a short period of
time (3 to 5 requests).  I'm using a database back-end for the session.

I was initially wrong in my thinking about Math::Currency, and my solution
was to "stringify" the instance, so I only store "$10.45" instead of a
Math::Currency object.

Where do you put your "more permanent" data, and what constitutes "more
permanent" data?  I can't think of anything that would be faster/easier to
store and retrieve specific information related to that user or session.

I'd agree that the session needs to be handled carefully, but I think the
careful part is not leaving stuff in the session that doesn't need to be
there, instead of not using it.

Jay

On Mon, 19 Jun 2000, Shane Nay wrote:

> Okay, backup a second..., you're doing this... why?  Do you need a
> Math::Currency object stored inside the session?..., that could be quite a
> hefty object.  See, everything you write to a session you have to read back in,
> and any time you update any small part of it it has to re-write the whole
> record.  What storage mechanism are you using for sessions, Filestore,
> Database?  Generally I think it's a best practice to be careful about what
> you're stuff in your sessions, i.e. how much data you're putting in there.  A
> complete update of several objects could be pretty hairy since you have to do a
> complete re-write of that record whenever you change one small detail.  You
> also have to read in that entire session, and decompose it which could take a
> little while.  Basically you're adding quite a bit of overhead to your
> web-application.  Personally I like to keep my sessions really small, and put
> more permanent data elsewhere, does anyone else have a "best practices" sort of
> thing on what should/should not be stored in a session?  (This seems to come up
> almost weekly I think)
> 
> Thanks,
> Shane.
> (Also you should read up on freeze thaw, because they can't store _everything_)
> 
> On Mon, 19 Jun 2000, you wrote:
> > Hello,
> >   I'm trying to use Math::currency with sessions, and I've run into a
> > stumper.  I initialize variables and make them Math::Currency objects, and
> > display them just fine, but when I come back (unthaw the session) instead
> > of seeing the value I get the reference showing
> > "Math::Currency=HASH(0x86b022)" instead of the value as it showed the
> > first time through.
> > 
> > It's a reference going in, and a reference coming out, but for some reason
> > it doesn't like being stuck into Apache::Session.
> > 
> > I can work around it by testing if it's a Math::Currency reference, and
> > call Math::Currency->new.  But this seems a little silly.  Anyone seen
> > this before?
> > 
> > Jay Jacobs
> 




Re: Apache::Session & Math::Currency thawing issue.

2000-06-19 Thread Jay Jacobs

I think I caught it.  For some reason (little help here), you need to
"stringify" the Math::Currency instance, and store it as a scalar.  And
calling ->new on a thawed object isn't a work around...

Jay

On Mon, 19 Jun 2000, Jay Jacobs wrote:

> Hello,
>   I'm trying to use Math::currency with sessions, and I've run into a
> stumper.  I initialize variables and make them Math::Currency objects, and
> display them just fine, but when I come back (unthaw the session) instead
> of seeing the value I get the reference showing
> "Math::Currency=HASH(0x86b022)" instead of the value as it showed the
> first time through.
> 
> It's a reference going in, and a reference coming out, but for some reason
> it doesn't like being stuck into Apache::Session.
> 
> I can work around it by testing if it's a Math::Currency reference, and
> call Math::Currency->new.  But this seems a little silly.  Anyone seen
> this before?
> 
> Jay Jacobs
> 
> 




Apache::Session & Math::Currency thawing issue.

2000-06-19 Thread Jay Jacobs

Hello,
  I'm trying to use Math::currency with sessions, and I've run into a
stumper.  I initialize variables and make them Math::Currency objects, and
display them just fine, but when I come back (unthaw the session) instead
of seeing the value I get the reference showing
"Math::Currency=HASH(0x86b022)" instead of the value as it showed the
first time through.

It's a reference going in, and a reference coming out, but for some reason
it doesn't like being stuck into Apache::Session.

I can work around it by testing if it's a Math::Currency reference, and
call Math::Currency->new.  But this seems a little silly.  Anyone seen
this before?

Jay Jacobs




Apache children hanging (not exiting)

2000-06-01 Thread Jay Jacobs

With that previous thread of Apache children hanging up the server it made
me think of an issue I see quite frequently in development... When I stop
the mod_perl server, it won't exit properly (or fast) :

[warn] child process 8530 still did not exit, sending a SIGTERM
(multiplied by number of processes)

I've seen this on servers running really sloppy code as well as really
tight code (but a lot of it).  Eventually the children do die off, but it
takes about 15 seconds...

Could this be related to the aforemented thread?

Jay Jacobs




RE: Apache::Session

2000-06-01 Thread Jay Jacobs

Mod_Rewrite does the same thing in a few less lines:

RewriteEngine On
RewriteCond /your/document_root/%{REQUEST_FILENAME} !-f
RewriteRule ^/S([^/]+)/(.*)/$2 [E=SESSION_ID:$1]

the RewriteCond statement just makes sure you don't (for some strange
reason) have a file/directory that is of the same name as the request, and
it's completely removable 

This also doesn't change the $r->uri value, but I find that kind of a
blessing.

Jay Jacobs
LachNet Inc.

On Thu, 1 Jun 2000, Michael Nachbaur wrote:

> Well, from what I'm reading, it looks like you don't want it to create sessions for 
>all images, CSS, et al on the first page load, right?  Instead of deleting sessions 
>that aren't used, you could try just not serving sessions to documents that don't 
>need 'em.
> 
> Like in my setup, I've put in a PerlTransHandler pointing to a custom perl module 
>I've created:
> PerlTransHandler  Apache::URISession
> 
> Then, in Apache::URISession, I've done the following:
> package Apache::URISession;
>  use strict;
>  use Apache::Constants qw(:common);
> 
>  sub handler {
> my $r = shift;
> my $uri = $r->uri;
> my ($session) = $uri =~ m|/S([0-9a-f]{32})|;
> $uri =~ s|/S[0-9a-f]{32}||;
> my $filename = $r->document_root . $uri;
> 
> $ENV{'SESSION_ID'} = $session if ( $session );
> print STDERR "SESSION: " . $session, "\n";
> print STDERR "URI: " . $uri, "\n";
> $r->uri($uri);
> $r->filename( $filename );
> return OK;
>  }
> 
>  1;
>  __END__
> 
> There might be another module that does this, but I wanted to embed the session key 
>in the URL.  So, in this example, it'll redirect the user to an address like this one:
> http://127.0.0.1/S94b419c5908ae5f0773a4bfd61cbec1d/index.html
> 
> It'll rip the session out, put it in ENV{SESSION_ID}, and continue processing.  I'm 
>not sure if I should be returning an OK there or not (I'm new to using handlers), but 
>it does the job.
> 
> Also, keep in mind, I'm using the new Apache::Session which creates 32-character 
>keys, which is why I'm doing the pattern match check like {32}.
> 
> -man
> 
> -Original Message-
> From: Niral Trivedi [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 01, 2000 12:57 PM
> To: [EMAIL PROTECTED]
> Subject: Apache::Session
> 
> 
> All,
> 
> I need to clear myself on a small issue regarding Apache::Session.
> 
> As per my understanding, Apache::Session will store session information
> in a backing store-either a flat file or in some database. And
> everytime, request comes in, it will check for sessionID in backing
> store and retrieve all information for that session. If request is new
> than it will create new sessionID and also create an entry in backing
> store..
> 
> Now, only way to remove this information from backing store is to do
> 'tied(%session_hash)->delete', Am I right? I mean is there any way we
> can remove these entries by setting 'time_out_interval' or something
> like that?? 
> 
> Because if we do 'tied(%session_hash)->delete' then it will create new
> session for every request... So, I was thinking of not doing
> 'tied->delete' but write a small cron script which runs at specified
> interval and removes entry from backing store which are older than some
> time...
> 
> Because concept of 'time_out_interval' does exist in Apache JServ and
> other application servers..
> 
> Any ideas, suggestions or pointers on this???
> 
> Thanks again..
> 
> Niral
> --
> 




Re: Guide search engine (was Re: multiple copies of a module)

2000-05-17 Thread Jay J

Jeremy Howard wrote:
>
> I'm glad you brought this up again. Since I mentioned I'd be happy to
> host such a thing, and asked for suggestions, I've got
> a total of one (from Stas--thanks!). That suggestion was to use
> ht://dig <http://www.htdig.org/>.
>
> Has anyone got a search engine up and running that they're happy with?
> Stas has made the good point that it needs to be able
> to hilight found words, since the pages are quite large. If anyone has
> a chance to do a bit of research about (free) search
> engines, I'd really appreciate it if you could let me know what you
> find out. It'd be nice publicity if it was mod_perl based,
> I guess, but it doesn't really matter.

I'm happy with ht://dig, I use it mainly for looking up docs I've
squirreled away in /manual. (instead of grep)

It's been a while since I've been to htdig.org but I did grab a tarball
recently, so I'm fairly confident there isn't* an existing mod_perl
wrapper -- but maybe there should be.

There are a number of perl scripts in the distribution, and I thought*
there was a plain Perl wrapper, but I could be mistaken.

I think a mod_perl frontend/wrapper could work well, that is, htsearch
is about 900K+ and takes a moment to fire up (on my box anyway) -- how
much worse could it be?

OTOH, one could* (conceivably) get crazy and access the DB's directly
and maybe XS any needed portions of htsearch (ambitious :-). However,
this still leaves htdig, htfuzzy, htmerge, etc .. to handle the
indexing.

As far as highlighting, I have a piece of code I'm using -- we could use
it as a starting point. Downside is it uses $` $' (it can probably be
tweeked to avoid this), but it handles the critical stuff like skipping
keywords within href's/tags, etc.

RE: Matt Sergeant -- Perhaps highlighting is overrated, but it usually
doesn't hurt. I too have a proprietary search facility, and a inverted
indexing prototype (stores packed doc-id integers in MySQL, for example)
-- but a great deal of work has gone into ht://dig ..


> My only concern is that it seems a little odd to keep this just to the
> Guide. Wouldn't it be useful for the rest of
> perl.apache.org? I wouldn't have thought it's much extra work to add a
> drop-down box to search specific areas of the sight
> (the Guide being one)...

I'd have to agree there.


> If there's a good reason to have the Guide's search engine separate to
> the rest of perl.apache.org, should it have a
> separate domain (modperlguide.org?, guide.perl.apache.org?)?
> 
> --
> Jeremy Howard
> [EMAIL PROTECTED]

ht://dig allows for the param 'restrict' => /to_this_directory .. which
might be useful for seperating things.

Count me in, whatever we choose.

-Jay J

# use Text::Wrapper;



database efficiency

2000-05-15 Thread Jay Jacobs

I've been reading over the guide on "Efficient Work with Databases under
mod_perl" and there's one thing I don't quite grok about it.  Let's say I
have a site that goes through select statements like water.  If I were to
cache the statement handler (as described in the guide), how does the
database (database dependant) handle a bunch of dangling statement
handlers?  Will the database process size grow a ton?  I'm not sure if I'm
hitting what I wanted to ask, but hopefully I'm close enough.


Jay Jacobs
LachNet Inc





Re: [Summation] 100% sessions?

2000-05-12 Thread Jay Jacobs

I really liked this solution... here is the simple mod_rewrite stuff I've
stuck into my httpd.conf to pull out the session_id:

RewriteEngine On
RewriteCond /your/doc_root/%{REQUEST_FILENAME} !-f
RewriteRule ^/S=([^/]+)/(.*)/$2 [E=SESSION_ID:$1]

When you set your session_id, be sure to prepend the "S=" to it.  I
figured that was a much better solution then just looking for 16
characters, although I put the !-f condition in there to test if it was a
file... by the slim chance that the S={session_id} pattern is actually a
real file... it could be done away with.

After this rewrite rule there will be a $ENV{SESSION_ID} variable set for
use in any application (regular cgi included)

This will also set the $r->filename to not include the session_id which
means that mason and the like won't break down looking for the file.

Note: This does NOT change $r->uri which will still contain the session
stuff in it.

Jay Jacobs
LachNet Inc.


On Thu, 11 May 2000, Gunther Birznieks wrote:

> At 01:21 PM 5/10/00 -0500, Jay Jacobs wrote:
> >I embedded notes into this with a short book at the end...
> >
> >On Wed, 10 May 2000, Gunther Birznieks wrote:
> >
> > > There is a strong reason for cookies only. Intranets and other controlled
> > > environments.
> >
> >
> >I'm trying to satisfy as many clents as possible in the chaos of the
> >uncontrolled world of a public site.
> 
> I was under the impression that this thread is about general session 
> architectures... and someone appeared to be arguing that there are no 
> situations where cookies alone would not cut it. The reality is that there 
> are quite a few developers who develop using cookies alone and accept it as 
> their user constraint. In an intranet with controlled users where the 
> business wants an app out quickly, they don't care about the flexibility 
> for the future especially if the apps are re-engineered to new business 
> requirements every 6 months anyway.
> 
> > > >User makes request:
> > > >   if a cookie exists with session_id
> > > > then verify it is a valid session_id
> > > > if a session-url exists remove it and rely on cookies
> > >
> > > Why would both exist?
> >
> >Becuase they're both set on an initial request, that way if the cookie
> >fails, the session is still in the url... again, uncontrolled, sloppy
> >world.
> >
> > > > if session is expired   # timed expirations as a security measure
> > > >   auth them again if needed and/else redirect to requested page.
> > > >
> > > >   else if a session_url exists with no cookie
> > > > verify validity and exipiration as above
> > > >
> > > >   else if no cookie and no url session
> > > > new session, set cookie and set session-url
> > > >
> > > >   timestamp the session for expiration.
> > > >
> > > >
> > > >Other notes:
> > > >   Having to re-write site-wide urls seems like a bad idea.  It 
> > negates any
> > > >caching (on both server and client sides), and forces all the pages to be
> > > >dynamic.  Relative links (although not the ../../prettiest thing) seems
> > > >like the best route.
> > >
> > > I don't get this. It's still a different URL whether the id is at the end
> > > of the URL or the beginning. Also, the pages are not dynamic with
> > > mod_rewrite... mod_rewrite (in this case) is just acting upon a data
> > > structure on the server.  The HTML files are still served as HTML files
> > > whether the root dir is shown as a session id
> > >
> > > The caching that you are ruining is the proxy caching. But the browsers
> > > will still cache the HTML and images (one would presume that multimedia
> > > content -- which benefits the most from a proxy cache would not go through
> > > the URL mangling if possible).
> >
> >
> >The thing about putting the session_id in the front is that the whole site
> >can then just do *static* relative linking.  The problem isn't using
> >mod_rewrite to get to the page, the problem is linking from that page to
> >another while maintaining the session_id in the url.  If I'm understanding
> >you wrong let me know, I'd be quite interested in a solution just using
> >mod_rewrite.
> Of course, if you put the session id at the front of the URL, then the 
> relative links will all work (unless they are absolute with regards to the 
> host).
> 
> However, it should be relatively easy to make this a lot cleaner 

Re: talking about cookies (was: session something...)

2000-05-12 Thread Jay Jacobs

The issue isn't the technical aspects of the bug, or even the fact that
users don't have to turn off cookies to fix the bug... the issue is that
this, with help from the talented press, will cause more people to simply
disable cookies whether right or wrong.  

This ties back into a previous discussion about storing sessions (or
session_id) in a cookie and how reliable (or unreliable) that is.

Jay Jacobs
LachNet Inc.


On Fri, 12 May 2000, Keith G. Murphy wrote:

> "Jeffrey W. Baker" wrote:
> > 
> > On Thu, 11 May 2000, Marc Slemko wrote:
> > 
> > > In reality, IE's recently publicized hole (which I reported to them, in a
> > > slightly modified form, months ago but they didn't see fit to release a
> > > patch...) doesn't change much.
> > >
> > > Hotmail?  Yahoo mail?  amazon.com?  etc.  Your cookies for all those sites
> > > are vulnerable anyway due to the "cross site scripting" issue.  This
> > > particular hole in IE doesn't change things too much.  Sure, there may be
> > > the rare site that isn't vulnerable to cross site scripting.  But that is
> > > the very rare site, and most sites that think they aren't vulnerable are.
> > >
> > > Cookies are not secure and will never be secure.  I have said it before
> > > and will say it again many times before I die.  Unfortunately, it isn't as
> > > simple as saying "well, don't use cookies".  There isn't much in the way
> > > of alternatives for a lot of things...
> > 
> > Cross-site scripting attacks are hard for most people to wrap their minds
> > around.  There are a zillion sites that are vulnerable, mainly because
> > they parrot back to the user whatever they submitted without doing any
> > validation or HTML/URL escaping.  Then there are browser bugs that don't
> > treat excaped character properly.  Sigh.
> > 
> Whether we're talking about the IE bug, or cross-site scripting issues,
> wouldn't the whole thing be solved by users turning *off* scripting and
> leaving the cookies *on*?  I.e., in what ways are cookies not safe if
> scripting is turned off?
> 
> What great functionality is lost if users turn off their scripting?
> 
> Of course, this may be an abstract question in terms of programming, if
> users *do* insist on enabling scripting.
> 
> I do notice that both Microsoft and CERT, in their different ways,
> recommend that folks turn off scripting for best protection against
> cross-site scripting attacks:
> 
> http://www.cert.org/advisories/CA-2000-02.html
> http://www.microsoft.com/technet/security/crsstQS.asp
> 
> So maybe some will get the message.
> Though making ridiculous recommendations like avoiding "promiscuous
> browsing" (CERT's words) doesn't help.
> And MS's recommendation simply eliminates E-mail-based attacks using
> their product (Outlook), while leaving others exposed.  They make it
> ridiculously hard to turn off scripting, then show you how to do it only
> in a limited way.
> 
> But it does seem like not even MS is saying "Don't accept cookies". 
> Though they're still pretty quiet on the latest IE hole.
> 




Re: [Summation] 100% sessions?

2000-05-10 Thread Jay Jacobs

I embedded notes into this with a short book at the end...

On Wed, 10 May 2000, Gunther Birznieks wrote:

> There is a strong reason for cookies only. Intranets and other controlled 
> environments.


I'm trying to satisfy as many clents as possible in the chaos of the
uncontrolled world of a public site.

> >User makes request:
> >   if a cookie exists with session_id
> > then verify it is a valid session_id
> > if a session-url exists remove it and rely on cookies
> 
> Why would both exist?

Becuase they're both set on an initial request, that way if the cookie
fails, the session is still in the url... again, uncontrolled, sloppy
world.

> > if session is expired   # timed expirations as a security measure
> >   auth them again if needed and/else redirect to requested page.
> >
> >   else if a session_url exists with no cookie
> > verify validity and exipiration as above
> >
> >   else if no cookie and no url session
> > new session, set cookie and set session-url
> >
> >   timestamp the session for expiration.
> >
> >
> >Other notes:
> >   Having to re-write site-wide urls seems like a bad idea.  It negates any
> >caching (on both server and client sides), and forces all the pages to be
> >dynamic.  Relative links (although not the ../../prettiest thing) seems
> >like the best route.
> 
> I don't get this. It's still a different URL whether the id is at the end 
> of the URL or the beginning. Also, the pages are not dynamic with 
> mod_rewrite... mod_rewrite (in this case) is just acting upon a data 
> structure on the server.  The HTML files are still served as HTML files 
> whether the root dir is shown as a session id
> 
> The caching that you are ruining is the proxy caching. But the browsers 
> will still cache the HTML and images (one would presume that multimedia 
> content -- which benefits the most from a proxy cache would not go through 
> the URL mangling if possible).


The thing about putting the session_id in the front is that the whole site
can then just do *static* relative linking.  The problem isn't using
mod_rewrite to get to the page, the problem is linking from that page to
another while maintaining the session_id in the url.  If I'm understanding
you wrong let me know, I'd be quite interested in a solution just using
mod_rewrite.

And with caching... Let's say the site rewrites the url dynamically, so
that the links are something like:
Home page
Now, for whatever unforseen reason the session_id changes (they close
their account and reopen). They hit a page that is cached on their side
with these in there, all of sudden they're back on their old session which
is invalid now.  That doesn't exist if the link is "../index.html" or some
other relative link that is cached.

In addition I was also talking about server-side caching, with something
like mason where it's possible to cache a static document on the server
side to speed up the process.  Think of an "about" page talking about the
company history... the session will have to be active there, they may want
to look at their account info after that, but the about page is static and
should be cached if possible.

Again, I'm just trying to get a feel for the best way to deal with the
chaos of the browsers and their users.  I don't see any way to gaurantee
that 100% of the people will be able to use a session-based site while
also allowing 0 session-jumping with high-security and privacy.  And if I
can increase 91% serviced to 92% serviced while assuming the end-user just
figured out what "click here" means, I'll do it.

Jay Jacobs
LachNet Inc.






Re: [Summation] 100% sessions?

2000-05-10 Thread Jay Jacobs

On Wed, 10 May 2000, Roger Espel Llima wrote:

> Jay Jacobs <[EMAIL PROTECTED]> wrote:
> >   So as I see it there are essentially 2 *mostly* reliable ways, cookies
> > and url-rewriting.  Both have drawbacks and neither are 100%.  There
> > really isn't a way to cross-reference anything else (IP or login) becuase
> > there are valid reasons for a user to come from multiple ip addresses
> > during a session (albeit rare), and sessions may be needed without
> > requiring a user to login.
> 
> >   It also doesn't make sense to try to rely on both cookies and
> > url-rewriting, that would just get sloppy and waste time.  The only thing
> > to do is to pick one or the other and deal with the drawbacks associated
> > with that...
> 
> Why wouldn't it make sense?  Some users have cookies turned off, then
> you just send them a rewritten URL.  That's what I do now: send a
> session cookie with every request.  If I got a session cookie from the
> client, then that's it; if not, I also add the session data at the end
> of the internal links.

After sleeping on it I agree to a point.  I think the url-session should
be first thing in the url and the site should be fully relatively linked.  
Cookies are a lot "cleaner" for the user and transparent.  So I've written
up pseudo-code (I learned something in college!) on the logic:

User makes request:
  if a cookie exists with session_id
then verify it is a valid session_id
if a session-url exists remove it and rely on cookies
if session is expired   # timed expirations as a security measure
  auth them again if needed and/else redirect to requested page.

  else if a session_url exists with no cookie
verify validity and exipiration as above

  else if no cookie and no url session
new session, set cookie and set session-url
  
  timestamp the session for expiration.


Other notes:
  Having to re-write site-wide urls seems like a bad idea.  It negates any
caching (on both server and client sides), and forces all the pages to be
dynamic.  Relative links (although not the ../../prettiest thing) seems
like the best route.

This way of doing sessions doesn't sit right with me, but I suppose when
your only tool is a hammer...

Jay Jacobs
LachNet Inc.




Re: [Summation] 100% sessions?

2000-05-10 Thread Jay Jacobs

  So as I see it there are essentially 2 *mostly* reliable ways, cookies
and url-rewriting.  Both have drawbacks and neither are 100%.  There
really isn't a way to cross-reference anything else (IP or login) becuase
there are valid reasons for a user to come from multiple ip addresses
during a session (albeit rare), and sessions may be needed without
requiring a user to login.
  It also doesn't make sense to try to rely on both cookies and
url-rewriting, that would just get sloppy and waste time.  The only thing
to do is to pick one or the other and deal with the drawbacks associated
with that...

URLS:
- redirecting to a different site sends the session_id in the
HTTP_REFERER in some browsers, which ruins it for the rest of the world ;)
- requires site-wide url-rewriting or site-wide relative links (including
things like "../../index.html" which seems ugly IMO)
- users bookmarking with the session_id which may be expired on the server
side thus negating the bookmarked session.
- messes up logging unless a custom logging handler, or url-rewriting
before logging is implemented

Cookies:
- Turned off by user
- May be blocked all together by some proxies.

I'm sure I missed some points, but it's all I can think of at this
time.

Jay Jacobs
LachNet Inc.




Re: 100% sessions?

2000-05-09 Thread Jay Jacobs


On Tue, 9 May 2000, Jeffrey W. Baker wrote:
> Why is the session ID invalid just because they left for a week?  Ask them
> to authenticate again and take them right back to whatever they were
> doing.
> 
> On some sites bookmarking the URL with the session ID embedded is the
> optimal behavior.
> 
> -jwb

Session-jumping is a key concern in my application, once a user logs,
they're going to be looking at sensitive information that pertains
directly to that user.  Sessions need to be timed and expire in a short
amount of time (30 mins or so) of inactivity.

If a registered user comes back after that time (from a bookmark or
refresh), I'm going to redirect them to the login page, and then putting
them to the originally requested document after they authenticate, just
like you said.

I just can't see tying in the ip address, or any other mechanism as being
100% effective for session management... 

Jay




100% sessions?

2000-05-09 Thread Jay Jacobs

I've been perusing the archives on the topic of cookie vs. url vs. user
session tracking, and I can't find a solution that is 100% effective.

Here's the scenario... using Apache::Session::DBI on a public site, where
registered users can log in to get detailed information and "place orders"
online.  Non-registered users will get basic information and ideally
should be able to "place orders" that will have no real effect on the site
(i.e. shopping cart with no purchasing)

Here's some major concerns I groked from the archives:
cookies: disabled from proxies, or disabled for "security"
user-based: wouldn't solve non-registered user issue, nor site-wide
url: requires site-wide url-rewriting, insecure from HTTP_REFERER
standpoint

My thought is to try to verify it from ip but that breaks when proxies
come from more than one ip (AOL), or when nat is in place covering
multiple client systems.  Also adding a lame security attempt, and put a
timed expiration on the server-side session after an hour or so.

I'm thinking of just relying on cookies, while not 100%, it's gotta be
close to 80 or 90% which may be good for this project.  But I figured
others had faced this same issue and had an ample solution...

Jay Jacobs
LachNet Inc.




Re: mod_perl mixing up scripts?

2000-01-13 Thread Jay J

- Original Message -
From: "Jason Terry" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 12, 2000 11:43 AM
Subject: Re: mod_perl mixing up scripts?


> I do not consider myself a mod_perl guru... But, it sounds like you are
> having troubles with global variables.  Once you have the script compiled
go
> here...
>
> 1) http://yourserver.com/perl-status
> 2) click "Compiled Registry Scripts"
> 3) click on the script in question
> 4) check on your hashes, scalars, and unknown variable at the bottom.
>
> My bet is that some of these is not being properly initialized for each
pass
> through your script.

Hmm, off-hand, how about duplicate package names?

-Jay J


> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 12, 2000 9:05 AM
> Subject: mod_perl mixing up scripts?
>
>
> >
> > Oh great mod_perl sages...I beseech thee on bended knee ( with eyes
> > averted)   :>)
> >
> > I'd like to preface this by saying that I _hate_ to ask lists for help,
so
> > do all I can to research the problem on my own... but I'm not sure I'm
> even
> > looking in the right place. I've read the mod_perl guide (have it
printed
> > and in a binder, in fact). Any assistance (including pointing me in the
> > right direction) would be greatly appreciated.
> >
> > I'm running Apache 1.3.9/mod_perl1.21 on a Mac Workgroup Server,
LinuxPPC
> > (1999). I have a group calendar script (FrameCal,
> > http://www.blue-gecko.com/framecal ) that is giving me problems.
> >
> > Actually, I have one calendar working perfectly with no problems. You
are
> > supposed to be able to create additional calendars that use the same
> > script. Each calendar has it's own separate folder (with it's own
separate
> > characteristics set in a .conf file). You pass the calendar information
> > when you call the script. ( action
> > ="URLtoScript/framecal.pl?calendar=whichCalendar".
> >
> > The problem is that the 2nd calendar has it's own set of authorized
users
> ,
> > and event catagories. It will work fine for a while when I restart
Apache,
> > but before long it will not let it's users log in. Checking out the drop
> > down menu it becomes apparent that you are looking at the catagories for
> > THE OTHER calendar. Restarting the server fixes the problem again for a
> > while.
> >
> > I thought that setting up entirely different framecal scripts in
entirely
> > different folders for the two calendars would solve the problem. So, the
> > script that works is in
> > /cgi-bin/calendar/admissions/framecal.pl
> > and the script that doesn't work is in
> > /cgi-bin/newscalendar/news/framecal.pl
> > but the information from the one calendar is still being confused by the
> > server with the other (though apparently not vice-versa).
> >
> > I believe that I have both locations set up with the exact same
> > permissions/access restrictions, but I suspect that I am missing
something
> > that involves the mod_perl aspects of the apache httpd.conf.
> >
> > Is there something that I can learn from calling myserver.edu/status or
> > /perl-status? (It looks like I need to recompile with Devel::Sydump to
get
> > much info from perl-status... if I knew what to do with it.)
> >
> > Maybe more info than you need to know, but... here is the list of Apache
> > compiled-in modules...
> > http_core.c
> > mod_env.c
> > mod_log_config.c
> > mod_mime.c
> > mod_negotiation.c
> > mod_status.c
> > mod_include.c
> > mod_autoindex.c
> > mod_dir.c
> > mod_cgi.c
> > mod_asis.c
> > mod_imap.c
> > mod_actions.c
> > mod_userdir.c
> > mod_alias.c
> > mod_access.c
> > mod_auth.c
> > mod_setenvif.c
> > mod_perl.c
> >
> > Thanks for any ideas you might have to share.
> >
> > Darren Addy
> > University of Nebraska at Kearney
> >
>



Re: preventing speaking HTTP to HTTPS port

1999-12-22 Thread Jay J

- Original Message -
From: "Kees Vonk 7249 24549" <[EMAIL PROTECTED]>
To: "modperl" <[EMAIL PROTECTED]>
Sent: Wednesday, December 22, 1999 5:55 AM
Subject: preventing speaking HTTP to HTTPS port


> I run a SSL enable intranet site, unfortunately a lot of
> users try to get to the site using the http (instead of
> https) protocol, this results in lots of the following
> messages appearing in the log file:
>
[snip]
> Is there anyway I can trap those situations send the users a
> nice message and stop my error log being poluted? At the
> moment this seems to result in a 404 being returned.
>
>
> Kees

This problem is also a candidate for mod_rewrite, especially if it's a
unique server name, otherwise maybe based on URI.

RSE's site seems to be down:

http://www.google.com/search?q=cache:www.engelschall.com/pw/apache/rewritegu
ide/

-Jay J

[btw - I believe this is far far off-topic]




Re: again - more then one PerlTransHandler

1999-12-15 Thread Jay J

- Original Message -
From: "Andrei A. Voropaev" <[EMAIL PROTECTED]>
To: "Evgenii Bazarov" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, December 15, 1999 10:18 AM
Subject: Re: again - more then one PerlTransHandler


> It works perfectly well for me. I have modperl 1.21, apache 1.3.9 on
> RedHad linux (5.2). I install any number of TransHandlers and as long
> as each one of them returns DECLINED they are all executed. I tried
> both ways (one line and multiple lines) and everything has worked.
>
> Probably you just need to make sure that you used EVERYTHING=1 when
> you compiled modperl. That's what I had and nothing else.
>
> Andrei

Out of curiosity, would it be PERL_STACKED_HANDLERS=1 specifically?

-Jay J



> On Mon, Dec 13, 1999 at 06:41:45AM -0700, Evgenii Bazarov wrote:
> > Hi everybody,
> >
> > Sorry for the poor wording of my question. Once again:
> >
> > I am trying to install and use more then one translation
> > handler. I tried two approaches to specifying handlers
> > in the Apache config file (both recommended in the
> > "Eagle" book.) First, have both handlers on the same line,
> > e.g. in httpd.conf
> >
> > PerlTransHandler  SimpleTranslation::handler FancyTranslation::handler
> >
> > In this case Apache spits out error:
> >
> >  Syntax error on line 29 of /etc/httpd/conf/perl.conf
> >  PerlTransHandler takes one argument, the Perl Translation handler
routine
> > name.
> >
> > and exits.
> >
> > Secondly I tried to put two lines in config:
> >
> > PerlTransHandler  SimpleTranslation::handler
> > PerlTransHandler  FancyTranslation::handler
> >
> > In this case, only second handler gets invoked.
> > Am I missing something?!!!
> >
> > Evg
> >
> >
> >
> > 
> > Hi!
> >
> > I tried to set more then one PerlTransHandler but
> > if I specify both on the same line, Apache says
> > "syntax error", otherwise it see only the last one.
> >
> > Apache 1.3.6 on Linux with mod_perl 1.19
> >
> > According to "Apache Modules" book it should be
> > possible... Any advice will be highly appreciated!
> >
> > Cheers,
> > Evg
> >
> >
> >
> > 
> > Get free email and a permanent address at http://www.netaddress.com/?N=1
>
> --
>



Re: Newbie: Running script using Apache API

1999-12-10 Thread Jay J

- Original Message -
From: "Michael Dearman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 10, 1999 5:35 AM
Subject: Newbie: Running script using Apache API


> Howdy all,
>
> Trying to run a script from the Eagle Book (ch.4 Example 4-14)
> Using the Apache API, so it looks like:
>
> #!/usr/bin/perl -w
> # file perl/hello3.pl
>
> use strict:
>
> my $r-> = Apache->request;
> $r->content_type('text/html');
> $r->send_http_header;
> return OK unless $r->header_only;
> .
> And so on. Like a module.pm in other words.
>
> It doesn't work. The 'perl/' dir is the one set up for other scripts.
> The perl.conf for this dir is per book directions.
>
> 
>  SetHandler perl-script
>  PerlHandlerApache::Registry
>  PerlSendHeader On
>  Options+ExecCGI
> 
[snip]
> Thanks,
> M. Dearman

Hey Michael,

You seem to have missed something along the way. The answer actually lies in
your own explanation of the problem.

For that location, you already have a handler -> Apache::Registry, what you
want* is your .pm as the handler for a particular location. I think if you
page back a chapter or two you'll see examples of how httpd.conf or
.htaccess files should be setup.

-Jay J

(omitting all mention [except this] of stacked handlers for this example)





Re: Logo / Brand

1999-12-04 Thread Jay J

- Original Message -
From: "Ken Williams" <[EMAIL PROTECTED]>
To: "Bill Desjardins" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, December 04, 1999 11:31 PM
Subject: Re: mod_perl Programmers demand is going up...

Ken wrote:
> I'd rather see a camel with wings.  Seems like an eagle without wings
isn't
> much of an eagle, and a camel without a hump isn't much of a camel.
>
> Just like mod_perl gives you all the power of Apache & Perl together?
>
> Yeah, I'm reaching.
>

It occurred to me that an appropriate metaphor might be an elephant. :-)

After all, an elephant: never forgets, it towers over the other animals in
the jungle, it's often hunted by evil human predators, one can easily afix a
saddle to ride on top, it's smart: "They have the biggest brain (12
lbs.)..", it's thick skinned.

Maybe we adorn it's back with an apache-feather colored blanket, or a
feather behind it's ear.

>From the latin pachydermas apacheous?

http://www.reno.quik.com/snow/elephant.html
http://www.lazoo.org/elephants/elephant_facts.html

The logo :-) http://www.lazoo.org/elephants/ELEPHANT.GIF

Couple problems though, it might be tough to make an elephant look "cool"
(shades?), and the obvious jab: mod_perl = elephant = big footprint = proof:
ps aux | grep apache :-o

-Jay J




> [EMAIL PROTECTED] (Bill Desjardins) wrote:
> >Or even the head of a camel on an eagles body? I guess you could call it
> >an Eamel ;-)
> >
> >my $.02
> >
> >Bill
> >
> >===
> >Bill Desjardinshttp://www.carracing.com
> >[EMAIL PROTECTED]Tel: 305.205.8644
> >FREE Homepages for Racers and Race Tracks!!
> >
> >On Sat, 4 Dec 1999, Rod Butcher wrote:
> >
> >> Um... how about a mythical beast with the head of an eagle and the body
> >> of a camel ?
> >> Rod




Re: Logo / brand

1999-12-04 Thread Jay J

- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Victor Zamouline" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, December 04, 1999 11:08 AM
Subject: Re: Logo / brand


> > I have browsed my graphic libraries and put some eagles and other birds
at:
> >
> > http://www.jazzvalley.com/modperl/symbols/index.html
> >
> > I am not a graphist, but those willing to make a sketch of a logo
(assuming
> > there is an eagle on it) may use some of that stuff.
>
> I loved the drawings as they are closer to being a logo-like vs the real
> photos. Especially I liked:
> http://www.jazzvalley.com/images/modperl/animals/birds/gif/hawk7.gif
> http://www.jazzvalley.com/images/modperl/animals/birds/gif/baldegl1.gif
> http://www.jazzvalley.com/images/modperl/animals/birds/gif/baldegl3.gif

Speaking of drawings vs. photo ...

If needed, I can take a stab at converting any photos to line-art (ala Adobe
Streamline and friends).

I also do 3DSMax stuff (mostly hobby/addiction) if that's of any interest.
Sometimes it's easier to use Max to achieve certain effects on 2D
graphics (shadows, bevels/extrudes, rotations, text animation, etc).

-Jay J



Re: "DigExt" in user-agent hammering my site

1999-10-28 Thread Jay J

- Original Message -
From: Randal L. Schwartz <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, October 28, 1999 9:50 AM
Subject: "DigExt" in user-agent hammering my site


>
> In the past week or so, I've been seeing many many portions of my site
> sucked down in rapid fire.  These sucks followed patterns of being a
> spider -- some autogenerated URLs from pod2html are definitely bad,
> and I saw these bad hits, indicating that someone is following every
> link in every one of my WT columns.  robots.txt is *occasionally*
> being fetched, but not always.
>
> The only thing in common with these rude intrusions is a windows-IE
> user agent, along with a new string "DigExt".
>
> Has anyone else seen this?  Can we trace this back to some lousy user
> interface somewhere?  I tried blocking them, and I got back some users
> that wondered why I was blocking them.
>
> Is it a new version of IE that permits heavy rapid download?
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
> <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!

Hey Randal,

I just tried it using IE5 for NT4 ..

What you're seeing is when someone has used "Make available offline"
followed by:

"If this favorite links to other pages, would you like to make those pages
available offline too? [y/n] ... Download pages [x] links deep from this
page"

The useragent is this: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT;
DigExt)

And proceeds to crawl the site with 0-wait time between requests

I haven't inspected the client-header to see if there might be something to
indicate it's in "crawl" mode .. I think it's doubtful there is. So.

-Jay J




rwrite returned -1 (again) mod_perl 1.21

1999-10-04 Thread Jay J

A search of the archive revealed things like:

... Sep 1998: "It may be worth noting that I've so far only seen this
behavior on SSL connections"
... Oct 1998: "It means the client connection was broken. No cause for
alarm. With Apache 1.3.x you won't see that message unless LogLevel is set
to debug."
... May 1999: "This bug has been fixed in the CVS tree"

The http://perl.apache.org/guide mentions it as well..

Indeed I've got Loglevel's of debug/info .. but, should this still be
appearing?

Would it be of any interest that this request may* have been mod_rewrite'd
(like the guide example but SSL)?

I'll just turn down the logging and tell my users to quit aborting
connections ;-)
-Jay J


(( First message ))
[Mon Oct  4 02:22:36 1999] [info] [client xxx.xxx.xxx.xxx] (32)Broken pipe:
client stopped connection before rwrite completed

(( 28 times ))
[Mon Oct  4 02:22:36 1999] [debug] Apache.xs(355): (32)Broken pipe:
mod_perl: rwrite returned -1 (fd=4, B_EOUT=8)

(( 4830 times ))
[Mon Oct  4 02:22:36 1999] [debug] Apache.xs(355): mod_perl: rwrite
returned -1 (fd=4, B_EOUT=8)
...
[Mon Oct  4 02:23:09 1999] [debug] Apache.xs(355): mod_perl: rwrite
returned -1 (fd=4, B_EOUT=8)


Server: Apache/1.3.6 (Unix) mod_perl/1.21 mod_ssl/2.3.6 OpenSSL/0.9.3a

httpd.conf:
 LogLevel debug
 SSLLogLevel info

Compiled-in modules:
  http_core.c
  mod_env.c
  mod_log_config.c
  mod_mime.c
  mod_negotiation.c
  mod_status.c
  mod_include.c
  mod_autoindex.c
  mod_dir.c
  mod_cgi.c
  mod_asis.c
  mod_actions.c
  mod_userdir.c
  mod_proxy.c
  mod_alias.c
  mod_rewrite.c
  mod_access.c
  mod_auth.c
  mod_setenvif.c
  mod_ssl.c
  mod_perl.c


Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
osname=linux, osvers=2.0.36, archname=i686-linux
uname='linux localhost 2.0.36 #1 tue oct 13 22:17:11 edt 1998 i686
unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-O2', gccversion=2.7.2.3
cppflags='-Dbool=char -DHAS_BOOL'
ccflags ='-Dbool=char -DHAS_BOOL'
stdchar='char', d_stdstdio=define, 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 -lndbm -lgdbm -ldb -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 Jan 26 1999 09:59:09
  @INC:
/usr/lib/perl5/5.00502/i686-linux
/usr/lib/perl5/5.00502
/usr/lib/perl5/site_perl/5.005/i686-linux
/usr/lib/perl5/site_perl/5.005