When you try to connect directly via myWebsite.com
, your browser will default to http on port 80. Apparently, your webserver is listening on port 8080 though.
You need to configure Tomcat to listen for incoming requests on port 80.
There are many tutorials and questions here on stackoverflow about how to change the tomcat port from 8080 to 80.
E.g from How to change the port of Tomcat from 8080 to 80?:
1) Go to conf
folder in tomcat installation directory
e.g. C:\Tomcat 6.0\conf\
2) Edit following tag in server.xml
file
3) Change the port=8080
value to port=80
4) Save file.
5) Stop your Tomcat and restart it.
Keep in mind that, by default, Tomcat will not start on port 80, unless run as root. However, running as root is generally considered bad practice.
The following resource summarizes well how to mitigate this problem with Tomcat and EC2:
https://www.excelsior-usa.com/articles/tomcat-amazon-ec2-advanced.html#port80
The easiest solution would be to redirect the tomcat port (e.g.8080) via iptables:
sudo /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo /sbin/service iptables save