Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Greg Cope

Andrew Ho wrote:
> 
> Hello,
> 
> I checked the list archives and it didn't look like this had been posted yet.
> For those of you who haven't seen it yet... a great read on perl.com about
> the Apache/mod_perl setup at eToys, co-authored by our own mod_perl
> regular contributer Perrin Harkins.
> 
> http://www.perl.com/pub/a/2001/10/17/etoys.html
> 

Yup, this is an excellent read.  Thanks Perrin.

Greg



CPAN and libapreq

2001-09-25 Thread Greg Cope

Dear All

Doing an automated install on a new dev server I noticed that with a
snapshot bundle created on another, it lists libapreq-0.33 as being
Apache::libapreq.

When cpan comes to install the bundle and looks for Apache::libapreq it
downloads 0.31 eg:

cpan> i /libapreq/
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
  Database was generated on Tue, 25 Sep 2001 08:01:47 GMT
CPAN: HTTP::Date loaded ok
Going to read /root/.cpan/sources/modules/03modlist.data.gz
DistributionD/DO/DOUGM/libapreq-0.31.tar.gz
DistributionJ/JI/JIMW/libapreq-0.33.tar.gz
Module  Apache::libapreq (D/DO/DOUGM/libapreq-0.31.tar.gz)


I am assuming something is up here - I can overide this, but can the
pointer for module Apache::libapreq been changed to libapreq-0.33 on
cpan mirros ?

Thanks

Greg



Re: Mod_perl and Post Read Request

2001-04-12 Thread Greg Cope

Jay Thorne wrote:
> 
> 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?
> 

Did you complie mod_perl with the configure option of EVERYTHING=1 ?

I've found that dead chickens help the juju along, but invaribaly the
answer lies elsewhere ;-)

Hope that helps.

Greg


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




Re: unreleased sockets using DBI / DBD::mysql under mod_perl?

2001-03-14 Thread Greg Cope

Joern Janoschek wrote:
> 
> On Wed, 14 Mar 2001 18:46:31 +, Greg Cope wrote:
> 
> >There's no reason why Apache::DBI should not work - by the sounds of it
> >the connections strings may have been different ?
> >
> >Apache::DBI works in an environment where on user ID is used to connect
> >to the DB mulitple time.  If you use two different connection strings
> >Apache::DBI will try and make both persistent (IIRC).
> >
> >So check your DBI connection strings as they should be indentical.
> 
> Here is the problem: The connection strings _are_ the same. No
> change at all between two connects... same host, same user, same
> DB, even the same table (not that it bothers)... nothing
> changes. That's the strange thing and that's what we didn't
> understand at all and what pushed us to the point where we
> disabled Apache::DBI.
> Could it be that there is a connection between the socket
> problem and the ever rising persistent connections? Maybe the
> Apache::DBI cannot share an already connected handle because the
> system says the socket is still in use and not free at all. That
> would explain the unusual behaviour of Apache::DBI...
> Maybe someone who hasn't an explaination could tell me at least
> where to look at? Linux system? Apache? mod_perl? Mysql?
> DBI/DBD?
> 

This would appear to be a DBI problem - but I'm no expert.  Have you
tried the DBI list ?

I am afraid I can shed no further light on this.

Greg


> Thanks anyway,
> 
> Jörn Janoschek.
> KLAHOLD - We make IT work! - http://www.klahold.de
> - WebDevelopment - http://www.klahold.de
> - Content-Management-System - http://www.interred.de



Re: unreleased sockets using DBI / DBD::mysql under mod_perl?

2001-03-14 Thread Greg Cope

Joern Janoschek wrote:
> 
> Hi,
> 
> we are currently developing several Perl scripts for a big
> german site with high traffic and the need of fast DB
> connections. The webserver are Apache 1.3.14 setup with mod_perl
> (current version as far as I know). The scripts connect to a
> Mysql 3.2332 on another machine over a socket connections.
> Now the problem: High traffic result to many connections to the
> DB. The DB seems to be fast enough (4 Xeon 750 machine with 4
> GB) to handle those requests. BUT after some time the DB get
> flooded by unauthorised connections. Looking at the DB server
> stats it doesn't look like a high demand for processor power...
> the machine is idling as far as a DB server can be idle. Those
> faulty connection, we can't get rid of. Once they are coming in,
> the DB doesn't seem capable of handling, authenticating or
> refusing them properly.
> We regard this as a some sort of mod_perl socket problems
> because performance tests during the night, using PHP with the
> same queries and similar load proof to be all correctly
> answered. No unauthenticated connection in the processlist of
> the mysql, even when there are 500 concurrent DB requests
> running.
> Taking a peek at the webserver netstats when connecting with
> Perl scripts show a lot of open and not closing socket
> connections to the mysql... only after some timeout period they
> get disconnected.
> Currently Perl tests over mod_cgi still have to be made, but I
> doubt this will be a problem, but who knows... maybe we have
> some DBD::mysql configuration problem here? This is surely the
> wrong list to ask... :-) but you'll never know, maybe sonmeone
> reading this can point me in the propper direction.
> 
> Anyway, anyone experienced the same behaviour before? Any hint
> to a solution are greatly appreciated, we need a
> fix/solution/workaround soon!
> 
> A word on Apache::DBI: Yes, we did try persistant connections to
> avoid heavy connection load on the mysql. BUT it simply didn't
> work. Well sort of. Persistant connections were established, but
> they never got reused. Until about 7 open connections
> resulted in a DB crash. Not nice. Same problem with a
> corresponding persistant connection test using PHP... maybe a
> Mysql client source configuration problem or something like it?
> Anyone experienced this before?
> 

There's no reason why Apache::DBI should not work - by the sounds of it
the connections strings may have been different ?

Apache::DBI works in an environment where on user ID is used to connect
to the DB mulitple time.  If you use two different connection strings
Apache::DBI will try and make both persistent (IIRC).

So check your DBI connection strings as they should be indentical.

Greg


> Thanks for any help or hint,
> 
> Jörn Janoschek.
> KLAHOLD - We make IT work! - http://www.klahold.de
> - WebDevelopment - http://www.klahold.de
> - Content-Management-System - http://www.interred.de



Re: [OT] Re: mod_perl shared memory with MM

2001-03-11 Thread Greg Cope

Perrin Harkins wrote:
> 
> > Can I ask why you are not useing IPC::Sharedlight (as its pure C and
> > apparently much faster than IPC::Shareable - I've never benchmarked it
> > as I've also used IPC::Sharedlight).
> 
> Full circle back to the original topic...
> IPC::MM is implemented in C and offers an actual hash interface backed by a
> BTree in shared memory.  IPC::ShareLite only works for individual scalars.
> 

Not tried that one !

I'ce used the obvious Sharedlight plus Storable to serialise hashes.

> It wouldn't surprise me if a file system approach was faster than either of
> these on Linux, because of the agressive caching.

I would be an interesting benchmark ... Althought it may only be a
performance win on a lightly loaded machine,the assymption being that
the stat'ing is fast on a lowly loaded system with fast understressed
disks.  I could be completly wrong here tho ;-).

Has anyone used the file system approach on a RAM disk ?

Greg


> 
> - Perrin



Re: [OT] Re: mod_perl shared memory with MM

2001-03-11 Thread Greg Cope

DeWitt Clinton wrote:
> 
> On Sun, Mar 11, 2001 at 03:33:12PM +0100, Christian Jaeger wrote:
> 
> > I've looked at Cache::FileCache now and think it's (currently) not
> > possible to use for IPC::FsSharevars:
> >
> > I really miss locking capabilities. Imagine a script that reads a
> > value at the beginning of a request and writes it back at the end of
> > the request. If it's not locked during this time, another instance
> > can read the same value and then write another change back which is
> > then overwritten by the first instance.
> 
> I'm very intrigued by your thinking on locking.  I had never
> considered the transaction based approach to caching you are referring
> to.  I'll take this up privately with you, because we've strayed far
> off the mod_perl topic, although I find it fascinating.
> 
> > - why don't you use 'real' constants for $SUCCESS and the like? (use
> > constant)
> 
> Two reasons, mostly historical, and not necessarily good ones.
> 
> One, I benchmarked some code once that required high performance, and
> the use of constants was just slightly slower.
> 
> Two, I like the syntax $hash{$CONSTANT}.  If I remember correctly,
> $hash{CONSTANT} didn't work.  This may have changed in newer versions
> of Perl.
> 
> Obviously those are *very* small issues, and so it is mostly by habit
> that I don't use constant.  I would consider changing, but it would
> mean asking everyone using the code to change too, because they
> currently import and use the constants as Exported scalars.
> 
> Do you know of a very important reason to break compatibility and
> force the switch?  I'm not opposed to switching if I have to, but I'd
> like to minimize the impact on the users.
> 
> > - you probably should either append the userid of the process to
> > /tmp/FileCache or make this folder globally writeable (and set the
> > sticky flag). Otherwise other users get a permission error.
> 
> As of version 0.03, the cache directories, but not the cache entries,
> are globally writable by default.  Users can override this by changing
> the 'directory_umask' option, or keep data private altogether by
> changing the 'cache_root'.  What version did you test with?  There may
> be a bug in there.
> 
> > - why don't you use Storable.pm? It should be much faster than Data::Dumper
> 
> The TODO contains "Replace Data::Dumper with Storable (maybe)".  :)
> 
> The old File::Cache module used Storable, btw.
> 
> It will be trivial to port the new Cache::FileCache to use Storable.
> I simply wanted to wait until I had the benchmarking code so I could
> be sure that Storeable was faster.  Actually, I'm not 100% sure that I
> expect Storeable to be faster than Data::Dumper.  If Data::Dumper
> turns out to be about equally fast, then I'll stay with it, because it
> is available on all Perl installations, I believe.
> 
> Do you know if Storeable is definitely faster?  If you have benchmarks
> then I am more than happy to switch now.  Or, do you know of a reason,
> feature wise, that I should switch?  Again, it is trivial to do so.

I've found it to be arround 5 - 10 % faster - on simple stuff on some
benchmarking I did arround a year ago.

Can I ask why you are not useing IPC::Sharedlight (as its pure C and
apparently much faster than IPC::Shareable - I've never benchmarked it
as I've also used IPC::Sharedlight).

Greg

> 
> > >I have some preliminary benchmark code -- only good for relative
> > >benchmarking, but it is a start.  I'd be happy to post the results
> > >here if people are interested.
> >
> > Could you send me the code?, then I'll look into benchmarking my
> > module too.
> 
> I checked it in as Cache::CacheBenchmark.  It isn't good code, nor
> does it necessarily work just yet.  I simply checked it in while I was
> in the middle of working on it.  I'm turning it into a real
> benchmarking class for the cache, and hopefully that will help you a
> little bit.
> 
> Cheers,
> 
> -DeWitt



Re: Translation handler continuous loop problem

2001-01-31 Thread Greg Cope

"Sinclair, Alan (CORP, GEAccess)" wrote:
> 
> I am hoping someone might have a clue on how to resolve this awkward
> problem.
> 
> I have just installed a mod_perl URI translation handler to extract a
> session id from the URI. In general the translation works correctly by
> removing the session id from the URL when detected. However, a Netscape
> browser client triggers Apache to enter a continuous loop if I do not
> specify the domain name in the hostname component of the URL. The problem
> does not occur in Internet Explorer (that surprised me.)
> 
> All these examples are from Nestcape on both NT and Unix.
> For example, say I enter http://lions.access.com/sp9/outage.html  The
> translation handler works correctly.
> If I then enter: http://lions/sp9/outage.html  There is a continuous loop in
> Apache and on each iteration, an entry is written to access_log. I have to
> stop the request in Netscape.
> 
> The bizarre thing is I can enter any other URL such as
> http://lions/internal/whatever and there is no problem. The mod_perl
> translation header goal is stripping session id info from the URL in the
> form http://hostname/SESSION_ID/sp9/whatever It looks for sp9 in the path. I
> have attempted to debug by trying to send error messages to the error log
> without success.
> 
> Does anyone have any suggestions on how I can determine why the translation
> handler is entering into a continuous loop when a request is sent from
> Netscape?
> 
> I would be appreciative of any help!!

I could be completely wrong but ...

I can't see a problem here - although I would need to see the code.

There could be an issue with how IE and Netscape actually format the
header (i.e you may enter the above, but the header that gets sent may
be different) - but I could be completely wrong on this !

You may wish to look at http://sourceforge.net/projects/sessionmanager/

Which is URI transhandler / session manager that I wrote for a project
that never came about.  I may make another release that uses PerlSetVars
to configure the module if I get a chance to test it.

If this does not help, then post either the code, or a URL to the code
if its long, so that some of us can have a look.

Greg

> 
> Env is: Solaris 2.6  Apache 1.3.14  mod_perl 1.24_01



Whats the status of libapreq-32 ?!

2001-01-29 Thread Greg Cope

Dear All

I can rememeber that Jim Winstead was overhauling libapreq and sugested
that ver 0.32 may be out early in the new year if OK, is this still the
case ?

Greg



Re: [JOB] another bloke for hire...

2001-01-22 Thread Greg Cope

Matt Sergeant wrote:
> 
> If anyone has any spare tuits they want to donate to Take23, we have
> started the job postings stuff and have a spec for exactly what we want,
> but not really enough time to code it up. Experience with AxKit would be a
> huge bonus, otherwise you'll be right in at the deep end.
> 

Matt,

I've been looking at this - not alot, but a bit (as I am in the deep
end, and there is only so much XML I want at a time ;-)

A few minor issues:

Your NewsAdmin module appears to assume that all XML file under the doc
root are news XML files - how do you want to deal with this - I'll
change the last bit of the doc root (defined line 11) from news to jobs.

Also what sort of validation do you want on job posting - at the mo we
just upload a file, and edit the XML, I am happy posting jobs like this,
but what about t'others ?

I can write a kludgy form that accepts / validates input and creates
some XML as per discussions if thats what you want ?

Greg


> --
> 
> 
> /||** Director and CTO **
>//||**  AxKit.com Ltd   **  ** XML Application Serving **
>   // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
>  // \\| // ** Personal Web Site: http://sergeant.org/ **
>  \\//
>  //\\
> //  \\



Re: Upgrading mod_perl on production machine (again)

2001-01-16 Thread Greg Cope

Bill Moseley wrote:
> 
> This is a revisit of a question last September where I asked about
> upgrading mod_perl and Perl on a busy machine.
> 
> IIRC, Greg, Stas, and Perrin offered suggestions such as installing from
> RPMs or tarballs, and using symlinks.  The RPM/tarball option worries me a
> bit, since if I do forget a file, then I'll be down for a while, plus I
> don't have another machine of the same type where I can create the tarball.
>  Sym-linking works great for moving my test application into live action,
> but it seems trickier to do this with the entire Perl tree.
> 
> Here's the problem: this client only has this one machine, yet I need to
> setup a test copy of the application on the same machine running on a
> different port for the client and myself to test.  And I'd like to know
> that when the test code gets moved live, that all the exact same code is
> running (modules and all).
> 
> What to do in this situation?
> 
> a) not worry about it, and just make install mod_perl and restart the server
> and hope all goes well?

Hum  ignoring problem means that will bite you ! 

> 
> b) cp -rp /usr/local/lib/perl5 and use symlinks to move between the two?
> When ready to move, kill httpd, change the perl symlinks for the binary,
> perl lib, and httpd, and restart?

This is what I would do.

depending on present set up I would install all the above in a "new"
location - and then symlink to it.  Yup this does mean a few more disk
stat's, but means I can roll back most installs very quickly if
required.

Having said that I have not done it too often on an alien box.  Also is
the present perl easily simlinkable (i.e the binary and the lib tree).

I just play with the --prefix and usually do --prefix=package_version
(eg apache_perl_1.3.14 would be a mod_perl apache version 1.3.14).

Also you could script the change over if required to be xtra quick 
(although this is getting silly)

I've used this without any issues on Linux boxes for 18 months, but I am
very conservative about my perl (i.e I'm still on 5.005_03 and waiting
for 5.6.1 ;-)

> 
> c) setup a new set of perl, httpd, and my application and when ready to go
> live just change the port number?
> 
> Or simply put - how would you do this:
> 
> With one machine I want to upgrade perl to 5.6.0, upgrade your application
> code, new version of mod_perl, and allow for testing of the new setup for a
> few weeks, yet only require a few seconds of downtime to switch live (and
> back again if needed)?
> 
> Then I wonder which CPAN module I'll forget to install...

do a CPAN snapshot bundle of a known good install, and install that -
easy no ?

Just my 2 euro worth.

Greg

> 
> Bill Moseley
> mailto:[EMAIL PROTECTED]



[JOB SEEKER] Freelancer / contractor based in England (S.E)

2001-01-15 Thread Greg Cope

Dear All

I will be "available" soon for contract (tele-commuting) / freelance
work.

My skills include perl obviously! (mod_perl, OO, modules, and DBI),
Apache,
MySQL, Linux, Solaris, qmail, DNS, and iffy Sybase / Oracle.

I've been doing the usual CGI work and some mod_perl dynamic content /
custom handlers.  Also I been doing custom emailing, SMS server work,
and Sys admin (Linux and Solaris)

I can make meetings in London / South East (England, UK) if required.

URL's / code samples / references / CV etc  available on request.

Thanks,

Greg Cope





Re: Book/code recommendations needed for an urgent mod_perrl task

2000-12-28 Thread Greg Cope

Peter Demling wrote:
> 
> Greetings from a 1st-time poster,
> 
> I'm a seasoned web programmer, but a Perl beginner and
> mod_perl stranger who has an "as soon as possible"
> mod_perl script to write for our Apache web server, so
> I'd appreciate any recommendations for books or code
> you may have, which could assist me in my task.  What
> I have to do is as follows:
> 
> Write a mod_perl script which will: 1] be invoked
> (with parameters) by a web client; 2] use its input
> parameters to construct an SQL statement; 3] query an
> Oracle database on a seperate machine with the
> constructed SQL statement; 4] use the returned query
> results to set the values of some variables; 5] use
> these variables to construct HTML output, and send it
> back to the web client.
> 
> I'm a quick-read, so as a Perl beginner who wants to
> keep the script as simple as possible, I'm assuming
> that "Learning Perl" is the best text for me, but does
> anyone think that "Programming Perl" OR "The Perl
> Cookbook" might be a better choice?  I'm also thinking
> that "Writing Apache Modules with Perl and C" will be
> neccessary, but perhaps the online mod_perl guide
> would be sufficient?

IMHO Learning Perl is a little basic for someone with a bit of
programming experience - if you have little experience then read it.

Apache Modules in Perl & C has is some excellent book - and has some
good examples.

I find the Cookbook excellent for the answer to the "How do I do XXX ?"
questions.

Read the Guide - period !

> 
> Last, I'm assuming that the basic structure of this
> databse-driven web script is fairly common, so any
> pointers to relevant code I could base this on would
> be greatly appreciated.


>From the above you will have lots of examples to choose from.

Greg Cope

> 
> Sincerely,
>  -Peter Demling
>   Amherst, MA
>   [EMAIL PROTECTED]
> 
> __
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/



Re: Mod_perl tutorials

2000-12-13 Thread Greg Cope

Nathan Torkington wrote:
> 
> J. J. Horner writes:
> > What is the story on these tutorials?  Is it something you can
> > distribute, or did most of it come off of the top your head?
> 
> Tutorials seems like a deadend for effort.  I've had zero (0)
> responses to my offer of my "Introduction to mod_perl" tutorial.

I'd be interested - although I hope I am beyond that stage now ;-).

I would like to see these sorts of things and "success stories" - how
ever short in the web to do a bit of advocay and (hopefully) attract
more developers (and mindshare).

Subliminal hint - www.take23.org

> 
> If nobody's interested in increasing the number of mod_perl
> programmers through tutorials, then the only other option I can think
> of is strategically-placed success stories.

agreed.

> 
> I know that perl.oreilly.com is making a point of collecting Perl
> success stories and is always hungry for more.  They won't convert
> the unwashed there, though.
> 
> It'd sure be nice to have a WebTechniques special issue on mod_perl.
> Hint, hint, Randal :-)

nudges from here as well ;-)


Greg
> 
> Nat



Re: Article idea: mod_perl + JSP

2000-12-13 Thread Greg Cope

Chris Winters wrote:
> 
> * Gunther Birznieks ([EMAIL PROTECTED]) [001212 23:53]:
> 
> > ...
> >
> > A well-specified app is always easier to code regardless of Java or Perl.
> > Over the years I've become more of a fan of seeing the benefits of good
> > software engineering than really thinking a particular language is a silver
> > bullet.
> 
> Yes -- it really comes down to what a company uses already and what
> it's being used for. My company is developing from scratch a web-based
> front end to a Visual Basic/SQL Server application. We could certainly
> do it faster in Perl (that's just because our Perl background is much
> stronger than our Java background), but having a Java-based solution
> is sexier and therefore more marketable than a Perl-based
> solution. (We are in business to make money, after all.) Is that a
> legitimate reason? I think so, but it's certainly a grey area.
> 
> > With that said though, I still love Perl.
> 
> Me too :-) It's frustrating to be doing something in Java that would
> take a much shorter time in Perl. But then there are things in Java
> that are simpler than Perl as well.
> 

Appologies if I am butting in - but what you apppear to say here is that
you are using JAVA because its sex / marketdriods know of it, yet perl
would be the quicker (and hence cheaper solution ?).  Surley for this
reason you should use perl and persuade the PBH of the cost benefit here
?

This has hit on a point - in that may people choose Java over Perl
because its sexier, which becomes self forfilling, unless we (the perl
community) persaude people that (mod_)perl is sexy


Greg

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




Re: mod_perl & IPC under Solaris 7

2000-12-10 Thread Greg Cope

Steven Cotton wrote:
> 
> Hi,
> 
> Anyone here any good with debugging IPC "No space left on device" errors?
> I can't find anything on the web or in deja, and am basically at a
> loss. Using Storable 0.703 and ShareLite 0.08 I'm getting a lot of the
> above errors when I have around 40 httpd children. Has anyone else used
> IPC under mod_perl and had the same errors? I can't even seem to find out
> what it is I'm running out of ..

shared memory segments ...

Different OS have different IPC limits

My linux box has ipcs and ipcrm (look at the man page first).


Greg Cope


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



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




Re: RFC: mod_perl advocacy project resurrection

2000-12-08 Thread Greg Cope

[EMAIL PROTECTED] wrote:
> 
> On Thu, 7 Dec 2000, Matt Sergeant wrote:
> 
> 
>
> > I'd love that. In fact anything that anyone had waiting to go onto
> > PerlMonth please drop a mail to [EMAIL PROTECTED] and we'll get you
> > published. (assuming that PerlMonth isn't going to resurrect itself)
> 
> Actually its kinda has been resurrected. Or it will be on the upcoming
> monday. There are a lot of mod_perl articles on PelrMonth and it will
> continue.
> 
> Next issue has an article by Stas and Gerald Richter. As far as articles
> are concerned perlmonth.com has about 20 or so mod_perl related articles.
> 
> I know I've kinda been absent for some time. And I want to publicly
> apologize to the readers and the writers.

Hurray !

Can I say thanks - I like perl month!

Is the HTML::Template part 2 in there ?

Is it back for "good" (good >= 3 plus months ?)

Greg

> 
> But the next issue will be out upcoming monday.
> 
> I am also contemplating on starting www.apachemonth.com, and looking for
> someone to possibly write mod_perl related articles on such topics like,
> handling different phases of Apache with mod_perl, writing
> PerlTransHandlers, explanations on *Handlers, stuff that is more closely
> related to Apache, rather than templating solutions and such, which serve
> better under PerlMonth.
> 
> If anyone is interested in that please drop me a line or two.
> 
> -
> Baiju Thakkar
> http://www.perlmonth.comhttp://www.linuxmonth.com
> Just use Perl;  #!/boot/linux
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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




Re: RFC: mod_perl advocacy project resurrection

2000-12-06 Thread Greg Cope

Stas Bekman wrote:
> 
> Well as you've probably figured out, based on the load of email from me,
> I've dropped my last job, in order to finally finish the mod_perl book,
> have some rest and make a push to mod_perl.
> 

Well best of luck & hope you have a good rest - I'll certainly buy the
book!

> In Paris we couldn't hire a single mod_perl programmer, because people
> don't even know what that. They know a lot about php and ASP. It's true
> that they don't even know what's Perl :(

I think this is a general situation - sounds similar to the uk.

> But, you all know that php pretty much takes over. Why? For two reasons:
> 1) initial corporate pushing (press/ads)
> 2) once well known, the word of the mouth does the rest.

Well go back 2 / 2 1/2 years and PHP was little known.

> mod_perl lucks the corporate money/PR to get pushed. But we can still work
> on the exposure, which will bring corporate money/PR thru the word of the
> mouth.

I think your on the right track, as many other popular open source
things have started this way. 

\> Luckily Matt has got sick of waiting for someone to work on the
advocacy
> of mod_perl and he has just taken over it. Having a good informational
> site is good, but it's not enough. We need to solve the problem of people
> to find this site and wanting to use mod_perl. Solution? Spreading the
> word.
> 
> I see two main streams:
> 1) Online zines.
> 2) Conferences.
> 
> I think that we should start working on locating ezines wanting to publish
> mod_perl related articles (preferrably for a fee, to give incentives for
> others to write) and conferences where mod_perl can be relevant. The data
> is to be collected and distributed to the people who wish to advocate
> mod_perl, thru written articles and conference classes. I suppose that we
> will also look for companies who want to order mod_perl classes and find
> the teachers in the appropriate areas.

I think may people could write simple "How to ZXY" in mod_perl.  PHP has
excellent resources for similar things i.e how to do this or that.  Very
much like the Perl Cookbook.

I am not saying that mod_perl does not have these, and the guide has
some excellent examples, but these are often not easy to find and will
not attact people half as much as reading a single all-in one atricle.

> May be we could organize some certification classes, to give more PR to
> mod_perl.

Not wishing to sound negative - but certification more often causes
problems - MCSE's a case in point.

Overall Stas I think more aticles in the general IT press be it ezines
or in paper is the way to go to raise the profile.

As an aside whats happening to perl month ? as this appears to be
exactly the sort of thing we need.

Greg

> I suppose that much more can be done. Comments are welcome.
> 
> _
> Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
> http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
> mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
> http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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




Re: Antwort: RFC: DBI::Prof

2000-12-01 Thread Greg Cope

Tim Bunce wrote:
> 
> On Fri, Dec 01, 2000 at 09:48:34AM +, Matt Sergeant wrote:
> > On Fri, 1 Dec 2000, Tim Bunce wrote:
> >
> > > On Fri, Dec 01, 2000 at 02:37:47AM +0100, Stas Bekman wrote:
> > > >
> > > > It would be much easier for Tim to do it from the inside than any of us
> > > > doing the overloading hacking, but that's up to Tim to decide when if ever
> > > > this should go in :)
> > >
> > > Things are changing for the better workwise now and I hope to get back to
> > > regular DBI and DBD::Oracle (and Oracle::OCI) work early next year.
> >
> > You said that at TPC :-)
> 
> Yeah, well... there are plans and there are plans :)
> 
> I recently gave notice to the company that I've been Technical Director
> of for many years that I'll be leaving in March 2001. Such big changes
> of direction take time to work up to and work out smoothly. I am
> specifically rearranging things so I have time for DBI related work.

Very interesting.

Although a bit OT, but I am sure everyone is interested, what changes
are you planning for DBI ?

Greg

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



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




Probably [OT] Are there any Simple Generic Server modules

2000-11-20 Thread Greg Cope

Dear All

This is a little OT - but bear with me.

I am looking for a simple generic server (prefably OO) that I can use
for my NON OO stuff.

I have writen my own, but I am after ideas 

One project I've got involves getting HTML (template)files via LWP, and
uploads them into an IPC cache for HTML::Template.  It needs to accept
signals so that Apache can HUP it to go get new templates.

Using a generic server class can enable me to get the code out of
apache.

Any clues welcome.

Thanks.

Greg

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




Re: [ANNOUNCE] ApacheCon USA 2001: Call For Papers

2000-11-14 Thread Greg Cope

Gunther Birznieks wrote:
> 
> At 01:58 PM 11/14/00 +0100, Robin Berjon wrote:
> >At 11:22 14/11/2000 +0100, Stas Bekman wrote:
> > >Just as with TPC our aim is to have a full double room track for mod_perl
> > >for all 3 days. So make sure that you submit enough mod_perl material, so
> > >we will have it full.
> >
> >I have some experience speaking before a crowd at conferences (though not
> >at technical ones) or on stage and I think I know mod_perl enough to be
> >able to write about several aspects of using it. The one thing I'm missing
> >is inspiration :) Are there any subjects that desperatly beg to be talked
> >about but have no writer/speaker ?
> Speaking on just what I'd like to see... but my tastes may be a bit eclectic.
> 
> I'd like to see a talk on templating systems and mod_perl. Hint to whomever
> is watching. :)

Your trying to reignight that old thread  don the flame proff stuff,
seriously this would be a good mod_perl thing.

Matt are you going to do something on AXKit ?

> 
> Actually I suspect case studies would be good.
> 
> I'd also be very interested in performance benchmarks related to some of
> the more sophisticated techniques people talk about (eg using IPC vs files
> for storing shared data).
> 
> 
> Maybe a case study on developing huge sites on mod_perl. I imagine the
> system Ask works on would be an interesting engineering case study with
> real world benchmarks.

This would be good "advertising" and hence help when we go to a
{client|boss|manager|person with pointy hair} and say look at mod_perl
site XZY runs it (and hopefully they go "Ah ... your hired !" ;-). 

> I'd also love to see an as objective as possible talk comparing the
> mod_perl 1.0 and 2.0 architectures to the Apache Java Servlet/JSP stuff.
> And maybe some performance comparisons for simple stuff written in both.
> Not too many people use both Java and Perl and I think most people don't
> really understand how or where one should/could be used over the other.

Gunter - sounds like you are talking yourself into a slot here - again
this would be interesting from a PHB perspective i.e put mod_perl into
context with Java.


If any one is interested I could do something on Session Manager - which
I've been looking at rewriting in C - but I have to learn C at the same
time so its very slow 


Greg

> 
> Later,
> Gunther





Re: [OT] mod_perl evangelism

2000-11-14 Thread Greg Cope

David Hodgkinson wrote:
> 
> Chaps,
> 
> In the last couple of days and on several mailing lists (MySQL for
> one), I've seen people pointed to www.phpbuilder.org for answers.
> 
> Where the hell's the mod_perl version?!

Agreed.

I've always thought that php had better "web support" in terms of "How
to do this  in php" or tutorials.  mod_perl's lack of similar
resources is not a bad thing.

Stas was up to something similar with sourcegarden - do not know where
thats upto - I think Stas has been buzy with other things.

I'd help with something  (sticking his head out on a block ;-)

Greg

> 
> --
> Dave Hodgkinson, http://www.hodgkinson.org
> Editor-in-chief, The Highway Star   http://www.deep-purple.com
>   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
>   -





Re: Sharing vars across httpds

2000-11-08 Thread Greg Cope

Perrin Harkins wrote:
> 
> On Mon, 6 Nov 2000, Differentiated Software Solutions Pvt. Ltd wrote:
> > We want to share a variable across different httpd processes.
> > Our requirement is as follows :
> >
> > 1. We want to define one variable (which is a large hash).
> > 2. Every httpd should be able to access this variable (read-only).
> > 3. Periodically (every hour) we would like to have another mod_perl program to 
>refresh/recreate this large hash with new values
> > 4. After this, we want the new values in the hash to be available across httpds
> 
> If that's all you want to do, I would stay away from the notoriously slow
> and sometimes tricky IPC modules.  My dirt simple approach is to put the
> data in a file and then read it into each httpd.  (No point in trying to
> load it before forking if you're going to refresh it in an hour
> anyway.)  You can use Storable for your data format, which is compact and
> fast.  To check for an update, just stat the file and reload the data if
> it has a newer mtime.  If you don't like doing the stat every time, put a
> counter in a global variable and just stat once every 10 requests or
> something, like Apache::SizeLimit does.  If your data is too big to pull
> into memory, you can use a dbm file instead.
> 
> - Perrin

Have you benchmarked this vs IPC::ShareLite ?

I've heard similar rumours about IPC being slow - but is this using
Shareable (a pure perl implementation) or ShareLite (C / XS
implentation).

I would be interested in any results / ideas on how to do it.

Greg





Re: database access

2000-11-08 Thread Greg Cope

Jason Liu wrote:
> 
> Is Apache::DBI absolutely necessary if you want to establish persistent
> database connection per child?

No you can write your own (its open source remember ;-) but why bother -
standing on the shoulders of giants etc 


Greg

> 
> Thanks,
> 
> Jason
> 
> > -Original Message-
> > From: David Hodgkinson [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, November 06, 2000 5:10 AM
> > To: Jason Liu
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: database access
> >
> >
> > "Jason Liu" <[EMAIL PROTECTED]> writes:
> >
> > > In general, how should database connections be handled between
> > parent and
> > > child processes?  Can you establish database connections from within a
> > > handler?
> >
> > Absolutely. And using Abache::DBI caches the connection handle.
> >
> > --
> > Dave Hodgkinson, http://www.hodgkinson.org
> > Editor-in-chief, The Highway Star   http://www.deep-purple.com
> >   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
> >   -
> >




Re: input from external process

2000-11-04 Thread Greg Cope

Eric Smith wrote:
> 
> Hi
> 
> Is it possible to have an existing mod_perl application read from an
> external process?  The case in point is procmail piping mails to the
> mod_perl application.  With high volumes of email, we would prefer not
> to have to launch the perl interpreter each time to perform the tasks
> specified by the incoming email.
> 
> Nasty way of effecting this communication is to have each mail message
> saved to a file and do a readdir every time interval.
> 
> Is it possible to have the mod_perl process listen on a socket (or
> something) that procmail may write to?

Why not write a perl server that lisens to a socket ?

Regards

Greg Cope


> 
> --
> Eric Smith
> Fruitcom.com Amsterdam
> Wire phone : +31 20 528 7340
> Mobile: +31 6 241 259 16
> www.fruitcom.com



[ NOW OT ] Re: HTTP Mod_Perl mini-server

2000-11-04 Thread Greg Cope

Perrin Harkins wrote:
> 
> On Fri, 3 Nov 2000, Vivek Khera wrote:
> > Lately I've been getting very interested in using solid-state disks
> > for high-performance issues.  They're expensive, but if you need that
> > much speed, they're worth it.
> 
> Are they?  I tried one once, and it wasn't any faster than my normal disk
> because I had so much RAM it was all getting buffered already.  If you
> don't have enough RAM, it might help, but I suspect these are more
> expensive than equivalent amounts of RAM.
> 
> - Perrin

A bit OT but:

Do they help with STATing of files ? as this appears to be a bottle neck
on some of my machines (i.e stating on the disks) 

Greg



Re: dynamic vs. mostly static data

2000-11-04 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Thu, 2 Nov 2000, Neil Conway wrote:
> 
> > I'm writing a web app in mod_perl, using a PostgreSQL database
> > backend and HTML::Template. In looking for ways to optimize
> > performance, I noticed that although my code is doing several
> > (say, 4-5) database queries per handler/webpage, a large part
> > of the data (~2 queries) is mostly static (it will change
> > perhaps once per week, or once per month). It's obviously
> > inefficient to run these queries on the database for every
> > single request.
> >
> > How can I 'cache' this data so that all Apache children can
> > access it quickly? Is there a way to automatically update
> > this cache periodically (say every 10 minutes)? Also, this
> > solution should work on any reasonably modern UNIX system
> > (Win32 is not important for now).
> 
> Along with all the other fine suggestions here, you might like to check
> out the Memoize module on CPAN. I don't think it yet offers a way to
> invalidate the cache, but I know that is planned.

What about IPC::SharedCache ?

This should allow you to cache stuff in IPC and updateit from outside
apache via a crond job ?

just my 2 euro's worth.

Greg


> 
> --
> 
> 
> /||** Director and CTO **
>//||**  AxKit.com Ltd   **  ** XML Application Serving **
>   // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
>  // \\| // ** Personal Web Site: http://sergeant.org/ **
>  \\//
>  //\\
> //  \\





Re: [ ANNOUNCE ] Apache::SessionManager-0.07

2000-10-30 Thread Greg Cope

Dave Rolsky wrote:
> 
> On Mon, 30 Oct 2000, G.W. Haywood wrote:
> 
> > If you can write Perl you can write C, there are onlya couple of dozen
> > keywords.  It's just that you're not so mollycoddled in C, you're much
> > closer to the machine, and you have to plan further ahead (instead of
> > waiting for the bang:).  I prefer it.
> 
> I think you're forgetting about little things like regexes and such.  Yes,
> Perl and C share a lot of syntax, but there are many things you can do
> easily in Perl that are brutal in C.

I agree but apache has regex.h ... a regex libary - hence these should
be possible - or am I missing the point ?

Greg


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



Re: [ ANNOUNCE ] Apache::SessionManager-0.07

2000-10-30 Thread Greg Cope

"G.W. Haywood" wrote:
> 
> Hi there,
> 
> On Mon, 30 Oct 2000, Greg Cope wrote:
> 
> > In theory there is no reason why this should not be translateable to C,
> > it is quite small (in perl).
> > However:
> > a) I cannot do C (and translating this is beyond me as a learning
> > exercise at the mo).
> > b) Also waiting is a good idea till all the bugs are sorted. (I am sure
> > there are more).
> 
> I think it's right to turn things like this into C.  I'll help you
> with it if you like, but I think you're right about waiting until the
> design is stable before doing it.
> 
> If you can write Perl you can write C, there are onlya couple of dozen
> keywords.  It's just that you're not so mollycoddled in C, you're much
> closer to the machine, and you have to plan further ahead (instead of
> waiting for the bang:).  I prefer it.

