Ubuntu安装nginx以及监控(ninx-module-vts)

1、在线安装依赖

参考:https://www.cnblogs.com/EasonJim/p/7806879.html

安装gcc g++的依赖库

sudo apt-get install build-essential
sudo apt-get install libtool

安装pcre依赖库(http://www.pcre.org/

sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev

安装zlib依赖库(http://www.zlib.net

sudo apt-get install zlib1g-dev

安装SSL依赖库

sudo apt-get install openssl

2、离线安装nginx

个人感觉离线安装nginx更好配置

(1)下载 nginx-1.18.0.tar.gz

https://nginx.org/en/download.html

(2)解压安装

tar -vxf nginx-1.18.0.tar.gz
cd nginx-1.18.0
./configure --prefix=/usr/local/nginx
make
make install

(3)配置

路径:/usr/local/nginx/conf/nginx.conf

 (4)启动

路径:/usr/local/nginx/sbin/nginx

启动:./nginx

重新加载配置文件:./nginx -s reload

停止:./nginx -s stop

3、安装监控流量插件ninx-module-vts

(1)参考:https://blog.csdn.net/Q748893892/article/details/105735733

(2)插件路径:https://github.com/vozlt/nginx-module-vts

(3)安装

/usr/local/nginx/sbin/nginx -V

 复制configure argumentes的参数 --prefix=***

./config --prefix=*** --add-module=/tol/soft/nginx-module-vts-0.1.18
make
(不要随手加入make install,这个不用install)

重启即可

 (4)清除status

http://localhost:8080/status/control?cmd=delete&group=*

 4、出现403错误可以尝试这样解决

 把局域网设置取消

 备注:

①出现404一般是配置问题

 

posted @   南风丶轻语  阅读(847)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示
点击右上角即可分享
微信分享提示