Nginx startup and shutdown commands

Source: Internet
Author: User
Nginx startup and shutdown commands start nginx-c/usr/local/nginx/conf/nginx. the conf-c parameter specifies the path of the nginx configuration file to be loaded. to stop an operation, send a signal to the nginx process (see the linux article for details about the signal). Step 1: check... nginx startup and shutdown commands start nginx-c/usr/local/nginx/conf/nginx. the conf-c parameter specifies the path of the nginx configuration file to be loaded. to stop an operation, send a signal to the nginx process (for details about the signal, see The linux chapter). Step 1: query the nginx master process number ps-ef | grep nginx in the process list to find the master process. its number is the master process number. Step 2: send a signal to stop Nginx: kill-QUIT master process number quickly stop Nginx: kill-TERM Master process number forcibly stop Nginx: pkill-9 Master process number in addition, in nginx. if the pid file storage path is configured in conf, the file stores the Nginx main process number. If no pid file is specified, the file is stored in the nginx logs directory. With the pid file, we do not need to first query the main process Number of Nginx, but directly send a signal to Nginx. the command is as follows: kill-signal type '/usr/local/nginx/logs/nginx. pid 'smooth restart: If the configuration is changed, restart Nginx. do you need to disable Nginx before enabling it? No. you can send a signal to Nginx to restart Nginx smoothly. Smooth restart command: use kill-HUP to enter the file path of the title or process number, or use/usr/nginx/sbin/nginx-s reload. note, after modifying the configuration file, you 'd better check whether the modified configuration file is correct to avoid Nginx errors affecting the stable running of the server. The command to determine whether Nginx configuration is correct is as follows: nginx-t-c/usr/nginx/conf/nginx. conf or/usr/nginx/sbin/nginx-t

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.