Skip to content

Instantly share code, notes, and snippets.

@Ivlyth
Created January 25, 2016 07:27
Show Gist options
  • Save Ivlyth/73d800fa45ea09c38abf to your computer and use it in GitHub Desktop.
Save Ivlyth/73d800fa45ea09c38abf to your computer and use it in GitHub Desktop.
compile nginx with Luajit2.0
mkdir ngx-with-lua
cd ngx-with-lua
current_dir=`pwd`
# download luajit
wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz
tar -xf LuaJIT-2.0.4.tar.gz
cd LuaJIT-2.0.4
make && make install
# download more set headers module for nginx
wget https://github.com/openresty/headers-more-nginx-module/archive/v0.29.tar.gz
mv v0.29.tar.gz nginx-more-set-headers-v0.29.tar.gz
tar -xf nginx-more-set-headers-v0.29.tar.gz
# download nginx devel kit
wget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gz
mv v0.2.19.tar.gz nginx-devel-kit-v0.2.19.tar.gz
tar -xf nginx-devel-kit-v0.2.19.tar.gz
# download lua module for nginx
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.0.tar.gz
mv v0.10.0.tar.gz nginx-lua-v0.10.0.tar.gz
tar -xf nginx-lua-v0.10.0.tar.gz
# download nginx
wget http://nginx.org/download/nginx-1.9.9.tar.gz
tar -xf nginx-1.9.9.tar.gz
export LUAJIT_LIB=/usr/local/lib/libluajit-5.1.so.2.0.4
export LUAJIT_INC=/usr/local/include/luajit-2.0/
# compile nginx
cd nginx-1.9.9
./configure --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_mp4_module --with-http_secure_link_module --with-http_gzip_static_module --with-stream --with-stream_ssl_module --add-module=$current_dir/headers-more-nginx-module-0.29 --add-module=$current_dir/ngx_devel_kit-0.2.19 --add-module=$current_dir/lua-nginx-module-0.10.0 --with-ld-opt="-Wl,-rpath,/usr/local/lib"
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment