I was able to access amazon instance via IP address, I was assigning my godaddy domain name to amazon instance using this tutorial.
I did this on my amazon instance and it's been more than 48 hrs. Now I am not able to access my Amazon instance via IP or via domain name. I've copied the tutorial below:
Configuration on EC2 Instance
The configuration we need to make on the EC2 instance is minimal. We just need to let Amazon allow for port forwarding and enable it on the EC2 instance. To do this ssh into the instance again and open up the necessary with this command:
sudo vi /etc/sysctl.conf
Within this file there is a line which looks like so:
net.ipv4.ip_forward = 0
Change the 0
to a 1
then save and quit. This tells the server to allow port forwarding. Next we just need to enable the action we just did. To do this we need to enter the following command:
sudo sysctl -p /etc/sysctl.conf
Next, if you haven't done this in the last part to this 3 part series, we need to actually alter the firewall so the port is actually forwarded. We do this with this command:
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080