Last active
April 3, 2020 15:34
-
-
Save karminski/135e58d2f52b91625dfc to your computer and use it in GitHub Desktop.
Revisions
-
karminski revised this gist
Apr 26, 2018 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,15 @@ #!/bin/bash # deploy_nginx_with_lua_nginx_module.sh # @version 171026:7 # @author karminski <[email protected]> # # @changes # 171026:7 CHANGE to nginx-1.10.3, lua-nginx-module-v0.10.10, luajit2-v2.1-20170925 # 170825:6 REMOVE --with-debug compile option to solve peformance issue. # 170627:5 CHANGE to nginx-1.10.3, lua-nginx-module-v0.10.8 # 161226:4 CHANGE to nginx-1.10.2, lua-nginx-module-v0.10.8, luajit2-v2.1-20161104 # 160816:3 CHANGE to nginx-1.10.1, lua-nginx-module-v0.10.8, luajit2-v2.1-20160517 # ... # @source # https://gist.github.com/karminski/135e58d2f52b91625dfc -
karminski renamed this gist
Apr 26, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
karminski revised this gist
Apr 26, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ #!/bin/bash # deploy_nginx_with_lua_nginx_module.sh # @version 180426:3 # @author karminski <[email protected]> # -
karminski revised this gist
Apr 26, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ # # @changes # 180426:3 CHANGE to luajit-v2.1-20170925, nginx-1.10.3, lua-nginx-module-v0.10.8 # @source # https://gist.github.com/karminski/135e58d2f52b91625dfc # [manual config area] -
karminski revised this gist
Apr 26, 2018 . 2 changed files with 118 additions and 39 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,118 @@ #!/bin/bash # nginx_deploy_with_lua_nginx_module.sh # @version 180426:3 # @author karminski <[email protected]> # # @changes # 180426:3 CHANGE to luajit-v2.1-20170925, nginx-1.10.3, lua-nginx-module-v0.10.8 # [manual config area] SOURCE_LUAJIT=https://github.com/openresty/luajit2/archive/v2.1-20170925.tar.gz SOURCE_NGINX=http://nginx.org/download/nginx-1.10.3.tar.gz SOURCE_NGX_DEVEL_KIT=https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz SOURCE_LUA_NGINX_MODULE=https://github.com/openresty/lua-nginx-module/archive/v0.10.10.tar.gz LUAJIT_INSTALLER_PATH=/data/apps/luajit LUAJIT_INSTALL_PATH=/data/apps/luajit NGINX_INSTALLER_PATH=/data/apps/src/nginx_installer NGINX_INSTALL_PATH=/data/apps/nginx UNTAR_FOLDER_LUAJIT=luajit2-2.1-20170925 UNTAR_FOLDER_NGINX=nginx-1.10.3 UNTAR_FOLDER_NGX_DEVEL_KIT=ngx_devel_kit-0.3.0 UNTAR_FOLDER_LUA_NGINX_MODULE=lua-nginx-module-0.10.10 # [dump config for check] echo -e "\033[34m- nginx_deploy_with_lua_nginx_module.sh start \033[0m" echo -e "\033[34m--------------------------------------------- \033[0m" echo -e "\033[34m- SOURCE_LUAJIT: ${SOURCE_LUAJIT} \033[0m" echo -e "\033[34m- SOURCE_NGINX: ${SOURCE_NGINX} \033[0m" echo -e "\033[34m- SOURCE_NGX_DEVEL_KIT: ${SOURCE_NGX_DEVEL_KIT} \033[0m" echo -e "\033[34m- SOURCE_LUA_NGINX_MODULE: ${SOURCE_LUA_NGINX_MODULE} \033[0m" echo -e "\033[34m- LUAJIT_INSTALLER_PATH: ${LUAJIT_INSTALLER_PATH} \033[0m" echo -e "\033[34m- LUAJIT_INSTALL_PATH: ${LUAJIT_INSTALL_PATH} \033[0m" echo -e "\033[34m- NGINX_INSTALLER_PATH: ${NGINX_INSTALLER_PATH} \033[0m" echo -e "\033[34m- NGINX_INSTALL_PATH: ${NGINX_INSTALL_PATH} \033[0m" echo -e "\033[34m- UNTAR_FOLDER_LUAJIT: ${UNTAR_FOLDER_LUAJIT} \033[0m" echo -e "\033[34m- UNTAR_FOLDER_NGINX: ${UNTAR_FOLDER_NGINX} \033[0m" echo -e "\033[34m- UNTAR_FOLDER_NGX_DEVEL_KIT: ${UNTAR_FOLDER_NGX_DEVEL_KIT} \033[0m" echo -e "\033[34m- UNTAR_FOLDER_LUA_NGINX_MODULE: ${UNTAR_FOLDER_LUA_NGINX_MODULE} \033[0m" # [install dependency] yum install -y pcre-devel.x86_64 openssl-devel.x86_64 wget gcc g++ # [fetch and install luajit] ## [fetch luajit source] mkdir -p ${LUAJIT_INSTALLER_PATH} cd ${LUAJIT_INSTALLER_PATH} wget ${SOURCE_LUAJIT} for i in `ls *.tar.gz` do tar -zxvf $i done cd ${UNTAR_FOLDER_LUAJIT} REPLACED_PATH=`echo ${LUAJIT_INSTALL_PATH} | awk '{gsub("/", "\\\/", $0); printf("%s\n", $0);}'` sed -i "s/export PREFIX= \/usr\/local/export PREFIX= ${REPLACED_PATH}/g" Makefile echo -e "\033[34m- [FETCH FINISH]\033[0m" ## [make and install luajit] # if you want debug with luajit, use: make CCDEBUG=-g make -j make install echo -e "\033[34m- luajit info: \033[0m" ${LUAJIT_INSTALL_PATH}/bin/luajit -v echo -e "\033[34m- [luajit INSTALL FINISH]\033[0m" # [fetch and install nginx] ## [fetch installer source] mkdir -p ${NGINX_INSTALLER_PATH} cd ${NGINX_INSTALLER_PATH} wget ${SOURCE_NGINX} wget ${SOURCE_NGX_DEVEL_KIT} wget ${SOURCE_LUA_NGINX_MODULE} for i in `ls *.tar.gz` do tar -zxvf $i done echo -e "\033[34m- [FETCH FINISH]\033[0m" ## [configure, build and install] cd ${NGINX_INSTALLER_PATH} export LUAJIT_LIB=${LUAJIT_INSTALL_PATH}/lib export LUAJIT_INC=${LUAJIT_INSTALL_PATH}/include/luajit-2.1 echo -e "\033[34m- config LUAJIT_LIB to ${LUAJIT_LIB} \033[0m" echo -e "\033[34m- config LUAJIT_INC to ${LUAJIT_INC} \033[0m" cd "${NGINX_INSTALLER_PATH}/${UNTAR_FOLDER_NGINX}" chmod +x ./configure ./configure --prefix=${NGINX_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 \ --with-http_stub_status_module \ --add-module=${NGINX_INSTALLER_PATH}/${UNTAR_FOLDER_NGX_DEVEL_KIT} \ --add-module=${NGINX_INSTALLER_PATH}/${UNTAR_FOLDER_LUA_NGINX_MODULE} \ make -j && make install export PATH=$PATH:${NGINX_INSTALL_PATH}/sbin ## [run nginx -v] echo -e "\033[34m- nginx info: \033[0m" ${NGINX_INSTALL_PATH}/sbin/nginx -V echo -e "\033[34m- [nginx INSTALL FINISH]\033[0m" echo -e "\033[34m- [ALL DONE]\033[0m" This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,39 +0,0 @@ -
karminski created this gist
Mar 15, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ #!/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} \