Re: ORACLE_HOME environment variable not set!

2002-11-05 Thread Gabriel C Millerd
On 31-Oct-02, Smejkal Petr wrote:

 
 I don't have any idea where the error message comes from. Do you know how to fix it?
 
if you $ENV{ORACLE_HOME}='/your/path/here'; in startup.pl everything will
be ok. there doesnt seem to be any problem resulting from the error. i put up
with it for a year or so in my error.logs.
if you set it in your /etc/init.d/apache it seems to do the same thing
until apachectl reload during log maintence. i believe.

-- 
Gabriel C. Millerd |
 Script Monkey |What soon grows old? Gratitude. --Aristotle
   |



AuthCookieDBI Question

2002-10-16 Thread Gabriel C Millerd


 Is there any thinking about there being a security problem or the
potential for one with Apache::AuthCookieDBI's Cookie name of
Apache::AuthCookieDBI_[NAMEHERE] I from time to time look at the cookies
my browsers collect and i have never seen anything simular.

-- 
Gabriel C. Millerd | I think a relationship is like a shark. It has to
 Script Monkey | constantly move forward or it dies. Well, what we
   |  have on our hands here is a dead shark. --Woody
   |   Allen




urls with session info

2002-10-02 Thread Gabriel C Millerd

   i have been trying to write a handler that will provide me with session
