Skip to content

Instantly share code, notes, and snippets.

@wojons
Forked from jmealo/openresty-nchan-redis-luarocks.sh
Created September 20, 2017 17:43
Show Gist options
  • Save wojons/746c7ce0c1aea878a5207ab4933ffda8 to your computer and use it in GitHub Desktop.
Save wojons/746c7ce0c1aea878a5207ab4933ffda8 to your computer and use it in GitHub Desktop.
OpenResty + LuaRocks + Nchan
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \
libssl-dev perl make build-essential git curl \
unzip
git clone https://github.com/openresty/stream-lua-nginx-module.git \
--branch master \
--single-branch /tmp/stream-lua-nginx-module-master
curl -L https://github.com/slact/nchan/archive/v1.1.7.tar.gz | tar xz -C /tmp
curl -L https://openresty.org/download/openresty-1.11.2.4.tar.gz | tar xz -C /tmp
cd /tmp/openresty-1.11.2.4
./configure --add-module=/tmp/nchan-1.1.7 \
--with-stream \
--with-stream_ssl_module \
--with-debug \
--add-module=/tmp/stream-lua-nginx-module-master
make
make install
curl -L https://github.com/luarocks/luarocks/archive/v2.4.2.tar.gz | tar xz -C /tmp
cd /tmp/luarocks-2.4.2
./configure --prefix=/usr/local/openresty/luajit \
--with-lua=/usr/local/openresty/luajit/ \
--lua-suffix=jit-2.1.0-beta2 \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make build
make install
luarocks install lua-struct
luarocks install lua-resty-http
git clone https://github.com/wojons/lua-resty-sse.git \
--branch master \
--single-branch /usr/local/openresty/lualib/resty/sse
# Enjoy luarocks as:
# sudo /usr/local/openresty/luajit/luarocks install lapis
# Luarocks was available as "/usr/local/openresty/luajit/luarocks~" for me, check that if it doesn't exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment