Last active
September 5, 2017 21:49
-
-
Save bbg/bf6644f97b6ee21a3199773c3913ec5e to your computer and use it in GitHub Desktop.
Nginx (Lua Module & Nginx Devel Kit & LuaJIT) install bash script
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 | |
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.1.tar.gz" | |
tar -xzvf LuaJIT-2.0.1.tar.gz | |
cd LuaJIT-2.0.1 | |
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 | |
echo "Downloading Nginx Devel Kit 0.2.18" | |
wget "https://github.com/simpl/ngx_devel_kit/archive/v0.2.18.tar.gz" | |
tar -xzvf v0.2.18.tar.gz | |
NGX_DEV="/tmp/ngx_devel_kit/ngx_devel_kit-0.2.18" | |
cd /tmp | |
mkdir lua-nginx-module | |
cd lua-nginx-module | |
echo "Downloading Lua Nginx Module 0.7.21" | |
wget "https://github.com/chaoslawful/lua-nginx-module/archive/v0.7.21.tar.gz" | |
tar -xzvf v0.7.21.tar.gz | |
LUA_MOD="/tmp/lua-nginx-module/lua-nginx-module-0.7.21" | |
cd /tmp | |
echo "Downloading Nginx 1.2.8" | |
wget 'http://nginx.org/download/nginx-1.2.8.tar.gz' | |
tar -xzvf nginx-1.2.8.tar.gz | |
cd ./nginx-1.2.8 | |
export LUAJIT_LIB=/usr/local/lib | |
export LUAJIT_INC=/usr/local/include/luajit-2.0 | |
./configure \ | |
--without-http_gzip_module \ | |
--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