Starting with Nginx upgrade (Smooth upgrade):
1) # RM-RF nginx-1.8.0//Delete the original nginx-1.8.0 directory, just delete this one
2) # TAR-XF nginx-1.8.0.tar.gz//Unpacking
3) #cd nginx-1.8.0/
4) #./configure \
>--user=nginx \//Add user Nginx
>--group=nginx \//Add Group Nginx
>--with-http_stub_status_module//Add Http_stub_status_module monitor its running status
5) # Make
6) #cd/usr/local/nginx/sbin/
7) # MV Nginx Nginx.bak//Backup
8) # Cp/root/lnmp_soft/nginx-1.8.0/objs/nginx /usr/local/nginx/sbin/
9) #ln-S/usr/local/nginx/sbin/nginx/usr/sbin///add links so you can use them as commands
# vim/usr/local/nginx/conf/nginx.conf
Add the following code to the server
server {
......
Location/nginx_status {
Stub_status on;
Access_log off;
#加入访问限制
#allow 192.168.4.254;
#allow 192.168.4.9;
#deny all;
}
......
}
One) #nginx-s Reload
#Curl 127.0.0.1/nginx_status
Active connections:1
Server accepts handled requests
9 9 18
reading:0 writing:1 waiting:0
----------------------------------------------------------------
Data Description:
Active connections: The number of active connections initiated on the backend.
The Server accepts handled Requests:nginx processed a total of 9 connections, successfully created 9 handshakes (proving that there was no failure in the middle), and processed a total of 18 requests.
Reading:nginx the number of header messages read to the client.
Writing:nginx the number of header information returned to the client.
Waiting: When Keep-alive is turned on, this value equals active– (reading + writing), meaning that Nginx has finished processing and is waiting for the next request instruction to reside in the connection.
Therefore, in the case of high access efficiency, the request is processed quickly, the number of waiting is more normal. If the reading +writing number is large, the concurrent traffic is very high and is being processed.
Compile and install Nginx Http_stub_status_module to monitor its operational status