-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nginx+lua+Openwaf:nginx语法检测报lua文件找不到相关错误 #20
Comments
建议使用 OpenResty |
由于某些因素,公司不会使用OpenResty,一直都是原生的nginx,为了跟nginx官网保持一致的更新速度,现在都使用nginx-1.14了,我那个问题是啥原因?找不到的那些模块在oepnwaf安装后确实没有,很无奈。 |
很抱歉,我并未用原生 nginx 搭建过 OpenWAF,都是基于OpenResty 运行的。 |
/data/server/nginx-1.14/sbin/nginx -tnginx: the configuration file /data/server/nginx-1.14/conf/nginx.conf syntax is ok |
|
"Expected value but found invalid number at character 99" 这类问题是 json 格式错误导致的 |
再结合 'load_access_rule' ,说明是 twaf_access_rule.json 的 json 格式错误 |
init_by_lua_file error: /opt/OpenWAF/lib/twaf/twaf_conf.lua:11: module 'geoip.country' not found 但是安装GeoIP-devel,如何解决 |
/data/server/nginx-1.14/sbin/nginx -V
nginx version: JYWS/2.1.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.1.0h 27 Mar 2018
TLS SNI support enabled
configure arguments: --prefix=/data/server/nginx-1.14 --with-http_v2_module --with-stream --with-http_gunzip_module --with-http_ssl_module --with-threads --with-file-aio --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_image_filter_module --with-http_auth_request_module --with-http_random_index_module --with-ld-opt=-Wl,-rpath,/usr/local/luajit/lib --with-pcre=/data/server/nginx-waf/module/pcre-8.42 --with-zlib=/data/server/nginx-waf/module/zlib-1.2.11 --with-openssl=/data/server/nginx-waf/module/openssl-1.1.0h --add-module=/data/server/nginx-waf/module/lua-nginx-module-0.10.12 --add-module=/data/server/nginx-waf/module/ngx_devel_kit-0.2.19 --add-module=/data/server/nginx-waf/module/nginx-sticky-module-1.2.5 --add-module=/data/server/nginx-waf/module/echo-nginx-module-0.61 --add-module=/data/server/nginx-waf/module/ngx_cache_purge-2.3 --add-module=/data/server/nginx-waf/module/ngx_http_lower_upper_case --add-module=/data/server/nginx-waf/module/ModSecurity-nginx
以上是整合了luajit以及nginx-lua-module模块,添加了openwaf的配置后报错:
# /data/server/nginx-1.14/sbin/nginx -t
nginx: the configuration file /data/server/nginx-1.14/conf/nginx.conf syntax is ok
nginx: [error] init_by_lua_file error: /opt/OpenWAF/app/twaf_init.lua:3: module 'resty.core' not found:
no field package.preload['resty.core']
no file '/opt/OpenWAF/resty/core.lua'
no file './resty/core.lua'
no file '/usr/local/luajit/share/luajit-2.0.5/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core/init.lua'
no file '/usr/local/luajit/share/lua/5.1/resty/core.lua'
no file '/usr/local/luajit/share/lua/5.1/resty/core/init.lua'
no file '/opt/OpenWAF/lib/resty/resty/core.so'
no file './resty/core.so'
no file '/usr/local/lib/lua/5.1/resty/core.so'
no file '/usr/local/luajit/lib/lua/5.1/resty/core.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/opt/OpenWAF/lib/resty/resty.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/usr/local/luajit/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
/opt/OpenWAF/app/twaf_init.lua:3: in main chunk
nginx: configuration file /data/server/nginx-1.14/conf/nginx.conf test failed
The text was updated successfully, but these errors were encountered: