Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the nginx startup, restart and shutdown commands in linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "what are the nginx startup, restart and shutdown commands in linux" with detailed contents, clear steps and proper handling of details. I hope that this article "what are nginx startup, restart and shutdown commands in linux" can help you solve your doubts.

Start the operation

Nginx-c / usr/local/nginx/conf/nginx.conf

The-c parameter specifies the path of the nginx configuration file to load

Stop the operation

The stop operation is done by sending a signal to the nginx process

Step 1: query the nginx main process number

Ps-ef | grep nginx

Look for the master process in the process list, and its number is the main process number.

Step 2: send a signal

Stop nginx calmly:

Kill-quit main process number

For example: kill-quit 16391

Quickly stop nginx:

Kill-term main process number

Force stop nginx:

Kill-9 main process number

In addition, if the pid file storage path is configured in nginx.conf, the file is stored in the nginx main process number, if not specified, it is placed in the logs directory of nginx. With the pid document, instead of querying the main process number of nginx, we send a signal directly to nginx with the following command:

Kill-signal type'/ usr/local/nginx/logs/nginx.pid'

Smooth restart

If you change the configuration, you have to restart nginx. Do you want to close nginx and then turn it on? No, you can send a signal to nginx and restart smoothly.

Smooth restart command:

Kill-hup residence title or process number file path

Or use the

/ usr/nginx/sbin/nginx-s reload

Note that after modifying the configuration file, it is best to check whether the modified configuration file is correct, so as to avoid errors in nginx that affect the stable operation of the server after restart. The command to determine whether the nginx configuration is correct is as follows:

Nginx-t-c / usr/nginx/conf/nginx.conf

Or

/ usr/nginx/sbin/nginx-t read here, this article "what are the nginx startup, restart and shutdown commands in linux" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report