nginx实时记录请求状态信息( ngx_realtime_request_module)
cd /usr/local/src/ wget "http://nginx.org/download/nginx-1.4.2.tar.gz" tar -xzvf nginx.tar.gz wget https://github.com/magicbear/ngx_realtime_request_module/archive/master.zip -O ngx_realtime_request.zip unzip ngx_realtime_request.zip cd nginx/ ./configure --prefix=/usr/local/nginx --add-module=../ngx_realtime_request_module-master make make install (如果已经安装了 就不需要这个) --------------------------------------------------- 已经安装了nginx 后续 参考地址:http://blog.csdn.net/gebitan505/article/details/17612845 暂停 nginx /usr/local/nginx/sbin/nginx -s quit 备份 cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak 替换二进制文件 cp ./objs/nginx /usr/local/nginx/sbin/ -------------------------------------------------- nginx.conf里面的配置 location ~ /ttlsa-rt-status { realtime_request on; } 检查nginx.conf配置文件是否正确 /usr/local/nginx/sbin/nginx -t 启动nginx /usr/local/nginx/sbin/nginx & URL请求 http://127.0.0.1/ttlsa-rt-status 响应 uptime:620 version:0.5 host request recv sent upstream_recv 20x 30x 40x 50x 127.0.0.1 1077 773831 481702 237709 1068 0 0 3 解释 uptime:620->nginx运行了xx秒 version:0.5 -> 当前插件版本 host:当前统计的域名,如果这台服务器有多个域名,会显示多行 request:请求量xx个 recv:接收xx字节 send:发送2043字节 20x:响应了xx次20x的状态码 30x:返回了xx次30x 40x:返回了xx次40xhttp状态码(我测试的404) 50x:返回了xx次50x 参考地址:http://www.ttlsa.com/nginx/nginx-modules-ngx_realtime_request_module/