7878www免费看片_黑人巨茎精品欧美一区二区_国产成人avxxxxx在线观看_国产成人精品日本亚洲1_欧美午夜刺激影院_人妻波多野结衣爽到喷水_A在线视频播放免费视频完整版_欧美人与动牲猛交a欧美精品_人妻系列无码专区2020_中文字幕精品久久久久人妻红杏ⅰ

您現(xiàn)在的位置:新疆網(wǎng)站建設(shè)-新疆網(wǎng)站制作-新疆二域設(shè)計>> 幫助中心>服務(wù)器相關(guān)>> Nginx服務(wù)重啟失?。篔ob for nginx.service failed

Nginx服務(wù)重啟失?。篔ob for nginx.service failed

作者:未知  來源:互聯(lián)網(wǎng)  發(fā)布時間:2025-08-16 16:36:49  點擊數(shù):0

啟動Nginx服務(wù)提示Nginx服務(wù)重啟失敗,如下提示:

Job for nginx.service failed because the control process exited with error code. Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journal


問題處理:


首先用命令

命令去校驗?zāi)愕腘ginx配置是否成功:

nginx -t

如果成功,他會給出如下信息:

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

如果你的配置文件有問題,也能從錯誤信息中看出來:

duplicate default server for [::]:80 in /etc/nginx/nginx.conf:41

錯誤已經(jīng)很明顯了,有多個配置文件里面使用了80端口。所以你可以用下面這條命令去查找一下:

grep -R default_server /etc/nginx

# 啰嗦一句,-R的意思是遞歸查找。這條命令會從 /etc/nginx下遞歸查找所有包含 default_server 的文件

找到該文件,寫個別的端口或者刪掉沒用的文件,這個錯誤就可以解決了!

查看Nginx服務(wù)狀態(tài)你可以發(fā)現(xiàn):

# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 2018-11-06 12:31:21 JST; 15s ago
...
11月 06 12:31:20 zhangch-101 nginx[1863]: nginx: [emerg] bind() to 0.0.0.0:5001 failed (98: Address already in use)
11月 06 12:31:21 zhangch-101 systemd[1]: nginx.service: control process exited, code=exited status=1
11月 06 12:31:21 zhangch-101 nginx[1863]: nginx: [emerg] still could not bind()
11月 06 12:31:21 zhangch-101 systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
11月 06 12:31:21 zhangch-101 systemd[1]: Unit nginx.service entered failed state.
11月 06 12:31:21 zhangch-101 systemd[1]: nginx.service failed.


這個錯誤比較明顯,已經(jīng)有進(jìn)程占用這個端口了。

這時你就應(yīng)該去看看哪個進(jìn)程占用了這個端口:

netstat -nap | grep 5001



關(guān)鍵字: 重啟失敗 Nginx

上一篇:完全卸載nginx的詳細(xì)步驟
下一篇:windows2019 server如何讓操作系統(tǒng)在指定時間自動重啟?

相關(guān)內(nèi)容:
版權(quán)所有 新疆二域信息技術(shù)有限公司 All Rights Reserved 地址:烏魯木齊市北京南路高新街217號盈科廣場B座615 備案號:新ICP備14003571號-6 新公網(wǎng)安備 65010402000050號