Skip to content

Instantly share code, notes, and snippets.

@DuyNguyen1879
Forked from Ivlyth/install_ngx_with_lua.sh
Created April 3, 2020 15:36
Show Gist options
  • Save DuyNguyen1879/386c752606ee3efae9a0c3fcd477887b to your computer and use it in GitHub Desktop.
Save DuyNguyen1879/386c752606ee3efae9a0c3fcd477887b to your computer and use it in GitHub Desktop.

Revisions

  1. Myth created this gist Jan 25, 2016.
    37 changes: 37 additions & 0 deletions install_ngx_with_lua.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    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