Comments (16)
I was able to pretty quickly write support for cache purge module basically you need
`echo "Modules to install :"
while [[ $CACHEPURGE != "y" && $CACHEPURGE != "n" ]]; do
read -p " Cache Purge [y/n]: " -e CACHEPURGE
done
# Cache Purge
if [[ "$CACHEPURGE" = 'y' ]]; then
cd /usr/local/src/nginx/modules
echo -ne " Downloading ngx_cache_purge [..]\r"
git clone https://github.com/FRiCKLE/ngx_cache_purge >> /tmp/nginx-autoinstall.log 2>&1
if [ $? -eq 0 ]; then
echo -ne " Downloading ngx_cache_purge [${CGREEN}OK${CEND}]\r"
echo -ne "\n"
else
echo -e " Downloading ngx_cache_purge [${CRED}FAIL${CEND}]"
echo ""
echo "Please look at /tmp/nginx-autoinstall.log"
echo ""
exit 1
fi
fi
# Cache Purge Module
if [[ "$CACHEPURGE" = 'y' ]]; then
NGINX_MODULES=$(echo $NGINX_MODULES; echo "--add-module=/usr/local/src/nginx/modules/ngx_cache_purge")
fi
`
from nginx-autoinstall.
Additional Features for Modules:
- pagespeed really should be built as a dynamic module.
The short answer is using the pagespeed unplugged; flag
does not actually drop it from usage like a dynamic module would.
pagespeed optionally built as a dynamic module gives much more flexibility to leave it off and truly unloaded by default.
Note: current flag to disable page speed doesn't fully disable it. Proof you still see INFO related messages in the error.log while it's set to "unplugged"
[ngx_pagespeed 1.13.35.2-0] No threading detected. Own threads: 1 Rewrite, 1 Expensive Rewrite. pagespeed: rollback gzip, explicit configuration in /etc/nginx/nginx.conf
I would make this change but it would be much faster for you guys to do it.
LOVE this script. I want to sleep with it in my bed.
You should charge me 25 cents to run it.
from nginx-autoinstall.
Curious if ModSecurity will be added or anyone has an updated script with it included?
I have added it here.... https://github.com/OptimBro/OptimNGINX
Not just modsecurity, but more extra modules support.
from nginx-autoinstall.
@Firegarden we already support it
from nginx-autoinstall.
I have re-tested and this is working as expected. Thank you!
RE: Bro I had used these directives in my server and it's not respecting them.
more_clear_headers more_set_headers
from nginx-autoinstall.
Dalla bill do you guys want to include an option to compile the lua-nginx-module
from nginx-autoinstall.
I just saw a user asking for Lua - can I send you my lua script? It's perfect.
See attached!
nginx-autoinstall.zip
You are good in writing scripts where I'm zero, can you add support for ModSecurity too? :)
from nginx-autoinstall.
Curious if ModSecurity will be added or anyone has an updated script with it included?
from nginx-autoinstall.
Any idea why I am getting this? Seems like its not installing it correctly.
Sep 08 11:24:50 vm47204 nginx[1210756]: no file '/usr/local/share/lua/5.1/resty/core/init.lua'
Sep 08 11:24:50 vm47204 nginx[1210756]: no file './resty/core.so'
Sep 08 11:24:50 vm47204 nginx[1210756]: no file '/usr/local/lib/lua/5.1/resty/core.so'
Sep 08 11:24:50 vm47204 nginx[1210756]: no file '/usr/local/lib/lua/5.1/loadall.so'
Sep 08 11:24:50 vm47204 nginx[1210756]: no file './resty.so'
Sep 08 11:24:50 vm47204 nginx[1210756]: no file '/usr/local/lib/lua/5.1/resty.so'
Sep 08 11:24:50 vm47204 nginx[1210756]: no file '/usr/local/lib/lua/5.1/loadall.so'
from nginx-autoinstall.
OK this script is just about the best thing on the internet. What is needed is nginx cache purge module. Can you please add support for nginx cache purge module? Also you could do naxsi because its pretty popular. My only other question - Why not use open ssl 1.1.0h ?
This is excellent excellent install script. Thank you
from nginx-autoinstall.
This scripts is good I want to give you an award!
from nginx-autoinstall.
Thanks @Firegarden :)
Please discuss cache purge in #45.
Also, why would we use OpenSSL 1.1.0h?
from nginx-autoinstall.
Make $5 Halla you guys think this is worth including in the script?
curl -L -O 'https://github.com/openresty/echo-nginx-module/archive/v0.61.tar.gz'
...
--add-module=/home/ubuntu/nginx/echo-nginx-module-0.61
The reason is because it is the best way to gain access to the $request_body variable which allows you to filter for the darn POST variables. Generally POST vars are not available to your NGXIN Config and this module is the most straight forward way to do that
from nginx-autoinstall.
Halla back I finally got the script modified to include lua - sorry bruhs I don't know how to use git hub so I am including the lines below that you need to add. It works perfectly.
Variables
NGINX_MAINLINE_VER=1.15.6
NGINX_STABLE_VER=1.14.0
LIBRESSL_VER=2.8.2
OPENSSL_VER=1.1.1
NPS_VER=1.13.35.2
HEADERMOD_VER=0.33
LUA_JIT_VER=2.1-20181029
LUA_NGINX_VER=0.10.14rc2
NGINX_DEV_KIT=0.3.0
while [[ $LUA != "y" && $LUA != "n" ]]; do
read -p " ngx_http_lua_module [y/n]: " -e LUA
done
Lua
if [[ "$LUA" = 'y' ]]; then
# LuaJIT download
echo -ne " Downloading OpenResty's LuaJIT [..]\r"
cd /usr/local/src/nginx/modules
wget https://github.com/openresty/luajit2/archive/v${LUA_JIT_VER}.tar.gz >> /tmp/nginx-autoinstall.log 2>&1
tar xaf v${LUA_JIT_VER}.tar.gz
cd luajit2-${LUA_JIT_VER}
if [ $? -eq 0 ]; then
echo -ne " Downloading OpenResty's LuaJIT [${CGREEN}OK${CEND}]\r"
echo -ne "\n"
else
echo -e " Downloading OpenResty's LuaJIT [${CRED}FAIL${CEND}]"
echo ""
echo "Please look at /tmp/nginx-autoinstall.log"
echo ""
exit 1
fi
echo -ne " Configuring OpenResty's LuaJIT [..]\r"
make >> /tmp/nginx-autoinstall.log 2>&1
if [ $? -eq 0 ]; then
echo -ne " Configuring OpenResty's LuaJIT [${CGREEN}OK${CEND}]\r"
echo -ne "\n"
else
echo -e " Configuring OpenResty's LuaJIT [${CRED}FAIL${CEND}]"
echo ""
echo "Please look at /tmp/nginx-autoinstall.log"
echo ""
exit 1
fi
# LuaJIT install
echo -ne " Installing LuaJIT [..]\r"
make install >> /tmp/nginx-autoinstall.log 2>&1
if [ $? -eq 0 ]; then
echo -ne " Installing OpenResty's LuaJIT [${CGREEN}OK${CEND}]\r"
echo -ne "\n"
else
echo -e " Installing OpenResty's LuaJIT [${CRED}FAIL${CEND}]"
echo ""
echo "Please look at /tmp/nginx-autoinstall.log"
echo ""
exit 1
fi
# ngx_devel_kit download
echo -ne " Downloading ngx_devel_kit [..]\r"
cd /usr/local/src/nginx/modules
wget https://github.com/simplresty/ngx_devel_kit/archive/v${NGINX_DEV_KIT}.tar.gz >> /tmp/nginx-autoinstall.log 2>&1
tar xaf v${NGINX_DEV_KIT}.tar.gz
#cd ngx_devel_kit-${NGINX_DEV_KIT} Downloading ngx_devel_kit [OK] [..]
if [ $? -eq 0 ]; then
echo -ne " Downloading ngx_devel_kit [${CGREEN}OK${CEND}]\r"
echo -ne "\n"
else
echo -e " Downloading ngx_devel_kit [${CRED}FAIL${CEND}]"
echo ""
echo "Please look at /tmp/nginx-autoinstall.log"
echo ""
exit 1
fi
# lua-nginx-module download
echo -ne " Downloading lua-nginx-module [..]\r"
cd /usr/local/src/nginx/modules
wget https://github.com/openresty/lua-nginx-module/archive/v${LUA_NGINX_VER}.tar.gz >> /tmp/nginx-autoinstall.log 2>&1
tar xaf v${LUA_NGINX_VER}.tar.gz
#cd lua-nginx-module-${LUA_NGINX_VER}
if [ $? -eq 0 ]; then
echo -ne " Downloading lua-nginx-module [${CGREEN}OK${CEND}]\r"
echo -ne "\n"
else
echo -e " Downloading lua-nginx-module [${CRED}FAIL${CEND}]"
echo ""
echo "Please look at /tmp/nginx-autoinstall.log"
echo ""
exit 1
fi
fi
Optional options
if [[ "$LUA" = 'y' ]]; then
NGINX_OPTIONS=$(echo $NGINX_OPTIONS; echo --with-ld-opt="-Wl,-rpath,/usr/local/bin/luajit")
fi
Lua
if [[ "$LUA" = 'y' ]]; then
NGINX_MODULES=$(echo $NGINX_MODULES; echo "--add-module=/usr/local/src/nginx/modules/ngx_devel_kit-${NGINX_DEV_KIT}")
NGINX_MODULES=$(echo $NGINX_MODULES; echo "--add-module=/usr/local/src/nginx/modules/lua-nginx-module-${LUA_NGINX_VER}")
fi
if [[ "$LUA" = 'y' ]]; then
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.1
fi
Removing Nginx files and modules files
echo -ne " Removing Nginx files [..]\r"
rm -r /usr/local/src/nginx \
/usr/sbin/nginx* \
/usr/local/bin/luajit* \
/usr/local/include/luajit* \
/etc/logrotate.d/nginx \
/var/cache/nginx \
/lib/systemd/system/nginx.service \
from nginx-autoinstall.
Sorry it's so messy hit me up if you want to use this or help me understand how to commit my version!
from nginx-autoinstall.
I just saw a user asking for Lua - can I send you my lua script? It's perfect.
See attached!
nginx-autoinstall.zip
from nginx-autoinstall.
Related Issues (20)
- Lua build error
- [IMPROVE] adding support for custom ZLIB and PCRE build
- right config for 443
- Quiche broken installation HOT 2
- add ngx_php7 module
- /usr/sbin/nginx: No such file or directory HOT 1
- can't install quic HOT 2
- Brotli make ended in error HOT 3
- Add NGINX-QUIC HOT 9
- Certbot
- nginx.conf question
- quic not working with ipv6 HOT 4
- Replace old `ngx_cache_purge` module source with a maintained fork HOT 1
- Support Zstd HOT 3
- set-misc-nginx-module not loaded HOT 1
- Option to reuse compiled/downloaded files
- Build failing on Ubuntu 22.04 with Brotli HOT 2
- Support certbot
- Support test coockie module
- support add nginx modules HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-autoinstall.