not me, anymore
Please use the httpd user's mailing list for help with Apache 2.0 on AIX.
If you have a patch to resolve the problem in your e-mail, that is great.
Note that issues with code in srclib/apr and srclib/apr-util are discussed at dev@apr.apache.org. You can subscribe to that list by sending a blank message to dev-subscribe@apr.apache.org.
Information about all Apache Software Foundation mailing lists can be found at http://www.apache.org/foundation/mailinglists.html. There are pointers from that page to archives for many of the lists.
bos.adt.base bos.adt.include bos.adt.lib bos.adt.libmRun
lslpp -L
fileset to see
if you have the fileset installed.
Word to the wise: Any information in the sister document describing breakage overrides any general principles described here.
Build Apache with the standard modules, including mod_so so that you can load your own modules into the server. Use the worker MPM because that is the strategic multi-process, multi-threaded MPM for Unix-like systems, and it works fine on AIX.
cd
into the root source
directory.
buildconf
You probably do not need to do this (see Running buildconf). But if you do, it is as simple as
$ ./buildconf
configure
$ CC=xlc_r ./configure \ --with-mpm=worker --enable-so --enable-layout=Apache \ --enable-mods-shared=most --enable-maintainer-mode \ --with-expat=`pwd`/srclib/apr-util/xml/expat \ --enable-static-support
If you want to use gcc instead of IBM's C for AIX, use
CC=gcc
instead of CC=xlc_r
If you want to build 64-bit Apache using the IBM tools, set OBJECT_MODE=64. (I don't know what to do with gcc. I suspect you need to set OBJECT_MODE and add -m64 to FLAGS.)
If you want to be able to debug your Apache build, add
--enable-maintainer-mode
to the configure options listed
above.
If you want to install it somewhere besides /usr/local/apache2,
then add --prefix=/my/favorite/directory
to the configure
options listed above.
Note to the curious: Explicitly specifying --enable-so
works around a bug in 2.0.45. It doesn't hurt to specify it for other
releases.
This first step, configure, will take a while while it detects what
capabilities are available on your system. With recent levels of
Apache, it can take seemingly forever to run. A huge amount of time
can be saved by avoiding the checks for a number of different versions
of the Berkeley DB libraries. If you don't need to use Berkeley DB
libraries, skip this portion of configure processing by adding
--without-berkeley-db
to the configure invocation.
If Berkeley DB is pre-installed on your system and the Apache
configure script finds it, then user and group databases maintained by
dbmmanage and htdbm can use the Berkeley DB format instead of the
default SDBM (Perl-compatible) format.
make
After the configure step is done, run
make
.
$ make
Please note: There is some non-standard naming of libraries, and IBM's native C compiler for AIX will display a plethora of warnings at the end of the build because of those names. Ignore them. They look like this:
xlc_r: 1501-218 file modules/aaa/.libs/mod_access.al contains an incorrect file suffix xlc_r: 1501-218 file modules/aaa/.libs/mod_auth.al contains an incorrect file suffix xlc_r: 1501-218 file modules/filters/.libs/mod_include.al contains an incorrect file suffix xlc_r: 1501-218 file modules/loggers/.libs/mod_log_config.al contains an incorrect file suffix xlc_r: 1501-218 file modules/metadata/.libs/mod_env.al contains an incorrect file suffix xlc_r: 1501-218 file modules/metadata/.libs/mod_headers.al contains an incorrect file suffix xlc_r: 1501-218 file modules/metadata/.libs/mod_setenvif.al contains an incorrect file suffix xlc_r: 1501-218 file modules/http/.libs/mod_http.al contains an incorrect file suffix xlc_r: 1501-218 file modules/http/.libs/mod_mime.al contains an incorrect file suffix xlc_r: 1501-218 file modules/generators/.libs/mod_status.al contains an incorrect file suffix xlc_r: 1501-218 file modules/generators/.libs/mod_autoindex.al contains an incorrect file suffix xlc_r: 1501-218 file modules/generators/.libs/mod_asis.al contains an incorrect file suffix xlc_r: 1501-218 file modules/generators/.libs/mod_info.al contains an incorrect file suffix xlc_r: 1501-218 file modules/generators/.libs/mod_cgid.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_negotiation.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_dir.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_imap.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_actions.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_userdir.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_alias.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_rewrite.al contains an incorrect file suffix xlc_r: 1501-218 file modules/mappers/.libs/mod_so.al contains an incorrect file suffix xlc_r: 1501-218 file server/mpm/worker/.libs/libworker.al contains an incorrect file suffix xlc_r: 1501-218 file server/.libs/libmain.al contains an incorrect file suffix xlc_r: 1501-218 file os/unix/.libs/libos.al contains an incorrect file suffix xlc_r: 1501-218 file /build/httpd/httpd-2.0.44/srclib/pcre/.libs/libpcre.al contains an incorrect file suffix
If you see warnings like this specifying _Errno as the missing prototype, please ignore these. It is due to a problem in a system header file. The problem is fixed as of AIX 5, and it has no negative side effects on older releases of AIX.
1506-304 (I) No function prototype given for "_Errno"
make install
You may need to perform make install
as root,
depending on where it is installed (specified via
--prefix
parameter passed to configure
).
# make install
If you get an install failure like the following, run
slibclean
as root and then run make install
again. If you aren't able to run slibclean
as root, the
alternative is to delete all the files in Apache's lib directory then
run make install
again.
cp .libs/libapr-0.so.0.9.5 /home/trawick/2048gcc/lib/libapr-0.so.0.9.5 cp: /home/trawick/2048gcc/lib/libapr-0.so.0.9.5: Text file busy make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. Stop.
Run apachectl configtest
to make sure all the Apache
modules can load.
If you built with gcc and you get an error similar to the following, see item B14 in this document for a solution.
Cannot load /home/trawick/apacheinst/modules/mod_actions.so into server: 0509-130 Symbol resolution failed for /home/trawick/apacheinst/modules/mod_actions.so because: 0509-136 Symbol __ashldi3 (number 15) is not exported from dependent module lt-httpd. 0509-192 Examine .loader section symbols with the 'dump -Tv' command.
User
and Group
If you intend for Apache to listen on a low port (e.g., 80) or you
need to start Apache as root for some other reason, you'll need to fix
the User
and Group
directives.
Find this section:
User nobody Group #-1
This won't work on AIX. On most systems, you can use nobody for both user and group, as shown below:
User nobody Group nobody
If you neglect to do this, you'll see a confusing error message like the following in error_log:
(22)Invalid argument: setgid: unable to set group id to Group 4294967295
If you want to have a single-process/multi-threaded server, find this section:
<IfModule worker.c> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule>
Add the following directives to the start of the worker.c
container:
ServerLimit 1 ThreadLimit 1024
and change StartServers to 1, MaxClients to 1024, MinSpareThreads to 1, MaxSpareThreads to 1024, and ThreadsPerChild to 1024.
If you want to enable mod_status, find this section:
#<Location /server-status> # SetHandler server-status # Order deny,allow # Deny from all # Allow from .your_domain.com #</Location>and uncomment all but the
Order
,
Deny
, and Allow
lines.
Also, find #ExtendedStatus On
and uncomment
that too.
Important: See the documentation for mod_access
for what to do with the Order
,
Deny
, and Allow
lines in case
you want to restrict who can see your server-status page.
You need to run buildconf
if one of the following
conditions is true:
Most users of Apache 2 on AIX do not need to run
buildconf
and don't need the prerequisites listed in this
section.
Warning: The version of libtool which is available from the AIX toolbox is not compatible with Apache 2.0 because a later version of libtool is needed. Installing the toolbox version of libtool will create symbolic links for aclocal and libtool in /bin which may cause the libtool installed in /usr/local/bin to be ignored. I do not know whether or not toolbox versions of m4 and autoconf can be used in place of the packages mentioned below. If you have such information, please let me know.
Download the following packages: m4, autoconf, libtool
gzip -dc autoconf-2.13.tar.gz | tar -xvf- gzip -dc m4-1.4.tar.gz | tar -xvf- gzip -dc libtool-1.4.2.tar.gz | tar -xvf-If you don't have makeinfo on your system, the build of m4 will fail. This is an easy work-around:
ln -s /usr/bin/true mydir/makeinfowhere
mydir
is some directory in your PATH. You
can erase the symbolic link mydir/makeinfo
after
building these tools.
Build them in this order. If using gcc, omit the "CC=xlc_r" on several of the commands.
cd m4-1.4 CC=xlc_r ./configure make make install cd ../autoconf-2.13 CC=xlc_r ./configure make make install cd ../libtool-1.4.2 CC=xlc_r CFLAGS=-bexpall ./configure make make installThe reason CFLAGS=-bexpall is needed in libtool is so that dlopen(self,....) will work correctly on AIX.
gcc note:Use -Wl,-bexpall
instead of simply
-bexpall
with gcc. gcc doesn't understand
-bexpall
, but prefixing it with -Wl
tells gcc to pass it on to the loader.
make distclean
to clean things up
back to the point of unpacking a tarball. If you are updating from
CVS, use make extraclean
followed by
buildconf
any time you update to get to the state of a
fresh tarball.
apachectl start
.
Note: Prior to 20011217 you would need to set the
LDR_CNTRL
environment variable. That is no longer
needed.
If you're running a single-child-process server, you'll see 3 httpd processes after Apache starts:
25680 26372 * 00:00:00 trawick httpd /home/trawick/2.0.28/bin/httpd 26372 1 - 00:00:00 trawick httpd /home/trawick/2.0.28/bin/httpd 29778 26372 EVENT 00:00:00 trawick httpd /home/trawick/2.0.28/bin/httpdThe one with parent pid 1 is the parent (just like 1.3). The one in EVENT state is the process full of worker threads. The remaining process is mod_cgid.
Information on upgrading from Apache 1.3 can be found at http://httpd.apache.org/docs-2.0/upgrading.html .
/dev/*random
). The
solution for these older levels of AIX is to install prngd from the
AIX toolbox and then add the following to your mod_ssl configuration
section:
<IfModule mod_ssl> SSLRandomSeed startup egd:/dev/egd-pool SSLRandomSeed connect egd:/dev/egd-pool other stuff </IfModule<silly doc problem: the mod_auth_digest hints below tell you to use a different random number source :)
If OpenSSL is built for dynamic linking but you wish to link mod_ssl directly into Apache (--enable-ssl=static), you can get link-edit errors like this:
ld: 0711-317 ERROR: Undefined symbol: .sk_new_null ld: 0711-317 ERROR: Undefined symbol: .X509_STORE_CTX_set_verify_cb ld: 0711-317 ERROR: Undefined symbol: .BIO_snprintf ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.To make this work, do a special build of OpenSSL like this:
./config threads no-shared no-dso no-asmThen point Apache to that OpenSSL build like this:
./configure --enable-ssl=static --with-ssl=/path-to-openssl_dir --other-opts
mod_deflate
Don't get it from the AIX Toolbox download page. The RPM there doesn't include header files. Instead, grab the lastest zlib tarball from the home of zlib, www.zlib.org.
Build a static library. It is small; there is no reason to complicate matters.
CC=xlc_r CFLAGS="-O -qmaxmem=8192" ./configure makeI recommend NOT doing
make install
. The first time I did this,
I broke an old installation of cvs because I overwrote the version
of zlib that cvs expected to use.
Another reason to segregate out of the standard install location (/usr/local/lib, /usr/local/include): there may be files in /usr/local/include which you do not want to consider for the Apache compilation.
consider doing something like this after running make
:
mkdir /home/george/zlib-for-apache mkdir /home/george/zlib-for-apache/lib mkdir /home/george/zlib-for-apache/include cp -p zlib.h zconf.h zutil.h /home/george/zlib-for-apache/include cp -p libz.a /home/george/zlib-for-apache/libTo enable mod_deflate, add these options to your existing configure options later:
--enable-deflate --with-z=/home/george/zlib-for-apache
This can be due to DNS calls at initialization. To confirm this, try starting Apache like this:
NSORDER=local bin/apachectl start
If that resolves the slow startup, then the problem was caused by a DNS lookup.
send_file()
API. This results in the files being stored in
the AIX Network Buffer Cache. This leaves the files open as long as
they are in the cache, preventing the underlying filesystem from being
cleanly unmounted.
To clear files from the cache and unmount the filesystem:
The old cache size can be displayed by
no -o nbc_limit
.
The cache size can be set to zero by no -o nbc_limit=0
.
no -o nbc_limit=old_value