配置为侦听端口80的Tomcat连接器无法启动

时间:2017-06-19 15:59:28

标签: java macos tomcat extjs spring-boot

我运行webapp https://github.com/donhuvy/mycustomer 我面临错误

  

说明

     

配置为侦听端口80的Tomcat连接器无法启动。   端口可能已在使用中,或者连接器可能配置错误。

     

动作:

     

验证连接器的配置,识别并停止任何进程   正在侦听端口80,或配置此应用程序以侦听   在另一个港口。

这是我的记录https://gist.github.com/donhuvy/93210850f955f9ddbc00ab735a0ade18#file-terminal-log-L191

我已经通过命令检查了端口80

sudo lsof -i TCP:80 | grep LISTEN

但结果一无所获。怎么解决? (我使用macOS 10.12.5)

更新

运行Sencha客户端(在目录client内)

sencha web -port 8082 start

我将Spring Boot端口更改为8082:

APPLICATION FAILED TO START

Description:

The Tomcat connector configured to listen on port 8082 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8082, or configure this application to listen on another port.

4 个答案:

答案 0 :(得分:2)

在linux下,1024以下的端口只能由root打开,因此默认情况下端口80是受限制的

如果您想在80端口上发布应用程序,则需要将请求从端口80重定向到您将运行springapp的端口(例如8080)端口

您可以使用apache2服务器,默认情况下允许在端口80上工作,并可以将请求转发给tomcat

来源:Spring Boot running app on port 80

答案 1 :(得分:0)

另一个应用程序已经使用了80端口。更改tomcat的帖子号。并且你不能直接在80帖子上运行tomcat你需要安装authbind,作为参考你可以按照以下链接: -

以下作品:

apt-get install authbind

首先,在/ etc / default / tomcat7文件中设置AUTHBIND = yes

sudo touch /etc/authbind/byport/80
sudo chmod 500 /etc/authbind/byport/80
sudo chown tomcat7 /etc/authbind/byport/80

参考:http://georgik.sinusgear.com/2012/03/10/tomcat-7-listen-on-port-80-linux-debian/comment-page-1/

http://2ality.com/2010/07/running-tomcat-on-port-80-in-user.html

答案 2 :(得分:0)

假设您使用的是eclipse,解决此错误的一种方法是右键单击控制台,然后单击“全部终止/断开连接”。然后运行该应用程序,它将正常运行。

enter image description here

右键单击“控制台”选项卡->并选择“终止/全部断开连接”,然后尝试运行代码。

注意:不要忘记在再次运行之前停止服务器。

答案 3 :(得分:0)

如果使用配置的端口80启动SpringBoot应用程序,则可能有2个问题:

  1. 需要以超级用户权限执行命令。只需在启动命令之前添加“ sudo”。这对我有帮助。

  2. 端口正在被另一个应用程序使用。要检查它,可以使用以下命令: “ netstat -l”;

相关问题