当前位置: 首页 > news >正文

Linux系统---Nginx配置nginx状态统计

配置Nignx状态统计

1、下载vts模块

https://github.com/vozlt/nginx-module-vts

[root@client ~]# nginx -s stop
[root@client ~]# ls
anaconda-ks.cfg                  nginx-1.27.3
ceph-release-1-1.el7.noarch.rpm  nginx-1.27.3.tar.gz
info.sh                          nginx-module-vts-master.zip
[root@client ~]# nginx -s stop
[root@client ~]# unzip nginx-module-vts-master.zip 

2、编译nginx

如果没有编译安装过nginx,就用下面这个

./configure --prefix=/usr/local/nginx/ --add-module=/root/nginx-module-vts-master && make && make install

如果我们已经编译安装过了,就只需把vts模块添加进去就行然后编译,不安装

[root@client ~]# mv nginx-module-vts-master /usr/local/nginx/
[root@client ~]# nginx -V
nginx version: nginx/1.27.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx 
[root@client ~]# nginx -V |grep vts    #显示是没有vts模块的
nginx version: nginx/1.27.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-compat --with-debug --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic 
[root@client ~]# cd nginx-1.27.3/
[root@client nginx-1.27.3]# ./configure --prefix=/usr/local/nginx/nginx-module-vts-master/
[root@client nginx-1.27.3]# make[root@client nginx-1.27.3]# cd objs/
[root@client objs]# ./nginx -V    #模块已经安装好了
nginx version: nginx/1.27.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx/ --add-module=/usr/local/nginx/nginx-module-vts-master/ 
[root@client objs]# mv /usr/local/nginx/sbin/nginx /opt/nginx.bak    #备份nginx命令
[root@client objs]# cp ./nginx /usr/local/nginx/sbin/    #使用当前添加了vts模块的命令
[root@client objs]# vim /usr/local/nginx/conf/nginx.conf   修改配置
[root@client objs]# nginx  启用nginx

进入/usr/local/nginx/conf/nginx.conf里修改,修改好后,如上图启用nginx就可以了

    ##添加如下配置###vhost_traffic_status_zone;  #添加这个server {listen       80;server_name  localhost;charset utf-8;access_log  logs/$server_addr.acce ss.log  main;location / {root   html;index  index.html index.htm;}##添加如下配置####location /status {					#这vhost_traffic_status_display;vhost_traffic_status_display_format html;}									#到这儿,中间部分添加进去

去网页访问测试结果

http://192.168.235.140/status

这就欧克了

http://www.lryc.cn/news/574839.html

相关文章:

  • 鸿蒙 Stack 组件深度解析:层叠布局的核心应用与实战技巧
  • AI时代工具:AIGC导航——AI工具集合
  • 接口自动化测试之pytest 运行方式及前置后置封装
  • 爬取小红书相关数据导入到excel
  • 项目需求评审报告参考模板
  • 图的拓扑排序管理 Go 服务启动时的组件初始化顺序
  • 飞往大厂梦之算法提升-day08
  • sqlserver怎样动态执行存储过程,并且返回报错
  • Java实现简易即时通讯系统
  • day41 打卡
  • 基于元学习的回归预测模型如何设计?
  • MySQL:深入总结锁机制
  • linux操作系统的软件架构分析
  • 战略调整频繁,如何快速重构项目组合
  • 原生策略与功耗方案参考
  • Android 开发问题:Wrong argument type for formatting argument ‘#2‘ in info_message
  • 马克思主义基本原理期末复习下
  • DVWA Brute Force漏洞深度分析与利用指南
  • iwebsec靶场sqli注入(2)
  • Vue3+Spring boot 前后端防抖增强方案
  • 学习记录:DAY33
  • 2025年渗透测试面试题总结-2025年HW(护网面试) 09(题目+回答)
  • HarmonyOS开发基础 --面向鸿蒙的TypeScript基础语法一文入门
  • 大模型本地部署,拥有属于自己的ChatGpt
  • 《仿盒马》app开发技术分享-- 兑换列表展示(68)
  • OSS安全合规实战:金融行业敏感数据加密+KMS自动轮转策略(满足等保2.0三级要求)
  • 如何使用MQTTX软件来进行MQTT协议的测试
  • # Python中等于号的使用
  • 逆向入门(7)汇编篇-mul指令的学习
  • DAY 41 简单CNN