Nginx(二) nginx 無法啟動


有時候在客戶端輸入:nginx

但是終端會輸出以下,顯示啟動失敗

nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] still could not bind()

這時候可以輸入:ps -ef| grep nginx

 終端會輸出以下,顯示占用的端口

    0   551     1   0  9:22PM ??         0:00.01 nginx: master process nginx
   -2   614   551   0  9:26PM ??         0:00.00 nginx: worker process
    0   618   606   0  9:27PM ttys000    0:00.00 grep nginx

然后輸入:kill 551

來停止該端口進程。

再在終端輸入:nginx

然后在瀏覽器輸入:http://127.0.0.1:8080/

就會顯示啟動正常。

------------------謝謝大佬們的打賞--------------------

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM