Apache安装启用 ModSecurity

2018-10-13 18:26:29 124

ModSecurity 是一个强大的包过滤工具,将检查每一个进入web服务器的包。它将根据内部规则,比较每一个包,并且确定是否需要禁止这个包或继续发送给web服务器。


1、下载 

modsecurity-apache: http://www.landui.com/projects/mod-security/files/modsecurity-apache/

modsecurity-crs: http://www.landui.com/projects/mod-security/files/modsecurity-crs/0-CURRENT/


2、安装

1)启用 mod_unique_id 模块


2)验证服务器安装了最新版本libxml2函数库


3)停止Apache httpd


4)解压


gzip -d modsecurity-apache_2.6.3.tag.gz

tar xvzf modsecurity-apache_2.6.3.tar

gzip -d modsecurity-core-rules_2.6.tar.gz

tar xvzf modsecurity-core-rules_2.6.tar.gz


5)配置


./configure


6)编译并测试ModSecurity


make

make test


7)安装


make install


修改 http.conf,启用ModSecurity,在httpd.conf文件添加:


LoadFile /usr/lib/libxml2.so

LoadModule security2_module modules/mod_security2.so


8)重启apache


到这里已经安装了ModSecurity,你可以查看配置指令文档:http://www.landui.com/apps/mediawiki/mod-security/index.php?title=Reference_Manual



提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: