View Nginx process ps-ef|grep nginx
If it is on, it will appear similar to the following
Root 2700 1 0 09:35? 00:00:00 Nginx:master Process Nginx-c/etc/nginx/nginx.conf
Nginx 2701 2700 0 09:35? 00:00:00 Nginx:worker Process
If it's not turned on
/usr/local/nginx-1.8.0/sbin/nginx-c/usr/local/nginx-1.8.0/conf/nginx.conf
Specify the configuration file with-C or do not specify
/usr/local/nginx-1.8.0/sbin/nginx-t-c/usr/local/nginx-1.8.0/conf/nginx.conf
-T to test if the configuration file is correct
[Email protected] sbin]#/usr/local/nginx-1.8.0/sbin/nginx-t-c/usr/local/nginx-1.8.0/conf/nginx.conf
Nginx:the configuration file/usr/local/nginx-1.8.0/conf/nginx.conf syntax is OK
Nginx:configuration file/usr/local/nginx-1.8.0/conf/nginx.conf Test is successful
After opening
[Email protected] sbin]# Ps-ef|grep Nginx
Root 5198 1 0 09:45? 00:00:00 Nginx:master process/usr/local/nginx-1.8.0/sbin/nginx-c/usr/local/nginx-1.8.0/conf/nginx.conf
www 5199 5198 0 09:45? 00:00:00 Nginx:worker Process
Root 5204 2612 0 09:45 pts/0 00:00:00 grep nginx
calmly stop kill-quit master process number
Fast Stop Kill-term main process number
Force Stop kill-9 Nginx
If the PID file path is configured nginx.conf, if not, in the logs directory
Kill-Signal type '/usr/local/nginx-1.8.0/logs/nginx.pid '
Finish modifying the configuration file /usr/local/nginx-1.8.0/sbin/nginx-s Reload
Upgrade
1. Replace the old program file with the new program first
2, KILL-USR2 the old version of the program's main process number or process file name
At this point the old Nginx master process will rename its process file to. oldbin, then execute the new version of Nginx, at which time the old and the newer versions run simultaneously
3, Kill-winch old version main process number
4. Start new/old worker process without overloading configuration
Kill-hup old/New version main process number
Calmly close the old/new process
Kill-quit old/New process number
Close old/new processes quickly
Kill-term old/New process number
Nginx Start stop