Last active
November 6, 2019 20:26
-
-
Save jmervine/5407622 to your computer and use it in GitHub Desktop.
Revisions
-
jmervine revised this gist
Apr 23, 2013 . 1 changed file with 1 addition and 56 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,56 +1 @@ ### See: [http://www.rubyops.net/nginx-with-lua-module](http://www.rubyops.net/nginx-with-lua-module) -
jmervine revised this gist
Apr 23, 2013 . 1 changed file with 0 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 @@ -12,8 +12,6 @@ if ! test -d /usr/local/include/luajit-2.0; then cd LuaJIT-2.0.1 make sudo make install else echo "Skipping LuaJIT-2.0.1, as it's already installed." fi -
jmervine revised this gist
Apr 18, 2013 . 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,6 +1,6 @@ # Installing Nginx with Lua module [Download the script.](https://gist.github.com/jmervine/5407622/raw/nginx_w_lua.bash) Or run the following command: -
jmervine revised this gist
Apr 18, 2013 . 1 changed file with 8 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 @@ -1,5 +1,13 @@ # Installing Nginx with Lua module [Download the script.](https://gist.github.com/jmervine/5407622#file-nginx_w_lua-bash) Or run the following command: bash < <(curl -s https://gist.github.com/jmervine/5407622/raw/nginx_w_lua.bash) ### What's it do? * Download LuaJIT 2.0.1 * Install LuaJIT 2.0.1 * Link `luajit` to `lua` -
jmervine revised this gist
Apr 18, 2013 . 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 @@ -31,7 +31,7 @@ Include Results: Stop Nginx: `sudo /etc/init.d/nginx stop` Patch [`/etc/init.d/nginx`](https://gist.github.com/jmervine/5407622#file-nginx-init-sh) like so: 13,14c13,18 < PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -
jmervine revised this gist
Apr 18, 2013 . 1 changed file with 100 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 @@ -0,0 +1,100 @@ #!/bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $local_fs $remote_fs $network $syslog # Required-Stop: $local_fs $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the nginx web server # Description: starts nginx using start-stop-daemon ### END INIT INFO export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH # ensure default configuration location test "$DAEMON_OPTS" || DAEMON_OPTS="-c /etc/nginx/nginx.conf" PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/opt/nginx/sbin/nginx NAME=nginx DESC=nginx # Include nginx defaults if available if [ -f /etc/default/nginx ]; then . /etc/default/nginx fi test -x $DAEMON || exit 0 set -e . /lib/lsb/init-functions test_nginx_config() { if $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1; then return 0 else $DAEMON -t $DAEMON_OPTS return $? fi } case "$1" in start) echo -n "Starting $DESC: " test_nginx_config # Check if the ULIMIT is set in /etc/default/nginx if [ -n "$ULIMIT" ]; then # Set the ulimits ulimit $ULIMIT fi start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS || true echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON || true echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON || true sleep 1 test_nginx_config start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true echo "$NAME." ;; reload) echo -n "Reloading $DESC configuration: " test_nginx_config start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON || true echo "$NAME." ;; configtest|testconfig) echo -n "Testing $DESC configuration: " if test_nginx_config; then echo "$NAME." else exit $? fi ;; status) status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx && exit 0 || exit $? ;; *) echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest}" >&2 exit 1 ;; esac exit 0 -
jmervine revised this gist
Apr 17, 2013 . 1 changed file with 13 additions and 13 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 @@ -33,16 +33,16 @@ Stop Nginx: `sudo /etc/init.d/nginx stop` Patch `/etc/init.d/nginx` like so: 13,14c13,18 < PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin < DAEMON=/usr/sbin/nginx --- > export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH > > # ensure default configuration location > test "$DAEMON_OPTS" || DAEMON_OPTS="-c /etc/nginx/nginx.conf" > PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > DAEMON=/opt/nginx/sbin/nginx` > Note: the above may not be the best way, but it's what I had to do to get it to work and I didn't have a ton of time to mess with it. -
jmervine revised this gist
Apr 17, 2013 . 1 changed file with 12 additions and 7 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 @@ -33,11 +33,16 @@ Stop Nginx: `sudo /etc/init.d/nginx stop` Patch `/etc/init.d/nginx` like so: ` 13,14c13,18 < PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin < DAEMON=/usr/sbin/nginx --- > export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH > > # ensure default configuration location > test "$DAEMON_OPTS" || DAEMON_OPTS="-c /etc/nginx/nginx.conf" > PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > DAEMON=/opt/nginx/sbin/nginx` -
jmervine revised this gist
Apr 17, 2013 . 1 changed file with 13 additions and 6 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 @@ -23,14 +23,21 @@ Include Results: * `/usr/local/include/luajit-2.0/*` ### Starting Nginx $ LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH /opt/nginx/sbin/nginx -c /path/to/nginx.conf ### Update existing Nginx init: Stop Nginx: `sudo /etc/init.d/nginx stop` Patch `/etc/init.d/nginx` like so: 13,15c13,14 < export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH < PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin < DAEMON=/opt/nginx/sbin/nginx --- > PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > DAEMON=/usr/sbin/nginx -
jmervine revised this gist
Apr 17, 2013 . 1 changed file with 13 additions 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,4 +1,4 @@ # Installing Nginx with Lua module * Download LuaJIT 2.0.1 * Install LuaJIT 2.0.1 @@ -22,3 +22,15 @@ Lib Results: Include Results: * `/usr/local/include/luajit-2.0/*` ### Update existing Nginx init: Patch `/etc/init.d/nginx` like so: 13,14c13,14 < PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin < DAEMON=/opt/nginx/sbin/nginx --- > PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > DAEMON=/usr/sbin/nginx -
jmervine revised this gist
Apr 17, 2013 . 1 changed file with 23 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 @@ -1 +1,24 @@ Installing Nginx with Lua module: * Download LuaJIT 2.0.1 * Install LuaJIT 2.0.1 * Link `luajit` to `lua` * Download NDK * Download lua-nginx-module * Download Nginx 1.2.8 * `configure` Nginx with lua-nginx-module * Install Nginx Binary Results: * `/opt/nginx/sbin/nginx` * `/usr/local/bin/lua` * `/usr/local/bin/luajit` Lib Results: * `/usr/local/lib/*lua*` Include Results: * `/usr/local/include/luajit-2.0/*` -
jmervine revised this gist
Apr 17, 2013 . 2 changed files with 2 additions and 51 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,51 +1 @@ Installing Nginx with Lua module: 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 @@ -33,6 +33,7 @@ tar -xzvf v0.7.21.tar.gz LUA_MOD="/tmp/lua-nginx-module/lua-nginx-module-0.7.21" cd /tmp wget 'http://nginx.org/download/nginx-1.2.8.tar.gz' tar -xzvf nginx-1.2.8.tar.gz cd ./nginx-1.2.8 @@ -45,7 +46,7 @@ export LUAJIT_INC=/usr/local/include/luajit-2.0 --add-module=$LUA_MOD make -j2 sudo make install unset LUAJIT_LIB unset LUAJIT_INC -
jmervine revised this gist
Apr 17, 2013 . 1 changed file with 4 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 @@ -1,4 +1,8 @@ #!/usr/bin/bash # # bash < <(curl -s https://gist.github.com/jmervine/5407622/raw/nginx_w_lua.bash) set -x cd /tmp if ! test -d /usr/local/include/luajit-2.0; then -
jmervine revised this gist
Apr 17, 2013 . 1 changed file with 47 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 @@ -0,0 +1,47 @@ #!/usr/bin/bash cd /tmp if ! test -d /usr/local/include/luajit-2.0; then echo "Installing LuaJIT-2.0.1." wget "http://luajit.org/download/LuaJIT-2.0.1.tar.gz" tar -xzvf LuaJIT-2.0.1.tar.gz cd LuaJIT-2.0.1 make sudo make install test -x /usr/local/bin/lua || sudo ln -s /usr/local/bin/luajit /usr/local/bin/lua else echo "Skipping LuaJIT-2.0.1, as it's already installed." fi mkdir ngx_devel_kit cd ngx_devel_kit wget "https://github.com/simpl/ngx_devel_kit/archive/v0.2.18.tar.gz" tar -xzvf v0.2.18.tar.gz NGX_DEV="/tmp/ngx_devel_kit/ngx_devel_kit-0.2.18" cd /tmp mkdir lua-nginx-module cd lua-nginx-module wget "https://github.com/chaoslawful/lua-nginx-module/archive/v0.7.21.tar.gz" tar -xzvf v0.7.21.tar.gz LUA_MOD="/tmp/lua-nginx-module/lua-nginx-module-0.7.21" wget 'http://nginx.org/download/nginx-1.2.8.tar.gz' tar -xzvf nginx-1.2.8.tar.gz cd ./nginx-1.2.8 export LUAJIT_LIB=/usr/local/lib export LUAJIT_INC=/usr/local/include/luajit-2.0 ./configure --prefix=/opt/nginx \ --add-module=$NGX_DEV \ --add-module=$LUA_MOD make -j2 make install unset LUAJIT_LIB unset LUAJIT_INC -
jmervine created this gist
Apr 17, 2013 .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,51 @@ Installing Nginx with Lua module: #!/usr/bin/bash cd /tmp if ! test -d /usr/local/include/luajit-2.0; then echo "Installing LuaJIT-2.0.1." wget "http://luajit.org/download/LuaJIT-2.0.1.tar.gz" tar -xzvf LuaJIT-2.0.1.tar.gz cd LuaJIT-2.0.1 make sudo make install test -x /usr/local/bin/lua || sudo ln -s /usr/local/bin/luajit /usr/local/bin/lua else echo "Skipping LuaJIT-2.0.1, as it's already installed." fi mkdir ngx_devel_kit cd ngx_devel_kit wget "https://github.com/simpl/ngx_devel_kit/archive/v0.2.18.tar.gz" tar -xzvf v0.2.18.tar.gz NGX_DEV="/tmp/ngx_devel_kit/ngx_devel_kit-0.2.18" cd /tmp mkdir lua-nginx-module cd lua-nginx-module wget "https://github.com/chaoslawful/lua-nginx-module/archive/v0.7.21.tar.gz" tar -xzvf v0.7.21.tar.gz LUA_MOD="/tmp/lua-nginx-module/lua-nginx-module-0.7.21" wget 'http://nginx.org/download/nginx-1.2.8.tar.gz' tar -xzvf nginx-1.2.8.tar.gz cd ./nginx-1.2.8 export LUAJIT_LIB=/usr/local/lib export LUAJIT_INC=/usr/local/include/luajit-2.0 ./configure --prefix=/opt/nginx \ --add-module=$NGX_DEV \ --add-module=$LUA_MOD make -j2 make install unset LUAJIT_LIB unset LUAJIT_INC