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 instantclient-odbc-solaris6432-10.2.0.3-20070101.zip

Oracle Basic Client instantclient-basic-solaris6432-10.2.0.3-20070101.zip

Notes:
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 apr_dbd_odbc.so 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.


Instructions
ODBC Build
1. First download the Unix ODBC Manager from http://www.unixodbc.org/ .
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"

Most=
httpd.exp mod_authz_owner.so mod_ident.so
mod_actions.so mod_authz_user.so mod_imagemap.so
mod_alias.so mod_autoindex.so mod_include.so
mod_asis.so mod_cgid.so mod_info.so
mod_auth_basic.so mod_dav.so mod_log_config.so
mod_auth_digest.so mod_dav_fs.so mod_logio.so
mod_authn_anon.so mod_dbd.so mod_mime.so
mod_authn_dbd.so mod_deflate.so mod_negotiation.so
mod_authn_dbm.so mod_dir.so mod_rewrite.so
mod_authn_default.so mod_dumpio.so mod_setenvif.so
mod_authn_file.so mod_env.so mod_speling.so
mod_authz_dbm.so mod_expires.so mod_status.so
mod_authz_default.so mod_ext_filter.so mod_userdir.so
mod_authz_groupfile.so mod_filter.so mod_vhost_alias.so
mod_authz_host.so mod_headers.so


Build Apache APR_DBD Driver
1. First download the Apache DBD build for the driver.
http://code.google.com/p/odbc-dbd/wiki/Linux
2. Untar the download. tar –xvf dbd_odbc-1.0.7.zip
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.
LD_LIBRARY_PATH=/opt/app/apache2/bin:/usr/sfw/lib:/opt/app/apache2/unix-odbc/bin:/opt/app/apache2/unix-odbc/lib:

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'


PATH=/opt/app/apache2/bin:/usr/bin:/usr/sfw/lib:/usr/sfw/bin:/opt/sfw/bin:/usr/sfw/bin:/usr/sbin:/usr/ccs/bin:/opt/app/apache2/unix-odbc/bin:/opt/app/apache2/unix-odbc/lib

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: