Tuesday, July 14, 2015

Apache with Oracle Build - partial

PREFIX=/root/apache/build
##cd /usr/src
#wget http://sourceforge.net/projects/pcre/files/pcre/8.37/pcre-8.37.tar.gz
#tar xvf pcre-8.37.tar.gz
#cd pcre-8.37
#/usr/local/pcre
#./configure --disable-cpp --prefix=/root/apache/pcre
#make
#make install
#wget http://www.apache.org/dist/httpd/httpd-2.4.12.tar.gz
#tar xvf httpd-2.4.12.tar.gz
#cd /usr/src
#wget http://www.apache.org/dist/apr/apr-1.5.2.tar.gz
#wget http://www.apache.org/dist/apr/apr-util-1.5.4.tar.gz
#tar xvf apr-1.5.2.tar.gz
#tar xvf apr-util-1.5.4.tar.gz
#cd apr-1.5.2
#./configure --prefix=$PREFIX
#make
#make install
#cd ..
#cd apr-util-1.5.4
#./configure --with-apr=/usr/src/apr-1.5.2 --with-oracle=/opt/oracle/instantclient_11_2 --with-oracle-include=/opt/oracle/instantclient_11_2/sdk/include --prefix=$PREFIX
#make
#make install
#mv apr-1.5.2 httpd-2.4.12/srclib/apr
#mv apr-util-1.5.4 httpd-2.4.12/srclib/apr-util

cd httpd-2.4.12
##./configure --enable-so --enable-ssl --with-mpm=prefork --with-included-apr=  --with-included-apr-util
#./configure --enable-so --with-apr=/usr/src/apr-1.5.2 --with-pcre=/root/apache/pcre --prefix=$PREFIX
make
#make install




# Basic Auth Working
<Directory /var/www/html/agency1>
        AuthType Basic
        AuthName "http.conf agency1"
        # (Following line optional)
        AuthBasicProvider file
        AuthUserFile /etc/httpd/conf/security/passwords
        AuthGroupFile /etc/httpd/conf/security/groups
        # Require user fox
        Require group agency1
</Directory>
# Digest Auth now working key is AuthName must match realm
<Location /agency2>
        #AllowOverride AuthConfig
        AuthType Digest
        AuthName "agency2"
        AuthDigestDomain /agency2/
        #AuthDigestProvider file
        AuthUserFile /etc/httpd/conf/security/digest
        Require user user2
</Location>




<IfModule mod_dbd.c>
# mod_dbd configuration
DBDriver oracle

DBDParams "user=user pass=password dbname=XE server=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=XE)))"
DBDPersist off
 # You should test with Persist off then change to on if it works.
DBDMin  4
DBDKeep 8
DBDMax  20
DBDExptime 300
</IfModule>
<Directory /var/www/html/private>
  # 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 password FROM authn WHERE userid = %s"
</Directory>