Nginx之13运筹帷幄 - (VeryNginx)
生活随笔
收集整理的這篇文章主要介紹了
Nginx之13运筹帷幄 - (VeryNginx)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
什么是VeryNginx
VeryNginx 基于 lua_nginx_module(openrestry) 開發,實現了高級的防火墻、訪問統計和其他的一些功能。 集成在 Nginx 中運行,擴展了 Nginx 本身的功能,并提供了友好的 Web 交互界面。
如何安裝VeryNginx
Nginx編譯環境
yum -y install gcc gcc-c++ git pythonNginx基礎依賴
VeryNginx依賴
使用到了以下模塊,自己編譯 Nginx 時,需要包含以下模塊才能正常使用。
編譯安裝 Nginx
# 下載nginx源碼包 wget http://nginx.org/download/nginx-1.15.9.tar.gz tar -xzvf nginx-1.15.9.tar.gz # 配置編譯參數 ./configure --prefix=/usr/local/nginx \ --with-ld-opt=-Wl,-rpath,/usr/local/lib/ \ --with-http_ssl_module \ --with-http_stub_status_module \ --add-module=../ngx_devel_kit-0.3.0 \ --add-module=../lua-nginx-module-0.10.11rc2 # 用yum去解決nginx依賴時不用指定下面三個編譯項 --with-pcre=../pcre2-10.32 \ --with-zlib=../zlib-1.2.11 \ --with-openssl=../openssl-1.0.2p # 編譯及安裝 make -j4 & make install安裝 VeryNginx
git clone https://github.com/alexazhou/VeryNginx.git cd VeryNginx python install.py install verynginx # 更新 Nginx 配置文件 vim /usr/local/nginx/conf/nginx.conf # 在 全局 配置段中加入: include /opt/verynginx/verynginx/nginx_conf/in_external.conf; # 在 http 配置段中加入: include /opt/verynginx/verynginx/nginx_conf/in_http_block.conf; # 在 server 配置段中加入: include /opt/verynginx/verynginx/nginx_conf/in_server_block.conf; include /opt/verynginx/verynginx/nginx_conf/in_external.conf; http {include /opt/verynginx/verynginx/nginx_conf/in_http_block.conf;server {listen 80; server_name localhost; include /opt/verynginx/verynginx/nginx_conf/in_server_block.conf;} }登錄 VeryNginx
瀏覽器訪問 http://Server_Name/verynginx/index.html
默認用戶名和密碼都是 verynginx
在這個Dashboard中,可見到目前TCP連接數及響應時間和網絡流量等相關數值,在Config中也可以根據相應用戶請求進行進行一些規則匹配實現自定義防火墻的功能。
總結
以上是生活随笔為你收集整理的Nginx之13运筹帷幄 - (VeryNginx)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 华为代码质量军规.pdf
- 下一篇: Nginx - 记一次Nginx端口转发