Bug 159608

Summary: www/apache22: apache WITH_BDB_BASE settings described in UPDATING do not work
Product: Ports & Packages Reporter: Jo Rhett <jrhett>
Component: Individual Port(s)Assignee: freebsd-apache (Nobody) <apache>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Jo Rhett 2011-08-08 18:40:11 UTC
There are settings described in ports UPDATING file and implemented in Makefile.modules to build apache with the base bdb 1.85 libraries.  Using these settings produces an apache which cannot authenticate against bdb 1.85 files.

dbmmanage /path/to/file view/adduser/delete/etc works fine
file /path/to/file
		/path/to/file: Berkeley DB 1.85 (Hash, version 2, native byte-order)

Accessing from the web server always returns a 500 error with the following in the error log:
	(2)No such file or directory: could not open dbm (type default) auth file: /path/to/passwd.dat

I've recompiled apr and apache with a variety of different options, and nothing works.  apr without any databases doesn't work. apr with BDB doesn't work, etc.  My options for apache have remained the same:
	APACHE_PORT=www/apache22
	WITH_DBM=bdb
	WITH_BDB_BASE=yes

Running a ktrace shows that even though it is built this way, it continues to search for a DBM file.

# kdump |grep /passwd
  724 httpd    NAMI  "/path/to/passwd.dat.dir"

Fix: 

No clue.
How-To-Repeat: /etc/make.conf: 
        APACHE_PORT=www/apache22
	WITH_DBM=bdb
	WITH_BDB_BASE=yes

cd /usr/ports/www/apache22
make
make install

Create a DB 1.85 authentication file like so:
  jrhett:$1$JJueifadJ$jjp1FrHQ1OLnGwpYc3Egr1:admin

file /path/to/passwd.dat
		/path/to/passwd.dat: Berkeley DB 1.85 (Hash, version 2, native byte-order)

Edit the httpd.conf like so:
<Directory />
AuthBasicProvider       dbm
AuthDBMType             default
AuthDBMUserFile         /path/to/passwd.dat
AuthDBMGroupFile        /pathto/passwd.dat
</Directory>
Comment 1 Remko Lodder freebsd_committer freebsd_triage 2011-08-11 07:45:01 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-ports-bugs

Reassign to the ports team for investigation.
Comment 2 Philip M. Gollucci freebsd_committer freebsd_triage 2011-08-16 01:29:39 UTC
Responsible Changed
From-To: freebsd-ports-bugs->apache

over to maintainer
Comment 3 Olli Hauer freebsd_committer freebsd_triage 2012-08-25 20:33:44 UTC
State Changed
From-To: open->analyzed

During the rewrite / cleanup of the www/apache22 port 
I removed all parts which where needed to build apr/apr-util, 
since they are not apache httpd related. 

The lines do no longer exist (they where a leftover from 
years ago where the apachex port was repocopied to apache22. 

The bundled apr-util and the port devel/apr? does not support 
building db support against the db185 version which is included 
in the FreeBSD libc, so there is no way to have support for db 
files which are created with apache13. 

Even this answer is not the one you expect I have to say sorry. 
I will close the pr.
Comment 4 Olli Hauer freebsd_committer freebsd_triage 2012-08-25 20:43:37 UTC
State Changed
From-To: analyzed->closed

devel/apr1 can not build d185 support against libc. 
apache22 takes the db information from apu-util so the 
options WITH_DBM=bdb, WITH_BDB_BASE=yes where useless 
and a false suggestion.
Comment 5 Jo Rhett 2012-08-27 18:14:04 UTC
When did this change? It absolutely wasn't broken since apache 1.3.  I was happily using the WITH_BDB_BASE settings with apache 2.0 and then 2.2 right up until I tried to recompile for 2.2.21. So it was broken between 2.2.17 and 2.2.21.

Finally, the dbmmanage which ships with apache only works with the built in db, so clearly it is intended to work. Something was broken in the port.

-- 
Jo Rhett
Net Consonance : net philanthropy to improve open source and internet projects.