Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question

2 Answers 2

up vote 0 down vote accepted

I'm guessing you're connecting to the EC2 instance as ec2-user, as that is the default login for Amazon Linux AMI Base 2010.11.1. But to run the tcpdump command you need to use sudo.

sudo tcpdump ...

I am not familiar with with the tcpdump command so you will have to sort out the proper syntax on your own.

I may not be familiar with tcpdump, but I am familiar with the Amazon Linux AMI Base 2010.11.1, and based on your question I am wondering if you installed Apache, PHP, MySQL, etc? These programs are not included by default in Amazon's base AMI. You can run the following command to see all the packages installed.

yum list installed

Any programs you need installed that are not listed either need to be installed using yum, or compiled from the source.

sudo yum install <program_name_here>

For example, to install Apache 2.2 you can run:

sudo yum install httpd

Here are some good resources:

HowTo: Get started with Amazon EC2 api tools

AWS EC2 Getting Started Guide

Hope this all helps...

share|improve this answer

The default is not allowed http connection to the instance:

share|improve this answer
    
I did. Here is my details for default, Security Group, HTTP:Connection method: HTTP, Protocol: tcp, from port:0, to port:0, source/ip: 0.0.0.0/0. Is my source/ip wrong?? –  moderaga Feb 28 '11 at 9:25
    
Ok, then run "tcpdump -pn port 80" and open page. Output copy to question. –  ooshro Feb 28 '11 at 9:27
    
where do I run the command? Terminal after connected to the instances(I use OSX)? It gives me this: -bash: tcpdump: command not found –  moderaga Feb 28 '11 at 9:29
    
What the instances OS? –  ooshro Feb 28 '11 at 9:31
    
Amazon Linux AMI Base 2010.11.1, EBS boot, 64-bit architecture with Amazon EC2 AMI Tools. I guess its Linux –  moderaga Feb 28 '11 at 9:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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