nginx啟動及檢測nginx配置是否正確

2021-09-02 18:23:53 字數 1084 閱讀 9029

檢查配置檔案:

上面的結果說明nginx.conf:58行有問題

啟動nginx

nginx的sbin目錄下 執行./nginx

ps -ef|grep nginx後顯示

root 28775 1 0 18:24 ? 00:00:00 nginx: master process ./nginx

nobody 28776 28775 0 18:24 ? 00:00:00 nginx: worker process

nobody 28777 28775 0 18:24 ? 00:00:00 nginx: worker process

nobody 28778 28775 0 18:24 ? 00:00:00 nginx: worker process

nobody 28779 28775 0 18:24 ? 00:00:00 nginx: worker process

nobody 28780 28775 0 18:24 ? 00:00:00 nginx: worker process

nobody 28781 28775 0 18:24 ? 00:00:00 nginx: worker process

nobody 28782 28775 0 18:24 ? 00:00:00 nginx: worker process

nobody 28783 28775 0 18:24 ? 00:00:00 nginx: worker process

說明正常啟動。

重啟命令:

./nginx -s reload

service nginx start

service nginx stop

service nginx restart

service nginx reload

/etc/init.d/nginx start

/etc/init.d/nginx stop

/etc/init.d/nginx restart

/etc/init.d/nginx reload

參考:[url]

nginx在centos linux安裝、部署完整步驟並測試通過

[url]

Nginx啟動 重啟 關閉 Nginx開啟啟動配置

cd usr local nginx sbin nginxkill hup 主程序號或程序號檔案路徑 或者使用 cd usr local nginx sbin nginx s reload nginx t c usr local nginx conf nginx.conf 或者 cd usr loc...

NGINX心跳檢測

nginx心跳檢測 在30s內 fail timeout,預設值為10s nginx與中介軟體通訊失敗2次 max fails,預設值為1,設定為0則認為服務端一直可用 則認為中介軟體不可用 不可用中介軟體在30s內與nginx通訊成功2次,則認為中介軟體恢復。當upstream中的一台中介軟體響應...

Nginx的編譯安裝及啟動

1.安裝指令碼 bin bash 解決依賴關係 yum y install zlib zlib devel openssl openssl devel pcre pcre devel gcc gcc c autoconf automake make 生成編譯前的配置 編譯make j 2 編譯安裝 ...