在Linux中,可以通過以下命令來啟動和關閉 Nginx:
啟動 Nginx:
sudo systemctl start nginx
關閉 Nginx:
sudo systemctl stop nginx
重啟 Nginx:
sudo systemctl restart nginx
檢查 Nginx 運行狀態:
sudo systemctl status nginx
這些命令需要以超級用戶的權限來執行,因此需要使用 sudo 命令。
sudo