当前位置: 首页 > 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

这就欧克了

相关文章:

  • 哪些网站可以接任务做兼职东莞关键词优化推广
  • 免费网站软件免费下载安装seo静态页源码
  • 做app简单还是网站上海最新新闻热点事件
  • 网站不能访问的原因百度爱采购优化
  • 营销型的网站宁波网站建设团队
  • 域名解析错误怎么解决网络seo是什么工作
  • 如何使用MQTTX软件来进行MQTT协议的测试
  • Harmony状态管理 @Local和@Param
  • 计算机网络期末复习
  • Git 3天2K星标: Happy-LLM 项目介绍(附教程)
  • 【基础篇-消息队列】—— 如何实现单个队列的并行消费及如何保证消息的严格顺序
  • LangChain网页自动化PlayWrightBrowserToolkit
  • 在Ubuntu下建设自己的本地大模型docker+ollama+openwenui
  • leetcode173.二叉搜索树迭代器
  • 深入理解 BOM:浏览器对象模型详解
  • RabbitMQ是什么?以及优缺点
  • Kafka 监控与调优实战指南(一)
  • 通过Prompt提示构建思维链
  • FSMC控制LCD(TFTLCD:Z350IT002)显示案例
  • OpenAI-Kotlin文档详解
  • 基于目标驱动的分布式敏捷开发
  • 顺序表整理和单项链表01 day20
  • 华为云Flexus+DeepSeek征文 | 基于华为云的 Dify-LLM 企业级 AI 开发平台部署指南
  • AI 产品部署和交付的基础设施——全景解析
  • 【Linux手册】环境变量与命令行参数:贯穿系统与应用的隐形桥梁
  • 09.【C语言学习笔记】指针(一)