Closed zhixiangjoy closed 3 years ago
Final I try to install openresty ,but still get errors:
Dec 11 11:21:49 nginx-proxy03 systemd[1]: Starting The OpenResty Application Platform...
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: nginx: [error] init_by_lua error: /usr/local/lua/crowdsec/lrucache.lua:49: attempt to redefine 'lrucache_queue_s' at line 2
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: stack traceback:
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: [C]: in function 'cdef'
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: /usr/local/lua/crowdsec/lrucache.lua:49: in main chunk
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: [C]: in function 'require'
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: /usr/local/lua/crowdsec/CrowdSec.lua:4: in main chunk
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: [C]: in function 'require'
Dec 11 11:21:49 nginx-proxy03 nginx[4326]: init_by_lua:2: in main chunk
Dec 11 11:21:49 nginx-proxy03 systemd[1]: openresty.service: Control process exited, code=exited, status=1/FAILURE
Dec 11 11:21:49 nginx-proxy03 systemd[1]: openresty.service: Failed with result 'exit-code'.
Dec 11 11:21:49 nginx-proxy03 systemd[1]: Failed to start The OpenResty Application Platform.
Hello,
Thanks for the report ! You shouldn't have to use openresty, nginx mod lua should do the trick.
The error nginx: [emerg] unknown directive "lua_package_path" in /etc/nginx/conf.d/crowdsec_nginx.conf:1
looks like lua was actually not installed as a nginx module (this directive is one of nginx).
Can you check if lua is correctly enabled at nginx level ?
Thanks,
@zhixiangjoy any update on this ?
Thanks for your reply, It's my fault。I had modify the nginx.conf which had delete the line :
include /etc/nginx/modules-enabled/*.conf;
In that situation, nginx can't loading the lua lib.
when I follow the step , I can't restart nginx :
There is some messages:
Should I need install nginx-lua-module by mannul or install openresty? Thanks !