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
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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
@jmealo
Copy link

jmealo commented Feb 6, 2017

Great script. I made some updates:
https://gist.github.com/jmealo/e3cf626411980898a3581908b2b7d130

Fixes:

  • Missing unzip, git, and curl

(unzip and curl are required by luarocks)

Improvements:

  • Version bumps for all packages
  • Piped curl directly into tar
  • Reduced line count

@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