Thank you Ged.

I have been meaning to learn C (along with lots of other things).

Any good books to recommend - I've got practicle C from O'Reilly - I
need something that is not too dry and manpage ish, but also not an
idiots guide as I can do perl (well I think I can).

I've been toying with the idea of C as this would push it out of the
mod_perl areana.  The logic of it is quite simple.  But for a beginer it
look all to complex.  Plus there is the minor issue of time !

Thanks again for the offer of help, I may take you up on that.

Greg

> 73,
> Ged.



Re: [ ANNOUNCE ] Apache::SessionManager-0.07

2000-10-30 Thread Greg Cope

Gunther Birznieks wrote:
> 
> At 01:31 AM 10/30/2000 +, Greg Cope wrote:
> >[...snip...]
> > >
> > > And don't forget about the use of DirectoryIndex:
> > > GET /index.html http/1.0
> > >
> > > HTTP/1.1 302 Found  <<== here's your redirect
> > >
> > > Now this gets through:
> > > GET / http/1.0
> >
> >Hum ...
> >
> >Nice one - I had not tried this  It took me a while to trap a  '/'
> >request (it would go into an endless loop and blow out when the GET
> >request topped 4k, mostly full of session ID's).
> >
> >Not sure how to fix this - ideas anyone ?
> >
> >I do the following to trap a '/' style request - this is where I am
> >losing the /index.html (that's getting turned into a simple '/').
> >
> >if ($redirect !~ m#/$# && -d $r->lookup_uri($redirect)->filename) {
> > $redirect .= '/';
> >   }
> >
> >Is this a major issue ? (as apache should if I am not mistaken turn that
> >back into an index.html or whatever is the directory index directive)
> 
> This is an issue if your index.html requires the session id. So if you
> direct to / you'll lose it. It's not bad if index.html is static, but it
> could be generated via a handler or perhaps it's an index.cgi

This should work (i think I test this case - cant remember) with just
'/' as it just adds the '/' on - i,e you keep the session ID.

My brain is stuck on the implications of this at the mo - I cannot see
the "issue".  The behavour appears wrong as the redirect is not right,
yet it seems to come out in the wash .

Any ideas on what needs to be done - Gunther ? Bill ?

> 
> >As apache has yet fully to do the URI translation I apear to be missing
> >this an assuming its a '/' on its own ?!?!
> >
> > >
> > > HTTP/1.1 200 OK
> > >
> > > I'm also unclear about excluding some files with $NON_MATCH.  Perhaps I
> > > didn't set it up correctly.
> > >
> > > If the session is in the URL, and a browser uses relative links it will try
> > > to use that session for all links.  So if $NON_MATCH is used to ignore
> > > .gif, for example, I see this:
> > >
> > > File does not exist:
> > > /usr/local/apache/htdocs/f0d960ddbbe1e82ca55ed2372447751e/apache_pb.gif
> >
> >I wondered on this for some time - as I use a new virtual host for
> >static content {gif|jpeg|js|css} files (with logging turned off).
> >
> >Err - on this point I am a plank and offer my apologies - a few '#' too
> >many and this functionality no longer works - whops 
> >
> >In the meantime remove the hashes that
> >comment out the lines between 48 and 51 inclusive, also in the source is
> >a line:
> >
> >$NON_MATCH = '\.gif|\.jpeg|\.jpg';# ignore images
> >
> >So if you only want gifs try:
> >
> >$NON_MATCH = '\.gif';
> 
> So what is the logic here? You must always process an existing session id
> for images because they will be in the path, but you just shouldn't
> generate the session id if one does not exist for these mime types.

The module does a simple regex on DIR_MATCH and DECLINES if there is no
match.

If there is a match it then checks NON_MATCH and DECLINES if there is a
match here (i.e if we want to avid these hence NON_MATCH).

This was easier for me that to make a complex regex that matched this,
but not that etc ...

The logic is to not session these matches as they are not need.

If you keep your images on a different Vhost, or in a diferent dit (that
DIR_MATCH does not match and is hence ignored) then you do not need
this.

If you keep your images in the same place as the stuff you want to
session - then you may be interested.

It occurred to me whilist writing this module that there are manu
permutations (TMTOWTDI) and hence this was writen for the above combo.

Personnaly I do not use it.

> > > You might consider moving some of your code into other handlers later in
> > > the request and just let the transhandler extract out the session id.  That
> > > way you can use  and friends to configure what requires a
> > > session and what doesn't, and you can use PerlSetVars to control behavior
> > > section-by-section in httpd.conf.
> >
> >Gerald has already suggested this - I was thinking of controlling
> >directory access via the match variable.  Why ? well perlset var gets
> >checked each request - performance wise a little nasty.  This is however
> >due to most of m

[ ANNOUNCE ] Apache::SessionManager-0.07

2000-10-29 Thread Greg Cope

Bill Moseley wrote:
> 
> At 05:24 PM 10/29/00 +, Greg Cope wrote:
> >Announcing Apache::SessionManager.
> 
> Hi Greg,
> 
> Here's a couple of other comments.

I should have mentioned that this was my first bit of public code - and
to be gentle ..

> 
> Don't forget to keep track of args on redirects:
> 
> GET /a5cc39a8c110566e41b5b8efafc2a055/index.html/abc/123?query=abc http/1.0
> Cookie: SESSION=cb74254c1de96365e91fa6d6d481f952
> 
> HTTP/1.1 302 Found
> Date: Sun, 29 Oct 2000 18:28:54 GMT
> Server: Apache/1.3.14 (Unix) mod_perl/1.24_01
> Location: /index.html/abc/123<<<<=== lost the args here.

I thought I had this covered ages ago. ... I've just tried this on my
set up and I do not lose the args e.g.

Netscrape 4.75 on Linux / Redhat

switch cookies off in preferences - redirect on:

get Cart/cat?foo=bar

redirect to:

get /{insert session id here}/Cart/cat?foo=bar

But I was not checking COOKIE_CHECK

A few minutes later that should be fixed ...

I have not being doing a COOKIE_CHECK style redirect against a
foo.html?arg=bar style get request - all mine have been simple HTML
pages.

Thanks.

> 
> And don't forget about the use of DirectoryIndex:
> GET /index.html http/1.0
> 
> HTTP/1.1 302 Found  <<== here's your redirect
> 
> Now this gets through:
> GET / http/1.0

Hum ...

Nice one - I had not tried this  It took me a while to trap a  '/'
request (it would go into an endless loop and blow out when the GET
request topped 4k, mostly full of session ID's).

Not sure how to fix this - ideas anyone ?

I do the following to trap a '/' style request - this is where I am
losing the /index.html (that's getting turned into a simple '/').

if ($redirect !~ m#/$# && -d $r->lookup_uri($redirect)->filename) {
$redirect .= '/';
  }

Is this a major issue ? (as apache should if I am not mistaken turn that
back into an index.html or whatever is the directory index directive)

As apache has yet fully to do the URI translation I apear to be missing
this an assuming its a '/' on its own ?!?!

> 
> HTTP/1.1 200 OK
> 
> I'm also unclear about excluding some files with $NON_MATCH.  Perhaps I
> didn't set it up correctly.
> 
> If the session is in the URL, and a browser uses relative links it will try
> to use that session for all links.  So if $NON_MATCH is used to ignore
> .gif, for example, I see this:
> 
> File does not exist:
> /usr/local/apache/htdocs/f0d960ddbbe1e82ca55ed2372447751e/apache_pb.gif

I wondered on this for some time - as I use a new virtual host for
static content {gif|jpeg|js|css} files (with logging turned off).

Err - on this point I am a plank and offer my apologies - a few '#' too
many and this functionality no longer works - whops 

In the meantime remove the hashes that
comment out the lines between 48 and 51 inclusive, also in the source is
a line:

$NON_MATCH = '\.gif|\.jpeg|\.jpg';# ignore images

So if you only want gifs try:

$NON_MATCH = '\.gif';


> 
> You might consider moving some of your code into other handlers later in
> the request and just let the transhandler extract out the session id.  That
> way you can use  and friends to configure what requires a
> session and what doesn't, and you can use PerlSetVars to control behavior
> section-by-section in httpd.conf.

Gerald has already suggested this - I was thinking of controlling
directory access via the match variable.  Why ? well perlset var gets
checked each request - performance wise a little nasty.  This is however
due to most of my projects being a easy to split on a URI '/foo/' entry
i.e I know which parts of a URI need sessioning as it were.

I was going to go for a perlset var as per Gerald Suggestions - but am
having secound thoughts - What do you|everyone think - using globals (a
la Apache::DBI style) is not as clean, but easy and fast whilst
perlsetvar is slower yet better to configure.

> Hope some of this helps.

Yup, you spotted a few bugs I had not seen - thanks

> 
> Have fun,

Define fun ;-)

I have found this one of the most rewarding coding exercises recently -
why:

a) Its complex.

b) Having all the mod_perl people have a go at breaking it (which they
have done ! )

c) fixing it - which is has thus far been quite eaay (famous last words
;-)

I'll be uploading a version 0.07 with the fixes outlined above.

Thanks Bill, much appreciated as you have tested it in ways that I had
not thought of (and I've tried a few), hopefull v 0.07 should fix most
of the above.

Thanks again.

Greg

> 
> Bill Moseley
> mailto:[EMAIL PROTECTED]



[ ANNOUNCE ] Apache::SessionManager-0.06

2000-10-29 Thread Greg Cope

Dear All

I've finally got a tar ball onto sourceforge (but that's another [OT]
story ;-)

Announcing Apache::SessionManager.

For those that do not know this is a (near) Transparent Session Manager
module - it will get (and optionally set) a Session ID from a client
request.  It does no more that this with the ID - authenticating it /
checking validity is up to you.  It is supposed to compliment
Apache::Session, which can be used as the backbend session store.

It has some perldoc in the Apache::SessionManager.pm file.

There is an example startup.pl in the example dir. of the tar ball.

It is quite configurable in that you can change its behaviour to taste -
see the perldoc / source.

It works in my development environment.

It is BETA and the API may change.  Use it at your own risk!  The usual
warranty applies - in that if it breaks please send any bits to
/dev/null, and any patches / bug fixes to me!

Please send me any feedback directly.

A BIG thank you to all that have help / sent me feedback / ideas, and
also to Doug for mod_perl and the Apache and perl authors.

Oh, Find it here:

http://sourceforge.net/projects/sessionmanager/

Regards

Greg Cope



Re: [ RFC ] New Module Apache::SessionManager

2000-10-29 Thread Greg Cope

Gunther Birznieks wrote:
> 
> How long have you been a member of sourceforge and when was the project
> created?

7 days ago 

I am the admin - its called - wait for the great supprise - Session
Manager

> 
> Sometimes it takes changes (eg giving you access to the project directory
> with write permissions) the famous 6 hour wait for their cluster of
> machines to get up to date.
> 
> You know that you are the default project admin, but if I remember
> correctly you have to give yourself write privileges to the project just
> like anyone else in the project list there.
> 
> Anyway, we've had similar issues with SourceForge. As a FAQ, it sounds OK
> to have a wait like that, but in practice it does get frustrating. However,
> in the end, it's a lot easier to have the CVS infrastructure hosted
> somewhere else cuz it's a pain in the ass to set up CVS for anonymous
> access securely and then all the tools surrounding it (eg cvsweb) and keep
> them up to date as security patches come out.
> 
> With that said though, I think their support has been responsive to us for
> a free service. We've usually had 24 hour turnaround on any question
> (except no answer on weekends -- but I've never had a high priority support
> issue to warrant that).

No I've np argument with the service at all its great.

It could do with a few obivious points like "Go here to add a
description" if $description == undef && user eq 'admin' .

I've managed to add a description etc ... but as yet have not mastered
uploading a file 

Although this is not mod-perl related - because its about sourceforge -
I am trying to sort out a mod perl module hence any clues as to how to
upload a file would be welcome.

Greg


> 
> Later,
> Gunther
> 
> At 12:53 PM 10/29/00 +, Greg Cope wrote:
> >Matt Sergeant wrote:
> > >
> > > On Wed, 25 Oct 2000, Gerald Richter wrote:
> > >
> > > > I have three anonations:
> > > >
> > > > 1.)
> > > >
> > > > $r->header_out(Location => $r->uri());
> > > >
> > > > Also this code works with most browsers it doesn't conform to the HTTP
> > > > specs. A location header must include a host part. Shouldn't be to
> > hard add
> > > > something like
> > > >
> > > > $r->header_out(Location => 'http://' . $r -> server -> server_hostname .
> > > > $r->uri());
> > >
> > > + port too.
> >
> >Ok
> >
> >I've not had a chance to play with anything as I recovering from a
> >rather long week 
> >
> >On another note I've had little success with Sourceforge - I've set a
> >project up but cannot seem to login to FTP nor upload a CVS snapshot,
> >nor add a description .  I've been in touch with support and am
> >awaiting more news.
> >
> >Hence is it worth a CPAN entry ? (I've not got an account )
> >
> >Anyway thanks for the tips.
> >
> >Greg
> >
> > >
> > > --
> > > 
> > >
> > > /||** Director and CTO **
> > >//||**  AxKit.com Ltd   **  ** XML Application Serving **
> > >   // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
> > >  // \\| // ** Personal Web Site: http://sergeant.org/ **
> > >  \\//
> > >  //\\
> > > //  \\
> 
> __
> Gunther Birznieks ([EMAIL PROTECTED])
> eXtropia - The Web Technology Company
> http://www.extropia.com/



Re: [ RFC ] New Module Apache::SessionManager

2000-10-29 Thread Greg Cope

darren chamberlain wrote:
> 
> Greg Cope ([EMAIL PROTECTED]) said something to this effect:
> > > $r->header_out(Location => 'http://' . $r -> server -> server_hostname .
> > > $r->uri());
> >
> > Seems easy - will add it in.
> 
> It's not that simple, of course -- you need to maintain port numbers and
> all that. I recommend using Apache::URI -- create a new Apache::URI object,
> set its attributes from the Apache object, and then call unparse on it.

I don't see the complication - this appears to work ok:

  my $uri = Apache::URI->parse($r);

  # hostinfo give port if necessary - otherwise not
  my $hostinfo = $uri->hostinfo;
  my $scheme =  $uri->scheme . '://';

  $redirect = $scheme . $hostinfo . '/'. $session_id . '/' . $rest .
$args;

This should always give the following redirect URI:

http://www.foo.com/456456456456456/orginal_request.hmtl

the scheme and port changing as neccessary.

The only  possible issue is if the hostname / scheme containt duff (un
uencoded) chars - which appears illogical to me.


Greg

> 
> (darren)
> 
> --
> In the fight between you and the world, back the world.



Re: [ RFC ] New Module Apache::SessionManager

2000-10-29 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Wed, 25 Oct 2000, Gerald Richter wrote:
> 
> > I have three anonations:
> >
> > 1.)
> >
> > $r->header_out(Location => $r->uri());
> >
> > Also this code works with most browsers it doesn't conform to the HTTP
> > specs. A location header must include a host part. Shouldn't be to hard add
> > something like
> >
> > $r->header_out(Location => 'http://' . $r -> server -> server_hostname .
> > $r->uri());
> 
> + port too.

Ok

I've not had a chance to play with anything as I recovering from a
rather long week 

On another note I've had little success with Sourceforge - I've set a
project up but cannot seem to login to FTP nor upload a CVS snapshot,
nor add a description .  I've been in touch with support and am
awaiting more news.

Hence is it worth a CPAN entry ? (I've not got an account )

Anyway thanks for the tips.

Greg

> 
> --
> 
> 
> /||** Director and CTO **
>//||**  AxKit.com Ltd   **  ** XML Application Serving **
>   // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
>  // \\| // ** Personal Web Site: http://sergeant.org/ **
>  \\//
>  //\\
> //  \\



Re: ApacheCon report

2000-10-28 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Sat, 28 Oct 2000, Greg Cope wrote:
> 
> > Matt Sergeant wrote:
> > >
> > > http://modperl.sergeant.org/ApacheConRep.txt
> > >
> > > Enjoy.
> >
> > Thanks for that Matt, I did enjoy it - IBM's party coninciding with Suns
> > keynote made me chukle ;-)
> >
> > I eventually could not make the conferance due to a nasty deadline 
> >
> > Did Doug mention when mod_perl 2.0 would / maybe / migh possibly be
> > ready (I know, I know that it will be ready when its ready, only
> > asking!)
> 
> Unfortunately I had to run (I had a beer with my name on it) before
> getting chance to speak to Doug again. But it also depends a *lot* on the
> progress of Apache 2.0, which is really holding mod_perl 2.0 up, from what
> I can tell. But once that's out of the way, I don't think anything is
> stopping mod_perl 2.0 progress - Doug seems to be able to move pretty
> quickly on things, as he has a good idea where he's going with the
> project.

Sounds sooner than I though - great.

Doug and Ryan appear to work for the same company - Covalent - so Doug
should go bend Ryans ear - I want my mod_perl 2.0 ;-)

Thanks again Matt.

Greg

> 
> --
> 
> 
> /||** Director and CTO **
>//||**  AxKit.com Ltd   **  ** XML Application Serving **
>   // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
>  // \\| // ** Personal Web Site: http://sergeant.org/ **
>  \\//
>  //\\
> //  \\



Re: ApacheCon report

2000-10-28 Thread Greg Cope

Matt Sergeant wrote:
> 
> http://modperl.sergeant.org/ApacheConRep.txt
> 
> Enjoy.

Thanks for that Matt, I did enjoy it - IBM's party coninciding with Suns
keynote made me chukle ;-)

I eventually could not make the conferance due to a nasty deadline 

Did Doug mention when mod_perl 2.0 would / maybe / migh possibly be
ready (I know, I know that it will be ready when its ready, only
asking!)

Greg

> 
> --
> 
> 
> /||** Director and CTO **
>//||**  AxKit.com Ltd   **  ** XML Application Serving **
>   // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
>  // \\| // ** Personal Web Site: http://sergeant.org/ **
>  \\//
>  //\\
> //  \\



