Build Apache 2.2.X on AIX 5.3 Platforms Part II: Common Issues

By Brad Reeves on Friday, November 14th, 2008 in Technical | Related Software Packages: , | Keywords: ,

Purpose

Building the Apache Web server on AIX is generally a straightforward enterprise in which you: obtain the code, run a few simple commands (configure, make, and make install) and then stop by your boss’s cube to ask if she’s got anything she’d like you to take off her plate.

You don’t know us very well yet, so we’ll be frank: we say “straightforward” with tongue firmly planted in cheek. A quick Google search on the topic will return a plethora of issues users encounter while building the code if they try anything beyond straight vanilla. In other words, if you need an install with any additional modules or capabilities, expect some issues.

We’ve already covered the vanilla installation, in the first installment of the Building Apache on AIX. This second part of the tutorial takes you beyond those basics. Before attempting any of these work-arounds, we recommend that you have met all the requirements for a “basic” build.

Before You Start

Follow the setup from the first installment of this guide, Building Apache 2.2.X on AIX 5.3 platforms.

Meat & Potatoes

Common Problems

Neglecting to  clean between failed builds (or builds with numerous, particular errors)
During compilation phase of the build, if any errors are encountered, the subsequent build
must be preceded by a make clean. As Joe Biden would say “Let me repeat that”, make clean.
It is important that your build runs from start to finish without errors and that there is
not any artifacts from previous build attempts giving you false positive or false negative results.

Environment Issues
The most frequent issues with a build are ones that are encountered because the build environment
is not set up correctly. Incorrect gcc version, gcc library version, and not adding the
math library (libm.a) are the most common. Setup of these environment elements are covered in
the first installment of this guide.

Configuration Options

The latest versions of Apache Web server have over 160 configuration options and flags, making for millions potential combinations. These options control exactly how the Web server is going to build and, more importantly, how it is going to run. On AIX, there are several options that we have found are either required, or particularly beneficial to complete the build.

--prefix=PATH
Setting this option is required. PATH is the exact path where the Web server will be installed and run from post compilation.

--with-included-apr
apr and apr-util are bundled with the Apache Web server source releases, and will be used without any problems in almost all circumstances. However, if apr or apr-util versions 1.0 or 1.1, are installed on your system (as is the case if you are using AIX 5.3), you must either upgrade your apr/apr-util installations to 1.2 and force the use of the bundled libraries, or have httpd use separate builds.

To use the bundled apr/apr-util sources, specify the --with-included-apr option added in version 2.2.3 of Apache Web server.

--enable-ssl=shared
If you choose to add ssl capabilities to your Web server, you must enable this option. This also means that you must have OpenSSL installed on your system. On AIX systems a typical install will litter OpenSSL elements across your file system, and this will cause issues as you compile. For instance, we have found complete or portions of OpenSSL installed in the following directories : /usr , /usr/bin, /opt/freeware/bin, /usr/include, /usr/linux. Most often, the correct OpenSSL to use is the libraries found in /usr.  To specify using this one, you must set the following options:

--with-ssl=/usr This tells the configuration step to bind to libraries found in and under /usr.

--enable-mods-shared=ssl This tells the system to create the ssl module as a shared object.

Other important configuration options include:

--enable-so: This configures apache for later installation of shared objects (modules).  Apache httpd can be built either with static, built-in modules, or be built so that modules can be stored outside of the httpd binary file, and may be compiled and added at a later time. Having the ability to add modules after the main build is accomplished using the Apache Extention Tool (apxs).  This dynamic build is enabled by the –enable-so option. The modules that are built as extentions to the main binary are called Dynamic Shared Objects (DSO).

Finally, here are a few optional modules you may include during your configuration:

Proxy Modules
--enable-proxy
--enable-proxy-ajp
--enable-proxy-balancer

Configuring Proxy

  • Forward Proxy

ProxyRequests On
ProxyVia On

<Proxy *>
Order deny,allow
Deny from all
Allow from internal.example.com
</Proxy>

  • Reverse Proxy

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /path http://domainname.com/thing
ProxyPassReverse /path http://domainname.com/thing

  • Proxy Access

<Proxy *>
Order Deny,Allow
Deny from all
Allow from 192.168.0
</Proxy>

Helper Modules
--enable-module=rewrite
--enable-module=log_referer

Get open source software support

Common Error Messages

Openssl compilation error.
Sample error: /usr/include/openssl/pq_compat.h:1:3: error: invalid preprocessing directive #IBM_PROLOG_BEGIN_TAG

On AIX, it is not uncommon to encounter errors during compilation if ssl is enabled. This is because
IBM’s OpenSSL package contains a number of include files in /usr/include/openssl where a special “IBM Prolog” include line has been added, making the header files incompatible with gcc.
The fix is to edit pq_compat.h, and comment out any lines with IBM_PROLOG_BEGIN_TAG, as well as any associated lines with the Prolog include tag.

Linker errors
Sample error: 0711-317 ERROR: Undefined symbol: .BIO_clear_flags

On AIX, once you have satisfied the gcc requirements to build Apache two linkers will exist
on your system. Linker errors, like the one seen above, are a result of the pathing to libraries being
different for the compiler and the linker, and can be resolved by setting environment flags.

Now, on all UNIX systems there is a library path that is to be used during link phase, and runtime,
and on all UNIX systems this path is set via the LD_LIBRARY_PATH variable. All Unix systems, that is, except AIX. For this reason, we usually set the path using both the standard and the AIX variable as a safety precaution. The native AIX linker should use LIBPATH, while LD_LIBRARY_PATH will be used by the Gnu linker.

Example library path setup looks like this:

set LIBPATH=/usr/lib:/lib
set LD_LIBRARY_PATH=/usr/lib:/lib
export LIBPATH LD_LIBRARY_PATH

Finishing Up

Augmenting the basic build with additional modules will add complexity to the build process, but by following this tutorial and properly setting up your environment, most errors can be avoided. Of course, each system can have other libraries and packages installed that can cause additional error messages, or warnings. While we have built Apache on AIX many times, on many different systems, this guide does not claim to, and can’t possibly, anticipate every situation. Should you encounter other errors, please email them to us, and we’ll include them in a future revision.

We wish you good luck, and happy compiling.

Brad Reeves

Linux. KDE. Open Source. Refuses to own an iPod. Drives a Mini Cooper. Brad's a Senior Content Engineer at OpenLogic but get this: he's also been a ski patrol guy, basketball coach, line cook, and trainer at HP (for starters). Brad has earned his guru status, and - if you want something done? Folks actually refer to him as the "office do-er of everything". Cooks veggies in all manner of delicious ways, but eats only meat. Able to benchpress any given 17 year old. This guy? Totally deserves the superman logo and if it weren't for that pesky copyright, we'd give it to him. In color.

One Response to “Build Apache 2.2.X on AIX 5.3 Platforms Part II: Common Issues”

  1. [...] contributed tips and tutorials on a range of topics including working with Firefox and installing Apache on AIX. Rod Cope reported the results of some experimentation with open source reporting [...]

Leave a Reply

© 2010 OpenLogic, Inc. | Licensing | Privacy Policy | Terms of Use