導航:首頁 > 程序命令 > 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重啟命令相關的資料

熱點內容
linux登錄失敗次數 瀏覽:35
linuxread0 瀏覽:334
三軌直銷系統源碼 瀏覽:323
手機銀行app怎麼更新呢 瀏覽:249
單片機匯編學習 瀏覽:533
配1u伺服器主機需要注意什麼 瀏覽:40
演算法工程師小李 瀏覽:635
程序員搬到哪裡買房好 瀏覽:629
steam測試亞洲伺服器怎麼切換 瀏覽:513
vc命令行編譯工程 瀏覽:333
當貝市場解壓步驟 瀏覽:460
哪裡有賣安卓系統的app 瀏覽:474
河南省雲伺服器租賃雲主機 瀏覽:757
基金app哪個好2021年 瀏覽:43
迷你電梯單片機 瀏覽:40
編譯電腦 瀏覽:504
程序員進入網吧 瀏覽:249
cad圖轉換pdf 瀏覽:811
魔域單機版命令 瀏覽:490
ftp伺服器需要開放什麼埠 瀏覽:329