Skip to content

Instantly share code, notes, and snippets.

@karminski
Last active April 3, 2020 15:34
Show Gist options
  • Select an option

  • Save karminski/135e58d2f52b91625dfc to your computer and use it in GitHub Desktop.

Select an option

Save karminski/135e58d2f52b91625dfc to your computer and use it in GitHub Desktop.
nginx with lua-nginx-module auto deploy scripts
#!/bin/bash
# setup.sh
# [manual config area]
GLOBAL_PATH=/home/apps/nginx
INSTALL_PATH=/home/apps/nginx/nginx
# [nginx module]
nginx=nginx-1.9.12
ngx_devel_kit=ngx_devel_kit-0.3.0rc1
lua_nginx_module=lua-nginx-module-0.10.2
stream_lua_nginx_module=stream-lua-nginx-module-0.0.1
# run
cd ${GLOBAL_PATH}
export LUAJIT_LIB=${GLOBAL_PATH}/src/luajit-2.1/lib
export LUAJIT_INC=${GLOBAL_PATH}/src/luajit-2.1/include/luajit-2.1
echo "config LUAJIT_LIB to ${LUAJIT_LIB} "
echo "config LUAJIT_INC to ${LUAJIT_INC} "
echo -e "\n\n"
# configure nginx
cd "${GLOBAL_PATH}/${nginx}"
./configure --prefix=${INSTALL_PATH} \
--with-ld-opt="-Wl,-rpath,${LUAJIT_LIB}" \
--with-stream \
--with-stream_ssl_module \
--with-http_ssl_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--add-module=${GLOBAL_PATH}/${ngx_devel_kit} \
--add-module=${GLOBAL_PATH}/${lua_nginx_module} \
--add-module=${GLOBAL_PATH}/${stream_lua_nginx_module} \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment