Nginx Start stop

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.