DBM File Support
Purpose
NCSA HTTPd 1.4 and before handled groups and passwords in a flat file
database reminiscent of the /etc/passwd and /etc/group files found
on most versions of un*x (especially older ones). This meant that lookups
had to search through the file in order, comparing each entry until
the match occured. While this was good enough for fewer then a hundred
entries, by the time you hit 10000 entries, access times would be through
the roof.
In order to alleviate this bottleneck, NCSA HTTPd 1.5 supports DBM files.
DBM is a fairly straight forward database library that is supported on
most un*x platforms. And even if your platform doesn't have it, chances
are the GNU gdbm will compile on your platform, and you can use that.
With DBM support, lookup times should be consistent, and consistently
faster then under a comparable flat file.
With the DBM format, however, you lose some of the ease of use that was
associated with the hand editable flat file. We have provided support
programs to convert from one format to the other, as well as add/delete/modify
DBM files without conversion.
Syntax
There are three directives pertinent to DBM support: AuthUserFile,
AuthGroupFile, and AuthDigestFile. These directives take one argument
which specifies the full pathname of the particular file. For DBM support,
these directives have been augmented to accept an optional second argument.
If the filenames are followed by the word "dbm", HTTPd will assume that
the files are in DBM format. If the filenames are followed by the word
"standard", or no third argument is present, the standard flat file format
will be assumed. Here are some examples of the syntax:
AuthUserFile /usr5/guillory/public_html/.htpasswd dbm
AuthGroupFile /usr5/guillory/public_html/.htgroup standard
Note that you can different formats for your group and password files. In the
above example, the word standard was unnecessary, as the standard format
is the default.
Support
There are several utilities in the support directory to manipulate
DBM authentication files. The pair of utilities std2dbm.c and dbm2std.c are
provided to convert back and forth between DBM and standard flat file
formats. The std2dbm.c program can convert group files, password files, and
digest files to DBM format. However, there is a current limitation on
line length in group files. Lines in the .htgroup files must be no longer
than 1023 characters. We will remove this limitation during this beta.
There are three utilities to manipulate DBM files directly: dbmpasswd.c,
dbmgroup.c, and dbmdigest.c. These programs allow you to add entries,
modify entries, and delete entries.
The Library:
NCSA HTTPd Development Team / httpd@ncsa.uiuc.edu / Last Modified 7-06-95