1

I'm new to linux and AWS.

What I've done: 1. I've setup a Centos 6 instance from the AWS store. 2. I just installed the web server and configured the web server with the basics. 3. I've setup the security groups with access to ports 80 and 443. I did not touch anything in IPtables or edited httpd.conf.

What works: 1. I am able to SSH fine, 2. I've copied an index.html file to var/www/html. The file downloads when I do a wget on the public dns locally via SSH

What does NOT work: 1. Unable to browse to web server. http://ec2-52-50-168-32.eu-west1.compute.amazonaws.com/ or public IP 52.50.168.32

iptables --line -vnl

sudo iptables --line -vnL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination
1 10479 2006K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED

2 0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
3 1 60 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
4 858 44756 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22

5 205 12424 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination
1 0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 11301 packets, 2330K bytes) num pkts bytes target prot opt in out source destination

netstat -vatn

Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 40 172.31.7.51:22 196.14.20.130:43734 ESTABLISHED tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
tcp 0 0 :::443 :::* LISTEN

  • Can you please clarify. Perhaps edit your question to show exactly what works and what doesn't, and from where. For example maybe you can wget from the instance, but not from your PC. Maybe you can ping from inside AWS, maybe not from your PC. Showing exactly what you type and the response could help us help you. You might like to show screenshots of your routing table and security groups too. – Tim Apr 11 '16 at 20:03
  • As well as the setup of your web server. Is anything actually listening on that port? Is the OS own firewall configured to let it in? – JayMcTee Apr 11 '16 at 20:40
  • @Tim I've added some outputs from iptables and netstat. Please include commands when asking for info, as I'm not familiar with the commands. thanks. – Jonathan Williams Apr 12 '16 at 8:23
0

I can't ping your instance, I can't look up DNS, but I can ssh in by IP. My best guess is that you can run wget from the instance itself.

Here's nslookup on my EC2 IP (edited for brevity, my IP replaced with X's)

nslookup  ec2-X-X-X-X.us-west-2.compute.amazonaws.com
Non-authoritative answer:
Name:   ec2-X-X-X-X.us-west-2.compute.amazonaws.com
Address: 11.0.1.10

Here's my nslookup on your IP

nslookup ec2-52-50-168-32.eu-west1.compute.amazonaws.com
Non-authoritative answer:
*** Can't find ec2-52-50-168-32.eu-west1.compute.amazonaws.com: No answer

I also did a lookup using network tools, which also tells me that the URL you've given is not correct. I found that you had a dash missing. The correct URL is below, here's the network tools link

http://ec2-52-50-168-32.eu-west-1.compute.amazonaws.com

Now that we have the correct domain name, we can look at what's next.

My best guess if you can wget from inside the instance is your security group or internet gateway isn't set up correctly. You need to read Amazon documentation to work this out, we can't teach you AWS here. However if you give it a shot and can't work it out we can probably help progress you towards a solution.

You will probably find my tutorial on setting up AWS, Nginx, and such useful, as it has instructions and screenshots.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.