httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Ballé <sba...@sbcmaroc.com>
Subject [users@httpd] Re: Regarding Apache HTTP Authentication with an Oracle Database
Date Fri, 07 Nov 2008 11:57:42 GMT
Hi, here is a procedure to get apache 2.2 + *apr_dbd_oracle.so on linux 
(base debian 4 etch apache by apt-get standard)
*

*Install Oracle instant client :
*

get files from 
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html 

get  basic.zip and sdk.zip
unzip them in /opt/oracle wich you create if not existent.
make sure you got a symlink /opt/oracle/instantclient to the current 
version (/opt/oracle/instantclient_11_1 now).

Note that the main problem to get the *apr_dbd_oracle.so is that the 
library libclntsh.so has move from lib directory in oracle client to 
oracle client main directory.
adding a symlink solves the compile issue :
*

ln -s /opt/oracle/instantclient /opt/oracle/instantclient/lib

then go on :

cd /tmp
wget http://mirrors.kahuki.com/apache/apr/apr-1.3.3.tar.bz2
cd /usr/src
tar -jxvf /tmp/apr-1.3.3.tar.bz2
cd apr-1.3.3
./configure --prefix=/usr
make
make install

cd /tmp
wget http://mirrors.kahuki.com/apache/apr/apr-util-1.3.4.tar.bz2
cd /usr/src
tar -jxvf /tmp/apr-util-1.3.4.tar.bz2
cd apr-util-1.3.4
./configure --with-apr=/usr/src/apr-1.3.3 
--with-oracle=/opt/oracle/instantclient 
--with-oracle-include=/opt/oracle/instantclient/sdk/include --prefix=/usr
make
make install

create tables in oracle :

create table apache_authn
(
        user_id varchar2(50)
        ,password varchar2(50)
        ,primary key (user_id)
)

then change you virtualhost config :
    DBDriver oracle
    DBDParams "user=test pass=test dbname=XE server=127.0.0.1:1521"
    DBDPersist off
# You should test with Persist off then change to on if it works.

and configure a directory :
    <Directory /var/www/test>
        AllowOverride None
        AuthType Basic
        AuthName "Acces utilisateur requis"
        AuthBasicProvider dbd
        Require valid-user
        AuthDBDUserPWQuery "SELECT password FROM apache_authn WHERE 
user_id = %s "
    </Directory>

restart apache.

password format is the same that those in the usual password file. just 
take what is after the ":".
source files mention that sha1 and md5 password should work.

Samuel Ballé

-------

    Hi Rajaopal M.,

    In order to use the mod_dbd.so, and mod_authn_dbd.so modules with
    mysql I had to build the mysql dbd driver provided in the arp-util
    (within Apache httpd-2.2.9).

    To accomplish this I used the configure flag noted in apr-util:

    ./httpd-2.2.9/srclib/apr-util> configure --help | grep -i mysql
    --with-mysql=DIR enable MySQL DBD driver

    I passed this --with-mysql flag to the top level configure when
    configuring httpd-2.2.9. Even though it doesn't undestand this flag,
    it passes it on to lower level configurations, such as when
    configuring apr-util.

    I have no experience with Oracle, but here are the Oracle configure
    flags I found in the configure help in apr-util:

    ./httpd-2.2.9/srclib/apr-util> configure --help | grep -i ora
    --with-oracle-include=DIR path to Oracle include files
    --with-oracle=DIR enable Oracle DBD driver; giving ORACLE_HOME as DIR

    Hope this helps, -Steve

        Rajagopal M. wrote:

        Hi Steve,

        I am RajaGopal Maddi. I have seen from one of the blogs in
        objectmix.com that you have used MySQL database for HTTP
        Authentication in Apache?

        Is it resolved for you? Steve, what should I do for doing the
        same with Oracle Database? Where do we get the
        *apr_dbd_oracle.so* from?

        Please throw some light on interaction with the Oracle Database.

        Thanks

        RajaGopal Maddi


Mime
View raw message