You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Kevin Castellow <ke...@gmail.com> on 2010/05/14 17:44:20 UTC

[users@httpd] Mod_dbd using Oracle Instant Client not sending correct Connection String on Solaris ignoring most http.conf values

I am using Apache with mod-dbd and the Oracle Instant client.  I am not
seeing the correct connection string values sent to Oracle from Apache
despite the values in my TNS file and httpd.conf.

My Apache version is below:
Server version: Apache/2.2.15 (Unix)
Server built:   May 12 2010 13:54:22

My Oracle Instant Client is:
Version 11.2.0.1.0 for 32-bit Solaris Sparc.
I have the instant client full version, with sdk, and sqlplus.  I used the
sqlplus to assist in testing.

My OS is:
SunOS testldsdev02b 5.10 Generic_118833-36 sun4v sparc SUNW,Sun-Fire-T1000


Description:
I built the apr and apr-util to activate the apr_dbd_oracle.so.  This build
completed with no errors.
I have the instant client installed in a directory that is inside of my
apache home.
$apache_home/oracle/instantclient_11_2/


My HTTPD.CONF snippet looks like this:

# mod_dbd configuration
DBDriver oracle
DBDParams "user=dcbdev2 pass=dcbdev2
dbname=test.company.netserver=asglssora02-vip"


DBDMin  4
DBDKeep 8
DBDMax  20
DBDExptime 300

<Directory /opt/app/apache2/htdocs/test>

  # core authentication and mod_auth_basic configuration
  # for mod_authn_dbd
  AuthType Basic
  AuthName "My Server"
  AuthBasicProvider dbd

  # core authorization configuration
  Require valid-user

  # mod_authn_dbd SQL query to authenticate a user
  AuthDBDUserPWQuery "Select BASIC_PASSWORD from BASE where USER_ID=%s"
</Directory>


My TNSNAMES file has these values: (I don't believe this file is used for
Apache connectivity but I put it there in case it is.)
TEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = asglssora02-vip)(PORT = 1521))
     #(FAILOVER = YES)
    )
    (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = test.company.net))
  )


>From SNOOP I see this being sent from the Apache server to the oracle
listener.

Connect Data:
(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=)(CID=(PROGRAM=httpd)(HOST=testldsdev02b)(USER=daemon)))(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.235.13)(PORT=1521)))

That is copied and pasted right from the capture file.

The problems are there is not a SERVICE_NAME value, the user name is the
name of the process starting Apache and not the database user.
The only value that is correct is the host ip address but I'm not sure how
it got that value but not the other values.

How do I populate the value of the service name and user properly?


Additionally here is the error log on startup from on log level error
[Fri May 14 10:50:19 2010] [notice] Apache/2.2.15 (Unix) mod_ssl/2.2.15
OpenSSL/
0.9.7d DAV/2 configured -- resuming normal operations
[Fri May 14 10:50:19 2010] [info] Server built: May 12 2010 13:54:22
[Fri May 14 10:50:19 2010] [debug] worker.c(1757): AcceptMutex: pthread
(default: pthread)
[Fri May 14 10:50:19 2010] [error] (20014)Internal error: DBD: Can't connect
to oracle
[Fri May 14 10:50:19 2010] [error] (20014)Internal error: DBD: failed to
initialise
[Fri May 14 10:50:19 2010] [crit] (20014)Internal error: DBD: child init
failed!
[Fri May 14 10:50:19 2010] [error] (20014)Internal error: DBD: Can't connect
to oracle



Regards,
Kevin
http://kevincastellow.workintel.com

Re: [users@httpd] Mod_dbd using Oracle Instant Client not sending correct Connection String on Solaris ignoring most http.conf values

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, May 14, 2010 at 11:44 AM, Kevin Castellow
<ke...@gmail.com> wrote:
> I am using Apache with mod-dbd and the Oracle Instant client.  I am not
> seeing the correct connection string values sent to Oracle from Apache
> despite the values in my TNS file and httpd.conf.
>
> My HTTPD.CONF snippet looks like this:
>
> # mod_dbd configuration
> DBDriver oracle
> DBDParams "user=dcbdev2 pass=dcbdev2 dbname=test.company.net
> server=asglssora02-vip"
...
> The problems are there is not a SERVICE_NAME value, the user name is the
> name of the process starting Apache and not the database user.
> The only value that is correct is the host ip address but I'm not sure how
> it got that value but not the other values.
>
> How do I populate the value of the service name and user properly?

If you want to experiment, try adding "#define CAN_DO_LOGIN" to the
top of apr_dbd_oracle.c in APR-Util and rebuilding.

The user and pass are specified on an earlier DB call when that is
defined.  Also, the dbname will never be provided unless CAN_DO_LOGIN
is defined.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org