Compiling mod_security in CentOs 6.5 - apr_crypto.h: No such file or directory
Brought to you by:
victorhora,
zimmerletw
Hello,
I am trying to compile mod_security with Nginx in CentOS 6.5 env. Can some please help how to solve problem with missing "apr_crypto.h". In configure part there is a warning: "WARNING: APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto'"
Thank you in advance.
Steps:
OS: CentOS release 6.5 (Final) 2.6.32-431.29.2.el6.x86_64
Pre-requirements:
yum install gcc make automake autoconf libtool
yum install pcre pcre-devel libxml2 libxml2-devel curl curl-devel httpd-devel
yum list installed | grep apr-devel
apr-devel.x86_64 1.3.9-5.el6_2 @base
Download:
git clone https://github.com/SpiderLabs/ModSecurity.git mod_security
cd mod_security
./autogen.sh
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR,
build'. libtoolize: copying file
build/ltmain.sh'libtoolize: putting macros in AC_CONFIG_MACRO_DIR,
build'. libtoolize: copying file
build/libtool.m4'libtoolize: copying file
build/ltoptions.m4' libtoolize: copying file
build/ltsugar.m4'libtoolize: copying file
build/ltversion.m4' libtoolize: copying file
build/lt~obsolete.m4'configure.ac:21: installing
build/config.guess' configure.ac:21: installing
build/config.sub'configure.ac:17: installing
build/install-sh' configure.ac:17: installing
build/missing'alp2/Makefile.am: installing `build/depcomp'
./configure --enable-standalone-module
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gawk... (cached) gawk
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for perl... /usr/bin/perl
checking for env... /bin/env
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for C/C++ restrict keyword... __restrict
checking for pid_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking for atexit... yes
checking for getcwd... yes
checking for memmove... yes
checking for memset... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strrchr... yes
checking for strstr... yes
checking for strtol... yes
checking for fchmod... yes
checking for strcasestr... yes
checking host system type... (cached) x86_64-unknown-linux-gnu
Checking platform... Identified as Linux
checking for libcurl config script... /usr/bin/curl-config
./configure: line 14382: test: : integer expression expected
./configure: line 14385: test: : integer expression expected
./configure: line 14388: test: : integer expression expected
checking if libcurl is at least v... yes, 7.19.7
checking if libcurl is linked with gnutls... no
configure: using curl v7.19.7
configure: looking for Apache module support via DSO through APXS
configure: found apxs at /usr/sbin/apxs
configure: checking httpd version
configure: httpd is recent enough
checking for libpcre config script... /usr/bin/pcre-config
configure: using pcre v7.8
checking for libapr config script... /usr/bin/apr-1-config
configure: using apr v1.3.9
checking for libapu config script... /usr/bin/apu-1-config
configure: using apu v1.3.9
checking for libxml2 config script... /usr/bin/xml2-config
checking if libxml2 is at least v2.6.29... yes, 2.7.6
configure: using libxml2 v2.7.6
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for liblua config script... no
checking for lua install... no
configure: optional lua library not found
checking for libyajl config script... no
checking for yajl install... no
configure: optional yajl library not found
checking for ssdeep path... no
configure: optional ssdeep library not found
configure: WARNING: APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto'
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tools/Makefile
config.status: creating apache2/Makefile
config.status: creating standalone/Makefile
config.status: creating nginx/modsecurity/config
config.status: creating build/apxs-wrapper
config.status: creating mlogc/mlogc-batch-load.pl
config.status: creating tests/regression/misc/40-secRemoteRules.t
config.status: creating tests/regression/misc/50-ipmatchfromfile-external.t
config.status: creating tests/regression/misc/60-pmfromfile-external.t
config.status: creating tests/run-unit-tests.pl
config.status: creating tests/run-regression-tests.pl
config.status: creating tests/gen_rx-pm.pl
config.status: creating tests/csv_rx-pm.pl
config.status: creating tests/regression/server_root/conf/httpd.conf
config.status: creating tools/rules-updater.pl
config.status: creating mlogc/Makefile
config.status: creating tests/Makefile
config.status: creating apache2/modsecurity_config_auto.h
config.status: executing depfiles commands
config.status: executing libtool commands
make
Making all in tools
make[1]: Entering directory
/home/xxxx/nginx/mod_security/tools' make[1]: Nothing to be done for
all'.make[1]: Leaving directory
/home/xxxx/nginx/mod_security/tools' Making all in apache2 make[1]: Entering directory
/home/xxxx/nginx/mod_security/apache2'make all-am
make[2]: Entering directory
/home/xxxx/nginx/mod_security/apache2' /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include/httpd -DWITH_CURL -I/usr/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -DREQUEST_EARLY -DWITH_REMOTE_RULES -g -O2 -I/usr/include/apr-1 -MT mod_security2_la-acmp.lo -MD -MP -MF .deps/mod_security2_la-acmp.Tpo -c -o mod_security2_la-acmp.lo
test -f 'acmp.c' || echo './'`acmp.clibtool: compile: gcc -DHAVE_CONFIG_H -I. -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include/httpd -DWITH_CURL -I/usr/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -DREQUEST_EARLY -DWITH_REMOTE_RULES -g -O2 -I/usr/include/apr-1 -MT mod_security2_la-acmp.lo -MD -MP -MF .deps/mod_security2_la-acmp.Tpo -c acmp.c -fPIC -DPIC -o .libs/mod_security2_la-acmp.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include/httpd -DWITH_CURL -I/usr/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -DREQUEST_EARLY -DWITH_REMOTE_RULES -g -O2 -I/usr/include/apr-1 -MT mod_security2_la-acmp.lo -MD -MP -MF .deps/mod_security2_la-acmp.Tpo -c acmp.c -o mod_security2_la-acmp.o >/dev/null 2>&1
mv -f .deps/mod_security2_la-acmp.Tpo .deps/mod_security2_la-acmp.Plo
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include/httpd -DWITH_CURL -I/usr/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -DREQUEST_EARLY -DWITH_REMOTE_RULES -g -O2 -I/usr/include/apr-1 -MT mod_security2_la-apache2_config.lo -MD -MP -MF .deps/mod_security2_la-apache2_config.Tpo -c -o mod_security2_la-apache2_config.lo
test -f 'apache2_config.c' || echo './'
apache2_config.clibtool: compile: gcc -DHAVE_CONFIG_H -I. -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include/httpd -DWITH_CURL -I/usr/include/libxml2 -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -DREQUEST_EARLY -DWITH_REMOTE_RULES -g -O2 -I/usr/include/apr-1 -MT mod_security2_la-apache2_config.lo -MD -MP -MF .deps/mod_security2_la-apache2_config.Tpo -c apache2_config.c -fPIC -DPIC -o .libs/mod_security2_la-apache2_config.o
In file included from apache2_config.c:17:
modsecurity.h:55:24: error: apr_crypto.h: No such file or directory
make[2]: [mod_security2_la-apache2_config.lo] Error 1
make[2]: Leaving directory
/home/xxxx/nginx/mod_security/apache2' make[1]: *** [all] Error 2 make[1]: Leaving directory
/home/xxxx/nginx/mod_security/apache2'make: [all-recursive] Error 1
Last edit: fin358ile 2015-01-05
There is an ommission in the configure.ac file. The patch below should allow you to compile fine. After you update the configure.ac file, run the autogen.sh script before executing ./configure
Last edit: Marecandja 2015-04-15
Hi,
rhel6 apr-devel was not compiled with crypto support apr_crypto.
Quickly
I use mod_secure and download from GITLAB (6.2.2015)
https://github.com/SpiderLabs/ModSecurity
and press button "DOWNLOAD ZIP"
Untar,unzip ModSecurity-master.zip
2.
./autogen.sh
./configure --enable-standalone-module
vi apache2/modsecurity.h
line 55
#include "apr_crypto.h"
change and comment
//#include "apr_crypto.h"
vi apache2/msc_remote_rules.c
line 27 comment //#include "apr_crypto.h"
and
make
make is OK...
Last edit: Martin Jína 2015-02-06
Hello,
I also see this error message. It continues to compile ok (modsecurity-2.9.0), but I do receive -
"configure: WARNING: APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto'"
What are the ramifications here? I am using modsec on Nginx with RH 6.X kernel. What is broken in modsec as a result?
Thanks