Fix Undefined symbol: db_create Issue with mod svn dav and Apache 2

The Environment

Ubuntu 7.10 (Gusty) running Subversion 1.4.2 and Apache 2.2

The Problem

The following warning would come up when trying to restart Apache 2.2 using a restart command like httpd restart or /etc/init.d/httpd restart


Syntax error on line 100 of /usr/local/apache/conf/httpd.conf: Cannot
load /usr/local/apache/modules/mod_dav_svn.so into server:
/usr/lib/libsvn_fs_base-1.so.0: undefined symbol: db_create

A Solution

After much research, this error seems related to the standard (apt-get or yum) repository installations of Subversion being compiled to use the Berkeley DB package. Berkeley DB was the original data store for Subversion repositories. These days it is suggested to use the FSFS data store instead.

Berkeley DB wasn't installed by default on the server and the preference is to use the more current FSFS. So, instead of trying to install Berkeley the solution was to recompile Subversion from source code using the current version, 1.5.5.

In the process of recompiling, the Expat library was found to be necessary and not already on the server. whereis expat can be run to check if it's already installed. If not, apt-get install libexpat1-dev can be used install this prerequisite library. (or yum install expat-devel on distributions, like CentOS)

Note that the /usr/local/apache in the code below is specific to our server environment and is determined by the Apache --prefix flag. /usr/local/apache2 is common for Apache2 builds and /usr/local/apache is common WHM/cPanel environments. Your path should be the directory in which your httpd.conf file resides. The /tmp/svnbuild path below is irrelevant and can really be any path that has read, write and execute permissions.

Code to Compile Subversion 1.5.5 from Source

Disclaimer: Compiling can fix one problem and cause another, so it's best to test on a development system first, or at least know how to roll back to where you were


# download and extract Subversion
mkdir /tmp/svnbuild
cd /tmp/svnbuild
wget http://subversion.tigris.org/downloads/subversion-1.5.5.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.5.5.tar.gz
tar xvzf /tmp/svnbuild/subversion-1.5.5.tar.gz
tar xvzf /tmp/svnbuild/subversion-deps-1.5.5.tar.gz
cd /tmp/svnbuild/subversion-1.5.5

# read the INSTALL file if you need more details
nano INSTALL

IMPORTANT, this next block of code should be one line, even though it may be wrapping and appear to be multiple lines.

Also, be sure to change the /usr/local/apache values if your Apache paths are different


./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apache --with-apr-util=/usr/local/apache --with-apxs=/usr/local/apache/bin/apxs


# build and install Subversion
make
make install


# restart Apache
httpd restart

Other Notes

These notes may be helpful if you've fixed the undefined symbol: db_create error, but SVN on Apache still isn't working for you.

Remember that dav_svn_module should be getting loaded as a shared (DSO). Running the httpd -M command should show a line with dav_svn (shared). If you don't see it then try adding the following to the Apache configuration file, httpd.conf


LoadModule dav_svn_module modules/mod_dav_svn.so

dav_module should also appear in the httpd -M list. If not then it can be recompiled into Apache by using --enable-dav-module (or simply checking the Mod DAV box if your using WHM/cPanel's Apache Update tool). Or if it's not build in static then it can be loaded as a DSO too by adding the following to the httpd.conf.


LoadModule dav_module modules/mod_dav.so

If both modules are installed as DSO then the dav_module line should come before the dav_svn_module in httpd.conf. For instance,


LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so

Lovingly crafted by orangecoat with some rights reserved, and a promise not to spam you.

Back to top