首页 / 安装部署 / nginx实现waf运行环境lua扩展的部署

nginx实现waf运行环境lua扩展的部署

2023-04-25 12:09:24安装部署 阅读 491
wget https://www.isres.com/file/LuaJIT-2.1.0-beta3.tar.gz
tar -zxvf LuaJIT-2.1.0-beta3.tar.gz
cd LuaJIT-2.1.0-beta3
make && make install

export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.1
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH


# lua -v
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio

cd ../


wget https://www.isres.com/file/ngx_devel_kit.zip
unzip ngx_devel_kit.zip
wget https://www.isres.com/file/lua-nginx-module.zip
unzip lua-nginx-module.zip

如果已经安装有nginx 的nginx -V 看看还有什么第三方模块
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-mail --with-mail_ssl_module --with-http_ssl_module --with-http_flv_module --with-http_dav_module --with-http_sub_module --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre --add-module=/usr/tmp/ngx_cache_purge-master/ --add-module=/usr/tmp/ngx_http_substitutions_filter_module-master

wget https://www.isres.com/file/ngx_cache_purge-2.3.tar.gz
tar -zxvf ngx_cache_purge-2.3.tar.gz
wget https://www.isres.com/file/ngx_http_substitutions_filter_module.tar.gz
tar -zxvf ngx_http_substitutions_filter_module.tar.gz

wget https://www.isres.com/file/nginx-1.15.5.tar.gz
tar -zxvf nginx-1.15.5.tar.gz && cd nginx-1.15.5/

./configure --prefix=/usr/local/nginx \
--user=www --group=www --with-mail --with-mail_ssl_module --with-http_ssl_module \
--with-http_flv_module --with-http_dav_module --with-http_sub_module --with-http_realip_module \
--with-http_addition_module --with-http_gzip_static_module --with-http_stub_status_module \
--with-pcre --add-module=/usr/tmp/ngx_cache_purge-2.3/ \
--add-module=/usr/tmp/ngx_http_substitutions_filter_module-0.6.4 \
--add-module=/usr/tmp/lua-nginx-module-master \
--add-module=/usr/tmp/ngx_devel_kit-master

make
make install

###本人已经有原来旧的改过的规则

cd /usr/local/nginx/
tar -zxvf waf.tar.gz
mv waf conf/


vim conf/nginx.conf

添加

lua_package_path "/usr/local/nginx/conf/waf/?.lua";
lua_shared_dict limit 10m;
init_by_lua_file  /usr/local/nginx/conf/waf/init.lua;
access_by_lua_file /usr/local/nginx/conf/waf/waf.lua;

cd conf/waf
vim config.lua

#logdir = "/usr/local/nginx/logs/hack/" 需要提前建目录
/usr/local/nginx/logs/hack
chown -R www:www /usr/local/nginx/logs/hack

nginx -t
service nginx restart

报错  error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory

echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
service nginx restart

ngx_lua_waf防火墙配置相关 https://github.com/loveshell/ngx_lua_waf

本文《nginx实现waf运行环境lua扩展的部署》由爱思考吧 isres.com 分享,转载请注明出处。本文网址:https://www.isres.com/bushu/38.html

本站主要收集测评能够节省时间和提升效率的软件工具并分享使用与学习的过程和感受,任何情况下用户都需遵守所使用软件资源的相关协议。与《nginx实现waf运行环境lua扩展的部署》有关的本站文章及资源仅供个人学习交流使用,相关资源请下载后24小时内删除,请勿用于其它用途,因此产生的任何问题由您自行承担。

lua

相关推荐

猜你喜欢

  • 给PhpStorm简单部署一个运行php代码的环境

    给PhpStorm简单部署一个运行php代码的环境

    1、下载Php https://windows.php.net/download#php-7.4-nts-vc15-x86 本次demo中下载的是 https://windows...

    2023-06-07 09:37:44 543
  • zabbix4.4的rpm安装部署以及客户端源码安装相关笔记

    重新部署了个新的zabbix server,替换原来的2.8,同时有一台原2.8的客户端的重装一个4.4的客户端。 rpm -Uvh https://repo.zabbix.com/zabbix/4...

    2020-05-01 15:25:22 4246
  • 显卡又少又贵,盘点所有拥有12GB以上显存的显卡型号清单

    显卡又少又贵,盘点所有拥有12GB以上显存的显卡型号清单

    在当今显卡价格高涨的时期,了解各种型号的显卡以及它们的性能和显存规格变得尤为重要。特别是对于那些需要进行人工智能工作的用户来说,显卡是不可或缺的工具。本文将向大家介绍所有显存大于等于12GB的显卡,...

    2023-05-17 19:22:47 1525
  • Centos一键安装部署vsftp

    Centos一键安装部署vsftp

    每次给不同的人配置ftp,都手工搞一次,决定简化这一步操作。 1、自动安装vsftp 2、自动设置被动模式、并打开iptables端口 3、支持自动创建ftp目录 帐号 密码 4、安装后,以后每次运行...

    2016-10-31 14:22:13 2952
  • 2分钟快速安装部署mysql5.7

    今天分享mysql5.7在Linux的安装部署,服务器运维工作都会涉及到安装部署mysql5.7。 mysql5.7在Linux的安装一般有三个方法,分别是: 1、源码编译安装 2、rpm包安装 3、...

    2023-04-24 11:53:13 563
  • windows server 2012 r2激活工具

    windows server 2012 r2激活工具

    最近倒腾下windows server 2012 r2,一直没成功激活,放了大半个月,今天睡觉前再看下,找到了个能用的激活工具,就记录下。 工具名称应该是 KMSpico ,从https://www....

    2020-04-14 15:21:24 9170
  • 自用实践两台电脑共用一个音响的方案

    自用实践两台电脑共用一个音响的方案

    家里有两台电脑,其中有一台不常用的也只有打游戏联机的时候才开,不想单独配一个音箱,于是必须实践两台电脑共用一个音响的方案。 本次方案就是加一条音频线,连接两台电脑,效果如下: 一般主板都有音频输入和...

    2023-09-07 09:42:20 1317
  • 解决:windows 2016远程桌面授权模式尚未配置许可证

    解决:windows 2016远程桌面授权模式尚未配置许可证

    远程桌面服务将在XX天后停止工作,在RD连接代理服务器上,请使用服务器管理器指定远程桌面授权模式和许可证件服务器。 通过在 https://activate.microsoft.com/ ...

    2020-07-31 15:28:00 21002