CentOS 6 x64 mod_security

nservices

Verified User
Joined
Dec 11, 2008
Messages
301
Hi,
I try to install mod_security on
CentOS 6.3 x64
PHP 5.4.6
apache 2.4.3

and I got this error: collect2: ld returned 1 exit status

any suggestions?

Best Regards,
Star Network.
 
Hello,

What exact commands you typing there, and what are the last 10-20 lines of the output with error?
 
Here is the lines:
gcc -DHAVE_CONFIG_H -I. -I../apache2 -I../apache2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -MT msc_test-msc_reqbody.o -MD -MP -MF .deps/msc_test-msc_reqbody.Tpo -c -o msc_test-msc_reqbody.o `test -f '../apache2/msc_reqbody.c' || echo './'`../apache2/msc_reqbody.c
mv -f .deps/msc_test-msc_reqbody.Tpo .deps/msc_test-msc_reqbody.Po
gcc -DHAVE_CONFIG_H -I. -I../apache2 -I../apache2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -MT msc_test-msc_geo.o -MD -MP -MF .deps/msc_test-msc_geo.Tpo -c -o msc_test-msc_geo.o `test -f '../apache2/msc_geo.c' || echo './'`../apache2/msc_geo.c
mv -f .deps/msc_test-msc_geo.Tpo .deps/msc_test-msc_geo.Po
gcc -DHAVE_CONFIG_H -I. -I../apache2 -I../apache2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -MT msc_test-msc_gsb.o -MD -MP -MF .deps/msc_test-msc_gsb.Tpo -c -o msc_test-msc_gsb.o `test -f '../apache2/msc_gsb.c' || echo './'`../apache2/msc_gsb.c
mv -f .deps/msc_test-msc_gsb.Tpo .deps/msc_test-msc_gsb.Po
gcc -DHAVE_CONFIG_H -I. -I../apache2 -I../apache2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -MT msc_test-acmp.o -MD -MP -MF .deps/msc_test-acmp.Tpo -c -o msc_test-acmp.o `test -f '../apache2/acmp.c' || echo './'`../apache2/acmp.c
mv -f .deps/msc_test-acmp.Tpo .deps/msc_test-acmp.Po
gcc -DHAVE_CONFIG_H -I. -I../apache2 -I../apache2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -MT msc_test-msc_lua.o -MD -MP -MF .deps/msc_test-msc_lua.Tpo -c -o msc_test-msc_lua.o `test -f '../apache2/msc_lua.c' || echo './'`../apache2/msc_lua.c
mv -f .deps/msc_test-msc_lua.Tpo .deps/msc_test-msc_lua.Po
gcc -DHAVE_CONFIG_H -I. -I../apache2 -I../apache2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -MT msc_test-msc_release.o -MD -MP -MF .deps/msc_test-msc_release.Tpo -c -o msc_test-msc_release.o `test -f '../apache2/msc_release.c' || echo './'`../apache2/msc_release.c
mv -f .deps/msc_test-msc_release.Tpo .deps/msc_test-msc_release.Po
/bin/sh ../libtool --tag=CC --mode=link gcc -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -lrt -lcrypt -lpthread -lexpat -o msc_test msc_test-msc_test.o msc_test-re.o msc_test-re_operators.o msc_test-re_actions.o msc_test-re_tfns.o msc_test-re_variables.o msc_test-msc_logging.o msc_test-msc_xml.o msc_test-msc_multipart.o msc_test-modsecurity.o msc_test-msc_parsers.o msc_test-msc_util.o msc_test-msc_pcre.o msc_test-msc_unicode.o msc_test-persist_dbm.o msc_test-msc_reqbody.o msc_test-msc_geo.o msc_test-msc_gsb.o msc_test-acmp.o msc_test-msc_lua.o msc_test-msc_release.o /etc/httpd/lib/libapr-1.la /etc/httpd/lib/libaprutil-1.la -L/usr/local/lib -lpcre -L/usr/local/lib -lxml2 -L/usr/local/lib -lz -liconv -lm
libtool: link: gcc -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/usr/local/include -I/usr/local/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -g -O2 -o msc_test msc_test-msc_test.o msc_test-re.o msc_test-re_operators.o msc_test-re_actions.o msc_test-re_tfns.o msc_test-re_variables.o msc_test-msc_logging.o msc_test-msc_xml.o msc_test-msc_multipart.o msc_test-modsecurity.o msc_test-msc_parsers.o msc_test-msc_util.o msc_test-msc_pcre.o msc_test-msc_unicode.o msc_test-persist_dbm.o msc_test-msc_reqbody.o msc_test-msc_geo.o msc_test-msc_gsb.o msc_test-acmp.o msc_test-msc_lua.o msc_test-msc_release.o -lrt -lcrypt -lpthread -lexpat /etc/httpd/lib/libapr-1.so /etc/httpd/lib/libaprutil-1.so -L/usr/local/lib /usr/local/lib/libpcre.so /usr/local/lib/libxml2.so -lz /usr/local/lib/libiconv.so -lm -Wl,-rpath -Wl,/etc/httpd/lib -Wl,-rpath -Wl,/etc/httpd/lib
/usr/bin/ld: warning: libexpat.so.0, needed by /etc/httpd/lib/libaprutil-1.so, may conflict with libexpat.so.1
msc_test-re_operators.o: In function `msre_op_rsub_execute':
/root/installations/modsec/modsecurity-apache_2.6.7/tests/../apache2/re_operators.c:423: undefined reference to `ap_regexec'
/root/installations/modsec/modsecurity-apache_2.6.7/tests/../apache2/re_operators.c:437: undefined reference to `ap_regexec'
/root/installations/modsec/modsecurity-apache_2.6.7/tests/../apache2/re_operators.c:389: undefined reference to `ap_pregcomp'
/root/installations/modsec/modsecurity-apache_2.6.7/tests/../apache2/re_operators.c:383: undefined reference to `ap_pregcomp'
msc_test-re_operators.o: In function `msre_op_rsub_param_init':
/root/installations/modsec/modsecurity-apache_2.6.7/tests/../apache2/re_operators.c:316: undefined reference to `ap_pregcomp'
collect2: ld returned 1 exit status
make[2]: *** [msc_test] Error 1
make[2]: Leaving directory `/root/installations/modsec/modsecurity-apache_2.6.7/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/root/installations/modsec/modsecurity-apache_2.6.7/tests'
 
