LinuxLOAP
From SaWiki
Install Apache with PHP & Oracle & LDAP Support on Linux
Menu: SolarisLOAP
Contents |
Environment: OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 4) Apache: Version 2.2.4, httpd-2.2.4.tar.gz PHP: Version 5.2.3, php-5.2.3.tar Oracle: oracle-instantclient-basic-10.2.0.3-1.i386.rpm oracle-instantclient-devel-10.2.0.3-1.i386.rpm LDAP: openldap-stable-20070831.tgz
Install Oracle Instant Client
Download the Basic client and the SDK from Oracle http://www.oracle.com/technology/tech/oci/instantclient/index.html
# rpm -ivh oracle-instantclient-basic-10.2.0.3-1.i386.rpm \ oracle-instantclient-devel-10.2.0.3-1.i386.rpm
Create /var/opt/oracle/tnsname.ora file
Example: tnsname.ora
Install LDAP Client and Libraries
compile OpenLDAP from http://openldap.org # ./configure --prefix=/usr/local/openldap # make depend # make install
Install apr & apr-util (with LDAP support)
- Needed if OS has older version of APR
apr
$ apr-1.2-11/configure --prefix=/usr/local/apr $ make $ sudo make install
apr-util
$ apr-util-1.2-10/configure --prefix=/usr/local/apr --with-ldap \ --with-ldap-include=/usr/local/openldap/include --with-ldap-lib=/usr/local/openldap/lib \ --with-apr=/usr/local/apr $ make $ sudo make install
Apache 2.2.4
Check that Apache was compiled with Dynamic Shared Object (DSO)
# apache/bin/httpd -l ... mod_so.c
Compile Apache with ssl and LDAP support
- mod_ssl is part of Apache 2, add in with ./configure --enable-ssl --enable-setenv
# ./configure --prefix=/usr/local/apache-2.2.4.loap --enable-ssl --enable-setenv --enable-so \ --enable-mods-shared=all --enable-ldap --enable-authnz_ldap --with-ldap --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr # make # make install
- ERROR: configure: error: Cannot use an external APR-util with the bundled APR. Add --with-included-apr to configure
- cp libphp5.so /usr/local/apache/modules/.
/etc/sysconfig/httpd config
OPTIONS="-f /usr/local/apache-2.2.4.loap/conf/httpd.conf"
/etc/init.d/httpd
add the following to allow for Oracle:
LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib:${LD_LIBRARY_PATH}
TNS_ADMIN=/var/opt/oracle
export LD_LIBRARY_PATH TNS_ADMIN
httpd.conf Entries
PHP Configuration
## PHP LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php AddType application/x-httpd-php .html DirectoryIndex index.php ExtendedStatus on #
LDAP Configuration
<Directory "/usr/local/apache-2.2.4.loap/htdocs/server_check"> Options all Options MultiViews Indexes AuthName "LDAP Access Test" AuthType Basic AuthBasicProvider ldap #AuthLDAPAuthoritative on AuthLDAPURL "ldap://rnldap.bluemustard.org:389/ou=people,dc=metaview,dc=bluemustard,dc=org" AuthGroupFile /usr/local/apache/security/htaccess.groups require group LDAP_test </Directory>
<Directory "/usr/local/apache-2.2.4.loap/htdocs/boss"> Options all Options MultiViews Indexes AuthName "LDAP Access Test" AuthType Basic AuthBasicProvider ldap #AuthLDAPAuthoritative on AuthLDAPURL "ldap://rnldap.bluemustard.org:389/ou=people,dc=metaview,dc=bluemustard,dc=org" require ldap-user barney bob fred tommy </Directory>
Compile PHP with Oracle & LDAP Support
# ./configure --enable-exif --enable-track-vars --with-calendar=shared --enable-magic-quotes \ --with-ldap=/usr/local/openldap --with-apxs2=/usr/local/apache-2.2.4/bin/apxs \ --with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client/lib --with-openssl # make # make install
# cp php.ini-dist /usr/local/lib/php.ini
Update httpd.conf for php
## PHP LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php AddType application/x-httpd-php .html DirectoryIndex index.php ExtendedStatus on #

