3

I build amazon ec2 instance as following steps given on

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

Also followed this:

http://imperialwicket.com/aws-building-a-lamp-instance

service httpd restart

says:

[root@ip-21-31-3-19 ec2-user]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

there is index.php file in

/var/www/html/index.php

drive but it gives error:

The connection has timed out

What can be the issue?

UPDATE

My instance was created by my friend from US. I am in India. He sent me mail he received after creating the instance.

Availability zone -     us-west-2c
Security groups -     launch-wizard-1. view rules
Scheduled events     No scheduled events

AMI ID - amzn-ami-pv-2013.09.2.x86_64-ebs (ami-cc293fc)
Subnet ID - subnet-4f727427
Platform -
Network interfaces - eth0
Key pair name - AmazonLinux01

I think security group is already created. I am handling ec2 instance first time.

Is this ec2-classic or VPC?? There has been given VPC id and AMI ID both. enter link description here

I followed this document to sent the security group - which says : Required option '-O, --aws-access-key KEY' missing (-h for usage)

where to get access key?

5
  • You didn't accidentally skip the "Add port 80 to the security group for your new server" bit did you?
    – Ladadadada
    Mar 17, 2014 at 7:53
  • @Ladadadada: Actually someone else created the server and gave me ppk file and remaining details. When this step is to be taken? Mar 17, 2014 at 8:52
  • It's in the second tutorial but you can alter your security groups at any time. They're in the EC2 section of the AWS Console in the Network & Security grouping.
    – Ladadadada
    Mar 17, 2014 at 9:40
  • You can use the Management Console to modify the security group - it's much easier than trying to use the ec2-tools.
    – Nathan C
    Mar 18, 2014 at 13:20
  • @NathanC: thanks, but I dont have credit card to open ec2 account. one my friend created and gave access ec2 tools. Problem is he is not enough technical to do it on management console Mar 18, 2014 at 14:29

2 Answers 2

3

I also faced the same problem, I skipped this part : Network Security Groups look "Adding Rules to a Security Group" on this page. Because server port should be allowed for external network access which is the reason for not being able to connect.

1
  • thanks, I updated my question. can you please help little more Mar 18, 2014 at 6:19
3

Sounds like you are not allowing port 80 on your security group. (Like everyone says). You can test it locally by running from your EC2 instance:

curl http://localhost

If it returns some HTML then it means that you cannot access the the instance from the outside and you need to open up port 80 on your security groups.

1
  • thanks, but still issue. I updated my question. can you please help little more Mar 18, 2014 at 6:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .