Global It Leader!!



 
 

리눅스 mod_security 아파치용 웹방화벽 설치

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 6,201회 작성일 12-03-22 14:22

본문

최신버전은 다음 사이트에 접속해서 파일을 다운받는다.

#cd /usr/local
#tar xvfz modsecurity-apache_1.9.4.tar.gz
#cd modsecurity-apache_1.9.4
#/usr/local/apache2/bin/apachectl stop
#/usr/local/apache2/bin/apxs -cia /usr/local/modsecurity-apache_1.9.4/apache2/mod_security.c
  DSO 방식으로 설치
#/usr/local/apache2/bin/apachectl start
  apxs를 이용하여 ModSecurity 모듈을 컴파일하고, 설치하고, 설정을 자동으로 변경한다.

  위의 명령은 mod_security.c를 컴파일 하고(-c 옵션), 공유객체를 웹서버 modules 디렉토리에
  설치하고(-i 옵션), 아파치 httpd.conf 설정파일에 적절한 LoadModule 줄을 추가(-a 옵션)한다.
  참고로 apxs는 아파치 웹서버의 확장모듈을 컴파일하고 설치하는 도구로써, 여러 소스와 오브
  젝트파일을 LoadModule 지시어로 실행 중인 아파치 서버로 읽어 들일 수 있는 동적공유객체
  (DSO)를 만든다. 위의 결과로 modules 디렉토리에 mod_security.so가 생성되고 httpd.conf 파
  일에 “LoadModule security_module modules/mod_security.so” 라인이 추가된다.

************만약 설치중에!!!!!!!!
Warning!  dlname not found in /usr/local/apache/modules/mod_security.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache/modules/mod_security.so
chmod: cannot access `/usr/local/apache/modules/mod_security.so': 그런 파일이나 디렉토리가 없음
apxs:Error: Command failed with rc=65536


에러 출력되면
1) cd /usr/local/apache2/build
2) mv libtool libtool.back
3) ln -s /usr/bin/libtool libtool
이렇게 libtool 설정 후 다시 설치

ModSecurity 활성화 및 Rule 정의
 
① httpd.conf 파일 수정
  
   # vi /usr/local/apache2/conf/httpd.conf 
   -----------------------------------------------------
    Include conf/modsecurity/*.conf                                 <=== 라인 추가
   -------------------------------------------------------

#mkdir /usr/local/apache2/conf/modsecurity                <=== modsecurity 룰 설정파일 디렉토리를 만들고
   첨부파일을 다운받아서 업로드한다. 아래 설정파일은 정보보호진흥원에서 2007년 11월 20일자로 배포하는 설정파일이다.
    * modsecurity_hosting_071120.conf    ===> 웹호스팅용.
    * modsecurity_SMB_071120.conf       ====> 스몰비지니스용(중소기업용)
 
#vi /usr/local/apache2/conf/modsecurity/modsecurity_hosting_071120.conf
안에 내용을 읽어보고 주석(#)을 제거하고 설정을 완료한다. 정보보호진흥원에서 만든 자료라서 잘해놨음..설명...ㅎ
설정파일 자세한 설명은 첨부한 pdf 참고하시길...
그리고 나서  아파치 재시작...

작동 여부 확인
 
#curl --head http://127.0.0.1/
 
--------------------------------------------------
HTTP/1.1 403 Forbidden
Date: Tue, 14 Aug 2007 10:41:13 GMT
Server: Microsoft-IIS/5.0                                        
<===정상작동중...       아닐때==>apache로나타남.
Content-Type: text/html; charset=iso-8859-1
---------------------------------------------------

댓글목록

등록된 댓글이 없습니다.

전체 167
게시물 검색
윈도우/리눅스 목록
번호 제목 글쓴이 조회 날짜
87 윈도우즈 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6138 04-30
86 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5371 04-26
85 윈도우즈 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5846 04-20
84 윈도우즈 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6292 04-20
83 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5451 04-17
82 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5644 04-17
81 윈도우즈 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6008 04-02
80 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5791 03-22
열람중 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6202 03-22
78 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6417 03-16
77 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5679 03-11
76 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5812 03-04
75 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5946 02-22
74 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6298 02-19
73 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6021 12-20
72 윈도우즈 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6383 12-02
71 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7010 11-08
70 윈도우즈 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6538 10-17
69 윈도우즈 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6680 10-16
68 리눅스 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8124 10-14