Last active
December 22, 2016 17:21
-
-
Save grigorkh/6fbab691f85f2ecd1bed0e2824316bef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# bash < <(curl -s https://gist.githubusercontent.com/grigorkh/6fbab691f85f2ecd1bed0e2824316bef/raw/e3017e8b485f28e5d9119c77daf4f21717ccea2d/ngx-lua-redis.bash) | |
set -x | |
cd /tmp | |
echo "Installing LuaJIT-2.0.4." | |
wget "http://luajit.org/download/LuaJIT-2.0.4.tar.gz" | |
tar -xzvf LuaJIT-2.0.4.tar.gz | |
cd LuaJIT-2.0.4 | |
make | |
sudo make install | |
cd /tmp | |
mkdir ngx_devel_kit | |
cd ngx_devel_kit | |
wget "https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz" | |
tar -xzvf v0.3.0.tar.gz | |
NGX_DEV="/tmp/ngx_devel_kit/ngx_devel_kit-0.3.0" | |
cd /tmp | |
mkdir lua-nginx-module | |
cd lua-nginx-module | |
wget "https://github.com/chaoslawful/lua-nginx-module/archive/v0.10.6.tar.gz" | |
tar -xzvf v0.10.6.tar.gz | |
LUA_MOD="/tmp/lua-nginx-module/lua-nginx-module-0.10.6" | |
cd /tmp | |
mkdir redis2-nginx-module | |
cd redis2-nginx-module | |
wget "https://github.com/openresty/redis2-nginx-module/archive/v0.13.tar.gz" | |
tar -xzvf v0.13.tar.gz | |
REDIS_MOD="/tmp/redis2-nginx-module/redis2-nginx-module-0.13" | |
cd /tmp | |
wget 'http://nginx.org/download/nginx-1.10.2.tar.gz' | |
tar -xzvf nginx-1.10.2.tar.gz | |
cd ./nginx-1.10.2 | |
export LUAJIT_LIB=/usr/local/lib | |
export LUAJIT_INC=/usr/local/include/luajit-2.0 | |
./configure --prefix=/opt/nginx \ | |
--add-module=$NGX_DEV \ | |
--add-module=$LUA_MOD \ | |
--add-module=$REDIS_MOD \ | |
--with-ipv6 \ | |
--with-http_ssl_module \ | |
--with-http_v2_module \ | |
--with-http_stub_status_module \ | |
--with-stream \ | |
--with-threads \ | |
--with-http_gunzip_module \ | |
--with-http_gzip_static_module \ | |
--with-http_degradation_module | |
make -j2 | |
sudo make install | |
unset LUAJIT_LIB | |
unset LUAJIT_INC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment