linux运行命名配置错误,linux下部署SpringBoot启动失败问题

1. 问题概要

注:在开发时候为了方便将Tomcat的端口改为了80端口

在Linux部署SpringBoot项目(非ROOT用户)执行

java -jar hemu.jar

出现

***************************

APPLICATION FAILED TO START

***************************

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.

检查发现也没有程序占用80端口

通过搜索在StackOverflow发现了如下回答。

On linux ports below 1024 can be opened only by root, so the port 80 is restricted by default

if you want to publish your app on 80 port you need to redirect request from port 80 to the port you gonna run your springapp (e.g 8080) port

you can use apache2 server wich is allowed by default to work on port 80 and can forward requests for you to tomcat

链接:

https://stackoverflow.com/questions/44635109/the-tomcat-connector-configured-to-listen-on-port-80-failed-to-start

解决方式

1.1 在命令前添加sudo

sudo java -jar hemu.jar

1.2 使用root账户启动

1.3 将配置文件service.port的值由80改为1024以外的值 如默认的8080端口

1.4非root账户不允许开1024以下的端口

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值