Get Firefox!

Valid HTML 4.01 Transitional

Home > Programming > Slackware, Apache and DBM

The Problem

Thanks to a silly decision in the design of the latest gdbm, one finds that when trying to compile the stock Apache webserver source code on Slackware Linux 10 or above, the Apache configure fails to find gdbm. This isn't that much of a problem unless you use the popular mod_rewrite which relies on dbm, and thus can't now be built. e.g.
./configure \
 --prefix=/usr/local/apache \
Configuring for Apache, Version 1.3.33
 + using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for Linux platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + using "tr [a-z] [A-Z]" to uppercase
 + checking for system header files
 + adding selected modules
    o rewrite_module uses ConfigStart/End
      disabling DBM support for mod_rewrite
      (perhaps you need to add -ldbm, -lndbm or
      -lgdbm to EXTRA_LIBS)
 + using system Expat
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/regex
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/modules/standard
The Solution
  1. Download the appropriate apache.dbm.diff.gz for your version of Slackware. In the 10.0 tree, it is in /patches/source/apache while in 10.1 it is in /source/n/apache.
  2. Untar your apache source, e.g. tar -xvzf apache_1.3.33.tar.gz
  3. cd apache_1.3.33
  4. gunzip ../apache.dbm.diff.gz
  5. patch -p1 < ../apache.dbm.diff
When you issue the patch command, you should see...
patching file src/modules/standard/mod_rewrite.h
patching file src/modules/standard/mod_auth_dbm.c
patching file src/helpers/find-dbm-lib
If so, you're all set, and upon compiling Apache it will now find DBM.
    o rewrite_module uses ConfigStart/End
 + using -ldb for DBM support
      enabling DBM support for mod_rewrite