mod_security installation problem

seoguru

Verified User
Joined
Jul 30, 2011
Messages
21
Hi guys,

I am trying to 'make' mod_security on server with DA but keep getting this error:

/usr/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
make[2]: *** [mod_security2.la] Error 1
make[2]: Leaving directory `/root/modsecurity-apache_2.6.1/apache2'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/modsecurity-apache_2.6.1/apache2'
make: *** [all-recursive] Error 1

Actually I never heard about "-lexpat" so it something new to me. Short search in google doesn't make expected results. Advice would be appreciated. Thanks
 
lexpat should be read as -l expat ;)

Install expat, if you using centos do yum install expat.

If you are using debian/ubuntu search for it apt-cache search expat.

Regards
 
Install the expat devel libs expat-devel or expat-dev via yum
 
Code:
 yum install expat-devel
solves above problem.

I got another one trying to latest modsecurity-apache_2.6.3:

Code:
make test

Code:
/root/modsecurity-apache_2.6.3/tests/../apache2/re_operators.c:423: undefined reference to `ap_regexec'
/root/modsecurity-apache_2.6.3/tests/../apache2/re_operators.c:437: undefined reference to `ap_regexec'
/root/modsecurity-apache_2.6.3/tests/../apache2/re_operators.c:389: undefined reference to `ap_pregcomp'
msc_test-re_operators.o: In function `msre_op_rsub_param_init':
/root/modsecurity-apache_2.6.3/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/modsecurity-apache_2.6.3/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/root/modsecurity-apache_2.6.3/tests'
make: *** [check-recursive] Error 1

Also
Code:
make CFLAGS=-DMSC_TEST test
doesnt work. I got the same problem on 2 servers (centos 5.7 64bit, apache 2.2).
 
Why do you have to run make test? Just run make and make install
 
Ok now I found solution . The ./configure is now in the base directory instead of within apache2.

Once you do the ./configure in the base directory you can then navigate into the apache2 directory and do a make, and make install.
 
Back
Top