How to compile apr1 with bdb 1.85 support?

Jo Rhett jrhett at netconsonance.com
Fri Jul 29 02:19:20 UTC 2011


Does anyone know how to compile devel/apr1 with support for Berkeley DB 1.85 from the OS distribution?

On Jul 27, 2011, at 1:50 AM, Jo Rhett wrote:
> Okay, by compiling apr with BDB support (db48 since that's what I have installed) I got that .so file to exist, but apr can't read the file.  It would appear that the root of this problem is that I can compile apache with db185 support, but there's no way I have found to compile apr with support for db185?
> 
> 54579 initial thread NAMI  "/path/to/passwd.dat"
> 54579 initial thread STRU  struct stat {dev=94, ino=14790906, mode=-rw-r----- , nlink=1, uid=1001, gid=80, rdev=59123456, atime=1311756287, stime=117346
> 0427, ctime=1173460427, birthtime=1173460427, size=16384, blksize=16384, blocks=32, flags=0x0 }
> 54579 initial thread RET   stat 0
> 54579 initial thread CALL  open(0x884b1100,O_RDONLY,<unused>0)
> 54579 initial thread NAMI  "/path/to/passwd.dat"
> 54579 initial thread RET   open 13/0xd
> 54579 initial thread CALL  fcntl(0xd,F_GETFD,0)
> 54579 initial thread RET   fcntl 0
> 54579 initial thread CALL  fcntl(0xd,F_SETFD,FD_CLOEXEC)
> 54579 initial thread RET   fcntl 0
> 54579 initial thread CALL  read(0xd,0xbfbfe484,0x200)
> 54579 initial thread GIO   fd 13 read 512 bytes
> 54579 initial thread RET   read 512/0x200
> 54579 initial thread CALL  write(0x2,0xbfbfda50,0x5b)
> 54579 initial thread GIO   fd 2 wrote 91 bytes
>       "__db_meta_setup: /path/to/passwd.dat: unexpected file type or format"
> 54579 initial thread RET   write 91/0x5b
> 54579 initial thread CALL  write(0x2,0x883847f3,0x1)
> 54579 initial thread GIO   fd 2 wrote 1 byte
> 54579 initial thread RET   write 1
> 54579 initial thread CALL  close(0xd)
> 54579 initial thread RET   close 0
> 54579 initial thread CALL  gettimeofday(0xbfbfa7c4,0)
> 54579 initial thread RET   gettimeofday 0
> 54579 initial thread CALL  write(0x6,0xbfbfc81c,0xbe)
> 54579 initial thread GIO   fd 6 wrote 190 bytes
>       "[Wed Jul 27 01:44:49 2011] [error] [client 99.124.207.89] (120022)APR does not understand this error code: could not open dbm (type DB) auth file: /path/to/passwd.dat
>       "
> 
> On Jul 27, 2011, at 1:31 AM, Jo Rhett wrote:
> 
>> More interesting.  I explicitly set AuthDBMType to DB and that problem disappeared, but the error remained.  Looking at kdump this seems to be the problem:
>> 
>> 3928 httpd    NAMI  "/usr/local/lib/apr-util-1/apr_dbm_db-1.so"
>>      "[Wed Jul 27 01:06:25 2011] [error] [client 99.124.207.89] (20019)DSO load failed: could not open dbm (type DB) auth file: /path/to/passwd.dat
>> 
>> # ls -la /usr/local/lib/apr*
>> -rw-r--r--  1 root  wheel  7164 Jul 26 02:36 /usr/local/lib/apr.exp
>> -rw-r--r--  1 root  wheel  4412 Jul 26 02:36 /usr/local/lib/aprutil.exp
>> 
>> This doesn't seem to be a problem of reading the file so much as trying to load a DS0 that doesn't exist?
>> 
>> I've rebuilt apr1 a few times now, and those files simply aren't installed.
>> 
>> On Jul 27, 2011, at 12:31 AM, Jo Rhett wrote:
>>> On Jul 26, 2011, at 3:09 PM, Philip M. Gollucci wrote:
>>>> run httpd -X
>>>> and then use ktrace -i / kdump
>>>> then grep for NAMI and the name of your file
>>> 
>>> Okay, well this makes sense at least - it's looking for a .dir file which of course doesn't exist.  What I don't understand here is that I don't have gdbm or sdbm enabled. In fact, I don't even have them compiled on the platform.
>>> 
>>> # kdump |grep /passwd
>>> 724 httpd    NAMI  "/path/to/passwd.dat.dir"
>>> 
>>> And more to the point, I explicitly told apache not to use anything except BDB 185.  You can see this in the configure line built by the port:
>>> 
>>> $ head -10 /usr/ports/www/apache22/work/httpd-2.2.19/config.log
>>> This file contains any messages produced by compilers while
>>> running configure, to aid debugging if configure makes a mistake.
>>> 
>>> It was created by configure, which was
>>> generated by GNU Autoconf 2.68.  Invocation command line was
>>> 
>>> $ ./configure --prefix=/usr/local --enable-layout=FreeBSD --with-perl=/usr/local/bin/perl5.14.1 --with-port=80 --with-expat=/usr/local --with-iconv=/usr/local --enable-http --with-pcre=/usr/local --with-apr=/usr/local/bin/apr-1-config --with-apr-util=/usr/local/bin/apu-1-config --disable-authn-file --disable-authn-default --disable-authz-host --disable-authz-groupfile --disable-authz-user --disable-authz-default --disable-auth-basic --disable-charset-lite --disable-include --disable-log-config --disable-env --disable-setenvif --disable-mime --disable-status --disable-autoindex --disable-asis --disable-cgid --disable-cgi --disable-negotiation --disable-dir --disable-imagemap --disable-actions --disable-userdir --disable-alias --disable-filter --disable-substitute --disable-proxy --disable-proxy-connect --disable-proxy-ftp --disable-proxy-http --disable-proxy-ajp --disable-proxy-balancer --disable-proxy-scgi --disable-reqtimeout --enable-so --enable-mods-shared=auth_basic auth_digest authn_file authn_dbm authn_anon authn_default authn_alias authz_host authz_groupfile authz_user authz_dbm authz_owner authz_default cache disk_cache file_cache dav dav_fs actions alias asis autoindex cern_meta cgi charset_lite deflate dir dumpio env expires headers imagemap include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias filter version reqtimeout ssl --with-dbm=db185 --with-berkeley-db=/usr --with-ssl=/usr --enable-v4-mapped --with-devrandom --with-mpm=prefork --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=i386-portbld-freebsd8.2
>>> 
>>> 
>>>> On 07/26/11 09:35, Jo Rhett wrote:
>>>>> I have a 6.3 system which I just upgraded to 8.2, and obviously recompiled all ports from scratch. I cleared out the ports DB entirely, cleared out /usr/local entirely except for etc/config files.  Every other port on the system recompiled fine, except for apache.  It works for everything except reading authentication files. I'd deeply appreciate any assistance you can give to solving this.
>>>>> 
>>>>> For some reason I can't figure out, BDB authentication using the built-in db 1.85 no longer works.
>>>>> 
>>>>> 	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
>>>>> 	
>>>>> apr1$ make showconfig
>>>>> ===> The following configuration options are available for apr-ipv6-devrandom-db48-1.4.5.1.3.12:
>>>>>  THREADS=on "Enable Threads in apr"
>>>>>  IPV6=on "Enable IPV6 Support in apr"
>>>>>  BDB=off "Enable Berkley BDB support in apr-util"
>>>>>  GDBM=off "Enable GNU dbm support in apr-util"
>>>>>  LDAP=off "Enable LDAP support in apr-util"
>>>>>  MYSQL=off "Enable MySQL suport in apr-util"
>>>>>  NDBM=off "Enable NDBM support in apr-util"
>>>>>  PGSQL=off "Enable Postgresql suport in apr-util"
>>>>>  SQLITE=off "Enable SQLite3 support in apr-util"
>>>>>  DEVRANDOM=on "Use /dev/random or compatible in apr"
>>>>> ===> Use 'make config' to modify these settings
>>>>> 
>>>>> apache22$ make showconfig
>>>>> ===> The following configuration options are available for apache-2.2.19:
>>>>>  THREADS=off "Enable threads support in APR"
>>>>>  MYSQL=off "Enable MySQL support for apr-dbd"
>>>>>  PGSQL=off "Enable PostgreSQL support for apr-dbd"
>>>>>  SQLITE=off "Enable SQLite support for apr-dbd"
>>>>>  IPV6=on "Enable IPv6 support"
>>>>>  BDB=on "Enable BerkeleyDB dbm"
>>>>>  AUTH_BASIC=on "Enable mod_auth_basic"
>>>>>  AUTH_DIGEST=on "Enable mod_auth_digest"
>>>>>  AUTHN_FILE=on "Enable mod_authn_file"
>>>>>  AUTHN_DBD=off "Enable mod_authn_dbd"
>>>>>  AUTHN_DBM=on "Enable mod_authn_dbm"
>>>>>  AUTHN_ANON=on "Enable mod_authn_anon"
>>>>>  AUTHN_DEFAULT=on "Enable mod_authn_default"
>>>>>  AUTHN_ALIAS=on "Enable mod_authn_alias"
>>>>>  AUTHZ_HOST=on "Enable mod_authz_host"
>>>>>  AUTHZ_GROUPFILE=on "Enable mod_authz_groupfile"
>>>>>  AUTHZ_USER=on "Enable mod_authz_user"
>>>>>  AUTHZ_DBM=on "Enable mod_authz_dbm"
>>>>>  AUTHZ_OWNER=on "Enable mod_authz_owner"
>>>>>  AUTHZ_DEFAULT=on "Enable mod_authz_default"
>>>>>  CACHE=on "Enable mod_cache"
>>>>>  DISK_CACHE=on "Enable mod_disk_cache"
>>>>>  FILE_CACHE=on "Enable mod_file_cache"
>>>>>  MEM_CACHE=off "Enable mod_mem_cache"
>>>>>  DAV=on "Enable mod_dav"
>>>>>  DAV_FS=on "Enable mod_dav_fs"
>>>>>  BUCKETEER=off "Enable mod_bucketeer"
>>>>>  CASE_FILTER=off "Enable mod_case_filter"
>>>>>  CASE_FILTER_IN=off "Enable mod_case_filter_in"
>>>>>  EXT_FILTER=off "Enable mod_ext_filter"
>>>>>  LOG_FORENSIC=off "Enable mod_log_forensic"
>>>>>  OPTIONAL_HOOK_EXPORT=off "Enable mod_optional_hook_export"
>>>>>  OPTIONAL_HOOK_IMPORT=off "Enable mod_optional_hook_import"
>>>>>  OPTIONAL_FN_IMPORT=off "Enable mod_optional_fn_import"
>>>>>  OPTIONAL_FN_EXPORT=off "Enable mod_optional_fn_export"
>>>>>  LDAP=off "Enable mod_ldap"
>>>>>  AUTHNZ_LDAP=off "Enable mod_authnz_ldap"
>>>>>  ACTIONS=on "Enable mod_actions"
>>>>>  ALIAS=on "Enable mod_alias"
>>>>>  ASIS=on "Enable mod_asis"
>>>>>  AUTOINDEX=on "Enable mod_autoindex"
>>>>>  CERN_META=on "Enable mod_cern_meta"
>>>>>  CGI=on "Enable mod_cgi"
>>>>>  CHARSET_LITE=on "Enable mod_charset_lite"
>>>>>  DBD=off "Enable mod_dbd"
>>>>>  DEFLATE=on "Enable mod_deflate"
>>>>>  DIR=on "Enable mod_dir"
>>>>>  DUMPIO=on "Enable mod_dumpio"
>>>>>  ENV=on "Enable mod_env"
>>>>>  EXPIRES=on "Enable mod_expires"
>>>>>  HEADERS=on "Enable mod_headers"
>>>>>  IMAGEMAP=on "Enable mod_imagemap"
>>>>>  INCLUDE=on "Enable mod_include"
>>>>>  INFO=on "Enable mod_info"
>>>>>  LOG_CONFIG=on "Enable mod_log_config"
>>>>>  LOGIO=on "Enable mod_logio"
>>>>>  MIME=on "Enable mod_mime"
>>>>>  MIME_MAGIC=on "Enable mod_mime_magic"
>>>>>  NEGOTIATION=on "Enable mod_negotiation"
>>>>>  REWRITE=on "Enable mod_rewrite"
>>>>>  SETENVIF=on "Enable mod_setenvif"
>>>>>  SPELING=on "Enable mod_speling"
>>>>>  STATUS=on "Enable mod_status"
>>>>>  UNIQUE_ID=on "Enable mod_unique_id"
>>>>>  USERDIR=on "Enable mod_userdir"
>>>>>  USERTRACK=on "Enable mod_usertrack"
>>>>>  VHOST_ALIAS=on "Enable mod_vhost_alias"
>>>>>  FILTER=on "Enable mod_filter"
>>>>>  SUBSTITUTE=off "Enable mod_substitute"
>>>>>  VERSION=on "Enable mod_version"
>>>>>  PROXY=off "Enable mod_proxy"
>>>>>  PROXY_CONNECT=off "Enable mod_proxy_connect"
>>>>>  PATCH_PROXY_CONNECT=off "Patch proxy_connect SSL support"
>>>>>  PROXY_FTP=off "Enable mod_proxy_ftp"
>>>>>  PROXY_HTTP=off "Enable mod_proxy_http"
>>>>>  PROXY_AJP=off "Enable mod_proxy_ajp"
>>>>>  PROXY_BALANCER=off "Enable mod_proxy_balancer"
>>>>>  PROXY_SCGI=off "Enable mod_proxy_scgi"
>>>>>  SSL=on "Enable mod_ssl"
>>>>>  SUEXEC=off "Enable mod_suexec"
>>>>>  SUEXEC_RSRCLIMIT=off "SuEXEC rlimits based on login class"
>>>>>  REQTIMEOUT=on "Enable mod_reqtimeout"
>>>>>  CGID=off "Enable mod_cgid"
>>>>> ===> Use 'make config' to modify these settings
>>>>> 
>>>>> 
>>>>> As said above, I appreciate any assistance you can give.
>>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> ------------------------------------------------------------------------
>>>> 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
>>>> Philip M. Gollucci (pgollucci at p6m7g8.com) c: 703.336.9354
>>>> VP Infrastructure,                Apache Software Foundation
>>>> Committer,                        FreeBSD Foundation
>>>> Consultant,                       P6M7G8 Inc.
>>>> Sr. System Admin,                 Ridecharge Inc.
>>>> 
>>>> Work like you don't need the money,
>>>> love like you'll never get hurt,
>>>> and dance like nobody's watching.
>>> 
>>> -- 
>>> Jo Rhett
>>> Net Consonance : consonant endings by net philanthropy, open source and other randomness
>>> 
>> 
>> -- 
>> Jo Rhett
>> Net Consonance : consonant endings by net philanthropy, open source and other randomness
>> 
>> _______________________________________________
>> freebsd-apache at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-apache
>> To unsubscribe, send any mail to "freebsd-apache-unsubscribe at freebsd.org"
> 
> -- 
> Jo Rhett
> Net Consonance : consonant endings by net philanthropy, open source and other randomness
> 

-- 
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness



More information about the freebsd-apache mailing list