modsecurity-2.9.3 컴파일 에러

centos7 / apache 2.4.36 / mod_security 에러 발생시 해결.

https://forum.directadmin.com/showthread.php?t=56837

In file included from modsecurity.h:49:0,
from apache2_config.c:17:
msc_remote_rules.h:54:9: error: unknown type name 'apr_crypto_key_t'
apr_crypto_key_t **apr_key,
msc_remote_rules.h:55:9: error: unknown type name 'apr_crypto_t'
apr_crypto_t *f,
make[2]: *** [mod_security2_la-apache2_config.lo] Error 1
make[2]: Leaving directory /usr/local/src/modsecurity-2.9.3/apache2′
make[1]: *** [all] Error 2
make[1]: Leaving directory /usr/local/src/modsecurity-2.9.3/apache2'
make: *** [all-recursive] Error 1

처음에 진행한 config

#  ./configure --with-apxs=/usr/local/apache/bin/apxs

apr 관련 에러가 발생한다.

이경우엔 apache 에서 사용하는 apr 이 apr_crypto_key_t 를 지원하지 않는것이다. 라고 생각했는데 아니었다 apr이 지정안되서 그냥 안되는거였다.

#./apachectl -V
Server version: Apache/2.2.34 (Unix)
Server built: Dec 6 2018 13:55:09
Server's Module Magic Number: 20051115:43
Server loaded: APR 1.5.2, APR-Util 1.5.4
Compiled using: APR 1.5.2, APR-Util 1.5.4

사실 그냥하면 될줄알았는데 아니더라...그래서 명시를 해준다.

# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apu=/usr/local/apache/bin/apu-1-config

잘되었다.

;;

허무하네

/usr/local/modsecurity
[root@localhost modsecurity]# ll
합계 0
drwxr-xr-x 2 root root 70 10월 4 16:11 bin
drwxr-xr-x 2 root root 30 10월 4 16:11 lib

#ll /usr/local/modsecurity/lib/mod_security2.so
-rwxr-xr-x 1 root root 2490512 10월 4 16:11 /usr/local/modsecurity/lib/mod_security2.so

잘된다.

Share