Tomcat running on port 3003 but curl gives “Connection reset by peer”

Hi Team,

I am working on the Tomcat deployment task for App Server 2.

What I have completed:

  • Installed Tomcat successfully
  • Configured Tomcat to run on port 3003 (edited /usr/share/tomcat/conf/server.xml)
  • Moved ROOT.war to:

/usr/share/tomcat/webapps

  • Set proper ownership:

sudo chown tomcat:tomcat /var/lib/tomcat/webapps/ROOT.war

  • Restarted Tomcat service
  • Verified service status:

sudo systemctl status tomcat

Status shows: active (running)

  • Verified port is listening:

netstat -tlnp | grep 3003

Output shows:

0.0.0.0:3003 LISTEN

Issue:

When I run:

curl http://stapp02:3003

I get the following error:

curl: (56) Recv failure: Connection reset by peer

Since:

  • Tomcat service is running
  • Port 3003 is listening

I am unsure why the connection is being reset.

Could someone please help me understand what might be missing or misconfigured?

Thanks in advance.




Hi @Pranav8

Could you please share the course level and task name?

The task is “Day 11: Install and Configure Tomcat Server” from “100 days of Devops” that I am completing on platform “KodeKloud - Engineer | Practice” . I hope I am clear now .

It’s not clear how you did the task, but give the error you’re getting you would want to look at journalctl -u tomcat to see what the underlying error was; tomcat is erroring out when you try to hit its endpoint. I had something similar (I installed tomcat using yum) which used the default java 1.8. The error I found in the logs suggest that it was a java version problem. So I did the following which fixed it:

  1. I installed openjdk 25.
  2. I used alternative --config java to make sure that java 25 was being used, which I confirmed with java -version.
  3. I restarted tomcat using systemctl.
  4. When I checked the endpoint, It reacted with a customized KKE specific web page, which is what was needed.

This made the grader happy.

1 Like