I have problem with connect ApacheHttpServer with Oracle. All work on OpenSuse 12.3
At first I install Oracle instal client 11.2. Set environment variables:
ORACLE_HOME=/usr/local/instantclient_11_2/
LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
PATH=$ORACLE_HOME:$PATH
TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_HOME LD_LIBRARY_PATH PATH TNS_ADMIN
After that I compile apache http :
#apr
./configure --prefix=/usr/local/apache2/apr
make
make install
#apr-util
./configure --prefix=/usr/local/apache2/apr-util --with-apr=/usr/local/apache2/apr/
make
make install
#httpd
CPPFLAGS=-IORACLE_HOME/include LDFLAGS=-LORACLE_HOME ./configure --prefix=/usr/local/apache2/httpd --with-apr=/usr/local/apache2/apr/ --with-apr-util=/usr/local/apache2/apr-util/
make
make install
Unfortunately, the installation was not successful because mod_dbd_oracle.so didn't created. I think I was connected with that:
#./configure output:
checking oci.h usability... yes
checking oci.h presence... yes
checking for oci.h... yes
checking for OCIEnvCreate in -lclntsh... no
setting LIBS to "-lnnz11"
checking for OCIEnvCreate in -lclntsh... no
nulling LIBS
setting LIBS to "-lnnz10"
I could not find a way how to solve. So I decided to use Oracle with ODBC driver. I install unixODBC 2.2.12-219.1.1.
After that I modife to odbc.ini and odbcinst.ini:
#odbc.ini
[xe]
DRIVER = oraclevb
DSN = xe
ServerName = //192.168.56.101:1521/xe
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10`enter code here`
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MaxLargeData = 0
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T
StatementCache=F
CacheBufferSize=20
UseOCIDescribeAny=F
#odbcinst.ini:
[oraclevb]
Description = Oracle ODBC
Driver = /usr/local/instantclient_11_2/libsqora.so.11.1
Setup =
FileUsage =
CPTimeout =
CPReuse =
I chcek how it work with command:
isql -v xe user passowrd
All was OK. So I again compile Apache Http Source. Modify httpd.conf to use ODBC:
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_dbd_module modules/mod_authz_dbd.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule dbd_module modules/mod_dbd.so
DBDriver odbc
DBDParams "datasource=xe"
<Directory "/sample">
AuthType Basic
AuthName "private area"
AuthBasicProvider dbd
AuthDBDUserPWQuery "SELECT password FROM USERS WHERE name = %s"
AuthzDBDQuery "SELECT group FROM GROUPS user_name = %s"
Require dbd-group grup1 grup2
</Directory>
Start Apache HTTTP Server and I found in error logs:
[Sun Jul 14 15:19:07 2013] [dbd_odbc] SQLConnect returned SQL_ERROR (-1) at dbd/apr_dbd_odbc.c:1130 [unixODBC][Driver Manager]Can't open lib '/usr/local/instantclient_11_2/libsqora.so.11.1' : file not found 01000
[Sun Jul 14 15:19:07.332394 2013] [dbd:error] [pid 13374:tid 140250220050240] (20014)Internal error: AH00629: Can't connect to odbc: [dbd_odbc] SQLConnect returned SQL_ERROR (-1) at dbd/apr_dbd_odbc.c:1130 [unixODBC][Driver Manager]Can't open lib '/usr/local/instantclient_11_2/libsqora.so.11.1' : file not found 01000
I don't know what I can do with that. Any suggestions would be very helpful. Maybe there is another way that conduct authorization and authentication using the Oracle database. Or other Apache module?
make
didn't create an.so
file, didn't it stop at that point and print an error message about why it couldn't do that work? If so, please update your question to include the text of the error message. If what you quote above ..checking for OCIEnvCreate in -lclntsh... no
... is the last message in the build, please indicate that. Good luck – shellter Jul 14 at 17:11checking for OCIEnvCreate in -lclntsh... no
, but continued on and did other work, then that is not the source of your problem.make
files can be smart and try to use libraries from different directories What you see in the 'trace' is the make file looking for where OCIEnvCreate is installed. It goes with its best guess. If the.so
wasn't found in a later part of a compile process, then themake
would stop then. Your apache log error is a hint to me that not everything about youroracle
installation is as it should be. – shellter Jul 14 at 20:42/opt/ora
and the issue the cmdfind . -name 'libsqora*'
. If you get a result from this search, add that to your question above. Unless you're working on a small development machine, don't dofind / -name...
, as it will run for hours, searching all files available , even remote files that are mounted to your server. (Or do that as a last resort, just before you go to bed ;-) ). Good luck. – shellter Jul 14 at 20:44