参考github上的文档,直接clone
[root@localhost source]# git clone --recursive https://github.com/owasp-modsecurity/ModSecurity ModSecurity
或者 git clone https://github.com/SpiderLabs/ModSecurity
[root@localhost modsecurity]# cd ModSecurity/
[root@localhost ModSecurity]# git submodule init
[root@localhost ModSecurity]# git submodule update
[root@localhost ModSecurity]# ./build.sh
[root@localhost ModSecurity]# ./configure
[root@localhost ModSecurity]# make
[root@localhost ModSecurity]# make install
[root@localhost ModSecurity]# ls /usr/local/modsecurity/
bin include lib
[root@localhost ModSecurity]# ls /usr/local/modsecurity/bin/
modsec-rules-check
安装nginx的插件/安装nginx
[root@localhost modsecurity]# git clone https://github.com/owasp-modsecurity/ModSecurity-nginx.git
[root@localhost modsecurity]# mv ModSecurity-nginx/ /opt/soft/
[root@localhost nginx-1.6.1]# ./configure –prefix=/opt/soft/nginx-1.26.1 –with-http_stub_status_module –with-http_ssl_module –add-module=/opt/soft/ModSecurity-nginx
安装规则
规则文件在crs目录下,我们下次详细讲解。