首页 > 技术文章 > nginx的监控配置

Mushishi_xu 2015-02-28 10:32 原文

最近在弄性能,在性能过程中需要监控nginx的一些配置,这里简单的搭建了环境

 

//下载nginx  根据自己的版本
wget http://nginx.org/download/nginx-1.6.0.tar.gz

tar zxvf nginx-1.6.0.tar.gz

//yum install pcre*  (http_rewrite)
//yum install zlib* (gzip 压缩库)
yum install gcc yum install gcc-c++
 yum install pcre* zlib* gcc gcc-c++
 
//配置nginx
./configure --prefix=/usr/local/nginx   

./configure  --prefix=/usr/local/nginx --add-module=/app/nginx-rtmp-module-master/ --with-http_flv_module --with-http_mp4_module
//编译并安装nginx
//编译,当编译没错时就安装,到程序源文件后执行
make && make install
 
//重启nginx
# /usr/local/nginx/sbin/nginx -s reload
 
//停止服务
# /www/wdlinux/nginx/sbin/nginx -s stop
 
//查看ngix服务
//-aux 显示所有包含其他使用者的行程 
ps -A //显示所有进程
ps aux|grep nginx
 
 
 
//下载模块
./configure --prefix=/usr/local/nginx --with-http_stub_status_module
 
//添加监控模块
location /nginx_status {
    # Turn on nginx stats
    stub_status on;
    # I do not need logs for stats
    access_log   off;
    # Security: Only allow access from 192.168.1.100 IP #
    #allow 192.168.1.100;
    # Send rest of the world to /dev/null #
    #deny all;
}

推荐阅读