-2

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
womble
  • 96,255
  • 29
  • 175
  • 230
Steve
  • 15
  • 3
  • 1
    What is the problem you are having? – Michael Hampton Aug 27 '15 at 01:20
  • 1
    -1 for no question whatsoever and you aren't actually explaining the point of the instance. What service? – Michael Bailey Aug 27 '15 at 01:55
  • as stated above, please explain your problem clearly and join any error messages/logs/whatever could help us to help you – Tom Aug 27 '15 at 07:20
  • @Michael Hampton I am not able to access Amazon Instance on EC2(It is used to host your website) via IP and not even via Domain name (I have domain registered at Godaddy and followed this tutorial to direct my domain to Amazon instance [link](http://blog.vizuri.com/setting-up-godaddy-and-route53-with-ghost-blogger ) – Steve Aug 27 '15 at 14:39
  • @Steve then please check my answer for usefulness – Michael Bailey Aug 27 '15 at 15:16
  • @ Michael Bailey Amazon EC2,It is used to host website(WebApp) – Steve Aug 27 '15 at 15:26

1 Answers1

1

I'm assuming it's a web app because 80. You have to set ports at the AWS Management Console level. It works almost like a hardware based firewall (inb4 "it isn't!", I know it isn't). Navigate to your security groups (the one assigned to the instance) and edit your inbound rules as needed.

Michael Bailey
  • 462
  • 2
  • 12
  • I have added port 80 to the security group,you can see in screenshot of my security group [link]http://imgur.com/kxOTLK0 ,I explained that previously I was able to access but once I followed this tutorial [link]http://blog.vizuri.com/setting-up-godaddy-and-route53-with-ghost-blogger because I wanted to point my godaddy domain to Amazon EC2 Instance ,so that I can open website using domain name also ,I am not able to access even via IP ,I have removed Amazon Aws nameservers from Godaddy account and set tit up like before ,still not able to access via IP or via Domain name – Steve Aug 27 '15 at 15:22
  • I restarted the Amazon AWS and now it's working ,the culprit was this command ,If i run this command it stops again `sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 ` – Steve Aug 28 '15 at 10:15