当前位置: 首页 > 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.lqws.cn/news/511885.html

相关文章:

  • leetcode173.二叉搜索树迭代器
  • 计算机网络期末复习
  • OSS生命周期管理自动化:7天冷归档+30天低频访问的合规存储策略(结合企业级数据分级场景)
  • 微控制器及应用/嵌入式微控制器 期末复习指南
  • Flask(六) 数据库操作SQLAlchemy
  • order、sort、distribute和cluster by(Spark/Hive)
  • HarmonyOS开发基础 --面向鸿蒙的TypeScript基础语法一文入门
  • SpringBoot | 越权和数据权限控制的一种实现方案
  • spring01-简介
  • “苏超”拉动周末消费,抖音生活服务:比赛城市迎来普遍消费上涨
  • 鸿蒙 FolderStack 组件全解析:折叠屏悬停布局开发指南
  • 【源码】Reactive 源码
  • c++ 空指针,悬挂指针(悬空指针),野指针
  • 总结汇报思路
  • 重点解析(软件工程)
  • 使用markRaw实例化echarts对象
  • RAG实战 第三章:知识库构建与管理
  • OSS安全合规实战:金融行业敏感数据加密+KMS自动轮转策略(满足等保2.0三级要求)
  • 宝塔服务器调优工具 1.1(Opcache优化)
  • 跟着chrome面板优化页面性能
  • 中断控制与实现
  • 《C++》命名空间简述
  • AutoGPT,自主完成复杂任务
  • 安卓9.0系统修改定制化____安卓9.0修改 默认开启开发者选项与usb调试的操作步骤解析 十一
  • 2025.6.24总结
  • # Python中等于号的使用
  • 创建首个 Spring Boot 登录项目
  • Linux零基础快速入门到精通
  • 大模型本地部署,拥有属于自己的ChatGpt
  • Vue 英雄列表搜索与排序功能实现