Home > Operation and Maintenance > Nginx > How to run and control nginx

How to run and control nginx

王林
Release: 2020-06-20 17:18:02
forward
3148 people have browsed it

How to run and control nginx

/usr/local/nginx in the following commands is the absolute path to the nginx binary.

(Recommended tutorial: nginx tutorial)

1. Start

/usr/local/nginx/sbin/nginx
Copy after login

2. Reopen the log file

/usr/local/nginx/sbin/nginx -s reopen
Copy after login

3. Reload the configuration file

/usr/local/nginx/sbin/nginx -s reload
Copy after login

4. Stop

/usr/local/nginx/sbin/nginx -s stop
Copy after login

5. Stop gracefully

(1) Check the process number

ps -ef|grep nginx
Copy after login

(2) Kill the process

kill -QUIT <进程号> 
或 
kill -TERM <进程号>
Copy after login

6. Force stop

pkill -9 ngin
Copy after login

The above is the detailed content of How to run and control nginx. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:juejin.im
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template