Last active
December 21, 2016 10:47
-
-
Save grigorkh/17285401e6be1b7950f638dd58a8d0a3 to your computer and use it in GitHub Desktop.
Script to compile nginx on ubuntu with lua support.
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/17285401e6be1b7950f638dd58a8d0a3/raw/cbbd7fd2205e1aebdf79649b98d598e4344040c2/ngx-lua.bash) | |
set -x | |
cd /tmp | |
if ! test -d /usr/local/include/luajit-2.0; then | |
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 | |
else | |
echo "Skipping LuaJIT-2.0, as it's already installed." | |
fi | |
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 | |
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