luarocks: Lua 包管理工具
LuaRocks 是 Lua 编程语言的程序包管理器,它提供了分发 Lua 模块的标准格式,易于管理 rock 安装的工具以及用于分发它们的服务器
国内代理
- luarocks.cn 是国内加速网站,使用
--server https://luarocks.cn指定国内源,示例
$ luarocks install apisix --server https://luarocks.cn
$ luarocks install kong --server https://luarocks.cn使用
安装 lua-casbin
/usr/local/openresty/luajit/bin/luarocks install lrexlib-pcre PCRE_DIR=/usr/local/openresty/pcre
GIT_SSL_NO_VERIFY=1 /usr/local/openresty/luajit/bin/luarocks install casbin安装 resty-http
luarocks install lua-resty-http使用示例(现象类似于 curl --resolve 的效果):
F&Q
module ‘resty.http’ not found
luarocks install lua-resty-httpfailed to load module resty.openssl.*, mTLS isn’t supported without lua-resty-openssl
luarocks install lua-resty-openssllua ssl certificate verify error: (20: unable to get local issuer certificate)
- nginx.conf 中配置(参考)
lua_ssl_verify_depth 2;
lua_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.pem;