zoukankan      html  css  js  c++  java
  • 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/

    就会显示启动正常。

    ------------------谢谢大佬们的打赏--------------------

  • 相关阅读:
    实现168732363.66元用逗号格式为168,732,363.66元
    程序员的十步学习法
    js中字符串方法大全
    js中数组方法大全
    异常,常用工具
    抽象类,常用类
    this 关键字
    面向对象
    DOS.JDK
    Android
  • 原文地址:https://www.cnblogs.com/Jomini/p/8546282.html
Copyright © 2011-2022 走看看