Re: [ RFC ] New Module Apache::SessionManager

2000-10-27 Thread Greg Cope

Gerald Richter wrote:
> 
> Hi Greg,
> 
> >
> > I also hot heard anything back from the poeple I sent a copy to, I can
> > hence only assume that its so good that it's made them speachless ;-)
> >
> 
> That's more a matter of time, then a matter of speach...

I am up against a deadline and hence will be a little short - but this
is excellent.

> Greg, I have taken a look at your module and the code and I think it is
> really worth publishing it.
> 
> I have three anonations:
> 
> 1.)
> 
> $r->header_out(Location => $r->uri());
> 
> Also this code works with most browsers it doesn't conform to the HTTP
> specs. A location header must include a host part. Shouldn't be to hard add
> something like
> 
> $r->header_out(Location => 'http://' . $r -> server -> server_hostname .
> $r->uri());

Seems easy - will add it in.

> 2.) You use global variables for configuration. While this is fast and easy
> your aren't be able to have different configurations for different
> directories or virtual hosts. From my point of view this is a must! I want
> to only run SessionManager for certain directories and are able to use
> different configurations for different applications.
> 
> I would highly recomend to use PerlSetVar for configuration.

Ok - will require some changes - will add these.

> 
> 3.) You have a hard coded make_session_id function. This function should be
> customable i.e. calling a user defined function which returns a new session
> id and there should be some way to interact with Apache::Session which
> already have a (configurable) class that generates session ids. Before the
> session id is send out to the browser, there must be some way to check if it
> is valid i.e. doesn't already exists, because it can't be (easily) corrected
> afterwards.

I had orgininally though of this, and decided against as this was
simpler.

My orgininal thoughts were to:

a) keep it very small (the whole thing => fast)
b) Keep it very simple

The logic is that this module just gets the session ID and other
handlers / modules authenticate that session ID.  If it is wrong then
you need to either change the cookie or redirect to a different ID (if
no cookies are set).

I can see that adding a call back to a user defined subroutine that
returns a Session ID would be possible.

Adding in a link to Apache::Session would also be possible.

As I wrote above I am up against a deadline and will not be able to do
anything till next week - I will impliment the above in the order they
are writen as they are in simplest -> complex ity order.

Thanks Gerald for the feedback above - much appreciated (even if there
are quite a few good ideas that involve changes !)

Thanks again

Greg
> 
> Gerald
> 
> -
> Gerald Richterecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
> WWW:http://www.ecos.de  Fax:  +49 6133 925152
> -





Re: [ RFC ] New Module Apache::SessionManager

2000-10-22 Thread Greg Cope

Gunther Birznieks wrote:
> 
> I believe Greg is familiar with Apache::Session. There have been
> discussions about this before. A session manager manages the workflow
> around sessions. A session stores information. They are two different things.
> 
> In addition, I believe the name session manager has come up on this list
> before with regards to this.

That just about covers it.  Thanks Gunther

As for cpan, I have an aliase for th cpan shell, and excellent module.

Greg



> 
> Later,
> Gunther
> 
> At 07:04 PM 10/21/00 -0500, James G Smith wrote:
> >Check out Apache::Session, available on CPAN and see if your code
> >could be moulded to fit it's way of thinking.  If they are too
> >much different, then you might want to consider contacting the
> >module list to see if what you have is a good name (it probably
> >is) before going all out with distribution (and consider CPAN).
> >
> >For more information,
> >
> >http://www.cpan.org/modules/00modlist.long.html#Part1-Modules:C
> >
> >
> >
> >Greg Cope <[EMAIL PROTECTED]> wrote:
> > >Greg Cope wrote:
> > >>
> > >> Dear ALL
> > >>
> > >> I've writen a module that does transparent session management via either
> > >> Cookies, Munged URI or Query Args.
> > >>
> > >> It has quite a few options to change the behavour, and appears stable in
> > >> my developement environment.
> > >>
> > >> What I suggest is that unless there is a major objection I call it
> > >> Apache::SessionManager and set up a Source Forge project with the same
> > >> name.
> > >>
> > >> Unless there is a major issue I assume that by the weekend everyone whom
> > >> wants to will have made thier view clear and will hopefully go forward
> > >> from there.
> > >>
> > >> Regards
> > >>
> > >> Greg
> > >
> > >
> > >Dear All
> > >
> > >Not having heard anything bad about this I will go ahead a setup a
> > >sourceforge project.
> > >
> > >I also hot heard anything back from the poeple I sent a copy to, I can
> > >hence only assume that its so good that it's made them speachless ;-)
> > >
> > >Seriously, could poeple drop me a note as to how they found it ?  I do
> > >not want to go to all the trouble of writing docs / install files /
> > >source forge projects etc ... if its a load of rubbish and I am wasteing
> > >my time.
> > >
> > >Regards
> > >
> > >Greg Cope
> > >
> >
> >--
> >James Smith <[EMAIL PROTECTED]>, 979-862-3725
> >Texas A&M CIS Operating Systems Group, Unix
> 
> __
> Gunther Birznieks ([EMAIL PROTECTED])
> eXtropia - The Web Technology Company
> http://www.extropia.com/



Re: [ RFC ] New Module Apache::SessionManager

2000-10-21 Thread Greg Cope

Greg Cope wrote:
> 
> Dear ALL
> 
> I've writen a module that does transparent session management via either
> Cookies, Munged URI or Query Args.
> 
> It has quite a few options to change the behavour, and appears stable in
> my developement environment.
> 
> What I suggest is that unless there is a major objection I call it
> Apache::SessionManager and set up a Source Forge project with the same
> name.
> 
> Unless there is a major issue I assume that by the weekend everyone whom
> wants to will have made thier view clear and will hopefully go forward
> from there.
> 
> Regards
> 
> Greg


Dear All

Not having heard anything bad about this I will go ahead a setup a
sourceforge project.

I also hot heard anything back from the poeple I sent a copy to, I can
hence only assume that its so good that it's made them speachless ;-)

Seriously, could poeple drop me a note as to how they found it ?  I do
not want to go to all the trouble of writing docs / install files /
source forge projects etc ... if its a load of rubbish and I am wasteing
my time.

Regards

Greg Cope



Re: IPC::Shareable (was Re: Perl module - LWP)

2000-10-21 Thread Greg Cope

"Alexander Farber (EED)" wrote:
> 
> "David M. Davisson" wrote:
> > Yes, it works fine.  No mods.
> 
> > From: "David Jourard" <[EMAIL PROTECTED]>
> > > Has anyone worked with the LWP module under mod_perl and have they found
> > > that it works with no modification.
> 
> I would like to ask the same question about IPC::Shareable.
> 
> Is anybody successfully using it under Solaris or OpenBSD?
> "make test" hangs for me on these platforms and the module
> author is unreachable :-(
> 
> http://vorpal.mcs.drexel.edu/bsd-ports/helix/shared-memory.html
> doesn't seem to help on OpenBSD (increasing SHMMAXPGS up to 4096)
> 
> If not IPC::Shareable, what module do you use for fast
> communication between Apache-children?

IPC::ShareLite is writen in C (and hence faster (arguably)), but it does
not serial data structures, so either Freeze / Thaw or DataDumper are
you friends here.

I've seen IPC::Sharable working ok on Solaris 2.6 but cannot offer any
guideance as to why it may not work.

Greg



Re: [ RFC ] New Module Apache::SessionManager

2000-10-18 Thread Greg Cope

Gunther Birznieks wrote:
> 
> I like the name as it works well with our naming (SessionManager, Session
> hierarchy) so I can probably write a wrapper that assumes your
> SessionManager is embedded in Apache and it's not confusing for our users
> who want to configure our apps to use your session manager.

Thanks Gunther

If anyone wants a copy in the mean time drop me a line.

Greg



> 
> Thanks,
>  Gunther
>



[ RFC ] New Module Apache::SessionManager

2000-10-17 Thread Greg Cope

Dear ALL

I've writen a module that does transparent session management via either
Cookies, Munged URI or Query Args.

It has quite a few options to change the behavour, and appears stable in
my developement environment.

What I suggest is that unless there is a major objection I call it
Apache::SessionManager and set up a Source Forge project with the same
name.

Unless there is a major issue I assume that by the weekend everyone whom
wants to will have made thier view clear and will hopefully go forward
from there.

Regards

Greg



Re: Spawning

2000-10-10 Thread Greg Cope

[EMAIL PROTECTED] wrote:
> 
> Hi there,
>  I am working on a web-oriented game that runs on Apache/modperl and
> MySQL. I have one perl process that runs forever and is outside of Apache
> that does a lot of tallying up and cleaning. I want the process to be
> started by Apache on server startup and give the process access to Apache
> much like a normal modperl script. Is this possible?
>  Atli.

I would always seperate any proccess that are not web request orientated
outside the request architecture - i.e write your own daemon / crond
script thats does this exterior processing.

What do you need to access apache internals for ?

Starting something on startup is just a question of adding the required
lines to the server startup script.

> p.s. I was able to achieve something similar by placing the script in my
> modules directory and simply calling it from a browser. The script never
> returns so the browser hangs but at least the script runs. This is however
> rather messy and obviously not a method I want to use.

Not highly recomended but what about an exec / system call from the
startup.pl ? (as root remeber!).

Greg Cope



Re: OOP and mod_perl question

2000-09-29 Thread Greg Cope

Andreas Grupp wrote:
> 
> Hello
> 
> I am trying to develop for the first time a perl module. It should work on a
> server with mod_perl. The objects are not using mod_perl ($r) and are just
> solving some of my work in a nicer way. Since I'm new in OOP on perl (I only
> know C++) I would hear from some experts that the following is allowed in Perl
> OO modules and does not conflict with mod_perl.
> 
> The question belongs to the constructor. I have $self as a class reference on
> the brandnew object. Now in the rest of my constructor I do some Querys on a
> MySQL database to get information about the authenticated user (.htaccess with
> AuthenDBI). Afterwards I store the user-data retrieved from the database in a
> hash-variable and put a reference to this hash in the $self object in the
> following way:
> 
> $self->{'userdata'}->$hashref
> 
> Now I can get the different parts of userdata in other instance-methods with
> code like the following ($po is an object of this class):
> 
> my $po = new Peseta;
> print "This desk belongs to: " . $po->{'userdata'}->{'ulname'} . "";

er ... this may be wrong but ...

Here you are directly referancing the Objects data structure - which in
OO is a little naughty (you should repsect an Objects privacy, but perl
will not enforce it).

Hence you would need a method call to return said data, in your Peseta
package put something thus:

sub get_desk_owner {

my $self = shift;
my $name = shift;
return $self->{'userdata'}->{$name};

}

and the secound line becomes:

print "This desk belongs to: " . $po->get_desk_owner('ulname'} .
"";

Why bother - well you may change the internal objects data structure and
hence your method will break all code that uses it, yet in mine all I
need is to change the object implemetation.

> My question is now: Can I be sure that there are no conflicts when several
> users are requesting pages that work with this module? Can I be sure that the
> object data is not shared between different requests and the object has really
> only data corresponding to the actual request when I follow the general rules
> for OOP under perl?

The objects instance data will not be shared between requests if you are
carfull (and useing strict, and -w will help alot here) to initialise
and scope variables properly.

In your example you use 'my' and hence this will be fine.

The way to make something global (BEWARE) is to use a package global
(via use vars), and not to reinitaialise it after the first request -
then the variable WILL have the same value as it had after its last use
IN THAT CHILD (as apache is a multi-process model - the var will have
different states in different children).

The mod_perl guide covers these issues very well.

Hope that helps.

Greg Cope

> 
> Thanks a lot for your answers
> 
>   Andreas
> 
> --
> 
> 
> Elektronikschule Tettnang   http://www.elektronikschule.de/~grupp
> Oberhofer Str. 25   mailto:[EMAIL PROTECTED]
> 88069 Tettnang  PGP-Key available via mail. Use subject
> Tel.: +49 7542 9372-33  Use subject: send pgp-public-key
> Fax.: +49 7542 9372-40



Re: tracking down why a module was loaded?;

2000-09-27 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Wed, 27 Sep 2000, Matthew Byng-Maddick wrote:
> 
> > > We all have to do our part to evangelize mod_perl more. I think ISPs are
> > > really key here as I think I may have mentioned before. If you get the ISPs
> 
> Actually I think the people we need to get involved are the web site
> builders - the larger companies offering dynamic web content creation. We
> also need some more mainstream tools, the oft-requested "Zope-a-like" in
> Perl. And it needs to be trivial to install (I'm not sure how likely that
> is to be yet).

Hum - most commercial companies that I know in London (few I know),
either use ASP (the M$ version) or PHP.  The best solution for them is
often not what is technically the best, but the compromise of staff cost
/ availability, and hence development cost.  e.g. I have a few friends
whom work in ASP shops whom know little about the web in terms of
cookies, sessions, headers, but they all know how to set a session in
ASP, and hence get the job done.  Their employers get the job done, at a
lower cost (IMHO ASP programmers are paid less than perl ones).  The
fact that they often get stuck when trying to do something a little out
of the ordinary does not appear to matter much!

As for a "Zope-a-like" or similar, I agree that there are few mod_perl
applications out there, and judging by the number of PHP apps on
freshmeat there's allot of competition.  A (or many) flagship
application(s) would help evangelise mod_perl allot.

On the easy to install front, I think that's due to programmer being
lazy.  I know there are issues, but making a module install using h2xs
stuff is easy (both for programmer and end user).  Supplying example
httpd.conf files is also easy - it just takes time.

> > > advertise support for mod_perl? How many without charging like US$100 more
> > > a month on top of the normal account fees?
> >
> > This is difficult, due to the security issues. If you have client cgi, you
> > can always use something like suEXEC or even something as complex as userv
> > to run your cgi scripts. With mod_perl, the plugged in scripts can do
> > anything that the webserver can, and you can (by writing a module that
> > doesn't compile) break the entire webserver.
> >
> > > PHP comes with a lot of ISP accounts for free with no extra cost. Java does
> > > not yet, but I've started seeing ISPs starting to support Java in the low
> > > end shared server accounts...
> >
> > Wow. I'm surprised, for the security reasons I've outlined above. But then
> > I don't know much about PHP, really.
> 
> PHP can runs as a normal CGI, using suExec. So it's like advertising Perl
> support.
> 
> What would help mod_perl is a working sandboxing system, based on Safe and
> SafeHole. I've advocated that idea before, but still don't have the time
> to go and build it. With that sort of system, and ISP could easily trap or
> prevent whatever they need to, and we could work with them to build up
> secure proffessional installations.
> 
> However, I'm honestly not sure if the whole of mod_perl is "right" for the
> majority of small fee ISP's. What the ISP's need is perhaps one of the
> mod_perl modules, like Mason, Embperl or AxKit, or something like
> that. Rather than letting users write PerlInitHandlers! Unfortunately I
> have no idea how you might secure one of these modules, even though one is
> my own.

Because mod_perl is so far entrenched into apache it is difficult to
sandbox it.  I've looked at running it for a hosting service and it was
less than easy, nor eligant to allow users access to mod_perl.

I agree with Matt's last point that mod_perl may not be
right for the mainstream "free ISP's".  After all with performance comes
power, and in an ISP's world do you want your webserver going wild due
to a badly written bit of perl ?

mod_perl is ideal for single use servers that host one application,
tailor made for that client (as in customer not http).  IMHO mod_perl
cannot be beaten on performance or flexibilty in this scenario.

Should we not promote mod_perl as a web platform for the 'cognisenti'. 
After all,  all the 'best' things are usually not the most popular,  but
most people know they are the best.  Perhaps this last bit is where the
mod_perl 'marketing machine' is failing.

just by 2 pence worth.

Greg Cope


> 
> --
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org




Re: Clean way of transfering Objects between childinit and requesthandlers ?

2000-09-18 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Sun, 17 Sep 2000, Chris Winters wrote:
> 
> > Hi Greg,
> >
> > Check out Class::Singleton for this purpose. Works great for me.
> >

.

 
> One thing C::Singleton misses is a clear_instance method though, which is
> pretty much necessary for mod_perl work (I'm surprised Andy hasn't fixed
> this, since he does a lot of mod_perl stuff)...
> 
> However copying the code is pretty trivial and adding that method is about
> another 3 lines.

Thanks gents - I'd not seen this one before.

Oh, Chris I think your ratio is a bit low - the actual module code is
extremely short.

Greg


> 
> --
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org




Clean way of transfering Objects between childinit and request handlers ?

2000-09-17 Thread Greg Cope

Dear All

I want to create an Object in a ChildInit handler and then pass it to
request handlers.

Its a DB Object / module and it does some initialiastion, it prepares a
few statment handles and then stores them in an array for later
execution.

One solution is to create a the object in a child init handler and to
store it in a package global - and then to use a type glob to referance
it from other handlers by using that package global (detailed below).

However this appears as a bit of a kludge and does not have any repect
for encapsulation ;-).

I feel there must be a cleaner way of doing this ? A read of the guide
etc ... has not given me any clues.

Any ideas appreciated.

Greg Cope

### type glob example (off the top of my head - could be wrong)

package child_init;

use vars qw($foo);

$foo = My::db_handler->new();

###

package request_handler;

*db = \$child_init::foo;

$db->foo();



Re: [ RFC ] A Session Manager module

2000-09-10 Thread Greg Cope

Jules Cisek wrote:
> 
> Sounds interesting.
> 
> Is this module just managing the sessionID or also the session data?  i.e.
> is the manager capable of storing complex objects (via something like
> Storable or Data::Dumper)?  Will you provide hooks "caching and DB
> abstraction" layers so that the developer can provide the backend
> implementation?

Just managing the session ID between client and server.  I prefer simple
modules that are small and neat (KISS).

storage of any data is upto you - can I suggest Apache::Session ?

All I want to do is provide a simple module in the unix sense of doing
one thing well.

I also had the idea of creating a BB (BareBones) version that has
few(er) configuration options and is very simple.

Greg

> 
> ~J




[ RFC ] A Session Manager module

2000-09-10 Thread Greg Cope

Dear All

As some of you are aware for the past few weeks I have been working on a
Session Manager style module.

It works (ish ;-), I know of a few issues (that may not be important
enough to change), but it works in my developement environment.

What do I do with it now ?  I think it may fit in well as a front end to
Apache::Session, although it needs a name.  Its only around 400 lines
(including some POD and comments). 

It could fit in quite well with Apache::Session (ie providing a session
id, and Apache::Session does the server side storage).  It may also fit
in with other implementations such as Embperl, Apache::ASP, and Mason -
although most of these have their own implenetations.

