3
votes

I am new to aws hosting, please help me out in pointing the domain name to tomcat hosted application. During configuration following steps are taken-

1- I have created ec2 ubuntu instance. Configured with java, tomcat. Deployed my war files on tomcat. I am able to access the application successfully. Using http://ec2-xx-xx-xxx-xx.us-west-2.compute.amazonaws.com:8080/login.jspx url.

2- A domain name(www.mydomain.com) registered at godaddy.

3- Created hostedzone (console.aws.amazon.com/route53) and set the nameservers to my godaddy domain name.

4- I have also edited the A(host) IP to the public ip of my ec2 instance.

I don't know what went wrong, I am unable to access my application via www.mydomainname.com.

2
If you only type your ec2 instance's public ip in your browser, does it also shows your web? - noname
Also it might be the case that after setting A in godaddy, it requires some time for the changes to be applied. - noname
unable to access web by typing only instance's public ip. If this is the problem then please guide me. - Aditya Pratap
Then I think the problem is in your server configurations, because in godaddy you map the domain name to the public ip, so you need to set your web as the default page when you access the public ip address, normally through port 443 for https connection, not your 8080 port - noname
One more thing, don't forget to enable http connection to port 80 and https connection to port 443 in your EC2 security group. - noname

2 Answers

1
votes

In order to ping an EC2 instance, you need to allow ICMP traffic in your security group settings.

0
votes

I solved my problem with the help of above answer provide by noname and some google help.

As I have unzipped tomcat so, did some env setup as followed-

  1. in server.xml changed port 8080 to 80

  2. sudo apt-get authbind.

  3. touch /etc/authbind/byport/80.

  4. chmod 500 /etc/authbind/byport/80.

  5. created setenv.sh in /usr/local/tomcat/bin folder.

  6. did entry of CATALINA_OPTS="-Djava.net.preferIPv4Stack=true" and AUTHBIND=yes in setenv.sh

  7. Changed the command to exec authbind --deep "$PRGDIR"/"$EXECUTABLE" start "$@" in place of exec "$PRGDIR"/"$EXECUTABLE" start "$@" in startup.sh

    Then restarted the server and problem solved.