Home > Article > Operation and Maintenance > What is the method to start and stop nginx in Linux system
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:
1. Check the process number
[root@LinuxServer ~]# ps -ef|grep nginx
2. Kill the process
[root@LinuxServer ~]# kill -QUIT 2072
[root@LinuxServer ~]# ps -ef|grep nginx2. Kill the process
[root@LinuxServer ~]# kill -TERM 2132 或 [root@LinuxServer ~]# kill -INT 2132
[root@LinuxServer ~]# pkill -9 nginxRestart1. Verify whether the nginx configuration file is correctMethod 1: Enter the nginx installation directory sbin and enter the command ./nginx - tSee the following display nginx.conf syntax is oknginx.conf test is successfulIt means the configuration file is correct! Method 2: Add -t before the start command -c 2. Restart the Nginx service
The above is the detailed content of What is the method to start and stop nginx in Linux system. For more information, please follow other related articles on the PHP Chinese website!