My original plan - believe it or not - was to write a short "how to"
style tutorial to creating a mod perl shopping cart, the idea was not to
have another shopping cart, as there are many other better
implentations, but to have a few reasonably easy examples of mod_perl in
a real world type example.  This was inspired by someones post a few
months back for documentation / articles etc.  Well I started and wrote
a few modules, and went on to create a templating module (as per any
true path to mod_perl wisdom!), this session module and a DB abstraction
layer (and aparently I should be creating a caching module as well!).

Well any ideas - please let me know.

Greg Cope


A few details below.

AIM:

To manage session ID's between client and server - to get (or optionally
set) a sesion id via Cookies, Mungled URL or path_info.

Implemetation:

Uses a transhandler.
Optional configurations to alter logic / options via a package scalar eg
(some but not all) in a startup.pl:

use SessionManager();

$SessionManager::DIR_MATCH = '/foohandler'; # default is match
everything of /\.html/ !
$SessionManager::REDIRECT = 1;  # default to no
redirect
$SessionManager::DEBUG = 7; # default debug is off
$SessionManager::SESSION_ID_LENGTH = 32;# nice long ID lenght
$SessionManager::NON_MATCH = '\.gif|\.jpeg|\.jpg';  # ignore images

i.e. the above will session manager a URI matching 'foohandler', if
cookies are off it will redirect and set an mungled URI with a session
id length of 32 - it will also dump loads of debug info (between 3 and
20 lines a request), and ignore any gifs, jpegs, and jpg files within a
URI 'foohandler'.

Also:

$SessionManager::COOKIES_ONLY = 1;

Will only try cookies and then stop

$SessionManager::ARGS_ONLY = 1;

Will only try ARGS (after cookies).

$SessionManager::URI_FIRST = 1;

Try URI (mangled) after cookies, before ARGS, this allows changing the
order of which things are checked.

$SessionManager::USE_ENV = 1;

Instead of using pnotes entries use Environmental variables.

There are aslo a few other bits in the works for trying to setting a
cookie if they are off by redirecting, and then using a mangled URI or
ARGS if that failed - this will have a TTL, and DOMAIN vars that will
allow overriding of the defaults.

Thats about it.



Re: SELECT cacheing

2000-09-10 Thread Greg Cope

Brian Cocks wrote:
> 
> I'm wondering how much improvement this caching is over the database caching
> the parsed SQL statement and results (disk blocks)?
> 
> In Oracle, if you issue a query that is cached, it doesn't need to be parsed.
> If the resulting blocks are also cached, there isn't any disk access.  If the
> database is tuned, you should be able to get stuff out of cache over 90% of
> the time.  I don't know what other databases other than Oracle do.

Oracle is clever in this respect - and you are right if you tune
correctly you should hit the cache ...

But may other DB's do not have a shared executition plan / results
cache.  MySQL, msql and postgreSQL do not.  As far as I am aware Sybase
only has an execution plan cache that is per connection (could be wrong
here).

The MySQL developers have got a SELECT CACHED idea, where you can define
a statement as cacheable, and further calls to SELECT CACHE will return
the cached results - this is all on the todo list with no fixed date.
 
> What are the advantages of implementing your own cache?  Is there any reason
> other than speed?

Could be wrong but no - and it has a bad point in that it introduces an
added layer of complexity .

I am certainly interested as accessing a local cache should be an order
of magnitude faster than asking a buzy DB.

Greg Cope

> 
> --
> Brian Cocks
> Senior Software Architect
> Multi-Ad Services, Inc.
> [EMAIL PROTECTED]





Re: open(FH,'|qmail-inject') fails

2000-09-10 Thread Greg Cope

Perrin Harkins wrote:
> 
> On Fri, 8 Sep 2000, Stas Bekman wrote:
> > > As far as benchmarks are concerned, I'm sending one mail after having
> > > displayed the page, so it shoul'dnt matter much ...
> >
> > Yeah, and everytime you get 1M process fired up...
> 
> Nevertheless, in benchmarks we ran we found forking qmail-inject to be
> quite a bit faster than Net::SMTP.  I'd say that at least from a
> command-line script qmail-inject is a more scalable approach.

Or even better would be to use qmail-remote and avoid the queue, but
thats a qmail and not a mod_perl thing.

BTW I'm looking at this at the mo and have decided to go back to a dump
email to db -> crond robot sends mail to port 25 -> mail delt with
there.  Why ? Well this is the most scalable, and its cross platform,
talking directly via pipes / forks etc usually has a limit somewhere,
and all too often I may reach it far sooner than I thought.

Greg

> 
> - Perrin





Re: upgrading mod_perl on production machine

2000-09-07 Thread Greg Cope

Stas Bekman wrote:
> 
> On Wed, 6 Sep 2000, Perrin Harkins wrote:
> 
> > On Wed, 6 Sep 2000, Bill Moseley wrote:
> > > I hope I didn't miss anything in the Guide at install.html and in
> > > control.html, but I was looking for any suggestions on upgrading mod_perl
> > > and Perl on a running production machine to limit the amount of down time.
> >
> > We use RPMs.  Some form of package, even if it's just a tarball, is a good
> > idea.  Build it on a different server and then just install it.  Having
> > multiple servers really comes in handy here because you can take some off
> > line, upgrade them while the others are live, and then switch.  Then your
> > site remains up the whole time.
> 
> The problem of the tar-ball is that it doesn't know to cleanup previously
> installed files. Imagine a situation where some module that was previously
> installed in perl5/5.00503 now installed in perl5/site_perl/5.005 -- You
> get the problem where the old version is loaded before the new one.
> 
> Therefore tar-ball is not a good solution, unless you scratch the whole
> tree a moment before you untar the ball.

Ah - what about this ...

install (using tarballs complie target dirs) in a
package_name-version_number directory.

Then symlink to that dir from where ever you need to.

My /usr/local looks like this on some of my production machines:

drwxr-xr-x6 root root 4096 Jun 28 16:25 BerkeleyDB.3.1
lrwxrwxrwx1 root root   13 Jul  7 06:21 apache ->
apache1.3.12/
drwxr-xr-x3 root root 4096 Jun 18 22:55 apache1.3.12
drwxr-xr-x2 root bin  4096 Jun 18 23:09 bin
drwxr-xr-x2 root root 4096 Jun 18 23:12 include
drwxr-xr-x2 root root 4096 Jun 15 18:15 lib
lrwxrwxrwx1 root root   30 Sep  2 11:57 mysql ->
/usr/local/mysql-3.23.23-alpha
drwxr-xr-x7 root root 4096 Jul 31 17:28
mysql-3.23.22-alpha
drwxr-xr-x7 root root 4096 Sep  2 11:14
mysql-3.23.23-alpha
drwxr-xr-x2 root bin  4096 Jun  8 21:42 sbin
drwxrwxr-x9 root root 4096 May 29 11:38 ssl


I can now roll back any new installs by just changing the symlink, and a
tarball of the required dir does the trick.

After testing I brought up new versions in the time in takes to make a
online command with a few &&'s in and apache is backup in the time it
takes for apache to restart - which depends on the ammount of perl
modules it needs to deal with etc ...

Greg Cope

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





Re: Apache::Session and performance question

2000-09-01 Thread Greg Cope

Perrin Harkins wrote:
> 
> On Mon, 28 Aug 2000, Chris Brooks wrote:
> > I went back through the documentation on Apache::Session,
> > Apache::Session::DBIStore, and Apache::DBI, and I haven't found a
> > problem in the way we have implemented this.  Does anyone else have
> > suggestions, or has anyone else experienced a similar performance hit?
> 
> You're not doing anything wrong.  As I said before, going to a databse on
> every request is expensive.  It will definitely crush your performance
> when compared to something really lightweight like serving static files
> with no db access.  You could try using one of the other session stores
> like FileStore to see if it's any faster for you, or you could try running
> MySQL on the same machine as the web server, but if you have significant
> traffic you will eventually need a separate db server machine and a
> cluster of web servers.
> 
> The only thing I could suggest for improving the performance of your setup
> is to make sure you have MySQL properly tuned, with an appropriate index
> on this table.
> 
> - Perrin

I think Perrin has already touched on this and it may be too bovious,
but if you are session managing all requests you are wasting alot of
time on non-html / dynamic content such as images, style sheets.

Greg Cope





Session manager(s)-how to set an outbound session ?

2000-08-14 Thread Greg Cope

Dear All

I'm writing a Session-Manager (transhandler) i.e deals with getting a
session id from cookies, uri, or query args, and sets one and redirects
if neccessary.  This is meant to compliment Apache::Session - in that
you use Apache::Session to store your session data.

Thanks to Mat and Eric (for the addhandler issue yesterday) I can:

- get a session from cookies, query args or via URI rewriting
- change the order of the last two (i.e look in uri first, query args
secound, or args first, uri secound).
- Only look in cookies, or args or uri.
- redirect if needed to set a session if none is found(default to one -
configurable to off) .
- match a uri to "session" i.e session-ing can be switched off for
certain uri's.
- store the session id / whether cookies are on / off in either pnotes
or $ENV{}
- debugging can be set for copious info on whats going on.

- Note there is no validation of the session - this just fetches the
session id, validating is up to other handlers.

- I'm adding in a check_cookie funtionality that will try to set a
cookie and then redirect to itself with a check in the URI, if no
session is found.

- lots of bonus unexplained funtionality  aka bugs I'v not found or
fixed.

Much of the code is a rehash of the examples in Apache Modules in Perl &
C.

Now I want to deal with out-bound content/session ids - obviously
cookies are easy as these could just be set in the transhandler and a
ref placed in pnotes (and $ENV although I'm not sure on this bit as I've
not tried it).

But what to do with args or uri sessioning ?

If relative urls are used the session appears to be preserved in
netscape between different uri's (if using uri's).  This means I can do
reasonable transparent session handling with Cookies or URI mangling
(ignoring session id leakage at this point).  This works quite well (I
happy with it!).

Adding to the args of links is a different question - any one any clues
? 

I will either have to say that adding a session to your links if cookies
are off is your issue within your content handler, or find a way of
manipulating them - anyone any ideas ?

If anyone wants a peek I can send them the code or post it here if
there'ss demand.  Its my secound stab, and the logic/ style / efficiency
may leave something to be desired - constructive flames welcome!

The main aim/motivation is for a very simple ecommerce thing where
sessions are vital - and offsite/exterior links are few and exit points
want to be tracked - hence URI rewriting is acceptable and a redirector
is handy.  Transparent session handling is a "nice" design goal.

I may also throw in a redirector that will strip session args (if I can
get $r->args(undef) to work ) and/or uri's (which can help with exit
tracking etc ...) before redirecting to the link to help with session
leaks.

Greg



Re: my transhandler runs only once in each child ?!?

2000-08-14 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Sun, 13 Aug 2000, Greg Cope wrote:
> 
> > Apache->push_handlers("PerlTransHandler", \&transhandler);
> 
> push_handlers is temporary, not permanent. And this line only gets
> executed once.

Thanks Mat - Explains everything.  I though it might be something as
simple as this, I'll birch myself later.

I spent hours yesterday looking at this. Doh,  Doh,  Doh !!!

Thanks again

Greg

ps You're up early


> 
> --
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org




Re: my transhandler runs only once in each child ?!?

2000-08-14 Thread Greg Cope

Eric Cholet wrote:
> 

> >
> > Apache->push_handlers("PerlTransHandler", \&transhandler);
> 
> this will trigger the handler for the first request. Nothing
> will trigger it for subsequent requests. If you want it to run
> for every request, why not just drop the push_handlers call
> and add PerlTransHandler tinasm::Session to httpd.conf.

Thanks Eric,

IIRC I had tried that arround a month ago -  and it did not work - but
the bug was elsewhere.  The reason I was doing it this way was so that I
could just do a :

use tinasm::Session;

in a statup file - which I think is {now think was} more elegant that
adding a transhandler, that'll teach me!

Now all working thanks

Greg

> 
> >
> > sub transhandler {
> >
> > my $r = shift;
> > unless ($r->uri =~ m!$DIR_MATCH!o) {
> > print STDERR "SESSION-MANAGER-$$-URI not matched\n"
> > if $DEBUG;
> > return DECLINED;
> > }
> >
> > print STDERR "SESSION-MANAGER-$$-URI match\n" if $DEBUG;
> >
> > . handler goes on for another 200 lines so I've snipped it - if
> > anyone wants to look at it drop me a line.
> 
> --
> Eric





my transhandler runs only once in each child ?!?

2000-08-13 Thread Greg Cope

Dear All

I've a bug somewhere that I cannot appear to spot..

I have writen parts of a transhandler to handle session's.  It works in
once in each child and then does not appear to be executed again.

I've looked through The Guide and could not see anything there, nor in
the 'Apache modules in Perl and C'.  I must be missing somehing (a clue
for a start ;-).

The obvious answer is that a variable is not being redefined /
initialised.

Any ideas appreciated.

Greg Cope

### some clues below (I hope)

I have these lines in my startup.pl:

use tinasm::Session();

$tinasm::Session::DEBUG = 1;
$tinasm::Session::DIR_MATCH = 'test';
$tinasm::Session::REDIRECT = 1;
$tinasm::Session::USE_ENV = 1;

# end of startup.pl, snippet #

part of the module below

# code snippet #
package tinasm::Session;

use strict;
use Apache;
use Apache::Constants qw(DECLINED REDIRECT OK);
use Digest::MD5 qw(md5_hex);

use constant SESSION_ID_LENGTH => 8;

use vars qw($DIR_MATCH $COOKIES_ONLY $ARGS_ONLY 
$DEBUG $REDIRECT $URI_FIRST $USE_ENV);

Apache->push_handlers("PerlTransHandler", \&transhandler);

sub transhandler {

my $r = shift;
unless ($r->uri =~ m!$DIR_MATCH!o) {
print STDERR "SESSION-MANAGER-$$-URI not matched\n"
if $DEBUG;
return DECLINED;
}

print STDERR "SESSION-MANAGER-$$-URI match\n" if $DEBUG;

. handler goes on for another 200 lines so I've snipped it - if
anyone wants to look at it drop me a line.




Cant set args to $r->arg(undef);

2000-08-13 Thread Greg Cope

Dear All

Although this in no longer important to me, I cannot appear to reset
$r->arg to an empty value.

I am writing a transhandler and if the args containted a certain value I
wanted to reset it to the args value without this value.

hence:


my $args = $r->args;

# remove value
$args =~ s/value//;

# resetting $r->args; 
$r->args($value);


If $args has more then value, then the args will be reset correctly.

However if $args, only contains value, and hence after the regex is now
empty, then the reset will not work, and $r->args() still contains the
orginal values...

Is this a bug / feature or just unexplained functionality ?

Greg Cope





Re: Feature sets [was Re: Templating System]

2000-08-02 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Tue, 1 Aug 2000, Drew Taylor wrote:
> 
> > Bill Moseley wrote:
> > >
> > > It seems as if there needs to be a general templating mailing list...
> > >
> > > Here I have a comment about comparing template systems, and then I solicit
> > > advice on which system to use...
> > >
> > 
> > Bill,
> >
> > After all the response the thread generated, I wonder if perhaps we
> > (meaning the people who have control over those things :-) really
> > _should_ setup another list.
> 
> Look at the history of this list: it often gets very bursty and the quiet
> again. I think setting up a perl-template mailing list would be initially
> heavily trafficed, but be pretty much dead in a few weeks (or days even).

I'd agree.

The list tends to hit a raw never and trafic goes up alot and then its
quite again.  I would like to see discussion here as long as its
relevant.

Greg Cope

> --
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org




Re: Is there a module for getting / setting a Session-ID

2000-08-02 Thread Greg Cope

[EMAIL PROTECTED] wrote:
> 
> In a message dated 7/30/00 7:33:41 AM Eastern Daylight Time,
> [EMAIL PROTECTED] writes:
> 
> > > And, on top of that, I have emilinated session hijacking
> >  > (with a Back Button Breaking method).
> >
> >  Can you enlighten me ?
> 
> A security method that will redirect the user to a relogin page if, for
> instance,
> they hit the browser's back button and then use navigation on the old pages.
> 
> Basically, while in a regular area, the links might be
> http://192.168.1.100/cmp/about/about.html
> and in the secure area there is a "?key=af65235cd773ae986"
> tacked on the end.
> Keys are transmitted over HTTPS only.
> The key is transformed for each page request.
> 
> Once the key is added to the links, it is mandatory to be returned.
> If it isn't the user is directed to reenter their password.
> 
> I've mapped out all the possibilites, and this method prevents any
> serious bad effects from session hijacking, while leaving much of the site
> free from slow HTTPS connections.
> 
> However, just like anywhere, if someone steals your plaintext cookie
> or you send them the link with your Url munge in it, they can add
> things to your shopping cart. However, and importantly, while
> the user is in the secure area, the shopping cart is locked down, so
> unless they have your password also, you never have to buy any of it.


Thanks for that.

Greg





Re: was Re: template kit..... - now session handling

2000-07-30 Thread Greg Cope

Ian Kallen wrote:
> 
> Today, Greg Cope <[EMAIL PROTECTED]> frothed and...:
> > I posted about a generic URL mangeler / cookie session handler a few
> > days ago.
> >
> > Allthough this is not rocket science - I've writen a URI transhandler
> > that will put the session id into pnotes, and if cookies are off will do
> > a redirect to itself with a munged URL
> > (www.foo.com/id_here/original_bit_here).  A quick uri rewrite and bob's
> > one of your parents sister.   The only major issue is that I cannot
> 
> Two separate issues, two separate replies :)
> 
> If you do this, build it into Apache::Session!  Leverage the existing
> storage mechanisms built in there already (file, DBI, etc).  My only
> other feature requests for this:

Why not have something that is generic that can work with
Apache::Session, and on its own.  Why - well some people may not like a
monothic session system, and may just wish to use one or the other.  For
example I am presently only using sessions to store a Database ID, and
that stores any data I like.  I am presently not using Apache::Session
(but thinking about it!)

> 
> 1) include a %no_url_munging hash with user agents for known
> indexing spider storage.  You don't want inktomi or altavista returing
> munged URL's in search results!


I'm already including an option that will do a URI match and only
session bit that match a simple REGEX - so certain areas of a domain /
site can be non-sessioned.

Including a hash that has indexers in is no big deal  - Joshua from
Apache::ASP fame has a different spin and suggests using the query args
instead of URI rewriting which could help to solve this issue.

> 2) Have it configurable so that the url munger session pnote'ing can be
> turned off or on.

So if cookies are on then put the session id into pnotes else do not do
the redirect / url_munling bit - is that what you mean ?


Thanks for the pointers

Greg Cope

> 
> I think without these features, url munging session mgt is pretty
> worthless.
> 
> --
> Salon Internet  http://www.salon.com/
>   Manager, Software and Systems "Livin' La Vida Unix!"
> Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326



Re: Is there a module for getting / setting a Session-ID

2000-07-30 Thread Greg Cope

[EMAIL PROTECTED] wrote:
> 
> I have fully implemented URL munging and Cookie support,
> but SERIOUS troubles start to arise when you start adding
> the notion of secure sessions.
> 
> I have done it, but it isn't pretty. Basically, there
> are three types of pages. Normal, Secure, and Secure
> (but you don't need a Secure Url Munging).

my methodolgy at the moment sessions everything within a give uri or
matched uri (if I do a simple regex match).
 
> And, on top of that, I have emilinated session hijacking
> (with a Back Button Breaking method).

Can you enlighten me ?
 
> It was a hassle, but I liked the idea that my site
> supported Cookies and URL Munging, and also made it
> more secure than the major etailers.
> 
> Unfortunately (?) my design is very tucked away inside
> my overall site, and my copious spare time allotment
> hasn't come in this summer.

Even if you cannot help I would appreciate any comments on my methods -
which only requires you to read a few emails !





Re: was Re: template kit..... - now session handling

2000-07-30 Thread Greg Cope

Joshua Chamas wrote:
> 
> Greg & Gerald,
> 
> I wanted to bring an important issue that came up with
> Apache::ASP, how will you deal with search engines indexing
> the session-ids in the URL?
> 
> In Apache::ASP, this is handled a couple of ways, first the
> session-id is stored as a query string param, not in the path
> to give a hint at its dynamic nature for smarter search engines
> that respect this, but more important, there is detection that if
> the incoming session is not active, a new session id will
> be assigned to the end user.  This will prevent users that come
> from a search engine to all have the same session id.
> 
> I don't know how this latter might be dealt with in this case
> except by perhaps some runtime checking with Apache::Session
> for existence, and then a redirect at that time to a new URL
> with the right session-id?  The Apache::ASP query string
> SessionQueryParse implementation makes changing the id without
> redirection possible, but at the expense of runtime buffer
> URL parsing for those without cookies.
> 
> Also note that a developer should be made aware of the security
> implications associated with off site HTTP_REFERER logging
> of one's session id, so that a developer can work around this
> accordingly.  In Apache::ASP, I just am careful to warn about
> this issue in the docs and give a appropriate workaround:
> 
>   http://www.nodeworks.com/asp/sessions.html

Thanks Joshua

I've looked thorugh Apache::Asp session code and saw your args method.

Ian Kallen suggested a hash of know indexers - which is a good idea -
but has one problem of how to keep this upto date.

A few issues that have been brought to my attention are:

1 - Wherethere to use URI rewriting - and hence the indexer issue - or
to rewrite query args (i.e remove a session arg and place it into a
pnotes entry).  So that hopefully clever indexers will ignore the last
bit.

2 - The HTTP_REFERER leaking is an issue that people need to be aware of
- I could make a quick redirect filter that could remove the session
id.  This can also help with click throughs etc.  I am not aiming to do
any checking of the session id - thats left to something else.

3 - When to redirect to check for cookies etc. i.e. when a client comes
in without any session info do we imediately redirect to try and set a
cookie, and then use that or else do something else.  Or only check
after the secound request.

4 - Defining what a session is may be helpfull.  What I call a session
others may disagree.  I need to scope what I'm going to write -
otherwise I be redoing it every 5 minutes!  My spin on a session is
something that needs to be tracked - and I usually only do this when I
have to.  Others may define a session as any user interaction within a
small time frame on thier site so that they can track a users click
though (TMTOWTDI on this front I know).


Please send me any comments.


Thanks again Joshua

Greg Cope





> 
> Its a nice feature to get right when its finally working. Enjoy!
> 
> --Joshua
> 






Re: was Re: template kit..... - now session handling

2000-07-29 Thread Greg Cope

Gerald Richter wrote:
> 
> Hi Greg,
> >
> > As far as I am aware (please someone prove me wrong!) the does not
> > appear to be such a module.
> >
> 
> I meant the module your are about to write :-)
> 
> >
> > Please send me ideas / thoughs and I'll have a go.
> >
> 
> Embperl currently goes the way that it sets up a tied hash at load time (so
> it only has to be done once) and monitor wherever somebody is writing to
> this hash. Only in the case that a element of the hash is modified, Embperl
> generates a session id (actually Apache::Session does it) and sends the
> cookie to the browser. Therefore I don't have to configure anything to use
> session management (of course you can configure several parameteress, like
> cookie domain etc.), because if the page stores some data in the hash,
> session management is enabled in all other cases it isn't used. That make
> session management as transparanet as possible for the programmer. When a
> new request starts, Embperl checks if there is a session id send in a cookie

So therefore would it not be easy to modify your code to check for a
pnotes entry called session and cookies ?

If session is set then use that.

If cookie is set (ie 1) then assume cookies are on! else if you have a
session and cookies are off then rewrite your urls to include the
session ID ?

> from the browser and tells Apache::Session to restore the data in the
> session hash.
> 
> This shema may not work, with session id in the url, because you need to do
> the redirect before the page is executed. Because Embperl anyways parses the
> page, it would be no overhead to rewrite all hrefs (and other urls) on the
> fly. I have not thought very much about, what is the best way to go here.

Ok - remeber that the URI transhandler stage is before nearly all the
others - hence a redirect should work.

If the session ID is in the uri I rewrite the uri to exclude it thus:

www.foo.com/123234345356/index.pl

would get rewritten to:

www.foo.com/index.pl

and 

123234345356 would get put into a pnotes entry called session and
cookie_on would be set to O!

If the redirect needs to happen then the emb perl page would never be
executed until after the redirect as the embperl handler is after the
transhandler stage - or have I got emb perl completely wrong ?
> 
> This should give you a short impression what Embperl does, now we have to
> think about how we can bring this together with a general module.

Unless you can see nothing wrong with the above I should be able to put
something basic together over the next few days ... documentation may be
a bit lacking mind ...

Is the pnotes issue OK ? or should we use an Environment Variable to
transfere the data between handlers ?

What other issue do you have ?

Greg

> 
> Gerald
> 
> -
> Gerald Richterecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
> WWW:http://www.ecos.de  Fax:  +49 6133 925152
> -




Re: was Re: template kit..... - now session handling

2000-07-29 Thread Greg Cope

Gerald Richter wrote:
> 
> Hi Greg,
> 
> >
> > Can I recommend you write a simple, standalone module that everyone can
> > use and not just an embperl solution - I'd be willing to help (or write
> > it) if people send me their wants / ideas, and then flame my code when I
> > think its ready!
> >
> 
> I would be happy if there is an standalone module that handles uri
> translation and cookie checking and so on. I always like more to use
> existing solution, then reinventing the wheel (that's one reason why I use
> Apache::Session in Embperl).

As far as I am aware (please someone prove me wrong!) the does not
appear to be such a module.

> Embperl has some special needs, because it makes the session handling totaly
> transparent to the programmer (he has just to put his values in a hash), but
> if you create such a module (or extent the already existing one), I would be
> happy to take a look at it and make it work with Embperl.

I would be more than happy to rewrite what I have based on what you /
others want.

My module needs alot of tydying to be anything like the standard of the
code found here, mine also includes session checking code (DB lookups).

Can you and any others please post ideas of what you/they want ?  Some
people have already done such a module so if they can chirp up with
thier wish lists then that would be great.

So far I have something that:

a) Checks the URI (simple regex) to see if its a URI that needs
"Sessioning"
b) Checks for cookies first
c) puts data into pnotes (name anyone ? (I used UID, SID and
COOKIES_ON)) or we could use sub env variables
d) then checks for a session id in a URI.
e) redirects to session id uri if non present.

> 
> Gerald
> 
> P.S. Could you resend me your module, because I have missed it on the list

You did not miss anything I never sent anything - too embarassed!

Please send me ideas / thoughs and I'll have a go.

Greg


> 
> -
> Gerald Richterecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
> WWW:http://www.ecos.de  Fax:  +49 6133 925152
> -



Re: template kit.....

2000-07-29 Thread Greg Cope

Tom Brown wrote:
> 
> On Fri, 28 Jul 2000, Paul J. Lucas wrote:
> 
> > On Fri, 28 Jul 2000, Denton River wrote:
> >
> > > Its been a long time since i have done a jobb without using sessions. I would
> > > really like to have this feature included in the kit im using and i think
> > > alot of developers are with me on this one.
> >
> >   What I don't understand is *why*.  Why can't you use to
> >   independent pieces of software: one for templates and the other
> >   for sessions that work perfectly well together (or seperately)?
> >
> >   I personally prefer smaller, more easily udnerstandable pieces
> >   to large, complex, feature-bloated software.
> 
> Agreed. It seems to me that someone should write a simple package for
> tieing in Apache::Session (or similar) in a transparent manner, perhaps
> using an early handler stage of the request and leaving the session info
> in $r->pnotes() ?? (via an object/typglob/whatever??)  That said, it's
> late and I'm really not in the appropriate state for making _solid_
> contributions ;-)

As per my other posts I think that this would be handy - and as others
have mention if we could make something that is generic then people use
it in small projects where they mostly roll their own, or other may
include it with a TT or embperl system, like Apache::Session is
supported via Embperl.

I've a simple / ugly module that does the above as a URI transhandler -
it is basically some code from the excellent apache modules book with
some extra cookie checking.  Mine also checks the cookie to see if is
valid (i.e DB lookup)

It:

Checks the URI to see if session management is "on" - returns declined
if not.

Either puts the cookie value of a cookie called session into pnotes, and
sets pnotes cookie_on to true.

Or does a rewrite to check cookies - with a new session id.(this bits
still being tested!)

If this fails it looks for a session id in the URL
(www.foo.com/session_id/everything else) - like the example in the
apache modules book.  - if a session is found it places this in pnotes,
and sets pnotes cookie_on to false.

If no session id in the URL it then makes one and does a redirect to
that.

If any sees any major issue with this then please drop me a line - I can
see so far:

1. Does a lot of redirects if cookies are off first time round.
2. Session ID may get sent with the URL in a HTTP_REFERER by a browser -
if you have links off your site.
3. Posted values get lost in the redirect - this is probably solvable.
4. I have added code to get the args and redirect those as well - so get
request do not lose their args.

If people want to send me wish lists I'll see if I can include them and
then write some docs (so far its in the tradition of real programmers
don't document - I'm hoping to be a real programmer ;-) and post it back
here.

Greg

> 
> >
> >   - Paul
> >
> 
> --
> [EMAIL PROTECTED]   | Don't go around saying the world owes you a living;
> http://BareMetal.com/  | the world owes you nothing; it was here first.
> web hosting since '95  | - Mark Twain





was Re: template kit..... - now session handling

2000-07-29 Thread Greg Cope

Gerald Richter wrote:
> 
> > I sure think that this template discussion is
> > intresting, forms autofill is one thing but another
> > thing that i think  would be neat is if the kit could
> > do session handling, like the Apache::ASP. Can embperl
> > or mason do this fancy stuff.
> >
> 
> Embperl can do session handling. It uses Apache::Session for storage and
> cares about the rest for you. You simply put the values for the user session
> in the hash %udat and they will be automaticly restored when the same user
> does the next request. Currently Embperl uses Cookies to store a session id
> witht in the browser. For Embperl 2.0 I plan to support also URL rewriting.

I posted about a generic URL mangeler / cookie session handler a few
days ago.

Allthough this is not rocket science - I've writen a URI transhandler
that will put the session id into pnotes, and if cookies are off will do
a redirect to itself with a munged URL
(www.foo.com/id_here/original_bit_here).  A quick uri rewrite and bob's
one of your parents sister.   The only major issue is that I cannot
appear to use posted values as they appear to get lost in the redirect
(Clues wanted !).

It appears that a few other people would want a session handler that can
do this transparent and then they can use Apache::Session to do the
rest.

Can I recommend you write a simple, standalone module that everyone can
use and not just an embperl solution - I'd be willing to help (or write
it) if people send me their wants / ideas, and then flame my code when I
think its ready!

Greg

> Gerald
> 
> -
> Gerald Richterecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
> WWW:http://www.ecos.de  Fax:  +49 6133 925152
> -





Re: Is there a module for getting / setting a Session-ID

2000-07-29 Thread Greg Cope

jeff wrote:
> 
> The mod_perl eagle book has a good section on saving state information
> using session ids. And it's not necessarily mod_perl based.

Thanks Jeff.

I've some code based on parts of the state section - speifically the
ideas of URL mungling.

Greg

> 
> --
> Jeff Saenz
> [EMAIL PROTECTED]




Re: Is there a module for getting / setting a Session-ID

2000-07-26 Thread Greg Cope

"Issam W. Alameh" wrote:
> 
> check Apache::ASP
> 
> http://www.nodeworks.com/asp/
> 
> It is so great
>

Thanks - I'm looking for something more lightwieght - i.e just to do
this ...

But all the people pointing me to Apache::ASP is starting to tell me
something.

Greg
 
> Issam
\



Re: OSS/Perl Conference Report

2000-07-26 Thread Greg Cope

Ask Bjoern Hansen wrote:
> 
> 
> ps. more pictures of Perl People at http://photo.tomat.dk/tpc4/
> now... if you haven't seen a picture of Doug before then you should
> take a look at http://photo.tomat.dk/tpc4/dsc_4696.html ... :)

seems to me to involve lots of Beer and and I not sure about the
relevance of the fish ...

Thanks

Greg


> 
> --
> ask bjoern hansen - 
> more than 70M impressions per day, 





Is there a module for getting / setting a Session-ID

2000-07-26 Thread Greg Cope

Dear All

Is there a (CPAN) module for transparently setting/getting a Session id
from a client:

i.e. If they are using cookies set and send a Session ID (shortish
expiration time) and optionally a User ID (cookie with a long expiration
time).

If cookies are off then use URL mangling to store a Session ID (no need
for a User ID as we would not be able to identify a revisit accurately
..).

These ID's could then be used with Apache::Session to store the data


If not why - does everyone roll thier own ? or are there issues that are
not obvious ? Would any be interested in one ?

Greg Cope





Re: Mail delivery failed: returning message to sender

2000-07-24 Thread Greg Cope

Mail Delivery System wrote:
> 
> This message was created automatically by mail delivery software.
> 
> A message that you sent could not be delivered to one or more of its
> recipients. The following address(es) failed:
> 
>   [EMAIL PROTECTED]:
> SMTP error from remote mailer after RCPT TO:<[EMAIL PROTECTED]>:
> host mail.apache.org [63.211.145.10]:
> 553 Open relay problem - see 
>http://www.mail-abuse.org/cgi-bin/nph-rss?195.102.240.129>
> 
> -- This is a copy of the message, including all the headers. --
> 
> Return-path: <[EMAIL PROTECTED]>
> Received: from [212.134.215.254] (helo=rubberplant.freeserve.co.uk)
> by serv1.is1.u-net.net with esmtp (Exim 3.12 #1)
> id 13Gf2m-0004W7-00; Mon, 24 Jul 2000 11:01:04 +0100
> Sender: greg
> Message-ID: <[EMAIL PROTECTED]>
> Date: Mon, 24 Jul 2000 10:01:09 +
> From: Greg Cope <[EMAIL PROTECTED]>
> X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686)
> X-Accept-Language: en
> MIME-Version: 1.0
> To: Perrin Harkins <[EMAIL PROTECTED]>
> CC: Modperl list <[EMAIL PROTECTED]>
> Subject: Re: YAM (Yet Another Module) - an IPC shared cache thing -
>  anyoneinterested  ?
> References: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> 
> Perrin Harkins wrote:
> >
> > On Fri, 21 Jul 2000, Greg Cope wrote:
> > > I've writen a small IPC sysV based shared cache thingy ... (useing
> > > IPC::ShareLite), and I'd like some comments oin the design if anywants
> > > to crtique...
> >
> > Can you explain how your approach is different from the ones in
> > IPC::Shareable, IPC::Cache, IPC::SharedCache, IPC::MM (using shared hash),
> > File::Cache, and BerkeleyDB, and list some advantages/disadvantag
> > your module?  Your module may be great, but it's hard for people to know
> > which one to use in this crowded field without some explanation of the
> > differences.
 
 I did not realise that the field was so crowded - my appologies - It
 appears that I have opened my mouth too soon - and that these modules
do
 the more than mine, and better.
 
 Basically its a light weight variant of HTML::Template - i.e it allows
 you to define tags, with values, that are substituted into a template
 when you ask for the content.  This template is stored in a Shared
(IPC)
 Cache (again in a very similar way to IPC::SharedCache).  The lightness
 of the module is evident in that it is just over 100 lines (at the
 moment!).
 
 Since I was refered to HTML::Template I then found all thse other
 modules and have been grapleing with wether to use those, or my own.  I
 think I'll carry on with mine for my projects (and as a learning
 excercise) - and use the others when clients need that functionality,
so
 that when I leave they can use the maintained CPAN modules.
 
 Hope that clarifies some of the confusion I appear to have created.
 
 Greg Cope
 
> > - Perrin





Re: ApacheCon Europe - thoughts please ?

2000-07-24 Thread Greg Cope

Richard Dice wrote:
> 
> > I am considering going to the ApacheCon Europe to see what's said and
> > put a few faces to names and meet a few people.
> 
> So am I.  And I'd be shipping myself in from Montreal/Toronto for it.
> I'm sure it will be worth the money, but I sympathise in terms of paying
> out of pocket for it as well, as I'd be doing the same.
> 
> I'm not sure if it's "a fair reflection" of the price of having an attendee
> there, but that's not what it's about:  It's about making money.  The
> conference organizers have their dreams of financial security, too, and
> are looking for an appropriate work/risk/reward pay-off as well.
> 
> I don't think you're being a scruge.  It's a lot of money to be looking
> at -- I know. :-)
> 
> History will show whether I get up the guts to write the cheque myself.

I've now reconsidered and am trying to summon up the will to write the
cheque as well.

Greg Cope

> 
> Cheers,
> Richard
> 
> --
> 
>  Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
>  ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED]
>  Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
>  "squeeze the world 'til it's small enough to join us heel to toe"
>  - jesus jones





Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-23 Thread Greg Cope

Joshua Chamas wrote:
> 

> I would recommend using Apache::ASP as it does everything you need.
> First it allows for creation of your dynamic tags:
> 
>   http://www.nodeworks.com/xml.html
> 
> It will reload all of your templates dynamically at runtime, for
> ease of development but also has advanced server startup parent
> httpd compilation abilities for greatest scalability, where templates
> are shared across child forks:
> 
>   http://www.nodeworks.com/asp/tuning.html#Precompile%20Scripts
> 
> Finally, it will give your designers a comfortable ASP scripting
> environment, while giving you the developer powerful APIs like
> the Script_OnStart event which you can use to customize the
> global environment available to each script:
> 
>   http://www.nodeworks.com/asp/events.html#Script_OnStart%20%26%20Script_OnEnd
> 
> If you think its scarey that designers might be able to execute
> arbitrary perl code in <% %> blocks, I have thought about allowing
> a config option to turn these blocks off, so the compiler will
> just strip them or render the raw code by default.  Might be like
> 
>   PerlSetVar CodeBlocks 0
> 
> This way, your designers would only be able to use the custom tags
> that you provide for them.


Thanks Joshua

I was aware that Apache::ASP did all the some of these things but not
all of this - and I see you will be including some XML support  I am
truely impressed (the caching bit, and the script environment changes).

My aims have thus far been to write my own modules that just do what I
need and no more, so that Firstly its efficient (no excess code, not to
say Apache::ASP has any of that ;-), and Secoundly to learn some more.

This does mean I reinvent the wheel code wise, compared to projects like
yours, HTML::Embperl, HTML::Template - but I'll learning in the mean
time.  I am not expecting to release anything on CPAN or for the code to
be used by anyone else.

If anything I've been introduced to HML::Template - which is just the
lightwieght templating module that would help with my present (work)
project (I'd use my own  module, but using a maintained CPAN module
would be better for my clients in the long term (i.e after I've left)).

Thanks again for the pointer.

Greg Cope

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




Re: OSS/Perl Conference Report

2000-07-23 Thread Greg Cope

Matt Sergeant wrote:
> 
> I've put my report on the OSS/Perl conference online for all to
> see. Hopefully you'll find it vaguely interesting in parts. Its at
> http://modperl.sergeant.org/oss-conf-report.txt

Thanks Mat - much appreciated.

It seems difficult to get a concise view of what people are playing with
(not only Doug's MPM threaded model, DBI connection pools, but now
hotspot style op code removal ...) development wide - without
subscribing to loads of lists, and even then there is on guarantee  of
any news!

Sounds like a good time was had by all.

Thanks again for the resumee.

Greg Cope.


> 
> --
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org





Re: YAM (Yet Another Module) - an IPC shared cache thing - anyoneinterested ?

2000-07-23 Thread Greg Cope

"T.J. Mather" wrote:
> 
> Have you considered using HTML::Template?  It is a simple yet powerful way
> to seperate HTML from Perl code.  It can do loops (good for HTML
> tables), includes, and if/unless/else statements.  Furthermore, it has
> shared memory for templates built in.
> 
> http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?dist=HTML-Template-1.8

Thanks for that.

Looking at that lead me IPC::SharedCache - which is almost exactly what
I have decided to do - albiet Sam Tregar's implementation appears alot
better.

My Implentation of the template is very simple - i.e you give it a
template, then ask it to sub in all the values into the tag locations,
and return a scalar ref.  There are a few other methods (for defining
tags and their values) -p but thats it.

I seem to have implemented an HTML::TemplateLite and IPC:SharedCacheLite
 I have learned alot and can always reuse the code in the orginals -
this is after all perl 

Thanks again.

Greg Cope





Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Greg Cope

Francesco Pasqualini wrote:
> 
> is it possible to use IPC sysV  to share DBI connection between apache
> childs ?

IIRC this is not possible as DBI connections are special magic things -
this was discussed on the list a few months back - but I cannot remember
the name of the thread.


Greg Cope
 
> What I'm looking for is the possibility to store a DBI connections in the
> $Session
> object (Apache::ASP or Apache::Session).
> In this way we can start a DB connection for each user session and we can
> have different application using differnet DB.
> 
> The connection is started when the user session start, is maintened in
> memory, it is visible to all the apache childs and will be closed at session
> end.
> 
> thanks
>



Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Greg Cope

[EMAIL PROTECTED] wrote:
> 
> Sorry, sounds like you could have just used Apache::StatINC, no?

Apache::StatINC only reloads your perl modules if they change.

My module loads (HTML) templates into a shared IPC memory segment - or
rather anything that can be stored as a scalar (limits of IPC::ShareLite
- if you need to store other things you would need to use Storable, or
Data::Dumper).

I do not use it to store perl modules, only to store all my html
templates.

Does that make sense ?

Greg Cope




Re: [OT]: Re: ApacheCon Europe - thoughts please ?

2000-07-22 Thread Greg Cope

Gunther Birznieks wrote:
> 
 >
>
> >Thoughts from anyone ?
> 
> Yeah, you're being pretty cheap. :)
> 
> Well, I'm sort of kidding here. But the reality is that a conference offers
> a lot -- not just knowledge (then just attend a tutorial locally at Sun or
> someplace) but networking. The coordination of a conference is a huge task.
> 
> Anyway, most conferences do have a free vendor expo, but I don't think that
> it's nearly as good as going to a whole conference. If you really want to
> attend a conference for "free", why don't you contribute back to the
> community that has been helping you make a living and give a talk?

Would love to - but I regard myself as in the "no-longer a newbie, but
not an
expert" stage, and certainly not in the same league as the poeple whom
are
already giving talks.

> 
> Let's put it this way, conferences are pure and simple a business expense
> BUT they are also fun. Don't go if it's not fun.
> 
> Then look at it like this... what do you pay to go on vacation? Surely it's
> the same basic formula minus the conference fee which by itself is less
> expensive than getting training the equivalent days at SUN. If you didn't
> go on vacation because it cost you 5% of your salary... OK then... that's
> your choice... then I guess I would find it hard to convince you that it's
> also worth it to go to a conference.

Thanks - I'm having secound thoughts.

Greg

> 
> Later,
>Gunther
> 
> __
> Gunther Birznieks ([EMAIL PROTECTED])
> eXtropia - The Web Technology Company
> http://www.extropia.com/




YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Greg Cope

Dear All

I've writen a small IPC sysV based shared cache thingy ... (useing
IPC::ShareLite), and I'd like some comments oin the design if anywants
to crtique...

Why / the problem:

I work in a dept where the coderes (Me !) code, and the HTML design
people do HTML.  The only commonality we share is that we agree on a tag
name (place holder ... where they want my dynamic content to go) and the
size of the content to be placed.  They then create the HTML (templates)
with tags, and I code perl that looks for these tags in the templates.

Nothing special so far. (The templating module is very, very simple and
only deals with new tags and
templates).

When mod_perling I used to load all the templates into an object that
had one class attribute - a hash of these templates.  The apache
children can create a new object(s) that will have the templates in the
class attribute 'cache'.  This is fine until you want to change anything
- you need an apache restart.  This was not really an issue, until we
had a new design which had often changing nav bars because new sections
are added / removed (often being daily sometimes hourly at times).

A Solution

Not whishing to use mod_perl to create any semi dynamic data (changes
daily /
hourly) etc. I thought about Sysv shared memory and
IPC::ShareLite.  Having had a "classical" Database training, I normalise
everything into modules quite aggressively (or at least try to think I
do).

Hence I want these templates in memory, and shared by all processes -
so that if a change needs to be made an exterior process can change one
or more
cache entr{y|ies}, and all apache children will then use the new cached
template.

Apart from security of the Shared memory - I see no major issues - but I
be looking through rose tinted specs...

Can any one see any major issues with this from a mod_perl prespective ?

If anyones interested in having a look see - drop me a line - as I'll
have to clear it up a bit !

Greg Cope





Re: [OT]: Re: ApacheCon Europe - thoughts please ?

2000-07-22 Thread Greg Cope

David Hodgkinson wrote:
> 
> Gunther Birznieks <[EMAIL PROTECTED]> writes:
> 
> > Well, I'm sort of kidding here. But the reality is that a conference offers
> > a lot -- not just knowledge (then just attend a tutorial locally at Sun or
> > someplace) but networking.
> 
> Buying key people lots of beer in other words.

LOL

I was thinking that this may be cheaper 

Greg Cope

> --
> Dave Hodgkinson, http://www.hodgkinson.org
> Editor-in-chief, The Highway Star   http://www.deep-purple.com
>   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
>   -





Re: Help! Need strategy for upgrading production system!

2000-07-22 Thread Greg Cope

Doug Luce wrote:
> 
> For this sort of thing, I assign a second IP address to the machine, then
> configure everything to bind to that IP address (making sure the original
> implementation binds to the first IP address only).

Or you could use a different set of ports ... less to configure then.

> 

 
> The trick is to start using versioned target directories for your
> stuff.  Instead of just cramming it all in /usr/local/bin, set up
> /usr/local/apache1.3.12/bin etc.

Agreed - when ever I set up boxes I always use a prefix of
/usr/local/package+version so the install goes there.

I then use symlinks so that the current version is symlinked from
/usr/local/package.

I then change any start up scripts to use /usr/local/package.

So when an upgrade is required I just install, and test (on a different
port) and when I am happy  I change the symlink and do a stop start -
the upgrade is hence nearly transparent.

One issue with this is things like DBD modules that are closly tied to
the version of perl and the DB client libs - if you upgrade either then
you may have a problem.  In this case I usually rebuild the DBD libs
between the stop and the start (it takes less than a minute.).  As yet
I've not moved to perl 5.6.

Greg Cope

> 
> doug
> 
> On Wed, 19 Jul 2000, Keith Kwiatek wrote:
> 
> > Hello,
> >
> > I have a production system (solaris 7) with apache 1.3.6 system with
> > mod_perl.1.19 and mod_ssl.2.3.1
> >
> > I would like to somehow install the latest apache + mod_perl + mod_ssl +
> > DBI/DBD versions on the production system, BUT without interrupting the
> > current production system. And then, after I have moved over and tested the
> > production web application in the new server, cleanly switch over.
> >
> > In other words, is it possible to install new versions of apache + mod_perl
> > + mod_ssl + DBI/DBD (and all the dependant modules) into a separate
> > directory on the production system -- WITHOUT affecting the older apache
> > production server?
> >
> > How in the world do I cleanly upgrade apache + mod_perl + mod_ssl + DBI/DBD?




> >
> > Thanks,
> > Keith
> >
> >





ApacheCon Europe - thoughts please ?

2000-07-19 Thread Greg Cope

Dear All

As some of you are at a conferance at the mo and I am still at work ;-(
I thought I'd ask about apacheCon Europe - although not strictly
mod_perl there is a relevance - even if tenous.

I've never been to an IT conferance like these -  and they appear quite
popular. Especially the BOF's.

I am considering going to the ApacheCon Europe to see what's said and
put a few faces to names and meet a few people.

However, I've just seen the prices - I am not saying that everyone
should do this for free or not be paid thier travel / hotels, but it
seems a little expensive.

Three days off work + threeday pass + other expenses + travel = 5% of my
income (I am contractor - hence I pay for it all).

Am I being a scruge or is this a fair reflection of the cost of going to
an event ?  Will there be out-of-Conference events that
non-conference-goeres can attend ?

Thoughts from anyone ?

Greg Cope




Re: Installing mod_perl a dozen times ...

2000-07-18 Thread Greg Cope

martin langhoff wrote:
> 
> hi,
> 
> i guess once you've been playing with mod_perl for a while, you
> certainly installed perl, many modules, plus mod_perl, plus apache, plus
> many more things ...
> 
> I keep a personal list of all the modules I must d/l and install on a
> virgin OS, and the correct order, versions and params (if needed).
> 
> this helps me reduuce the time it takes to up/down-grade perl, for
> instance. or mod_perl, maybe. I guess we all should have a list like
> that, and it'd be useful to share it and cross-pollinate ideas/modules.
> A goal might be making a bundle of key components to install. And maybe
> make a srpm out of it, or a small perl script.
> 
> what do you think? is it already done? maybe all of a sudden I've got
> this oh so great idea just because I have not read the instructions to
> download the latest bundle from CPAN

Have you tried the CPAN shell - it has an autobundle command that allows
you to create a snap shot of all your installed modules, and then all
you need to do is install that bundle via CPAN shell on your new
machine.

As for the creating a collective one - I feel that apart from the Apache
bundles you may find little common ground on what people use.

Hope that helps

Greg Cope



> martin




Re: ORA conference

2000-07-15 Thread Greg Cope

From: "Matt Sergeant" <[EMAIL PROTECTED]>
To: "Jason Bodnar" <[EMAIL PROTECTED]>
Cc: "Vivek Khera" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 15 July 2000 08:06
Subject: RE: ORA conference


: On Fri, 14 Jul 2000, Jason Bodnar wrote:
:
: > Since nobody had a better idea how about The Crown and Anchor Pub:
: >
: > http://www.crownandanchor.net/
:
: +1
:
: Now who's wearing the rose in their button hole so we can recognise each
: other? ;-)
:
: Either that, or wave copies of the Eagle book when people come in!

Judging by the trafic is there going to be anyone left on the list  ( Greg
is wondering if he should have gone .. ) ;-).

Being serious - If there is any big news can someone post a summary - so
that those of us not going do not feel completely left out ?

Also - Doug - any more news on mod_perl 2.0 and your DB pooling idea ?

Greg Cope


:
: --
: 
:
: Fastnet Software Ltd. High Performance Web Specialists
: Providing mod_perl, XML, Sybase and Oracle solutions
: Email for training and consultancy availability.
: http://sergeant.org | AxKit: http://axkit.org
:
:




Re: Apache::Upload ?

2000-06-28 Thread Greg Cope


Geoffrey Young wrote:
>

>
> I think lots of people are hoping libapreq gets integrated into the
> mod_perl-2.0 distribution :)
>
> --Geoff
 
excellent idea - What does everyone else think (Doug ?)
 
Greg Cope
 






Re: maintaing global variable in PerlLogHandler

2000-06-24 Thread Greg Cope

Jim Winstead wrote:
> 
> On Jun 23, Jim Sproull wrote:
> >   This all works fine. However, the get_sessionid and set_sessionid are
> > using a dbm file, which is locked and unlocked during each request.  (I
> > know, I know).  Obviously, this is a lot more load that is necessary.  I
> > tried using a simple global variable (defined before the handler), but this
> > was unreliable as it was set differently for each request.  No doubt due to
> > different processes handling each request.  Can anyone suggest a better way
> > of handling this globablly accessed data?  Thanks.
> 
> If you search the new-httpd list, you should be able to find a
> patch I posted to mod_usertrack (quite some time ago) that in
> addition to adding a configuration option (to set the cookie's
> domain or something like that), makes mod_usertrack create two
> additional notes -- "out-cookie" and "in-cookie" which are set to
> the value of its session cookie depending on whether it is outgoing
> (being set) or incoming (subsequent requests).

This is just what I've been after (the domain and cookie set checking) -
thanks.

Has anyone an issues with using this apache module with mod_perl.  I
need to track users via cookies on a site that is 1/2 html and half
mod_perl - hence this offers an ideal solution for cookie tracking HTML
pages via an UID. 

Jim , all the patches that I've found from you in archives appear to be
incomplete, I've tried fixing one but to little avail (my C is very very
basic).

Could you post or send me the patch - would be very much appreciated!

Also does anyone know if anyone is working on an Apache 2.0 version ?

Greg Cope

> 
> With that, it is very easy to know when the cookie is new, and if
> you log the two fields seperately, you can easily calculate the
> number of your visitors who have cookies disabled (or only make
> a single request to the webserver).
> 
> Jim




Re: Template techniques [ newbie alert + long ]

2000-06-08 Thread Greg Cope

Perrin Harkins wrote:
> 
> On Thu, 8 Jun 2000, Greg Cope wrote:
> > My original question was not related to templates (I'll use embperl for
> > that)
> 
> Well, I'm confused now.  You'll use Embperl for templates but you're not
> using Embperl for templates?

I use Embperl when I want a templating system - but not when using HTML
templates (wrong use of names on my part) - I am refering to a template
in this case as an HTML file with a few special tags.

> 
> > - the area I was trying to explore was how to read a template (all
> > HTML with a few  in it) and the sub in the new content.
> 
> Embperl would work fine for that, but it's overkill.  Your substitution
> approach is slower than compiling to perl subs, especially since you have
> to load the file, but saves lots of memory and is fine for something as
> simple as this.

Can you enlighten me into the compiling to perl subs ?

The file gets loaded once into shared memory - most (stripped) HTML
files are only a few 10's of K.

Also the file gets loaded once at startup - not during the request
stage.

> > Has anyone any suggestions as to speeding this up - yet keeping it
> > simple - I have played with referances to avoid all the variable copying
> > etc . ?
> 
> Caching templates in memory would certainly help, but you'll eat up a
> chunk of RAM.

If the html is usually reasonable in size, and the code I C&P'ed strips
the template into one long strip with spaces / tabs (designers making
things all indented etc ..) at each end of the string - and chomp.

Also the templates are modular - in that one template covers main part
of the page, and other templates cover the rest.  This helps contiunity
in HTML design etc .. (i.e only make one changen in one place)


Thanks for the input.

Greg

> 
> - Perrin



Re: Template techniques [ newbie alert + long ]

2000-06-08 Thread Greg Cope

Chris Winters wrote:
> 
> * [EMAIL PROTECTED] ([EMAIL PROTECTED]) [000608 11:07]:
> > I'm curious Matt, as opposed to what?, reparsing the template each
> > run?  Clearly reparsing would be a big loser in terms of performance.
> >
> > But what other technique could be used..., hrm.., without direct
> > control over the pipe, I really don't think it would get too much
> > better than this.  I mean, you could yank out sections and stuff it
> > into an array that would be like: text, coderef, coderef, text, etc.
> > Like in an ASP template you would parse the file, grab sections
> > between <% %> and eval it as a code ref, and stuff it into your array.
> > But this would probably not work specifically in ASP's case, but you
> > might be able to pull it off in Embperl.  (Unless the array itself
> > could also point to arrays, etc.)  Overall..., I think compiling it
> > directly makes a lot more sense in 99.999% of template languages...,
> > otherwise you'd end up putting too many restrictions on the template
> > language itself.
> >
> > Hmm..., sort of an interesting question, what ways could be utilized
> > in order to maximize speed in template execution.  I thought about
> > this a while ago, but after the fact I have to agree with Matt...,
> > just evaling each template as a package, or a code ref would be a
> > lot quicker, and if you could cook up another scheme, the resulting
> > code complexity might not pan out to be worth it.
> 
> The newest version of Template Toolkit (currently in alpha) supports
> compiling templates to perl code. See about 2/3 of the way down the
> the README at www.template-toolkit.org. Why reinvent the wheel? :)

My original question was not related to templates (I'll use embperl for
that) - the area I was trying to explore was how to read a template (all
HTML with a few  in it) and the sub in the new content.

My pages usually have serveral templates - or one larger template with
comments arround iterative bits (tables) so that I end up with a main
template which may look something like:







