- Newest
- Most votes
- Most comments
-
Configure Tomcat to Listen on Port 80: Edit Tomcat’s server.xml file to change the HTTP connector port from 8080 to 80.
Restart Tomcat after making the changes.
-
Use a Load Balancer (If Keeping Tomcat on Port 8080):
-
Configure an AWS Application Load Balancer to listen on port 80.
Forward requests from the load balancer to your EC2 instance on port 8080.
Update DNS records in GoDaddy to point to the load balancer’s DNS name.
-
Check Security Group Settings:
Ensure the security group allows inbound traffic on port 80 (or port 8080 if using a load balancer).
-
Verify Load Balancer Health Checks: Ensure that health checks are correctly configured for the load balancer, pointing to the right port and path.
Hi there,
When you type http://mydomain.com in the browser, it will by default try to connect to port 80 of the target server, that why you needed to specific port 8080 when your server listens to that port.
To connect without specifying the port, you can either
- change your Tomcat server to listen to port 80 instead, or
- use a Application Load Balancer with a listener on port 80, and a listenser rule to forward to port 8080 of the Tomcat server. See https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html
If ALB is used, you also need to point your DNS name to the ALB's DNS name with a CNAME record.
The above allows you to access http://mydomain.com/myapp/index.html
Next, if you want to access the index.html without specifying the path, you also need to override the default landing page, see - https://stackoverflow.com/questions/3976160/how-does-tomcat-find-the-home-page-of-my-web-app
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a month ago