Nginx Start, restart, shutdown

Source: Internet
Author: User

Nginx Start, restart, shutdown

First, start

CD Usr/local/nginx/sbin./nginx

Second, restart

Change Configuration Restart Nginx

Kill-hup The main process number or process number file path or use cd/usr/local/nginx/sbin./nginx-s reload

Determine if the configuration file is correct

Nginx-t-c/usr/local/nginx/conf/nginx.conf or Cd/usr/local/nginx/sbin./nginx-t

Third, close

Query Nginx main process number

Ps-ef | 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/logs/nginx.pid '

Four, 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, restart, shutdown

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.