unixhot / waf

使用Nginx+Lua实现的WAF(版本v1.0)
Apache License 2.0
1.41k stars 509 forks source link

使用最新版openresty启动报错 #21

Closed Huangzsnone closed 4 years ago

Huangzsnone commented 5 years ago

我这边部署了Openresty 1.15.8.1 ,把waf规则放到nginx/conf下,启动openresty报错

2019/05/28 15:05:23 [error] 8427#0: lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found:
        no field package.preload['resty.core']
        no file '/usr/local/openresty/nginx/conf/waf/resty/core.lua'
        no file '/usr/local/openresty/site/lualib/resty/core.so'
        no file '/usr/local/openresty/lualib/resty/core.so'
        no file './resty/core.so'
        no file '/usr/local/lib/lua/5.1/resty/core.so'
        no file '/usr/local/openresty/luajit/lib/lua/5.1/resty/core.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/usr/local/openresty/site/lualib/resty.so'
        no file '/usr/local/openresty/lualib/resty.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/usr/local/openresty/luajit/lib/lua/5.1/resty.so'
        no file '/usr/local/lib/lua/5.1/loadall.so')

可能是时间太久了,这个waf规则需要修改下才能使用呢。

wfwf1990 commented 5 years ago

你好 楼主 解决了吗

wfwf1990 commented 5 years ago

我也遇到了 默认在/tmp目录下没有错误日志

yujunhui commented 4 years ago

lua_package_path "/usr/local/openresty/nginx/conf/waf/?.lua"; 改成 lua_package_path "/usr/local/openresty/nginx/conf/waf/?.lua;;";

末尾两个分号是指新加的路径后面加上原来的默认路径。

unixhot commented 4 years ago

增加软链接 ln -s /usr/local/openresty/lualib/resty/ /usr/local/openresty/nginx/conf/waf/resty