data using the URL (eg, http://www.domain.com/$sessionid . $r-url) like
the eagle books has on p246.
   in addition i am serving a cookie with that same $sessionid and then
comparing to two $sessionid's in order to prevent the leaking referrer
information and other problems.
   i am using apache::session::flex for my session information.
   i am running into a lot of operational problems and i think i am
looking at restarting this little project of mine.
   i want to do this for caching of expensive personalized webpages for
people would be great if i could.

   is there a a:session package already out there that does this? there
sure are a lot of them.  seems that there are none that manipulate the url
however in the perltranshandler however.

   thanks





Re: which handler?

2002-06-14 Thread Gabriel C Millerd

On Fri, 14 Jun 2002, Geoffrey Young wrote:

 that's odd.  the above code essentially acts as though the user entered
 /not_ok_page.html in their browser all by themselves.  maybe I
 incorrectly assumed that's what you were looking for?

   well the problem with a onsite url is that the handler would have to
process that as well (unless i checked $r-uri for that specific uri. of
failure or DECLINED aspect works 100% perfect. its the non-DECLINE that
doesnt work


 Apache only gives handlers one shot at translating the URI to a

  does this mean 'apache only gives one and only one shot shot a
translating a url' or 'apache gives each handler one shot at translating a
url'? i assumed that after 'PerlTransHandler ModuleName' is done
mod_rewrite can still take a stab at the url.


 filename.  So, you can either trick apache by changing the URI and
 returning DECLINED, which lets Apache handle the translation for you,
 or map the filename yourself (as you do below) and return OK.


if I use this peice of code (solely as a way of trying to find the
problem) ...

sub handler {
  my $r=shift;
  $r-filename($r-document_root . $r-uri);
  return OK;
}

... i will get this for all requests

[date/time] [error] [client ip] File does not exist: /

 it's early here, and I haven't had my coffee yet, but what you're
 written should be essentially the same as the short snipped I provided
 (save the possibility of redirecting to an offsite URL).

  your part (the DECLINED) works perfecto ... thanks again

sub handler
{
my $r=shift;

if(sysdiag($r)) {
##
## somethng wrong here
##
$r-filename($r-document_root . $r-uri);
return OK;
}  else {
##
## this works perfect
##
$r-warn(Apache::Kosher($state));
my $url=$r-dir_config('KosherRedirect');
$r-content_type('text/html');
$r-header_out(Location=$url);
return REDIRECT;
}
}

---
Gabriel C. Millerd |Real Men don't make backups. They upload it via ftp
 Super Plumber |  and let the world mirror it. -- Linus Torvalds
   |




which handler?

2002-06-13 Thread Gabriel C Millerd


i want to make a apacher perlhandler method for location / (i think)
that will check and see if my system state is ok (like database, jabber,
and imap connectivity), and if not will redirect to another page.

if everything is kosher i would like everything to move on like normal ...
which handler method do i use for this.

thanks

---
Gabriel C. Millerd |   Have you noticed the way people's intelligence
 Script Monkey | capabilities decline sharply the minute they start
   |waving guns around? -Dr. Who




Re: which handler?

2002-06-13 Thread Gabriel C Millerd

On Thu, 13 Jun 2002, Geoffrey Young wrote:


 sounds like a job for a PerlTransHandler...

  thanks

 keep in mind that the PerlTransHandler cannot be applied to any
 Location (or any other container like Directory) so it will
 automatically apply to an entire (virtual) server.

  that would have been my problem all today i think

  thanks again

---
Gabriel C. Millerd | When sorrows come, they come not single spies, But
Sith Admin |in battalions. --William Shakespeare, Hamlet
   |




Re: which handler?

2002-06-13 Thread Gabriel C Millerd

On Thu, 13 Jun 2002, Geoffrey Young wrote:


 sounds like a job for a PerlTransHandler...

if ($not_ok) {
  $r-uri('/not_ok_page.html');
  return DECLINED;
}


this works great until i run into an Alias or a mod_rewite rule it seems.
what is the proper way to indicate success here? ora's writing apache
modules has this method and the method omitting '$r-filename()' line -
which i have not been able to get to work.

one step away from this .. perhaps a set of logic to act differently is
needed for different requests.

sub handler {
my $r=shift;
if(Apache::MonDiag($r) {
$r-filename($r-document_root . $r-uri);
return OK;
} else {
$r-warn(Apache::MonDiag($state));
my $url=$r-dir_config('MonDiagRedirect');
$r-content_type('text/html');
$r-header_out(Location=$url);
return REDIRECT;
}
}

---
Gabriel C. Millerd





DBD::RAM Woes

2002-06-10 Thread Gabriel C Millerd

i am writing a little function (see hack below) that will allow me to
sort data for my CGI's easily (especially for multiple columns) ... ala
another function that works the CGI.pm aspect of things.

problem is that this function seems to (under mod_perl) duplicate the
rows that i pass to it (although it sorts all of them wonderfully). if i
castrate the function in order to see if the problem is elsewhere to
'sub sortcol {return shift}' it works just fine (although it doesnt sort
anything)

thanks for any help you guys can provide.



package Hacks;
use strict;
use DBI;

sub sortcol {
 my body=@{$_[0]};
 my ords=@{$_[1]};
 my $cols = body;
 my $table=tmptable;
 my alpha=('a' .. 'zz');
 my col_names;
 my $dbh = DBI-connect('dbi:RAM:',,,{RaiseError = 0});

 for my $i (0 .. $cols-1) {
 push(col_names, $alpha[$i]);
 }

 $dbh-func({table_name  = $table,
 col_names   = join(',',col_names),
 data_type   = 'ARRAY',
 data_source = \@body,
 }, 'import' );

 my $orderby;
 {
 my tmp;
 for my $ord (ords) {
 my $ao=abs($ord);
 push(tmp,
  join(' ',
   $alpha[$ao],
   $ao==$ord ? ASC : DESC));
 }
 $orderby=join(', ', tmp);
 }

 # DBD::RAM 'export array' method broken?
 my $sth = $dbh-prepare(SELECT * FROM $table ORDER BY $orderby);
 $sth-execute();
 my body;
 while( my (cells) = $sth-fetchrow_array) {
 push(body, \@cells);
 }
 $sth-finish();
 $dbh-disconnect();
 return(\@body);
}
1;


---
Gabriel C. Millerd |Oh loneliness and cheeseburgers are a deadly
 Super Plumber |combination. -Comic Book Guy
   |




Apache::TalkBack

2002-06-05 Thread Gabriel C Millerd


got any ideas on what this would do if i wrote it? basically the goal is
to do the same thing netscape's talk back does. (whatever that is)

so i would store a data::dump of the $ENV, apache request ($r) and the cgi
param ($r), a Carp like $ of the bomb ... as well as the cgi name,
and timestamp.

then the user in charge of that cgi could look up those issues?

---
Gabriel C. Millerd |   All for one, one for all, that is out device.
 Script Monkey | -Alexander Dumas the Elder, The Three Musketeers
   |




RE: Invoke PHP scripts?

2002-05-30 Thread Gabriel C Millerd

On Wed, 29 May 2002, Jim Helm wrote:

 How about using php in cgi mode and using `php scriptname` from within
 perl to capture the output?  Not the best performance-wise, but it would
 do what you want, I think.


will the cgi environment be preserved?

---
Gabriel Millerd |   When I grow up I want a job where I run around in
Plumber |circles chasing my tail like an idiot ten hours a day.
|-- Monster.com




Re: Basic usage of Apache::Session::Oracle

2002-04-29 Thread Gabriel C Millerd

On Mon, 29 Apr 2002, F. Xavier Noria wrote:

 3. Could one set up things in a way that allows the database to see
the timestamps and program a trigger to delete old sessions? Or
is there a standard idiom for doing this in a different way?

thats what i usually do ... just add a column to the table named
'ts' with the default value of 'sysdate' then cull the values with a
trigger (not the program!)
if your cracking open someone else's code for something why not
add a few other tid bits like the CGI::remote_user(), CGI::self_url() to
it (as separate nullable columns) as well if($debug) so that you can
easily track down any problems that might be occuring when you interface
with your own CGI's.

---
Gabriel Millerd |   Life can be so tragic -- you're
Script Monkey   |here today and here tomorrow.