Skip to content

Instantly share code, notes, and snippets.

@wojons
Forked from yagop/openresty-luarocks.sh
Last active October 31, 2017 23:34
Show Gist options
  • Save wojons/3d72509c126bb480ade57bb18cb321f4 to your computer and use it in GitHub Desktop.
Save wojons/3d72509c126bb480ade57bb18cb321f4 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
wget https://github.com/openresty/stream-lua-nginx-module/archive/v0.0.1.tar.gz \
-O /tmp/stream-lua-nginx-module-0.0.1.tar.gz
mkdir /tmp/stream-lua-nginx-module-0.0.1
tar xzvf /tmp/stream-lua-nginx-module-0.0.1.tar.gz -C /tmp/stream-lua-nginx-module-0.0.1
wget https://github.com/slact/nchan/archive/v0.99.16.tar.gz \
-O /tmp/nchan-v0.99.16.tar.gz
mkdir /tmp/nchan-v0.99.16
tar xzvf /tmp/nchan-v0.99.16.tar.gz -C /tmp/nchan-v0.99.16
wget https://openresty.org/download/openresty-1.9.15.1.tar.gz \
-O /tmp/openresty-1.9.15.1.tar.gz
tar xzvf /tmp/openresty-1.9.15.1.tar.gz -C /tmp/openresty-1.9.15.1
cd /tmp/openresty-1.9.15.1
./configure --add-module=/tmp/nchan-v0.99.16/nchan-0.99.16 \
--with-stream \
--with-stream_ssl_module \
--with-debug \
--add-module=/tmp/stream-lua-nginx-module-0.0.1/stream-lua-nginx-module-0.0.1
make
sudo make install
luarocks install lua-struct
luarocks install lua-resty-http
git clone https://github.com/wojons/lua-resty-sse.git /usr/local/openresty/lualib/resty/sse
wget https://codeload.github.com/keplerproject/luarocks/tar.gz/v2.0.13 \
-O luarocks-2.0.13.tar.gz
tar -xzvf luarocks-2.0.13.tar.gz
cd luarocks-2.0.13/
./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
sudo make install
# Enjoy luarocks as:
# sudo /usr/local/openresty/luajit/luarocks install lapis
@wojons
Copy link
Author

wojons commented Feb 16, 2017

Thaknks i can always copy it back in this was just to solve a need one weekend i have the docker version of this somewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment