Linux下的nginx啟動、重新啟動


nginx的啟動命令是:

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

-c制定配置文件的路徑,不加-nginx會自動加載默認路徑的配置文件。

 

以上是通用的啟動命令

 

 

以下是轉載的,對於有以下命令的nginx可以使用,沒有以下命令的nginx,可以使用上面的方法

研究了一下nginx幫助后發現,有-s參數可對nginx服務進行管理:
# /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

於是我執行
# /usr/local/nginx/sbin/nginx -s  reload 
nginx已經重啟成功


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM