What is the method for Linux system to start and stop nginx?
This article mainly introduces the Linux system start, stop nginx method is what the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this Linux system start, stop nginx method is what the article will have a harvest, let's take a look.
Startup code format: nginx installation directory address-c nginx configuration file address
For example:
[root@LinuxServer sbin] # / usr/local/nginx/sbin/nginx-c / usr/local/nginx/conf/nginx.conf there are three ways to stop nginx:
Stop calmly 1. Check the process number.
[root@LinuxServer ~] # ps-ef | grep nginx
2. Kill the process
[root@LinuxServer ~] # kill-QUIT 2072
Quick stop 1. Check the process number
[root@LinuxServer ~] # ps-ef | grep nginx
2. Kill the process
[root@LinuxServer ~] # kill-TERM 2132 or [root@LinuxServer ~] # kill-INT 2132
Force to stop [root@LinuxServer ~] # pkill-9 nginx restart 1, verify that the nginx configuration file is correct method 1: enter the nginx installation directory sbin, enter the command. / nginx-t to see the following display nginx.conf syntax is ok
Nginx.conf test is successful
Indicates that the configuration file is correct!
Method 2: add-t before the startup command-c
2. Restart the Nginx service method 1: enter the nginx executable directory sbin and enter the command. / nginx-s reload
Method 2: find the current nginx process number, and then enter the command: kill-HUP process number to restart the nginx service
This is the end of the article on "what is the method of starting and stopping nginx in Linux system". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "what is the method to start and stop nginx in Linux system". If you want to learn more, you are welcome to follow the industry information channel.