Start and restart nginx under Linux

The start command of nginx is:

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

-c specifies the path of the configuration file, without -nginx will automatically load the configuration file of the default path.

 

The above is the general startup command

 

 

The following is reproduced. For nginx with the following commands, it can be used. For nginx without the following commands, the above method can be used

After researching the help of nginx, I found that there is a -s parameter to manage the nginx service:
# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/0.7.63
Usage: nginx [-?hvVt] [- s signal] [-c filename] [-p prefix] [-g directives]

Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-s signal : send signal to a master process: stop, quit, reopen, reload 
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file

So I executed
# /usr/local/nginx/sbin/nginx -s reload 
nginx has restarted successfully

 

http://blog.csdn.net/stuartjing/article/details/6909319

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326861991&siteId=291194637