CentOS 7 Nginx 錯誤集合

來源:互聯網
上載者:User

標籤:

「個人記錄,肯定有理解錯誤和理解不透的地方,小白總是有個成長的過程,希望大家多多指教。」

Nginx 錯誤集合


1、env: /etc/init.d/nginx: 沒有那個檔案或目錄


    這個問題剛開始困惑了我很久,明明檔案是存在的啊,指令碼也沒什麼錯啊,怎麼就是說檔案找不到,後面在網看到說是因為檔案格式為doc,Linux不能識別,所以,我的做法是:把檔案內容複寫出來,然後把之前的/etc/init.d/nginx刪除,用 vi /etc/init.d/nginx再建一個,再把內容複寫進去,我是這麼解決了。在網上又看到一個理簡便的方法:可以通過vim開啟該檔案,如果可以看到出現 ^M 的字元,就可以確定是DOS格式的了。那麼可以在vim中執行命令 :%s/\r\+$//e ,將其轉換成Unix格式即可。 第二種方法沒試過,不知道能不能行,我相信應該是可以的。


2、Starting nginx (via systemctl): Warning: Unit file of nginx.service changed on disk, ‘systemctl daemon-reload‘ recommended
        這是一個警告,這個是在我修改/etc/init.d/nginx檔案之後出現的,這個問題,直接按它提示的操作:$ systemctl daemon-reload 就可以了。



3、Starting nginx (via systemctl): Job for nginx.service failed. See ‘systemctl status nginx.service‘ and ‘journalctl -xn‘ for details.

        出現這樣的提示,一般先執行 $ systemctl status nginx.service  看看下面的具體情況。            

          比如:

[[email protected] init.d]# systemctl status nginx.servicenginx.service - LSB: start and stop nginx   Loaded: loaded (/etc/rc.d/init.d/nginx)   Active: failed (Result: resources) since 三 2015-06-24 20:21:31 CST; 5min ago  Process: 18620 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=0/SUCCESS)6月 24 20:21:31 Leco.lan systemd[1]: Starting LSB: start and stop nginx...6月 24 20:21:31 Leco.lan nginx[18620]: Starting nginx: nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)6月 24 20:21:31 Leco.lan nginx[18620]: [  確定  ]6月 24 20:21:31 Leco.lan systemd[1]: PID file /var/run/nginx/nginx.pid not readable (yet?) after start.6月 24 20:21:31 Leco.lan systemd[1]: Failed to start LSB: start and stop nginx.6月 24 20:21:31 Leco.lan systemd[1]: Unit nginx.service entered failed state.





待續……



















CentOS 7 Nginx 錯誤集合

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.