티스토리 뷰
Mod_security 설치
설치전 체크
mod_unique_id 인스톨되었는지 확인
libxml2 최신버전 인스톨되었는지 확인
lua ??
libxml2 최신버전 인스톨되었는지 확인
lua ??
설치전 필요한 패키지 설치
cd /usr/local/src/APM/httpd-2.2.9/modules/metadata
- /usr/local/apache/bin/apxs -cia mod_unique_id.c
vim /usr/local/apache/conf/httpd.conf
- LoadModule unique_id_module modules/mod_unique_id.so 이게 추가 되어 있다면
- LoadFile /usr/lib/libxml2.so 열 추가해준다
아래 패키지들이 필요하다던데?
libxml2
lua
pcre
pcre-devel
apr*
yum -y install libxml2 lua pcre pcre-devel apr*
pcre 소스 설치 (YUM 설치되면 소스 설치할 필요없음)
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.02.zip
unzip pcre-8.02.zip
cd pcre-8.02
./configure --prefix=/usr/local/pcre
make
make install
/usr/local/src/APM/httpd-2.2.9/modules/metadata
wget http://www.modsecurity.org/download/modsecurity-apache_2.5.12.tar.gz
xvfz modsecurity-apache_2.5.12.tar.gz
cd modsecurity-apache_2.5.12
cd apache2/
./configure --with-apxs=/usr/local/apache/bin/apxs
- 2.5.12에서는 그냥 apxs 경로만 나열해주면 되는듯 함
op) ./configure --with-apr=/usr/local/apache --with-apu=/usr/local/apache --with-apxs=/usr/local/apache/
op1) ./configure --with-apxs=/usr/local/apache/bin/apxs --with-pcre=/usr/local/pcre --with-apr=/usr/local/apache/bin/apr-1-config --with-apu=/usr/local/apache/bin/apu-1-config
make
make install
룰설정? 모드시큐어리티 기본룰을 아파치 컨프에 복사해놓고 편리하게 쓰자...
cp -arpf rules /usr/local/apache/conf/modsecurity
xvfz modsecurity-apache_2.5.12.tar.gz
cd modsecurity-apache_2.5.12
cd apache2/
./configure --with-apxs=/usr/local/apache/bin/apxs
- 2.5.12에서는 그냥 apxs 경로만 나열해주면 되는듯 함
op) ./configure --with-apr=/usr/local/apache --with-apu=/usr/local/apache --with-apxs=/usr/local/apache/
op1) ./configure --with-apxs=/usr/local/apache/bin/apxs --with-pcre=/usr/local/pcre --with-apr=/usr/local/apache/bin/apr-1-config --with-apu=/usr/local/apache/bin/apu-1-config
make
make install
룰설정? 모드시큐어리티 기본룰을 아파치 컨프에 복사해놓고 편리하게 쓰자...
cp -arpf rules /usr/local/apache/conf/modsecurity
httpd.conf 추가
vim /usr/local/apache/conf/httpd.conf
LoadModule security2_module modules/mod_security2.so
<IfModule mod_security2.c>
Include conf/modsecurity/modsecurity_crs_10_config.conf
#Include conf/modsecurity_2x_SMB_090311.conf
#Include conf/modsecurity_2x_hosting_090311.conf
</IfModule>
LoadModule security2_module modules/mod_security2.so
<IfModule mod_security2.c>
Include conf/modsecurity/modsecurity_crs_10_config.conf
#Include conf/modsecurity_2x_SMB_090311.conf
#Include conf/modsecurity_2x_hosting_090311.conf
</IfModule>
위 라인은 이미 추가?되어 있음? modsecurity.conf 파일 찾아서 인쿨르드 해주는듯함)
include conf/modsecurity/modsecurity*conf 이 라인만 추가했음
Include conf/modsecurity/modsecurity_crs_10_config.conf ← 내 서버는 이렇게 설정되어 있음
Include conf/modsecurity/modsecurity_crs_10_config.conf ← 내 서버는 이렇게 설정되어 있음
퍼미션 조정 (/APACHE_SETUP_DIR/conf/modsecurity)
chmod 440 -R modsecurity/
아파치 재시작
로그 확인
tail -f /usr/local/apache/log/error_log;
tail -f /usr/local/apache/log/error_log;
'Security' 카테고리의 다른 글
무단링크 방지 (0) | 2015.06.11 |
---|---|
mod_security 운영 (0) | 2015.06.11 |
Webknight 설치 (AQTRONIX) (0) | 2015.06.11 |
mod_security 타 사이트에서 배너광고 링크시 로그 (0) | 2015.06.11 |
키보드 보안 장치 KEYDARI USB (0) | 2015.06.11 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- yum
- cURL
- HAProxy
- centos8
- glusterfs
- 베이어다이나믹
- OpenVPN
- 인증서
- kvm
- virtualbox
- ntp
- php
- SSL
- L2TP
- MySQL
- ssh
- softether
- 리눅스
- mariadb
- pptp
- GeoIP
- IPSEC
- galera
- Apache
- gitlab
- WAF
- mod_security
- centOS7
- iptables
- NGINX
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함