Hi,
I compiled the mod_lua and set up all for openlitespeed, and im trying to run a lua script >that works on nginx<, as i read, the mod_lua uses excatly same commands as ngnix (you can use ngx.xxxxxxxx or ls.xxxxxxxxxxxx) should do same, however, it doesnt seem to work.
it gets loaded in a vconf file like this
include /www/server/total/ls_log.lua
but the error.log get filled with the intire file, starting from line 1 and forward...
Ill just post those first lines here too, just fui..
Im far from a lua scripting expert so of course i just hoped it would run out of the box, anyone have link to some working openlitespeed lua scripts i can see? and maybe a site with all the lua commands that works?
I compiled the mod_lua and set up all for openlitespeed, and im trying to run a lua script >that works on nginx<, as i read, the mod_lua uses excatly same commands as ngnix (you can use ngx.xxxxxxxx or ls.xxxxxxxxxxxx) should do same, however, it doesnt seem to work.
it gets loaded in a vconf file like this
include /www/server/total/ls_log.lua
but the error.log get filled with the intire file, starting from line 1 and forward...
Code:
2021-09-26 19:24:44.690756 [INFO] [PlainConf] [httpServerConfig:] start parsing file /www/server/total/ls_log.lua
2021-09-26 19:24:44.690759 [WARN] [PlainConf] [httpServerConfig:] parseline find block name [log_by_lua_block] is NOT keyword in /www/server/total/ls_log.lua:1
2021-09-26 19:24:44.690762 [WARN] [PlainConf] [httpServerConfig:] Not support [log_by_lua_block ] in file /www/server/total/ls_log.lua:1
2021-09-26 19:24:44.690764 [WARN] [PlainConf] [httpServerConfig:] Not support [local version = "1.5"] in file /www/server/total/ls_log.lua:2
2021-09-26 19:24:44.690767 [WARN] [PlainConf] [httpServerConfig:] Not support [-- local ok, app = pcall(require, "lsqlite3")] in file /www/server/total/ls_log.lua:3
2021-09-26 19:24:44.690770 [WARN] [PlainConf] [httpServerConfig:] Not support [local cpath = "/www/server/total/"] in file /www/server/total/ls_log.lua:4
2021-09-26 19:24:44.690772 [WARN] [PlainConf] [httpServerConfig:] Not support [if not package.cpath:find(cpath) then] in file /www/server/total/ls_log.lua:5
2021-09-26 19:24:44.690775 [WARN] [PlainConf] [httpServerConfig:] Not support [package.cpath = cpath .. "?.so;" .. package.cpath] in file /www/server/total/ls_log.lua:6
2021-09-26 19:24:44.690778 [WARN] [PlainConf] [httpServerConfig:] Not support [end ] in file /www/server/total/ls_log.lua:7
2021-09-26 19:24:44.690781 [WARN] [PlainConf] [httpServerConfig:] Not support [if not package.path:find(cpath) then] in file /www/server/total/ls_log.lua:8
2021-09-26 19:24:44.690784 [WARN] [PlainConf] [httpServerConfig:] Not support [package.path = cpath .. "?.lua;" .. package.path] in file /www/server/total/ls_log.lua:9
2021-09-26 19:24:44.690787 [WARN] [PlainConf] [httpServerConfig:] Not support [end ] in file /www/server/total/ls_log.lua:10
Code:
log_by_lua_block {
local version = "1.5"
-- local ok, app = pcall(require, "lsqlite3")
local cpath = "/www/server/total/"
if not package.cpath:find(cpath) then
package.cpath = cpath .. "?.so;" .. package.cpath
end
if not package.path:find(cpath) then
package.path = cpath .. "?.lua;" .. package.path
end