OpenWAF学习笔记(一)—— 安装

自学OpenWAF,在此做个笔记吧,毕竟我连Linux都没接触过(后面可能还会做些Linux常用命令的总结……鼓励下弱小的自己!!!)
学习也只是简单的学习和使用,可能存在理解跑偏的地方,欢迎各位大佬批评指正。

首先就是OpenWAF的安装,相关安装教程一抓一大把,GitHub上的安装教程在这-->轻松玩转OpenWAF之安装篇

安装教程还是很详细的,我个人是在VM中CentOS7下源码安装的,总结安装步骤如下:

1.安装OpenWAF依赖
cd /opt
yum install gcc gcc-c++ wget GeoIP-devel git swig make perl perl-ExtUtils-Embed readline-devel zlib-devel -y
wget http://www.over-yonder.net/~fullermd/projects/libcidr/libcidr-1.2.3.tar.xz
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
wget https://openresty.org/download/openresty-1.15.8.2.tar.gz
tar -xvf libcidr-1.2.3.tar.xz
tar -zxvf pcre-8.43.tar.gz
tar -zxvf openssl-1.1.1d.tar.gz
tar -zxvf openresty-1.15.8.2.tar.gz
rm -rf pcre-8.43.tar.gz \
           openssl-1.1.1d.tar.gz \
           openresty-1.15.8.2.tar.gz
cd /opt/libcidr-1.2.3
make && make install
2.安装 OpenWAF
cd /opt
git clone https://github.com/titansec/OpenWAF.git
mv /opt/OpenWAF/lib/openresty/ngx_openwaf.conf /etc
mv /opt/OpenWAF/lib/openresty/configure /opt/openresty-1.15.8.2
cp -RP /opt/OpenWAF/lib/openresty/* /opt/openresty-1.15.8.2/bundle/
cd /opt/OpenWAF
make clean
make install
ln -s /usr/local/lib/libcidr.so /opt/OpenWAF/lib/resty/libcidr.so
3.编译 openresty
cd /opt/openresty-1.15.8.2/
./configure --with-pcre-jit --with-ipv6 \ 
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_sub_module \
--with-http_geoip_module \
--with-openssl=/opt/openssl-1.1.1d \
--with-pcre=/opt/pcre-8.43
make && make install

至此,OpenWAF安装完毕~~~下篇会提到初次使用的基本配置OpenWAF学习笔记(二)—— 入门

posted @ 2020-07-28 14:44  LukeSteven  阅读(1084)  评论(0编辑  收藏  举报