Re: System crash related to mod_perl

2002-02-23 Thread masta



On Sat, 23 Feb 2002, Jim Hull wrote:

> - -- Begin --
> 
> print $q->header(
> -type=> 'image/gif',
> -expires=> 'now'
> );
> 
> print $im->jpeg(100);
> 
> - -- End 
you send a jpeg, with a gif-header 

send image/jpeg instead of image/gif

ciao




Re: [OT] Moving WYPUG

2002-02-15 Thread masta



On Fri, 15 Feb 2002, Jonathan M. Hollin wrote:

> Hi gang,
> 
> After a few months of outrageous instability, I am now moving WYPUG on
> to a Linux server (redhat 7.2).  Using ApacheToolbox
Good idea ;))
(no i don't like redhat, but i like linux)

> I now need to install some Perl modules (DBD-MySql, Image-Magick, etc).
> Under ActivePerl on WYPUG's current Win2K box, I would simply use the
> Perl Package Manager (PPM) to download and install these modules.  Is
> there an equivalent under Unix?  If not, what's the best way to install
> modules?  In short, what do I need to know?
just type
perl -MCPAN -eshell
this will ask you some simple questions, about the nearest mirror to you,
and so on, if you are on the command-prompt, type install Your::Module and
it will fetch the module from cpan, and install it...

Nico




Re: Custom Logging and User Tracking

2002-02-14 Thread masta



On Wed, 13 Feb 2002, Ryan Parr wrote:

> I checked it out and it's a good mod. I've already got the ability to log
> the data however. The issue that I'm having is that I can't seem to only get
> 1 log per hit. I can't seem to get around the fact that wherever I put my
> mod (PerlFixupHandler,PerlHandler,PerlLogHandler) or whatever statement I
> use ($r->is_main(), $r->is_initial_req()) I'm getting not only the requested
> page but every other request from the inital request. For instance, I'm
> getting and logging every graphic, css, javascript, or any other file that's
> linked in. But for my user tracking I want *just* the initial request, not
> that and all subrequests. I just can't seem to figure out how to do that.
> $r->is_main() and $r->is_initial_req() return true for everything.

Maybe i'm wrong, but is_initial_req, is just there, to keep track of
INTERNAL redirects, like, if you internaly redirect a file to another one,
and you don't want to process the redirected one (because you don't care
anymore).

I think the best one for you problem should be something like this...

1.) use a shared hash (IPC::SharedCache or something like this)
2.) compute a MD5-Hash, with some data from the user, like IP and
Browser-string
3.) put the MD5, or whatever in the hash, and set a timeoutvalue for this
one
4.) on every request, lookup for the key, and check/update the
timeout-value, and log the request, if it doesn't exists inside of the
hash, or the timeout occured
5.) run a cleanup every 50/100 request, and clear the cache from timeouted
values (for shared memory, this could also be done by a script running
from crontab)


i hope you get what i mean, and i hope it helps ;)))


ciao nico