标签:模板 bsp des lin dashboard multi for gcc-c++ evel
nginx-1.16.1 自动化安装及Prometheus监控配置
# Nginx下载: wget http://nginx.org/download/nginx-1.16.1.tar.gz # pcre 下载: https://ftp.pcre.org/pub/pcre/ wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz # zlib 下载: wget https://fossies.org/linux/misc/zlib-1.2.11.tar.gz # openssl 下载: http://distfiles.macports.org/openssl/ wget http://distfiles.macports.org/openssl/openssl-1.0.2s.tar.gz # nginx_upstream_check_module https://github.com/yaoweibin/nginx_upstream_check_module wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
cd /usr/local/src/
useradd nginx
解压:
tar -zxvf nginx-1.16.1.tar.gz
cd nginx-1.16.1
./configure --prefix=/usr/local/nginx-1.16.1 --with-http_ssl_module --with-http_gzip_static_module --with-pcre=/usr/local/src/pcre-8.43 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/src/openssl-1.0.2s --with-http_stub_status_module --with-http_realip_module --add-module=/usr/local/src/nginx_upstream_check_module-master --with-http_sysguard_module --add-module=nginx-module-vts
make
make install
在/etc/profile 中加入:
export NGINX_HOME=/usr/local/nginx
export PATH=$PATH:$NGINX_HOME/sbin
vim /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
User=nginx
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx reload
ExecStop=/usr/local/nginx/sbin/nginx quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
# 加入开机启动
systemctl enable nginx .service
systemctl status nginx .service
systemctl restart nginx .service
# 插件
https://github.com/hnlq715/nginx-vts-exporter
# 模板
https://grafana.com/grafana/dashboards/2949
nginx-1.16.1 自动化安装及Prometheus监控配置
标签:模板 bsp des lin dashboard multi for gcc-c++ evel
原文地址:https://www.cnblogs.com/miaocbin/p/12343227.html