Re: keeping client images private

2002-04-11 Thread Todd Goldenbaum

I keep a unique 'filestamp' in the database under each customer-- a 32-digit
randomly-generated number that then can be used either as a part of image
filenames, or as a directory name which contains a customer's images.  

That way, in order for one customer to see another's images, they'd either 
have to watch over the other customer's shoulder and write down the filestamp,
or they'd have to make a really good guess  ;)

todd
On Tue, 11 Sep 2001, will trillich wrote:

 y'all seem to have some clever brains out here, so i'm wondering
 if some of you can offer suggestions--
 
 what's a good clean way to keep images private per customer?
 
 i'm using mod_perl and HTML::Mason with session cookies, but
 coming up with a paradigm for storing and revealing images
 privately has got me a bit flummoxed.
 
   mr. smith has pix which he can see when he logs in to the
   website, and mr. brown has pix of his own, but neither can
   see the other's images. each customer can have two levels of
   imagery (main images/subsidiary images).
 
 i could have a handler intercept image requests and deny access
 if session-user isn't valid ... should i just make an apache
 alias to handle images as if they're from a certain subdir? and
 then use mod_perl to redirect the requests to the actual images
 internally?
 
 or actually store the images in actual subdirs of the
 documentroot?
 
 is there a better/faster/cheaper way?
 
 i'm sure there's more than one way to do this -- and before i
 take the likely-to-be-most-circuituitous route, i thought i'd
 cull advice from the clever minds on this list...
 
 




Re: which perl?

2001-06-24 Thread Todd Goldenbaum

On Sun, 24 Jun 2001, Stas Bekman wrote:

 On Sun, 24 Jun 2001, Brooklyn Linux Solutions CEO wrote:
 
It's got to be built in.  My mod_perl conf keeps looking in 5.6.0 in the @INC
array even after the 5.6.1 upgrade
  
  I got sick of the problem and linked 5.6.1 into 5.6.0
 
 You could achieve the same with:
 
 startup.pl:
 ---
 use lib qw(/usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1);
 
 note that lib.pm takes care of adding the arch lib paths (i686-linux on my
 machine) and removing dups.
 
interesting.  I created a symlink to my 5.6.1 binary, and I am pointing to
the 5.6.1 libraries within my PerlRequire script (in my case it's mason's
handler.pl)... and yet, modperl is still using 5.6.0!  

I am really at a loss... I'm really hoping i won't have to rebuild mod_perl
as this particular server is using a pre-built SSL version we don't want to
break ;)   but would that even help?  Is sounds like it shouldn't be necessary.

thanks
todd
 




Re: which perl?

2001-06-24 Thread Todd Goldenbaum

On Mon, 25 Jun 2001, Stas Bekman wrote:

 On Sun, 24 Jun 2001, Todd Goldenbaum wrote:
 
  On Sun, 24 Jun 2001, Stas Bekman wrote:
 
   On Sun, 24 Jun 2001, Brooklyn Linux Solutions CEO wrote:
  
  It's got to be built in.  My mod_perl conf keeps looking in 5.6.0 in the 
@INC
  array even after the 5.6.1 upgrade

I got sick of the problem and linked 5.6.1 into 5.6.0
  
   You could achieve the same with:
  
   startup.pl:
   ---
   use lib qw(/usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1);
  
   note that lib.pm takes care of adding the arch lib paths (i686-linux on my
   machine) and removing dups.
 
  interesting.  I created a symlink to my 5.6.1 binary, and I am pointing to
  the 5.6.1 libraries within my PerlRequire script (in my case it's mason's
  handler.pl)... and yet, modperl is still using 5.6.0!
 
 also notice that this will work only if your libs are binary compatible.
 
 did you make 4 symlinks? I've numbered these below as 1-4
 
 mine is:
 
 $ perl -V
 
 Characteristics of this binary (from libperl):
   Compile-time options: DEBUGGING USE_LARGE_FILES
   Built under linux
   Compiled at Apr 20 2001 22:58:59
   @INC:
 1/usr/lib/perl5/5.6.1/i686-linux
 2/usr/lib/perl5/5.6.1
 3/usr/lib/perl5/site_perl/5.6.1/i686-linux
 4/usr/lib/perl5/site_perl/5.6.1
 /usr/lib/perl5/site_perl/5.6.0
 /usr/lib/perl5/site_perl/5.005
 /usr/lib/perl5/site_perl

actually yes, they appear to be in the right order:

$ perl -V

Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at May 23 2001 08:18:14
  @INC:
/usr/local/lib/perl5/5.6.1/i686-linux
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl

and yet, mod perl is still showing that it's using 5.6.0...




Re: which perl?

2001-06-24 Thread Todd Goldenbaum

