Created
October 14, 2014 20:16
-
-
Save clecidor/bbf9e7130ab0ba2f16d6 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.github.com/jmervine/5407622/raw/nginx_w_lua.bash) | |
# Adapted from http://mervine.net/nginx-with-lua-module | |
# REQUIREMENT - uncomment if PCRE library is not already installed | |
# apt-get install libpcre3 libpcre3-dev | |
set -x | |
cd /tmp | |
if ! test -d /usr/local/include/luajit-2.0; then | |
echo "Installing LuaJIT-2.0.1." | |
wget "http://luajit.org/download/LuaJIT-2.0.2.tar.gz" | |
tar -xzvf LuaJIT-2.0.2.tar.gz | |
cd LuaJIT-2.0.2 | |
make | |
sudo make install | |
else | |
echo "Skipping LuaJIT-2.0.1, as it's already installed." | |
fi | |
mkdir ngx_devel_kit | |
cd ngx_devel_kit | |
wget "https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gz" | |
tar -xzvf v0.2.19.tar.gz | |
NGX_DEV="/tmp/ngx_devel_kit/ngx_devel_kit-0.2.19" | |
cd /tmp | |
mkdir lua-nginx-module | |
cd lua-nginx-module | |
#wget "https://github.com/chaoslawful/lua-nginx-module/archive/v0.7.21.tar.gz" | |
wget "https://github.com/openresty/lua-nginx-module/archive/v0.9.12.tar.gz" | |
tar -xzvf v0.9.12.tar.gz | |
LUA_MOD="/tmp/lua-nginx-module/lua-nginx-module-0.9.12" | |
cd /tmp | |
wget 'http://nginx.org/download/nginx-1.7.4.tar.gz' | |
tar -xzvf nginx-1.7.4.tar.gz | |
cd ./nginx-1.7.4 | |
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 | |
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
Line 24 needs "cd /tmp" before the mkdir. I noticed this when I had to run the script twice each time because it complained that it cannot find "/tmp/ngx_devel_kit/ngx_devel_kit-0.2.19/config"