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

nhu*_*uvy 4 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
Run Code Online (Sandbox Code Playgroud)

但是结果什么都没有。如何解决?(我使用macOS 10.12.5)

更新:

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

sencha web -port 8082 start
Run Code Online (Sandbox Code Playgroud)

我将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.
Run Code Online (Sandbox Code Playgroud)

Din*_*h K 7

在Linux上,只能由root用户打开低于1024的端口,因此默认情况下限制端口80

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

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

来源:Spring Boot在端口80上运行的应用程序

  • 这由“ java.net.SocketException:权限被拒绝”指示。如果另一个程序已经绑定到端口80(其他答案表明),您将收到另一个错误消息,例如“端口已在使用中”。顺便说一句:低于1024的端口在macOS上的工作原理相同(如问题中所述)。 (2认同)

小智 0

80 端口已被另一个应用程序使用。更改tomcat的post no。并且您不能直接在 80 post 上运行 tomcat,您需要安装 authbind,作为参考,您可以点击以下链接:-

以下作品:

apt-get 安装 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
Run Code Online (Sandbox Code Playgroud)

参考: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