6
votes

I run webapp https://github.com/donhuvy/mycustomer I face error

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.

This is my log https://gist.github.com/donhuvy/93210850f955f9ddbc00ab735a0ade18#file-terminal-log-L191

I have been check port 80 by command

sudo lsof -i TCP:80 | grep LISTEN

But result is nothing. How to fix it? (I use macOS 10.12.5)

Update:

Run Sencha client (inside directory client)

sencha web -port 8082 start

and I change Spring Boot port to 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.
3
Is there already something running on port 80? Could a firewall be preventing you from using that port?Carl Shiles
My /etc/hosts 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhostDo Nhu Vy
As I have been talk, I use command check port 80, result is nothing.Do Nhu Vy
first change the port to smth. else and check - if works, 80 is already used, try to find who is using it. if does not work - check other configs, it's not the portikos23
I try change port Spring Boot to 8082, and run Sencha client, but the same error happen.Do Nhu Vy

3 Answers

9
votes

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

Source: Spring Boot running app on port 80

0
votes

80 port is already use by another application. change the post no of tomcat. and you can not run tomcat on 80 post directly you need to install authbind, for reference you can follow below links :-

Following works:

apt-get install authbind

First, set AUTHBIND=yes in /etc/default/tomcat7 file

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

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

and

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

0
votes

If you start SpringBoot application with configured port 80, here can be 2 problems:

  1. Need to execute a command with root permissions. Just add "sudo" before the start command. This helped me.

  2. Port is using by another application. To check it, you can use the command: "netstat -l";