>





and a table template:



The Designers / HTML coders I work with can then chop and change these
templates - I have made a template loader that strips the iterative
table content out into a seperate template, so that they can code a fake
entry for design reasons - and I then strip it out (looking for some
special HTML comment tags).

In a startup.pl The code then looks somat like this forgive the probably
uncompliable perl etc ... this is for explaination purposes:

use vars (MAINTMP TABLETMP);

$MAINTMP = &load('main.tmp');
$TABLETMP = &load('table.tmp');


sub load {

my $file = shift;
my $html = '';

open (TEMPLATE, $file) || die ('Cant open : ', $file, $!);
while () {
chomp;
$_ =~ s/^\s+//;
$_ =~ s/\s+$//;
$html = $html . $_;
}
close (TEMPLATE)  || die ('Cant close : ', $file, $!);
return $html; 
}


then in a handler:

sub makeTableContents {

# assumes @_ is a nice list in order of values
# to insert into the table ..
my $template = $TABLETMP;
my $tablehtml;
foreach (@_) {
$template ~= s//$_/;
$tableHTML .= $template;
}
return $tableHTML;
}


sub doStuff {

# assumes that it is passed in the return value from
# makeTableContents and a title
my $tableHTML = shift;
my $title = shift;
my $template = $MAINTMP;

$template =~ s//$title/;
$template =~ s//$tableHTML/;

return $template;
}

Then when I want to send it I just print the return value of doStuff

This may not be OO - but it is simplistic, and although not benchmarked,
should be fast.  I have seen another OO ish implentation, that uses a
hash a bit like  Mats example - this allows more flexibility as all you
need do is add the tag to the HTML, and then add the tag to the hash -
then when you do the regex it gets put in.

Has anyone any suggestions as to speeding this up - yet keeping it
simple - I have played with referances to avoid all the variable copying
etc . ?

Thinking about it Mat's example is far more scalable, and reusable.

I am enjoying this thread ;-)

Greg Cope


> Chris
> 
> --
> Chris Winters
> Internet DeveloperINTES Networking
> [EMAIL PROTECTED]http://www.intes.net/
> Integrated hardware/software solutions to make the Internet work for you.




Re: [performance/benchmark] printing techniques

2000-06-08 Thread Greg Cope


From: "Matt Sergeant" <[EMAIL PROTECTED]>
To: "Stas Bekman" <[EMAIL PROTECTED]>
Cc: "___cliff rayman___" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 08 June 2000 09:23
Subject: Re: [performance/benchmark] printing techniques


: On Wed, 7 Jun 2000, Stas Bekman wrote:
:
: > On Wed, 7 Jun 2000, ___cliff rayman___ wrote:
: >
: > >
: > >
: > > Stas Bekman wrote:
: > >
: > > >
: > > >
: > > > Per your request:
: > > >
: > > > The handler:
: > > >
: > > > query | avtime completed failedrps
: > > > ---
: > > > single_print  |110  5000  0881
: > > > here_print|111  5000  0881
: > > > list_print|111  5000  0880
: > > > concat_print  |111  5000  0873
: > > > multi_print   |119  5000  0820
: > > > ---
: > >
: > > not very much difference once stuck in a handler.
: > > obviously multi_print is both ugly and slow, but the rest should be
used by the
: > > discretion of the programmer based on the one that is easiest to
maintain in
: > > the code.
: >
: > absolutely. I'd also love to know why is it different under the handler.
: > (talking about relative performance!)
:
: Because as I said - the method dispatch and the overhead of the mod_perl
: handler takes over. multi-print is the only one that has to call methods
: several times. The rest are almost equal.
:
: This also demonstrates some of the value in template systems that send all
: their output at once, however often these template systems use method
: calls too, so it all gets messed up.

This may be veering off topic - but its been on my mind for a while now 

Apart from thanking Stas for his benchmark work, which I find very
interesting (does he sleep ;-) - this and few few others (benchmarks) have
all touched on the area of including mod_perl output within HTML.  I have
always wonder what everyone else is doing on this front.

I usually suck a template into memory (one long line) - usually done at
startup.  I then create all the conent with either pushing onto an array, or
.= string concatination.  Finally I regex the template - looking for my tags
and replave those with output.  Needless to say that one page can onsists of
many templates (page or inside of table (bits from  ) etc ...).

>From Stas previous benchmarks I've preloaded the mysql driver and now
usually use the "push" onto array to prepare content - Thanks Stas.

Who does everyone else do it ? Can this type of operation (that everyone
must do at some time) be optimised as aggressively as some of the others ?
Yet still keep the abstraction between design and content.

Greg Cope

:
: --
: 
:
: Fastnet Software Ltd. High Performance Web Specialists
: Providing mod_perl, XML, Sybase and Oracle solutions
: Email for training and consultancy availability.
: http://sergeant.org http://xml.sergeant.org
:
:




Re: disconnect overloaded [ OT - appology]

2000-05-22 Thread Greg Cope

From: "KleverKaren" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 22 May 2000 21:42
Subject: Re: disconnect overloaded

whops  this is my girlfriends account  I'm obviously not that Klever
or I would use my own ;-)

Greg


: From: "James W.Blackwell" <[EMAIL PROTECTED]>
: To: <[EMAIL PROTECTED]>
: Sent: 21 May 2000 14:00
: Subject: disconnect overloaded
:
:
: : RH Linux 2.0.34
: : Apache/1.3.12
: : ApacheDBI-0.87
: : DBI-1.13
: : mySQL 3.22.20a
: :
: : Any ideas why I'm getting this "disconnect (overloaded)" entry each time
a
: page is loaded?  The data is represented correctly on the webpage.  I am
the
: only person hitting this server.
: :
: : 8901 Apache::DBI need ping: yes
: : 8901 Apache::DBI already connected to
: 'whitman:192.168.1.1userpasswordAutoCommit=1PrintError=1'
: : 8901 Apache::DBI disconnect (overloaded)
:
: If can jump in and offer a suggestion -  if no-one else has answered yet.
:
: You should see this message each time $dbh->disconnect(); is called -
: somewhere in this page a $dhn->connect(); and disconnect is being called -
: this is just Apache::DBI saying "I am already connect and I ignoring the
: disconnect so that I can keep that connection persistent"
:
: Hope that helps
:
: Greg Cope
:
: :
: : --James
: : ---
: : ASCII Ribbon campaign against HTML E-Mail  / \
: :
:
:




Re: Re: RFC: Apache::Request::Forms (or something similar)

2000-05-20 Thread Greg Cope

: >
: >On Wed, 17 May 2000, Peter Haworth wrote:
: >
: > > Drew Taylor and I are about to write a subclass of Apache::Request
which
: > > includes form element generation methods, a la CGI.pm. The current
: >favourite
: > > name is Apache::Request::Forms, but we'd like to know if anyone has a
: >better
: > > one.
: > >
: > > The module is currently planned to be fairly bare-boned, only adding
: >form
: > > element generation methods for methods which will benefit from
: >CGI.pm-style
: > > sticky values, and the parameters these methods take are likely to be
a
: >lot
: > > more restricted than CGI.pm's (not difficult, really). However, this
: >could
: > > change in the unlikely event that we get deluged with feature
requests.
: >
: >personally, i'd like to see Apache::HTML for generating html, written in
: >c.  something simple along the lines of HTML::AsSubs, then another class
: >to glues it and Apache::Request together that provides CGI.pm features,
: >like 'sticky forms'.  but, i haven't given that much thought.

I would as well Doug.

I find that I only use Apache::Request and Apache::Cookie and that I
sometimes need the functionality of CGI qw(:forms), but reframe from using
it due to the bloatish issues.

i.e it would be great to have such a thing as it would complement
Apache::Request and Apache::Cookie.

ps How are you getting on with the eagerly awaited mod_perl-dev-1.99 ?

Just my 2 pence worth of a feature request

Greg Cope
(who should get his head round learning C one day)




Re: speed up/load balancing of session-based sites - POT

2000-05-12 Thread Greg Cope

From: "Perrin Harkins" <[EMAIL PROTECTED]>
To: "Greg Cope" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: 13 May 2000 01:57
Subject: Re: speed up/load balancing of session-based sites - POT


: On Sat, 13 May 2000, Greg Cope wrote:
: > : Likewise with sessions. Even if you load balance across multiple
machines
: > : you don't need to access a session database on every request. Most
load
: > : balancing systems have something so they'll send the seme "session"
: > : (typically ip address) to the same backend server for N seconds as
long as
: > : the backend server is up of course.
: > :
: > : You can then put a daemon on each backend server as a local buffer and
: > : cache between the httpds and the session database. This daemon can
even
: > : load balance the session information over several databases if it's
: > : needed.
: > :
: > : viola, a lot less "real time" lookups in the database needed and a lot
: > : less direct connections.
: [...]
: > But - is this model not transaction safe ? - It may save alot of DB use
and
: > hence be alot quicker - but what if the webserver "disappears" halfway
: > through an IP based load ballanced "sesssion" - a potential source of
: > failure - something which a load ballancer is supposed to help with..
: >
: > Also if the loadballance goes south, and a secound takes over does it
have
: > the same IP based session info (probably not - but could be wrong ...) -
: > hence another potential source of failure.
:
: You have to do a write-through cache, i.e. you must write to the database
: as well as the cache, but you only have to READ the database if you don't
: find the session in the cache.  If you have a fair amount of read-only use
: of the session this can be a big win.

Ok - but I find that most of my session stuf updates a "last access"
atribute within the session and hence is mostly read + write - not just read
but YMMV - good point tho.

Greg

:
: - Perrin
:
:




Re: speed up/load balancing of session-based sites - POT

2000-05-12 Thread Greg Cope

POT = Possibly Off topic


: Likewise with sessions. Even if you load balance across multiple machines
: you don't need to access a session database on every request. Most load
: balancing systems have something so they'll send the seme "session"
: (typically ip address) to the same backend server for N seconds as long as
: the backend server is up of course.
:
: You can then put a daemon on each backend server as a local buffer and
: cache between the httpds and the session database. This daemon can even
: load balance the session information over several databases if it's
: needed.
:
: viola, a lot less "real time" lookups in the database needed and a lot
: less direct connections.

ironically I was thinking the same thing today (I may need to load ballance
3 webservers to one DB server).

But - is this model not transaction safe ? - It may save alot of DB use and
hence be alot quicker - but what if the webserver "disappears" halfway
through an IP based load ballanced "sesssion" - a potential source of
failure - something which a load ballancer is supposed to help with..

Also if the loadballance goes south, and a secound takes over does it have
the same IP based session info (probably not - but could be wrong ...) -
hence another potential source of failure.

If your model can accept this then fine - but this would not work in a
{few|many} ecomerce apps as session management is critical.

What do you think ?

Greg Cope
:
:
:  - ask
:
: --
: ask bjoern hansen - <http://www.netcetera.dk/~ask/>
: more than 70M impressions per day, <http://valueclick.com>
:
:




Re: speed up/load balancing of session-based sites

2000-05-08 Thread Greg Cope


: On Mon, 8 May 2000, Leslie Mikesell wrote:
:
: > According to Jeffrey W. Baker:
: >
: > > > I keep meaning to write this up as an Apache:: module, but it's
pretty trivial
: > > > to cons up an application-specific version. The only thing this
doesn't
: > > > provide is a way to deal with large data structures. But generally
if the
: > > > application is big enough to need such data structures you have a
real
: > > > database from which you can reconstruct the data on each request,
just store
: > > > the state information in the cookie.
: > >
: > > Your post does a significant amount of hand waving regarding people's
: > > requirements for their websites.  I try to keep an open mind when
giving
: > > advice and realize that people all have different needs.  That's why I
: > > prefixed my advice with "On my sites..."
: >
: > Can anyone quantify this a bit?
: >
: > > On my sites, I use the session as a general purpose data sink.  I find
: > > that I can significantly improve user experience by keeping things in
the
: > > session related to the user-site interaction.  These session object
: > > contain way more information than could be stuffed into a cookie, even
if
: > > I assumed that all of my users had cookies turned on.  Note also that
: > > sending a large cookie can significantly increase the size of the
: > > request.  That's bad for modem users.
: > >
: > > Your site may be different.  In fact, it had better be! :)
: >
: > Have you timed your session object retrieval and the cleanup code
: > that becomes necessary with server-session data compared to
: > letting the client send back (via cookies or URL) everything you
: > need to reconstruct the necessary state without keeping temporary
: > session variables on the server?  There must be some size where
: > the data values are as easy to pass as the session key, and some
: > size where it becomes slower and more cumbersome.  Has anyone
: > pinned down the size where a server-side lookup starts to win?
:
: I have really extensive benchmarks for every part of Apache::Session.
: These will be released with version 1.5, which also includes more than
: fifty new unit tests.  Again the performance is very dependent on what you
: are doing.  If everything is on one machine and you are grabbing Storable
: obejcts from the filesystem, you can retrieve and unStorable the object in
: time on the order of 100 microseconds (600 MHz Intel/Linux 2.2).  If you
: need to get the object out of a database across the network, network
: latency will add to that.  In larger applications, I would use a private,
: switch 100 Mb/s ethernet to access the shared backing store, so that
: latency is not bad.  Once again, it depends on your specific needs and
: implementation.

Butting in a little OT here but will v1.5 support the transparent use of
additional path if cookies are turned off.

The reason for asking is that other web technologies have this sort of
functionality and this would be a great plus for mod_perl (I know it does
not need it, and this can be easily writen..).

Greg Cope






Re: Re: mod_perl-1.99_01-dev

2000-05-06 Thread Greg Cope

: > > But you will be not able to tune the two types of the threads to have
: > > different Apache parameters (MaxRequests and others) so I'm not sure
you
: > > will get rid of the dual setup, unless these will be taken care of by
: > > mod_perl.
: >
: >well, there is a PerlInterpMaxRequests parameter in 1.99_01-dev, which
: >knocks off the Perl clone after x number of requests.  in addition, the
: >pool of interpreters are pulled and putback from the head of the list, so
: >you are getting re-used allocations (e.g. padlists aka lexicals).  that
: >is, say you configured PerlInterpStart to 10, but average no more than 5
: >concurrent requests.  you have 5 clones with allocated padlists, and 5
: >which are much smaller (but ready for conncurrent requests > 5).  this is
: >unlike 1.3 where you have 10 children, chances are high each of them will
: >endup will allocated padlists, as there's no control over which child
: >handles a request.
: >
: >i'm not saying 2.0 will rid the need for a dual setup, but the Perl side
: >is looking a whole lot smaller (er, less fat) at this point.

If using the threaded model can we not configure say:

10 apache children (fixed)
X number of threads
Y PerlInterpStart

This would (if my understanding is correct) result in a request arriving and
being :

- either be dealt with by a normal apache thread if  not a mod_perl
handler - i.e {html|gif|png|jpeg}
- or a by a light apache thread that calls a perlInterpreter from the pool
to handle the mod_perl handler

Combine with a garbage collector thread this would be excellent as it would
seriously reduce memory consumption (one of mod_perl's present weaknesses)
and result in IMHO the best architecture between all the JSP/Servlets/PHP
combos.

Just thinking aloud - so I could have got this completely wrong!

Greg Cope




Re: mod_perl-1.99_01-dev [ - possibly OT ]

2000-04-23 Thread Greg Cope


- Original Message -
From: "Gerald Richter" <[EMAIL PROTECTED]>
To: "Greg Cope" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 23 April 2000 13:46
Subject: RE: mod_perl-1.99_01-dev [ - possibly OT ]


> >
> > I though the new apache model was a hybrid were there were preforked
> > children that then used threads - have I missed the plot here ?
> >
>
> Yes, you can configure any combination. See Erics mails on the "RE:
mod_perl
> 2.x/perl 5.6.x ?" for a list of possible combinations.

Thanks

Greg

>
> Gerald
>
>
>




Re: mod_perl-1.99_01-dev [ - possibly OT ]

2000-04-22 Thread Greg Cope


- Original Message -
From: "Gerald Richter" <[EMAIL PROTECTED]>
To: "Greg Cope" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 22 April 2000 13:36
Subject: RE: mod_perl-1.99_01-dev


> >
> > Does this  mean that we {will|may} be able to use the interpreter pool
to
> > set up X Perl interpreters (say 20 to service dynamic handlers) with Z
> > apache (say 60 to handle static + dynamic content - assuming the dynamic
> > content is passed to the Perl interpreters) children, and hence have
> > significant memory savings as we can avoid (in some cases) the
> > light / heavy
> > httpd model ?
> >
>
> If you use only threads (instead of processes) to handle request by
Apache,
> the answer is yes :-)

Going a little off topic here ...

I though the new apache model was a hybrid were there were preforked
children that then used threads - have I missed the plot here ?

Or is it either a preforked child model or a threaded model ?

Greg

>
> Gerald
>
>
> -
> Gerald Richterecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
>
> Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
> WWW:http://www.ecos.de  Fax:  +49 6133 925152
> -
>
>




Re: mod_perl-1.99_01-dev

2000-04-22 Thread Greg Cope

- Original Message -
From: "Doug MacEachern" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 21 April 2000 06:51
Subject: mod_perl-1.99_01-dev


> eric and stas already let the cat out of the bag, but i was planning to
> give a summary of what's in progress for mod_perl-2.0 anyhow :)
> i've included a summary of the pieces i'm currently working on, there's a
> great deal left to do, but it's looking good and moving along fast.
> i'll be putting these design notes into cvs soon, along with a
> bigger-picture plan, which should make it easy to see where folks can help
> out if you're interested...

This is excellent news - I was going to ask what the status of
mod_perl.pre-2.X !

> interpreter pool
> 
>
> this logic is only enabled if Perl is built with -Dusethreads
> otherwise, mod_perl will behave just as 1.xx, using a single
> interpreter, which is only useful if you're using the prefork mpm.



This may be a question born of ignorance / inexperience but here goes:

Does this  mean that we {will|may} be able to use the interpreter pool to
set up X Perl interpreters (say 20 to service dynamic handlers) with Z
apache (say 60 to handle static + dynamic content - assuming the dynamic
content is passed to the Perl interpreters) children, and hence have
significant memory savings as we can avoid (in some cases) the light / heavy
httpd model ?

Or have I missed the plot vis-a-vi apache 2.0 and threads ?

>
> i'm also interested in shane's "garbage collector", which could also
> run in it's own thread, examining the padlists of idle interpreters
> and deciding to release and/or report large strings, array/hash sizes,
> etc., that Perl is keeping around as an optimization.

Adding in the garbage collector would also be a  massive bonus if people do
allot of sorting / data manipulation / sort term caching in RAM (Perl).



Again thanks for the good news.

Greg Cope





  1   2   >