跳到主內容

【Lua】安裝 luarocks

https://github.com/luarocks/luarocks/wiki/Download

https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix

 

apt-get update
apt install build-essential libreadline-dev unzip wget zlib1g-dev -y

#安裝 luarocks
wget https://luarocks.org/releases/luarocks-3.8.0.tar.gz && tar zxpf luarocks-3.8.0.tar.gz && cd luarocks-3.8.0 
./configure 
make && make install

#安裝 lua-resty-http
luarocks install lua-resty-http
#安裝 lua-ffi-zlib
luarocks install lua-ffi-zlib

 

install lua-zlib

cd /usr/local
wget https://github.com/brimworks/lua-zlib/archive/master.zip
unzip lua-zlib-master.zip
cd /usr/local/lua-zlib-master
cmake -DLUA_INCLUDE_DIR=/usr/local/openresty/luajit/include/luajit-2.1 -DLUA_LIBRARIES=/usr/local/openresty/luajit/lib -DUSE_LUAJIT=ON -DUSE_LUA=OFF
make
cp zlib.so /usr/local/openresty/lualib/zlib.so