Advertisement

ERROR | Web server failed to start. Port 8080 was already in use.

阅读量:

错误提示:

复制代码
    ***************************
    APPLICATION FAILED TO START
    ***************************
    
    Description:
    
    Web server failed to start. Port 8080 was already in use.
    
    Action:
    
    Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
    
    
    Process finished with exit code 1
    
    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    
在这里插入图片描述

解决方法:

1、确定监听端口8080的进程ID(PID)

复制代码
    sudo netstat -tulnp | grep :8080
    或
    sudo lsof -i :8080
    
    
      
      
      
    

2、终止该进程

复制代码
    sudo kill -9 PID
    
    
      
    

其中PID是上一步获取到的监听端口8080的进程ID。

如果你想要配置某个服务在启动时不要监听8080端口,你需要查看该服务的配置文件,并根据服务的具体配置方式进行修改。例如,如果是Apache服务器,你可能需要编辑httpd.conf或者相应的虚拟主机配置文件,将监听端口更改为其他未被使用的端口。

请注意,使用kill -9可能不会给予该进程任何清理自身和优雅关闭的机会,应当在确保安全的前提下使用。如果可能,首选使用kill PID来让进程自行关闭。

全部评论 (0)

还没有任何评论哟~