작성일 : 2011. 4. 12.
작성자 : 이선규 (neosky)


mod_security 설치 과정중 make 시 다음과 같이 에러가 발생하는 경우
다음과 같이 조치하면 된다.


[ make 시 에러 메세지 출력 후 중단 ]

/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic -I/usr/kerberos/include -L/usr/kerberos/lib -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/local/apache/include  -I/usr/local/apache/include   -I/usr/local/apache/include  -O2 -g -Wall -DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -I/usr/local/apache/include -I/usr/local/pcre/include -I/usr/include/libxml2  -c -o msc_pcre.lo msc_pcre.c && touch msc_pcre.slo

msc_pcre.c: In function 'msc_pregcomp_ex':
msc_pcre.c:73: error: invalid application of 'sizeof' to incomplete type 'pcre_extra'
msc_pcre.c:77: error: invalid application of 'sizeof' to incomplete type 'pcre_extra'
msc_pcre.c:98: warning: ignoring #pragma message
msc_pcre.c:119: warning: ignoring #pragma message
apxs:Error: Command failed with rc=65536
.
make: *** [mod_security2.la] 오류 1


[ 조치방법 ]

/usr/local/apache/include 디렉토리 내 pcre.h 파일은 백업하고,
/usr/local/pcre/include 디렉토리 내 pcre.h 파일을 /usr/local/apache/include 디렉토리 로 복사시키면 된다.

=> 여기서 apache include 는 apache 가 설치된 디렉토리이어야 한다. (위 부분중 빨간색 주목)



[다음과 같이 정상적으로 make 되는 것을 확인할 수 있음]

make
.... 생략 ....

/usr/local/apache/build/libtool --silent --mode=link gcc -o mod_security2.la  -L/usr/local/pcre/lib -lpcre -lxml2 -lz -lm -rpath /usr/local/apache/modules -module -avoid-version    msc_release.lo msc_lua.lo acmp.lo msc_geo.lo pdf_protect.lo msc_reqbody.lo persist_dbm.lo msc_pcre.lo msc_util.lo msc_parsers.lo modsecurity.lo msc_multipart.lo msc_xml.lo msc_logging.lo re_variables.lo re_tfns.lo re_actions.lo re_operators.lo re.lo apache2_util.lo apache2_io.lo apache2_config.lo mod_security2.lo
[root@neosky ]#

make install
.... 생략 ....

PATH="$PATH:/sbin" ldconfig -n /usr/local/apache/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apache/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/local/apache/modules/mod_security2.so






2011/04/12 18:43 2011/04/12 18:43








마음튼튼 이 작성.

당신의 의견을 작성해 주세요.

[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다