While the behaviour seems correct from the browser, I am getting errors in
the error_log that may be indicative of some kind of problem:
Here is the relevant snippet of my httpd.conf:

<PRE>
# Added for Oracle to work.  Dan H. 5-oct-2000
#####################################################

SetEnv ORACLE_HOME /home/oracle/product/8.1.6
SetEnv LD_LIBRARY_PATH /home/oracle/product/8.1.6/lib

# End Oracle
#####################################################
# Added for mod_perl.  Dan H. 5-oct-2000

PerlRequire    /home/apache/conf/startup.pl
PerlTaintCheck On
PerlWarn       On

Alias /survey/ /home/apache/survey/

<Location /survey>
   SetHandler perl-script
   PerlSendHeader On
   PerlHandler Apache::Registry
   Options ExecCGI
   #
   # Added 16-Oct-2000
   #
   AuthName SURVEY
   AuthType Basic
   PerlAuthenHandler AuthSurvey
   require valid-user
</Location>

# End Perl
#####################################################
</PRE>

Here is AuthSurvey.pm:

<PRE>
package AuthSurvey;
# authenticate users into the survey directory on the web server

use strict;
use Apache::Constants ':common';
use DBI;

sub handler {

  my $r = shift;
  my($res, $sent_pwd) = $r->get_basic_auth_pw();
  return $res if $res != OK;
  
  my $user = $r->connection->user;
  my $dbh = DBI->connect("DBI:Oracle:targ2","surveydev","surveydev");
  
  my $lt = "select 'password_ok'
              from oas_users
             where primary_db_user = 'SURVEYDEV'
               and oas_user = '".$user."'
               and oas_password = '".$sent_pwd."'";
  my $login_check = $dbh->selectrow_array($lt);
  
  if ($login_check && $login_check eq 'password_ok') {
    return OK;
  } else {
    return AUTH_REQUIRED;
  }
}

1;
</PRE>

Now, when I browse to the survey directory and enter my username and
password this line appears in the errors_log:

[datestamp] null: ORACLE_HOME environment variable not set!

I've never had this error before, and most of my scripts do access oracle,
always working fine.
Only in this case has it ever appeared.

Any help would be appreciated, or a pointer to some thorough documentation.
thanks!
Dan


Reply via email to