有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

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

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

Description:

The Tomcat connector configured to listen on port 80 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 80, or configure this application to listen on another port.

这是我的日志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引导端口更改为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.

共 (1) 个答案

  1. # 1 楼答案

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

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

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

    资料来源:Spring Boot running app on port 80