I am new to AWS Ec2. I just launch a instance, uploaded a test.php and test.html, both just display a "Hello world" text.
I copied my public DNS: ec2-XXX-XXX-XXX-XXX.compute.amazonaws.com
But it always has connection time out.
I managed to connect to the instance, I do a netstat, here is the result:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
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 0 :::22 :::* LISTEN -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 XX.XXX.XXX.XX:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp 0 0 0.0.0.0:123 0.0.0.0:* -
udp 0 0 XXXX::XXXX:XXXX:XXX:123 :::* -
udp 0 0 ::1:123 :::* -
udp 0 0 :::123 :::* - -
I cant see the port 80 which is for websvr, so i tried this:
ec2-authorize default -p 80
BUt it always required me to include the private key and cert, so I include them
ec2-authorize default -p 80 -K XXX.pem -C cert-XXX.pem
Then, it always said the cert failed to authenticate the SOAP.
Is it something wrong with my cert? (even though I request a new one, it still the same)
Or what should I do to enable to view my webpages (test.php or test.html)?
EDIT:
When I run : sudo tcpdump -pn port 80
Result:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
After open in webpage:
09:43:16.353743 IP XXX.XXX.X.XXX.4570 > XX.XXX.XXX.XX.http: Flags [S], seq 1XXXXXXXX6, win 8190, options [mss 1440], length 0
09:43:16.353779 IP XX.XXX.XXX.XX.http > XXX.XXX.X.XXX.4570: Flags [R.], seq 0, ack 1XXXXXXXX7, win 0, length 0
... etc