Last edited:
OK, the first version of your reply was saying about missing libexpat, I guess you've installed the missing lib, but you've got there:

/usr/bin/ld: warning: libexpat.so.0, needed by /etc/httpd/lib/libaprutil-1.so, may conflict with libexpat.so.1

Note, you did not specified commands you are typing there. What are they? And what Apache version is installed?
 
Hi,
yes, this is after libexpat :)
apache 2.2, php 5.3 (clean VPS over Centos 6.3 on openvz with Directadmin)
commands:
wget modsecurity-apache_2.6.7.tar.gz
tar -zvxf modsecurity-apache_2.6.7.tar.gz
cd modsecurity-apache_2.6.7
./configure
make
make test
make install

I got the error on make test.

Best Regards,
Star Network.
 
Code:
 ld returned 1 exit status

In most cases it would mean that you're missing a library, but I can't say which exactly.So you might need to check config log in the source directory, and/or run strace.

But, what if you skip running test, does make && make install complete successfully?
 
There is no reason to run make test... You only need to run make and make install
 
same error install mod_seciruty on apache 2.4.x

Hi,
yes, this is after libexpat :)
apache 2.2, php 5.3 (clean VPS over Centos 6.3 on openvz with Directadmin)
commands:
wget modsecurity-apache_2.6.7.tar.gz
tar -zvxf modsecurity-apache_2.6.7.tar.gz
cd modsecurity-apache_2.6.7
./configure
make
make test
make install

I got the error on make test.

Best Regards,
Star Network.

Same error tools, How to fix this error?
 
Back
Top