3. Installation

First we hve take care of the few pre-requisites, and then we will get into the main installtion.

3.1. Pre-requisites

The application server as we plan to install, requires the SSL libraries and LDAP libraries. SSL engine is also required for managing the SSL certs for Apache 2.x

3.1.1. iPlanet LDAP SDK

Become root by using the su command:

$ su -

Create the /usr/local/iplanet-ldap-sdk.5 directory. Copy the ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar.gz form /tmp/downloads to /usr/local/iplanet-ldap-sdk.5 directory.

# mkdir /usr/local/iplanet-ldap-sdk.5
# cp /tmp/downloads/ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar /usr/local/iplanet-ldap-sdk.5
# cd /usr/local/iplanet-ldap-sdk.5
# tar -xvf ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar

Now you should have all the required iPlanet LDAP lib files in the correct directory

3.1.2. OpenSSL Engine

Next we need to install the OpenSSL Engine

OpenSSL is an open source implementation of the SSL/TLS protocol. It is required to create and manage SSL certificates on the webserver. The installion is also necessary for the lib files that will be used by the SSL module for apache.

Change to the directory where you placed the OpenSSL source code files

 # cd /tmp/download
# gzip -d openssl.x.x.tar.gz
# tar -xvf openssl.x.x.tar
# cd openssl.x.x
# make
# make test
# make install

Upon successful completion of the make install the openssl binaries should reside in /usr/local/ssl

3.2. mySQL

Installaing mySQL is quite simple. The downloaded binaries have to be place in appropriate directory.

We start creating a user:group for mysql daemon, and copying the files to appropriate directories.

 # groupadd mysql
# useradd -g mysql mysql
# cd /usr/local
# gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - 
# ln -s full-path-to-mysql-VERSION-OS mysql

Next run the install_db script, and change permission on the files

 # cd mysql
# scripts/mysql_install_db
# chown -R mysql .

3.2.1. Starting mySQL

Now start the mySQL server to verify the installation

 # bin/mysqld_safe --user=mysql &

Verify mySQL daemon is running, by using the ps -ef command. You should see the following output:

# ps -ef | grep mysql
root      3237     1  0 May29 ?        00:00:00 /bin/sh bin/safe_mysqld
mysql     3256  3237  0 May29 ?        00:06:58 /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/data/downloa

3.2.2. Stopping mySQL

To stop the MySQL server, follow the instructions below

# cd /usr/local/mysql
# ./bin/mysqladmin -u root -p shutdown

3.2.3. Locating Data Directory

mySQL deamon stores all the information in a direcory called "Data Directory". If you followed the installation instructions above, your Data Directory should be located under /use/local/mysql/data.

To locate where your Data Directory is located, use the mysqladmin utility as follows:

# /usr/local/mysql/bin/mysqladmin variables -u root --password={your_password} | grep datadir

3.3. Apache 2.0

Start by setting some FLAGS for the compiler

# export LDFLAGS="-L/usr/local/iplanet-ldap-sdk.5/lib/ -R/usr/local/iplanet-ldap-sdk.5/lib/:/usr/local/lib"
# export CPPFLAGS="-I/usr/local/iplanet-ldap-sdk.5/include"

Next UNTAR the apache 2.0 source files, and execute the configure script.

# cd /tmp/download
# gzip -d httpd-2.0.46.tar.gz 
# tar -xvf httpd-2.0.46.tar
# cd httpd-2.0.46
#./configure --enable-so  --with-ssl --enable-ssl  --enable-rewrite   --enable-dav

Next run the make command

# make
# make install

3.3.1. Starting Apache

# /usr/local/apache2/bin/apachectl start

3.3.2. Stopping Apache

# /usr/local/apache2/bin/apachectl stop

3.4. mod_auth_ldap

Untar modauthldap_apache2.tar.gz

cd /tmp/download
# gzip -d modauthldap_apache2.tar.gz
# tar -xvf modauthldap_apache2.tar
# cd modauthldap_apache2

Now configure and install mod_auth_ldap

# ./configure --with-apxs=/usr/local/apache2/bin/apxs  --with-ldap-dir=/usr/local/iplanet-ldap-sdk.5/
# make
# make install

3.5. CERT DB for LDAPS://

You will also need to get the cert7.db and key7.db from http://www.xml-dev.com/xml/key3.db and http://www.xml-dev.com/xml/cert7.db and place it in the /usr/local/apache2/sslcert/directory.

3.6. PHP

Unzip the PHP Source Files

gzip -d php-xxx.tar.gz
tar -xvf php-xxx.tar

Configure and run the make command

cd php-xxx
./configure --with-mysql --with-apxs=/usr/local/apache2/bin/apxs

Compile the source code

# make 
# make install

Copy the php.ini file to the appropriate directory

cp php.ini-dist /usr/local/lib/php.ini