Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.
This object is in archive! 

Add option for Berkeley DB in EasyApache

Tudor Holton shared this idea 10 years ago
Open Discussion

By default, Apache builds without Berkeley DB, meaning that simple databases based on Berkeley's DB, SDBM, and GDBM formats will have htdbm mysteriously report that the file does not exist, or Apache will throw a similar 500 error if you attempt to use them to provide authentication.


The simple solution to this is to add in the Berkeley DB switch into EasyApache. Just add the file


/var/cpanel/perl/easy/Cpanel/Easy/Apache/BerkeleyDB.pm


with the following contents:

package Cpanel::Easy::Apache::BerkeleyDB;our $easyconfig = { 'version' => '$Rev: 1045 $', 'name' => 'BerkeleyDB', 'url' => 'http://httpd.apache.org/docs/[% apache_uri_version %]/programs/configure.html', 'step' => { '0' => { 'name' => 'to config options', 'command' => sub { my ($self) = @_; $self->add_to_configure( { '--with-berkeley-db' => '' } ); return ( 1, 'Ok' ); }, }, },};1;

Replies (3)

photo
1

Have you been successfully using Berkeley DB with the information you have provided? What's your experience been like? Do you have a particular goal you're trying to accomplish that only Berkley DB can do?

photo
1

cPScottT wrote:

Have you been successfully using Berkeley DB with the information you have provided? What's your experience been like? Do you have a particular goal you're trying to accomplish that only Berkley DB can do?
Yes. I was migrating an existing site that was using BDB as its access control and data store. The passwords had been one-way encrypted into the BDB file, so it was much easier to enable BDB than to contact each user and have them change their password. Plus, enabling BDB meant all the cgi code worked as expected, too. A win-win for everyone, and a much quicker and more flexible solution than any of the migration alternatives.

photo
1

I might add that this isn't the first site I've come across that uses BDB. BDB is an old product (Unix V!) but was bought by Oracle in 2006 and is still under very active development. It has significant speed advantages in certain cases, which is why cgi coders tend to prefer it over any of the SQL databases. It's designed for scalability which makes it more responsive when placed in a cloud environment, and its protocol is controlled, meaning that you can get stability and communication efficiencies there, too.

Leave a Comment
 
Attach a file