Followup-To: comp.databases.oracle.server
Sender: tcross@tiger.rapttech.com.au
Newsgroups: alt.apache.configuration,comp.os.linux.networking,comp.databases.oracle.server
Subject: Re: Running dynamically linked CGIs?
References: <c9bc36ff.0307022246.430292fd@posting.google.com> <c9bc36ff.0307030227.cdd0c3a@posting.google.com>
From: Tim X <timx@spamto.devnul.com>
Reply-To: timx@spamto.devnul.com
Date: 07 Jul 2003 18:30:21 +1000
Message-ID: <87wueubuxu.fsf@tiger.rapttech.com.au>
Lines: 61
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
NNTP-Posting-Host: ppp597.nsw.padsl.internode.on.net
X-Trace: duster.adelaide.on.net 1057565787 ppp597.nsw.padsl.internode.on.net (7 Jul 2003 17:46:27 +0950)
Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!enews.sgi.com!news.xtra.co.nz!news.mel.connect.com.au!news.ade.connect.com.au!duster.adelaide.on.net!not-for-mail
Xref: newssvr20.news.prodigy.com comp.os.linux.networking:358885 comp.databases.oracle.server:237041

>>>>> "Ramon" == Ramon F Herrera <ramon@conexus.net> writes:

 Ramon> I am going to answer part of my own posting.
 Ramon> ramon@conexus.net (Ramon F Herrera) wrote in message
 Ramon> news:<c9bc36ff.0307022246.430292fd@posting.google.com>...
 Ramon> [...]
 >> It seems that the Apache server doesn't have access to the Oracle
 >> libraries.  I tried linking the application statically, but that
 >> doesn't seem to be an option (?)  with OCI.  Next, I looked at the
 >> httpd config file and copied the library in question
 >> (libclntsh.so.9.0) to the directory /etc/httpd/modules/.  (Am I in
 >> the right direction?)  The problem now is that I am not sure about
 >> what the entry should look like.  There is an example:
 >> 
 >> # Example: # LoadModule foo_module modules/mod_foo.so
 >> 
 >> So I figure that the entry should be something like this:
 >> 
 >> 
 >> LoadModule what_the_heck_goes_here modules/libclntsh.so.9.0
 >> 

 Ramon> The LoadModule has _nothing_ to do with this, dummy :-)

 Ramon> Those modules are linked to the Apache server itself, and not
 Ramon> to the cgi-bin or other apps that may be exec'd by Apache.

 Ramon> The error message above was fixed simply by adding

 Ramon> $ORACLE_HOME/lib

 Ramon> To the /etc/ld.so.conf file and redoing the .so cache.

 Ramon> Having said that, I am not out of the woods yet.  The new
 Ramon> error message says:

 Ramon> nclaims: FAILED: OCIInitialize() nclaims: FAILED:
 Ramon> init_handles() nclaims: There was an error on 'OCILogon' [Thu
 Ramon> Jul 3 03:39:02 2003] [error] [client x.x.x.x] Premature end of
 Ramon> script headers: /home/ramon/public_html/cgi-bin/claimsof.cgi

 Ramon> (the same programs runs flawlessly from the Unix shell).

 Ramon> Now it looks like the OCI .so library is being found at link
 Ramon> time, but not at execute time??

When running your OCI cgi program from the unix shell are you using
the same user that apache is running as? e.g. nobody?

It could be that when you are testing it, you have a properly defined
oracle environment (ORACLE_HOME, ORACLE_SID etc), but not when the cgi
script is running under the user who runs apache or the user who is
running apache does not have access to directories needed etc.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!
