導航:首頁 > 程序命令 > nginxmac重啟命令

nginxmac重啟命令

發布時間:2023-07-09 12:14:12

⑴ 如何通過命令行重新安裝NGINX

1. 執行備份nginx配置數據。
mv /usr/local/nginx-generic-1.6.0 /usr/local/nginx-generic-1.6.0-backup

2. 執行重新安裝nginx
amh nginx-generic-1.6.0 install

3. 恢復配置
cp /usr/local/nginx-generic-1.6.0-backup/conf/nginx.conf /usr/local/nginx-generic-1.6.0/conf/nginx.conf

4. 重啟nginx
amh nginx restart

⑵ nginx怎麼啟動命令

啟動:
cd /usr/local/nginx/sbin
./nginx
nginx服務啟動後默認的進程號會放在/usr/local/nginx/logs/nginx.pid文件
cat nginx.pid 查看進程號

關閉:
kill -TERM pid 快速停止服務
kill -QUIT pid 平緩停止服務
kill -9 pid 強制停止服務

重啟:
cd /usr/local/nginx
./nginx -HUP pid
./nginx -s reload

⑶ 如何用命令重啟nginx

nginx伺服器頻繁出現502錯誤,這里分享下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
重啟nginx服務:

復制代碼代碼示例:
# /usr/local/nginx/sbin/nginx -s reload
nginx重啟成功
使用root許可權殺掉nginx進程:

復制代碼代碼示例:
#killall nginx
#nginx
其它相關命令:
1,顯示nginx進行id

復制代碼代碼示例:
#ps -aux | grep nginx
2,結果nginx的master進行pid

復制代碼代碼示例:
#kill -HUP 635
3,重啟ngnix

復制代碼代碼示例:
#/usr/local/nginx/sbin/nginx -s reload

⑷ 如何重啟 nginx

nginx 伺服器重啟命令,關閉
nginx -s reload :修改配置後重新載入生效
nginx -s reopen :重新打開日誌文件
nginx -t -c /path/to/nginx.conf 測試nginx配置文件是否正確

關閉nginx:
nginx -s stop :快速停止nginx
quit :完整有序的停止nginx

其他的停止nginx 方式:

ps -ef | grep nginx

kill -QUIT 主進程號 :從容停止Nginx
kill -TERM 主進程號 :快速停止Nginx
pkill -9 nginx :強制停止Nginx

啟動nginx:
nginx -c /path/to/nginx.conf

平滑重啟nginx:
kill -HUP 主進程號

⑸ mac下brew安裝 nginx 後怎麼啟動

那可能是你當前的用戶無許可權對/usr/local/文件夾進行讀寫操作,執行如下命令獲取許可權

[html]view plain

sudochown-R'yourname'/usr/local

2.安裝完成之後,執行如下命令啟動nginx

[html]view plain

sudonginx

3.測試

選擇你喜歡的瀏覽器打開如下url,如果一切順利將顯示nginx的歡迎頁面

[html]view plain

http://localhost:8080

閱讀全文

與nginxmac重啟命令相關的資料

熱點內容
我的世界pe112伺服器地址 瀏覽:877
程序員轉行銷售 瀏覽:468
沈陽醫療程序員 瀏覽:45
戴爾伺服器主機系統如何安裝 瀏覽:942
如何訪問雲伺服器裡面的文件 瀏覽:58
邯鄲解壓景點 瀏覽:668
如何查找本機伺服器 瀏覽:358
伺服器房主不小心變成成員怎麼改回來 瀏覽:106
視頻加密原理及解析 瀏覽:845
單片機閃爍點亮 瀏覽:33
程序員紅燒肉怎麼做 瀏覽:365
cpuzandroid 瀏覽:554
如何解壓e盤壓縮文件 瀏覽:266
哪種高級語言不需要編譯 瀏覽:475
內網如何設置多個伺服器 瀏覽:534
超級解壓場面圖 瀏覽:963
小說app雲什麼 瀏覽:871
凝思下載文件夾命令 瀏覽:942
編譯過程中的藍屏 瀏覽:565
方波單片機測量 瀏覽:560