目标
基于 Centos -7、 OpenResty、Best-Nginx-Waf 快速搭建起企业级的网站WAF防火墙;
1. 安装 OpenResty
yum -y install wget gcc perl unzip openssl openssl-devel
#下载并解压源码包
wget https://github.com/zylhahah/best-nginx-waf/archive/refs/heads/master.zip
tar zxf openresty-1.13.6.1.tar.gz
#编译安装
cd openresty-1.13.6.1
./configure
make
make install #默认会安装到/usr/local/openresty目录
#openresty 自带nginx, 启动nginx
/usr/local/openresty/nginx/sbin/nginx -t #检查配置文件语法是否正确
/usr/local/openresty/nginx/sbin/nginx #启动nginx
2. 部署 Best-Nginx-Waf
2.1 下载 Best-Nginx-Waf
wget https://github.com/ddonline/nginx-lua-waf/archive/master.zip
2.2 解压缩
unzip master.zip #解压后得到文件夹 best-nginx-waf
2.3 将 best-nginx-wa