RHEL / CentOS 安裝 mod_security
發表於 : 2018-01-15 22:09:28
https://www.phpini.com/apache/rhel-cent ... d_security
/etc/httpd/conf/httpd.conf
代碼: 選擇全部
yum install gcc make httpd-devel libxml2 pcre-devel libxml2-devel curl-devel git
wget https://www.modsecurity.org/tarball/2.9.2/modsecurity-2.9.2.tar.gz
tar xzf modsecurity-apache_2.9.2.tar.gz
cd modsecurity-apache_2.9.2
./configure
make install
cp modsecurity.conf-recommended /etc/httpd/conf.d/modsecurity.conf
cp unicode.mapping /etc/httpd/conf.d/
cd /etc/httpd
git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
mv owasp-modsecurity-crs modsecurity-crs
cd modsecurity-crs
cp crs-setup.conf.example modsecurity_crs_10_config.conf
代碼: 選擇全部
LoadModule security2_module modules/mod_security2.so
<IfModule security2_module>
# Include conf.d/modsecurity.conf
</IfModule>
Include modsecurity-crs/modsecurity_crs_10_config.conf
Include modsecurity-crs/base_rules/*.conf