centos下以systemctl方式啟動nginx報錯
天蓬老师
天蓬老师 2017-05-16 17:15:10
0
3
605

根據日誌的提示是/tmp/nginx/client_temp 這個目錄不存在,但是我反複檢查了這個目錄是存在的,我直接以/usr/local/nginx/sbin/nginx 進行操作沒有任何錯誤提示,實在是找不到原因在哪了,求大神指點迷津!!

錯誤如下:

[root@iZ94ss71ojfZ nginx]# systemctl status nginx
nginx.service - nginx - high performance web server
   Loaded: loaded (/etc/systemd/system/nginx.service; enabled)
   Active: failed (Result: exit-code) since Thu 2016-08-18 01:33:15 CST; 1s ago
     Docs: http://nginx.org/en/docs/
  Process: 15731 ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf (code=exited, status=1/FAILURE)

Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: Starting nginx - high performance web server...
Aug 18 01:33:15 iZ94ss71ojfZ nginx[15731]: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
Aug 18 01:33:15 iZ94ss71ojfZ nginx[15731]: nginx: [emerg] mkdir() "/tmp/nginx/client_temp" failed (2: No such file or directory)
Aug 18 01:33:15 iZ94ss71ojfZ nginx[15731]: nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: nginx.service: control process exited, code=exited status=1
Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: Failed to start nginx - high performance web server.
Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: Unit nginx.service entered failed state.
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回覆(3)
Peter_Zhu

目錄如果存在,應該要考慮權限問題

巴扎黑

看著像是快取的路徑配置有問題,題主可以查看設定檔為啥會有這個路徑"/tmp/nginx/client_temp",如果是有意為之,則要確保該路徑存在、並且有相應的讀寫權限。

大家讲道理

試試nginx -c your_conf_file,如果這個能成功,一般是權限問題。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!