Skip to content
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

install question #272

Closed
AnoopAlias opened this issue Apr 9, 2017 · 2 comments
Closed

install question #272

AnoopAlias opened this issue Apr 9, 2017 · 2 comments
Labels

Comments

@AnoopAlias
Copy link

I have installed openresty under /etc/nginx
and installed lua-resty-waf using command

/etc/nginx/bin/opm install p0pr0ck5/lua-resty-waf

I have also copied the rules folder from git to

ls /etc/nginx/site/lualib/rules/
11000_whitelist.json       21000_http_anomaly.json  40000_generic_attack.json  42000_xss.json     99000_scoring.json
20000_http_violation.json  35000_user_agent.json    41000_sqli.json            90000_custom.json

I am testing the settings using the example config from the docs and nginx -t shows fine . But the site itself is not loading

nginx error log says

# tail -f /var/log/nginx/error_log 
coroutine 0:
        /etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
        /etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
        access_by_lua(theo.in.include:23):15: in function <access_by_lua(theo.in.include:23):1>, client: 137.97.9.139, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/09 11:28:28 [error] 27357#27357: *36 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
        /etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
        /etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
        /etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
        header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.9.139, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"

What am I doing wrong?

Thanks in advance

@AnoopAlias
Copy link
Author

More detailed error

2017/04/10 06:48:15 [error] 27836#27836: *309 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:15 [error] 27836#27836: *309 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:15 [error] 27836#27836: *309 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:17 [error] 27836#27836: *311 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:17 [error] 27836#27836: *311 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:17 [error] 27836#27836: *311 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:17 [error] 27836#27836: *312 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:17 [error] 27836#27836: *312 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:17 [error] 27836#27836: *312 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:18 [error] 27836#27836: *310 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:18 [error] 27836#27836: *310 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:18 [error] 27836#27836: *310 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:18 [error] 27836#27836: *313 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:18 [error] 27836#27836: *313 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:18 [error] 27836#27836: *313 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:19 [error] 27836#27836: *314 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:19 [error] 27836#27836: *314 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:19 [error] 27836#27836: *314 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:19 [error] 27836#27836: *315 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:19 [error] 27836#27836: *315 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:19 [error] 27836#27836: *315 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:24 [error] 27836#27836: *316 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:24 [error] 27836#27836: *316 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:24 [error] 27836#27836: *316 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:55 [error] 27836#27836: *318 lua entry thread aborted: runtime error: /etc/nginx/site/lualib/resty/waf.lua:258: attempt to call a nil value
stack traceback:
coroutine 0:
	/etc/nginx/site/lualib/resty/waf.lua: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	access_by_lua(theo.in.include:26):19: in function <access_by_lua(theo.in.include:26):1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:55 [error] 27836#27836: *318 failed to run header_filter_by_lua*: /etc/nginx/site/lualib/resty/waf.lua:59: attempt to call a nil value
stack traceback:
	/etc/nginx/site/lualib/resty/waf.lua:59: in function '_parse_collection'
	/etc/nginx/site/lualib/resty/waf.lua:226: in function '_process_rule'
	/etc/nginx/site/lualib/resty/waf.lua:481: in function 'exec'
	header_filter_by_lua:8: in function <header_filter_by_lua:1>, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"
2017/04/10 06:48:55 [error] 27836#27836: *318 failed to run log_by_lua*: /etc/nginx/site/lualib/resty/waf/log.lua:23: lua-resty-waf should not be run in phase log
stack traceback:
	[C]: in function 'error'
	/etc/nginx/site/lualib/resty/waf/log.lua:23: in function 'fatal_fail'
	/etc/nginx/site/lualib/resty/waf.lua:394: in function 'exec'
	log_by_lua(theo.in.include:52):6: in function <log_by_lua(theo.in.include:52):1> while logging request, client: 137.97.10.21, server: theo.in, request: "GET / HTTP/1.1", host: "theo.in"

@p0pr0ck5
Copy link
Owner

Hi @AnoopAlias,

Thanks for checking us out! Apologies for the delayed in response, I've been on holiday. Currently, installation via OPM isn't currently working, as OPM doesn't support executing steps for building projects as part of installation: openresty/opm#30.

Until then, it's best to install via Luarocks, or manually via the Makefile (make && make install). I will update the docs to discourage the use of OPM for the time being. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants