Mod_dbxml integrates the Oracle Berkeley DB XML native XML database with the Apache Web server. Create dynamic Web content by direct XQuery database access.
First public release: mod_dbxml-0.1alpha
2006-11-04:
We are pleased to announce the first public release of mod_dbxml.
Warning: This is an alpha release. Mod_dbxml might not work at all. It might even crash your server and break your system. Use at your own risk!
Features:
- execute XQueries and serve the results directly to the client
- CGI-like interface between Apache and XQuery code
- queries are pre-compiled and cached
- support for multiple database environments
License
Mod_dbxml is released under the GNU General Public License, version 2.
Installation
This is an early alpha release. It lacks some features and didn't see much testing yet. Alpha testers are welcome! For now don't use mod_dbxml on a production system.
To install mod_dbxml you need a working ANSI C++ compiler and GNU make.
Have the Apache Web server installed. If you use a binary distribution also install the Apache server and Apache runtime (apr) development files. Mod_dbxml works with the Apache 2.x series.
Install Oracle Berkeley DB XML. Mod_dbxml works with version 2.2.13. You can download DB XML 2.2.13 from the Oracle web site.
Download mod_dbxml-0.1alpha, unpack the distribution tarball and run the configure script. The script expects the Apache extension tool apxs (or apxs2) to be on the search path. If this is not the case you can specify the location of the script by setting the APXS environment variable. The configure script tries to run the apr-config Apache runtime configuration script. Specify the full path to the script if Apache is linked against a different version of the apr library then indicated by apr-config as found on the search path. Specify the install locations of the various DB XML libraries with configure flags if you installed DB XML into another location than the default (/usr/local/BerkeleyDBXML.2.2). After the configure script has finished successfully, run make. Example:
./configure --with-berkeleydbxml=/usr/local \
--with-berkeleydb=/usr \
--with-apr-config=apr-1-config \
APXS=/usr/local/apache2/bin/apxs
make
sudo make install
See ./configure --help for a full list of the configure options.
Configuration
To load mod_dbxml add the following line to your Apache configuration:
LoadModule dbxml_module modules/mod_dbxml.so
Now you can use the dbxml handler for evaluating XQuery requests:
AddHandler dbxml .xq
Mod_dbxml recognises the following configuration directives:
- DbxmlEnv (required)
The full path to the DB XML Berkeley DB environment. Per-directory setting.
- DbxmlModulePath (optional)
XQuery module search path as colon (:) separated list. Default: None. Global setting.
Download example configuration.
Usage Example
List CGI environment:
import module namespace http = "http://moddbxml.org/2006/xmlns/http" at "module:http.xq";
declare default element namespace "http://www.w3.org/1999/xhtml";
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>mod_dbxml Test Page</title>
</head>
<body>
<h1>mod_dbxml Test Page</h1>
<h2>{ http:getenv("SCRIPT_NAME") }</h2>
<table>
{
for $element in http:env()/*
let $name := fn:local-name($element)
order by $name
return
<tr><td>{ $name }</td><td>{ $element/text() }</td></tr>
}
</table>
</body>
</html>
Feedback
Feedback is welcome. Please use the tracking system at SF.net.
Authors
- Hans-Thomas Mueller <htmue at users dot sourceforge dot net>