Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

在 CentOS 7 上部署圖形化強力防護的 VeryNginx

VeryNginx 是一款功能強大且自帶友善圖形介面的 Nginx 擴充方案,能即時分析 Nginx 運行狀態,涵蓋每秒請求數、響應時間、網路流量與連線數;同時提供請求過濾(IP、UserAgent、URI、請求參數)與訪問統計(總請求數、各狀態碼次數、返回位元組數、平均響應時間等)能力。

一、基礎環境

角色 serverA,IP 192.168.159.133
核心 3.10.0-327.el7.x86_64
發行版 CentOS Linux release 7.2.1511 (Core)
nginx version: openresty/1.9.15.1

二、安裝 VeryNginx

1、新增 nginx 用戶:

useradd -s /bin/false -d /opt/verynginx/ -m nginx

2、安裝編譯所需的基礎套件:

yum -y install make git gcc pcre-devel pcre openssl openssl-devel

3、下載並編譯安裝 openresty:

wget https://openresty.org/download/openresty-1.9.15.1.tar.gz
tar zxvf openresty-1.9.15.1.tar.gz
cd openresty-1.9.15.1
./configure --prefix=/opt/verynginx/openresty --user=nginx --group=nginx \
  --with-http_v2_module --with-http_sub_module \
  --with-http_stub_status_module --with-luajit
make
make install

4、修改配置檔:

cd ~
git clone https://github.com/alexazhou/VeryNginx.git
cp -r ~/VeryNginx/verynginx /opt/verynginx
yes | cp VeryNginx/nginx.conf /opt/verynginx/openresty/nginx/conf/
chown nginx.nginx /opt/verynginx/ -R

5、建立捷徑,方便直接呼叫 nginx:

find / -name "nginx"
cp /opt/verynginx/openresty/nginx/sbin/nginx /usr/bin/nginx

6、啟動服務並確認:

nginx
ps -ef | grep nginx
netstat -tupnl | grep nginx

7、查看相關日誌:

ll /opt/verynginx/openresty/nginx/logs
access.log  error.log  nginx.pid

8、登入位址、帳號與密碼位於 /opt/verynginx/verynginx/lua_script/VeryNginxConfig.lua。

9、成果預覽:

在 CentOS 7 上部署圖形化強力防護的 VeryNginx

在 CentOS 7 上部署圖形化強力防護的 VeryNginx

10、更多資訊可參考專案首頁 https://github.com/alexazhou/VeryNginx 。

Copyright © Linux教程網 All Rights Reserved