Thanks Andrew- good stuff.  You've convinced me, I'm just going to bite the
bullet and rebuild :)

todd


On Sun, 24 Jun 2001, Andrew Ho wrote:

 Todd,
 
 Perl and mod_perl are separate entities altogether. Perl is the scripting
 language. mod_perl is an extension to Apache, which builds a Perl
 interpreter into the Apache webserver.
 
 The binary components are mostly separate, e.g. you could theoretically
 run Perl and mod_perl at different versions; the actual perl binary and
 the mod_perl extensions are separate.
 
 However, the Perl interpreter built into the Apache webserver, plus all
 the associated Perl modules that implement mod_perl's functionality,
 inherit all the characteristics of the Perl it was built against--bugs in
 the interpreter, language characteristics, or where to find libraries.
 
 In your case it sounds like your mod_perl is built for a different version
 of Perl. As several others have suggested, the best way is to rebuild
 mod_perl so it is built against your version of Perl.
 
 Another easier to do it would be to use your vendor's package system,
 for example if you are using RedHat or Debian, you may be able to find
 Perl and mod_perl packages (RPMs or whatnot) and install them to fix the
 versioning issues.
 
 I still recommend building it; for the base case, it's pretty easy to do.
 Follow the all-in-one directions in the mod_perl download and it usually
 Just Works.
 
 The symlinking and changing the @INC path may work, but this is a hacky,
 symptomatic solution at best.
 
 Humbly,
 
 Andrew
 
 --
 Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
 Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
 Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
 --
 
 




which perl?

2001-06-23 Thread Todd Goldenbaum

Hi,

I am running Apache/1.3.14 (Unix) mod_perl/1.25 on a redhat 7 system.  Since
the perl binary that came with the redhat distribution was version 5.6.0, I 
assumed that is the version that got built into mod perl (statically linked).  
But I just discovered using perl's $] variable, that it's actually using 5.006! 

So far as I can tell, I don't even have a copy of perl 5.006 on my system...
Is mod_perl actulaly distributed with a version of perl interpreter intact?
If so, How do I upgrade it?

thanks,
Todd Goldenbaum
[EMAIL PROTECTED]




Re: which perl?

2001-06-23 Thread Todd Goldenbaum

On Sat, 23 Jun 2001, Steven Lembark wrote:
 
  I am running Apache/1.3.14 (Unix) mod_perl/1.25 on a redhat 7 system.
  Since the perl binary that came with the redhat distribution was version
  5.6.0, I  assumed that is the version that got built into mod perl
  (statically linked).   But I just discovered using perl's $] variable,
  that it's actually using 5.006!
 
  So far as I can tell, I don't even have a copy of perl 5.006 on my
  system... Is mod_perl actulaly distributed with a version of perl
  interpreter intact? If so, How do I upgrade it?
 
 For the amount of time it takes, I'd suggest just building a local
 copy of mod_perl.  If you use a .makepl_args.mod_perl file it can
 be done with a single perl Makefile.PL; make test install.

Hm, I'm still unclear about whether mod_perl actually gets distributed
with its own version of the perl interpreter, etc.   Plus I've never used
.makrpl_args.mod_perl, no idea where to start with that one... isn't there
another way?





Re: which perl?

2001-06-23 Thread Todd Goldenbaum

On Sat, 23 Jun 2001, Chris Reinhardt wrote:

 On Sat, 23 Jun 2001, Todd Goldenbaum wrote:
 
  Hi,
 
  I am running Apache/1.3.14 (Unix) mod_perl/1.25 on a redhat 7 system.
  Since the perl binary that came with the redhat distribution was
  version 5.6.0, I assumed that is the version that got built into mod
  perl (statically linked).  But I just discovered using perl's $]
  variable, that it's actually using 5.006!
 
  So far as I can tell, I don't even have a copy of perl 5.006 on my system...
  Is mod_perl actulaly distributed with a version of perl interpreter intact?
  If so, How do I upgrade it?
 
 
 Ummm 5.006 _is_ 5.6.0, just in the old perl numbering scheme.

how strange.
 
 ctriv@quartz:~$ perl -v
 
 This is perl, v5.6.1 built for sun4-solaris
 
 ctriv@quartz:~$ perl -e 'print $]\n'
 5.006001
 
 You should look at something like this (or it's sprintf equivalent).
 ctriv@quartz:~$ perl -e 'printf(%vd\n, $^V)'
 5.6.1

gotcha.  so it's 5.6.0...  however i'm still really curious about whether
mod_perl 'builds in' the interpreter when you build apache, or is it when
you run apache?

what i'm actually trying to do is get mod_perl to use a different version
of perl also installed on my system, 5.6.1, so as to settle some problems
within mason causing the httpd child processes to segfault.