diff --git a/nginx_build_script/build.sh b/nginx_build_script/build.sh index 5599a5b..7f4db95 100644 --- a/nginx_build_script/build.sh +++ b/nginx_build_script/build.sh @@ -31,12 +31,30 @@ make sudo make install cd .. +# lua-nginx-module buildup part (Big Part) +mkdir nginx-lua && cd nginx-lua +mkdir -p /opt/nginx-lua-module/ +git clone https://github.com/openresty/lua-resty-core +git clone https://github.com/openresty/lua-resty-lrucache +git clone https://github.com/openresty/luajit2 + +cd luajit2 && make install PREFIX=/opt/nginx-lua-module/luajit2 && cd .. +cd lua-resty-core && make install PREFIX=/opt/nginx-lua-module/ && cd .. +cd lua-resty-lrucache && make install PREFIX=/opt/nginx-lua-module/ && cd .. +cd .. + +export LUAJIT_LIB=/opt/nginx-lua-module/luajit2/lib +export LUAJIT_INC=/opt/nginx-lua-module/luajit2/include/luajit-2.1 + +# Build Nginx + cd nginx mkdir mosc && cd mosc && curl -sSL https://raw.githubusercontent.com/minoplhy/scriptbox/main/nginx_build_script/modules.sh | bash && cd .. curl -sSL https://raw.githubusercontent.com/minoplhy/scriptbox/main/nginx_build_script/configure.sh | bash && make if [[ $Nginx_Install == "yes" ]]; then - mkdir /lib/nginx/ && mkdir /lib/nginx/modules + mkdir -p /lib/nginx/ && mkdir -p /lib/nginx/modules + mkdir -p /etc/nginx && mkdir -p /etc/nginx/sites-enabled && mkdir -p /etc/nginx/modules-enabled cd objs && cp *.so /lib/nginx/modules rm /usr/sbin/nginx cp nginx /usr/sbin/nginx diff --git a/nginx_build_script/configure.sh b/nginx_build_script/configure.sh index bbc4975..995685b 100644 --- a/nginx_build_script/configure.sh +++ b/nginx_build_script/configure.sh @@ -1,7 +1,8 @@ ./auto/configure \ --with-cc-opt="-I../boringssl/include" \ --with-ld-opt="-L../boringssl/build/ssl \ --L../boringssl/build/crypto" \ +-L../boringssl/build/crypto \ +-Wl,-rpath,/opt/nginx-lua-module/luajit2/lib" \ --prefix=/usr/share/nginx \ --conf-path=/etc/nginx/nginx.conf \ --http-log-path=/var/log/nginx/access.log \ @@ -48,6 +49,8 @@ --add-dynamic-module=mosc/nginx-dav-ext-module \ --add-dynamic-module=mosc/echo-nginx-module \ --add-dynamic-module=mosc/ModSecurity-nginx \ +--add-dynamic-module=mosc/lua-nginx-module \ +--add-dynamic-module=mosc/ngx_devel_kit \ --with-http_v3_module \ --with-http_geoip_module \ --with-stream_geoip_module \ No newline at end of file diff --git a/nginx_build_script/modules.conf b/nginx_build_script/modules.conf index 4dfc872..18b430d 100644 --- a/nginx_build_script/modules.conf +++ b/nginx_build_script/modules.conf @@ -3,4 +3,6 @@ load_module /lib/nginx/modules/ngx_http_cache_purge_module.so; load_module /lib/nginx/modules/ngx_http_dav_ext_module.so; load_module /lib/nginx/modules/ngx_http_echo_module.so; load_module /lib/nginx/modules/ngx_http_headers_more_filter_module.so; -load_module /lib/nginx/modules/ngx_http_modsecurity_module.so; \ No newline at end of file +load_module /lib/nginx/modules/ngx_http_modsecurity_module.so; +load_module /lib/nginx/modules/ngx_http_lua_module.so; +load_module /lib/nginx/modules/ndk_http_module.so; \ No newline at end of file diff --git a/nginx_build_script/modules.sh b/nginx_build_script/modules.sh index 0cb4436..f4c3f49 100644 --- a/nginx_build_script/modules.sh +++ b/nginx_build_script/modules.sh @@ -3,4 +3,6 @@ git clone https://github.com/sto/ngx_http_auth_pam_module git clone https://github.com/arut/nginx-dav-ext-module/ git clone https://github.com/openresty/echo-nginx-module git clone https://github.com/nginx-modules/ngx_cache_purge -git clone https://github.com/SpiderLabs/ModSecurity-nginx \ No newline at end of file +git clone https://github.com/SpiderLabs/ModSecurity-nginx +git clone https://github.com/openresty/lua-nginx-module +git clone https://github.com/vision5/ngx_devel_kit \ No newline at end of file