libdb problem when trying to install on centos5 server

344 views
Skip to first unread message

Harlan Harris

unread,
Mar 14, 2011, 1:04:43 PM3/14/11
to rapache
Hi folks,

I'm trying to configure and install rApache for the first time on a 64-
bit CentOS 5 box, and am having some trouble with the part of the
build process where libapreq2 gets compiled.

gcc -shared .libs/util.o .libs/version.o .libs/cookie.o .libs/
param.o .libs/parser.o .libs/parser_urlencoded.o .libs/
parser_header.o .libs/parser_multipart.o .libs/module.o .libs/
module_custom.o .libs/module_cgi.o .libs/error.o -Wl,--rpath -Wl,/usr/
lib64 -Wl,--rpath -Wl,/usr/lib64 /usr/lib64/libapr-1.so /usr/lib64/
libaprutil-1.so -lldap -llber /usr/lib/libdb-4.3.so /usr/lib/
libexpat.so -lpthread -ldl -Wl,-soname -Wl,libapreq2.so.3 -o .libs/
libapreq2.so.3.1.0
/usr/lib/libdb-4.3.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

This seems to be related to the issues in this thread:
https://groups.google.com/group/rapache/browse_thread/thread/b033a679a9d12ead/6531de5f1179ec9a?lnk=gst&q=libdb#6531de5f1179ec9a

But I don't really see a resolution in that thread. Can anyone help?

Linux version 2.6.18-194.32.1.el5 (mock...@builder10.centos.org)
(gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Wed Jan 5
17:52:25 EST 2011

Name : httpd
Arch : x86_64
Version : 2.2.3
Release : 43.el5.centos.3

Name : httpd-devel
Arch : x86_64
Version : 2.2.3
Release : 43.el5.centos.3

And I'm compiling rapache-1.1.14.

Thanks!

-Harlan

Aleksandar Blagotić

unread,
Mar 14, 2011, 1:45:48 PM3/14/11
to rap...@googlegroups.com
Sure, just provide your ./configure command with all arguments included. Usually, I provide only path to R and Apache apxs, while apreq comes bundled with RApache:

./configure --with-R=/usr/bin/R --with-apache2-apxs=/usr/bin/apxs2

though I'm using 32bit Arch Linux... but it works fine for me...


--
You received this message because you are subscribed to the Google Groups "rapache" group.
To post to this group, send email to rap...@googlegroups.com.
To unsubscribe from this group, send email to rapache+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rapache?hl=en.


Harlan Harris

unread,
Mar 14, 2011, 2:08:50 PM3/14/11
to rapache
Unfortunately that's not the problem. I was already running configure
with the --with-apache2-apxs option, and adding --with-R doesn't help.
The problem is definitely a 64-bit issue. Configure is generating a
hard-coded path of /usr/lib/libdb-4.3.so, which should be /usr/lib64
instead.

Here are those files (resolving symlinks):

/lib/libdb-4.3.so: ELF 32-bit LSB shared object, Intel 80386, version
1 (SYSV), for GNU/Linux 2.4.20, stripped
/lib64/libdb-4.3.so: ELF 64-bit LSB shared object, AMD x86-64, version
1 (SYSV), for GNU/Linux 2.4.20, stripped

-Harlan

On Mar 14, 1:45 pm, Aleksandar Blagotić <aca.blago...@gmail.com>
wrote:
> Sure, just provide your ./configure command with all arguments included.
> Usually, I provide only path to R and Apache apxs, while apreq comes bundled
> with RApache:
>
> ./configure --with-R=/usr/bin/R --with-apache2-apxs=/usr/bin/apxs2
>
> though I'm using 32bit Arch Linux... but it works fine for me...
>
> On Mon, Mar 14, 2011 at 18:04, Harlan Harris <harlan.har...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hi folks,
>
> > I'm trying to configure and install rApache for the first time on a 64-
> > bit CentOS 5 box, and am having some trouble with the part of the
> > build process where libapreq2 gets compiled.
>
> > gcc -shared  .libs/util.o .libs/version.o .libs/cookie.o .libs/
> > param.o .libs/parser.o .libs/parser_urlencoded.o .libs/
> > parser_header.o .libs/parser_multipart.o .libs/module.o .libs/
> > module_custom.o .libs/module_cgi.o .libs/error.o  -Wl,--rpath -Wl,/usr/
> > lib64 -Wl,--rpath -Wl,/usr/lib64 /usr/lib64/libapr-1.so /usr/lib64/
> > libaprutil-1.so -lldap -llber /usr/lib/libdb-4.3.so /usr/lib/
> > libexpat.so -lpthread -ldl  -Wl,-soname -Wl,libapreq2.so.3 -o .libs/
> > libapreq2.so.3.1.0
> > /usr/lib/libdb-4.3.so: could not read symbols: File in wrong format
> > collect2: ld returned 1 exit status
>
> > This seems to be related to the issues in this thread:
>
> >https://groups.google.com/group/rapache/browse_thread/thread/b033a679...
>
> > But I don't really see a resolution in that thread. Can anyone help?
>
> > Linux version 2.6.18-194.32.1.el5 (mockbu...@builder10.centos.org)

Harlan Harris

unread,
Mar 21, 2011, 10:58:25 AM3/21/11
to rapache
Can anyone help? I'm not an expert in C compilation on Linux, and I
don't know that I can figure this out on my own.

Jeff, back in September, you said "I just recently confirmed that
rApache compiles cleanly on a CentOS 64bit dist.". However, that is
not my experience. Perhaps we did things differently?

Thank you!

-Harlan

On Mar 14, 2:08 pm, Harlan Harris <harlan.har...@gmail.com> wrote:
> Unfortunately that's not the problem. I was already running configure
> with the --with-apache2-apxs option, and adding --with-R doesn't help.
> The problem is definitely a 64-bit issue. Configure is generating a
> hard-coded path of /usr/lib/libdb-4.3.so, which should be /usr/lib64
> instead.
>
> Here are those files (resolving symlinks):
>
> /lib/libdb-4.3.so: ELF 32-bit LSB shared object, Intel 80386, version
> 1 (SYSV), for GNU/Linux 2.4.20, stripped
> /lib64/libdb-4.3.so: ELF 64-bit LSB shared object, AMD x86-64, version
> 1 (SYSV), for GNU/Linux 2.4.20, stripped
>
>  -Harlan
>
> On Mar 14, 1:45 pm, Aleksandar Blagotiæ <aca.blago...@gmail.com>

Jeffrey Horner

unread,
Mar 21, 2011, 11:22:20 AM3/21/11
to rap...@googlegroups.com, Harlan Harris
On Mon, Mar 21, 2011 at 9:58 AM, Harlan Harris <harlan...@gmail.com> wrote:
> Can anyone help? I'm not an expert in C compilation on Linux, and I
> don't know that I can figure this out on my own.
>
> Jeff, back in September, you said "I just recently confirmed that
> rApache compiles cleanly on a CentOS 64bit dist.". However, that is
> not my experience. Perhaps we did things differently?

Can you see if CentOS has apreq2 (or libapreq2) package? If so, then
install that and then reconfigure rapache. What's happening is that
rapache is trying to build libapreq2 that comes bundled with it, and
it may be the culprit in misreading the libdb link options.

Once installed, you can either let rapache's configure script find the
apreq2-config program, or you can set it explicitly with the configure
argument --with-apreq2-config=/path/to/apreq2-config.

Jeff

--
http://biostat.mc.vanderbilt.edu/JeffreyHorner

Harlan Harris

unread,
Mar 21, 2011, 11:50:42 AM3/21/11
to Jeffrey Horner, rap...@googlegroups.com
Thanks for the quick response, Jeff!

My install of CentOS did not have libapreq2 installed. I just now did the following to install it:
yum install libapreq2

When I re-run ./configure, I still get:
checking for apreq2-config... no

I've confirmed that installing the library does not install anything that looks like apreq2-config:
$ repoquery --list libapreq2
/etc/httpd/conf.d/apreq.conf
/usr/lib64/httpd/modules/mod_apreq2.so
/usr/lib64/libapreq2.so.3
/usr/lib64/libapreq2.so.3.6.1
/usr/share/doc/libapreq2-2.09
/usr/share/doc/libapreq2-2.09/CHANGES
/usr/share/doc/libapreq2-2.09/LICENSE
/usr/share/doc/libapreq2-2.09/NOTICE
/usr/share/doc/libapreq2-2.09/README
/etc/httpd/conf.d/apreq.conf
/usr/lib/httpd/modules/mod_apreq2.so
/usr/lib/libapreq2.so.3
/usr/lib/libapreq2.so.3.6.1
/usr/share/doc/libapreq2-2.09
/usr/share/doc/libapreq2-2.09/CHANGES
/usr/share/doc/libapreq2-2.09/LICENSE
/usr/share/doc/libapreq2-2.09/NOTICE
/usr/share/doc/libapreq2-2.09/README

(two copies of some things because both the 32-bit and 64-bit version of the package show up...)

Running ./configure with no additional options does not work. It doesn't detect the system libapreq2, tries to rebuilt it, and fails.

I got a little farther with this:
./configure --with-apache2-apxs=/usr/sbin/apxs --with-apreq2-config=./libapreq2/apreq2-config

Configure now detects the apreq2-config script, and make doesn't try to build the library. But...

$ make

Configuring libapreq2

touch .apreq-config

Compiling mod_R

/usr/sbin/apxs -I/usr/include/R -I/home/harlan/rapache-1.1.14/libapreq2/include  -I/usr/include/apr-1  -c mod_R.c -Wl,-rpath,/usr/lib64/R/lib -L/usr/lib64/R/lib -lR -L/home/harlan/rapache-1.1.14/libapreq2/library/.libs -lapreq2
/usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1  -I/usr/include/R -I/home/harlan/rapache-1.1.14/libapreq2/include -I/usr/include/apr-1  -c -o mod_R.lo mod_R.c && touch mod_R.slo
mod_R.c: In function 'AP_hook_request_handler':
mod_R.c:533: warning: 'ret' may be used uninitialized in this function
mod_R.c: In function 'RApache_setCookie':
mod_R.c:1696: warning: 'tmpExpires' may be used uninitialized in this function
/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o mod_R.la  -rpath /usr/lib64/httpd/modules -module -avoid-version    mod_R.lo -Wl,-rpath,/usr/lib64/R/lib -L/usr/lib64/R/lib -lR -L/home/harlan/rapache-1.1.14/libapreq2/library/.libs -lapreq2
/usr/bin/ld: cannot find -lapreq2

collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: *** [mod_R.so] Error 1


That's odd. The libraries are in the usual spots:

$ ls -l /usr/lib/libapreq2*
lrwxrwxrwx 1 root root    18 Mar 21 11:31 /usr/lib/libapreq2.so.3 -> libapreq2.so.3.6.1
-rwxr-xr-x 1 root root 49768 Jun 17  2008 /usr/lib/libapreq2.so.3.6.1
$ ls -l /usr/lib64/libapreq2*
lrwxrwxrwx 1 root root    18 Mar 21 11:31 /usr/lib64/libapreq2.so.3 -> libapreq2.so.3.6.1
-rwxr-xr-x 1 root root 53072 Jun 17  2008 /usr/lib64/libapreq2.so.3.6.1

Why can't it find them?

 -Harlan

Harlan Harris

unread,
Mar 22, 2011, 11:47:01 AM3/22/11
to Jeffrey Horner, rap...@googlegroups.com
As this list has limited readership, and Jeff, I'm sure you're very busy, I'm going to post this to R-Help too to see if I can get some additional eyes on it... Will report back what I learn.

 -Harlan

Laura Perovich

unread,
Mar 22, 2011, 2:16:57 PM3/22/11
to rap...@googlegroups.com
I think I ran into some similar issues installing on a CentOS 5 server that Jeff helped out with.  See this thread:
http://groups.google.com/group/rapache/browse_thread/thread/f038211213315a29#

I did modify his suggestion some to get things to work.  Here some additional notes I made at the time about the installation process:
#Notice: itest is failing because it's not finding mod_log_config.so
#path to it is: /usr/lib/httpd/modules/mod_log_config.so
#This needs to be added to the test config file, referenced in the same way it's referenced in the apache config file
#Look at the apache config file: /etc/httpd/conf/httpd.conf
#in this, there is a line:
LoadModule log_config_module  modules/mod_log_config.so
#Make sure this is carried into the test config file at /root/rapache-1.1.9/test/httpd.conf
/usr/sbin/apachectl configtestLoadModule log_config_module ../../../usr/lib/httpd/modules/mod_log_config.so


Unfortunately, my knowledge of this is fairly limited and my memory of the process is pretty fuzzy, but hopefully something in the thread or my notes will help you figure out what's going on.  On the bright side, I did eventually get everything working!

Harlan Harris

unread,
Mar 22, 2011, 5:12:25 PM3/22/11
to Jeffrey Horner, rap...@googlegroups.com
Yay, with Jeff's help, looks like I'm good to go!

I used yum to install both the libapreq2 and libapreq2-devel packages, then rebuilt and installed per the normal process. Note that to configure the server in RHEL/CentOS, all that's seemingly necessary is to put the following in a new file called /etc/httpd/conf.d/r.conf

LoadModule R_module modules/mod_R.so
<Location /RApacheInfo>
SetHandler r-info
</Location>

Then do /etc/init.d/httpd restart.

 -Harlan

On Mon, Mar 21, 2011 at 11:22 AM, Jeffrey Horner <jeffrey...@vanderbilt.edu> wrote:
Reply all
Reply to author
Forward
0 new messages