Friday, April 18, 2008

Apache Build Instructions with Oracle Instant Client

Apache 2.2.6 Webserver with Oracle Instant Client connectivity

Required Downloads

Application File Name
Apache 2.2.6 httpd-2.2.6.tar
DBD Apache odbc-dbd-1.0.7.tar.gz
Unix-ODBC Driver Manager unixODBC-2.2.12.tar

Oracle Instant Client

Oracle Basic Client

These instructions build all the necessary pieces into one main directory. This has the advantage of being very portable. All the files can be zipped and moved from server to server.
The disadvantage is one component may require an upgrade and it may be necessary to rebuild the entire application for one change.

This build was created on a Solaris 10 zone. Specifically here is the details from
uname –a
SunOS machine1 5.10 Generic_118833-36 sun4v sparc SUNW,Sun-Fire-T1000 .

The user account is a standard user that does not have root access. In this case the user is named “apache” with a home directory located /export/home/apache.

Overview of Process:
1. Download all the files.
2. Build the odbc-unix manager.
3. Build apache with all necessary options.
4. Build the and link into the apache built in step 3.

Verify Build Environment on the Box
1. There are two settings that must be set for these builds to succeed.
2. Warning: This will overwrite any previous settings for PATH and LD_LIBRARY_PATH.

export PATH=.:/usr/bin:/usr/sfw/lib:/usr/sfw/bin:/opt/sfw/bin:/usr/sfw/bin:/usr/sbin:/usr/ccs/bin
export LD_LIBRARY_PATH="/usr/sfw/lib"

3. Type set to view environment values
4. Verify the LD_LIBRARY_PATH and PATH match the values in step #2.

ODBC Build
1. First download the Unix ODBC Manager from .
2. Untar the download. tar –xvf unixODBC-2.2.12.tar
3. This creates a new directory named unixODBC-2.2.12.
4. cd unixODBC-2.2.12/
5. $ ./configure --prefix=/opt/app/apache2/unix-odbc --disable-gui
6. make
7. make install
8. No errors and now the installation directory(/opt/app/apache2) should exist with unix-odbc installed.

Apache Build
1. First download the Apache build. These instructions use 2.2.6.
2. Untar the download. tar –xvf httpd-2.2.6.tar
3. cd httpd-2.2.6/

Note: =”-DAPR_DSO_BUILD=1” allows you to add the apr_dbd driver in the next section. Without this parameter at build time you can not add drivers.

./configure CPPFLAGS="-DAPR_DSO_BUILD=1 -I/opt/app/apache2/unix-odbc/include" --prefix=/opt/app/apache2 --with-mpm=worker --enable-
mods-shared="all proxy proxy-balancer proxy-connect proxy-http cache ssl"
Mod so is automatically built when mods-shared is used.

4. ./configure CPPFLAGS="-DAPR_DSO_BUILD=1 -I/opt/app/apache2/unix-odbc/include" --prefix=/opt/app/apache2 --with-mpm=worker --enable-ssl --enable-proxy --enable-proxy-balancer --enable-proxy-connect --enable-proxy-http --enable-setenvif --disable-charset-lite --enable-include --disable-env --disable-autoindex --disable-asis --disable-negotiation --disable-imap --disable-actions --disable-userdir --enable-so --enable-cache --enable-expires --enable-headers --enable-authn-dbd --enable-dbd --enable-status
5. Make
6. Make install
$ ./configure CPPFLAGS="-DAPR_DSO_BUILD=1 -I/opt/app/apache2/unix-odbc/include" --prefix=/opt/app/apache2 --with-mpm=worker --enable-mods-shared="all proxy proxy-balancer proxy-connect proxy-http so cache ssl"


Build Apache APR_DBD Driver
1. First download the Apache DBD build for the driver.
2. Untar the download. tar –xvf
3. cd dbd_odbc/

4. ./configure CPPFLAGS=-I/opt/app/apache2/unix-odbc/include --with-apr=/opt/app/apache2

Note: Errors may appear that look like this:
configure: error: libodbc not found - An ODBC Manager (e.g. unixODBC) is required to build apr_dbd_odbc
See `config.log' for more details.

Must have odbc Manager in LD_LIBRARY PATH for build to succeed.

5. Make
cc1: error: unrecognized command line option "-Wno-pointer-sign"
*** Error code 1
make: Fatal error: Command failed for target `apr_dbd_odbc.lo'


Error during make net
cc1: error: unrecognized command line option "-Wno-pointer-sign"
*** Error code 1

Remove the –Wno-pointer-sign option

Add permissions to chmod +x install-sh

6. Make install

No comments: