Accessing Amazon EC2 site

0

I am new to cloud hosting and that stuff. So I finally managed to upload a file to instance using the code below using Terminal on OS X (Mac)

scp -i key.pem index.html ec2-user@ec2-50-17-89-32.compute-1.amazonaws.com:/tmp/

After that when I accessed ec2-user@ec2-50-17-89-32.compute-1.amazonaws.com, the page was not loading, so I learned I should have added the HTTP port and then added the HTTP port in security groups. However my site still isn't loading. Am I missing something?

enter image description here

Hem Teja

Posted 2012-09-30T14:26:57.303

Reputation:

do you set up a webserver? like apache! – fengd – 2012-09-30T14:29:17.653

no , how can i do that ? sorry am noob – None – 2012-09-30T14:29:56.053

I would say what you are looking for is a webhosting service, which Amazon EC2 is not. But if you really want to stick with EC2 ... depending on which image you took, you need to figure out how to install a webserver first. If you're using Ubuntu ... login with SSH then apt-get install apache2 then copy that index.html to /var/www/ (I think that's what the document root is set to) – iserko – 2012-09-30T14:31:24.393

i know , I got Dedicated Servers,, but would like to store files in amazon – None – 2012-09-30T14:33:03.387

Use S3 then. http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html

– iserko – 2012-09-30T14:35:26.340

if you want to store files, why are you using Elastic Cloud Computing (ec2), instead of the Simple Storage Service (s3)?

– Will Palmer – 2012-09-30T14:35:41.997

yea i used s3 , I just want to explore EC2 ? please some one help where i am struck. – None – 2012-09-30T14:37:10.343

Answers

0

  1. Did scp work without error? Was the index.html copied to the server?
  2. Use ssh, connect to the server and make sure it is under /tmp
  3. Copy your file (index.html) to teh document root of the Apache server
  4. Check it in the browser
  5. What is the result? If it doesn't work, check the access.log of Apache server: what messages do you see there?

Mentallurg

Posted 2012-09-30T14:26:57.303

Reputation:

0

What is the type of your instance? "Amazon Linux AMI" ? "Red Hat"? "SUSE"? "Ubuntu"?

ssh access with "ec2-user" works only for "Amazon Linux AMI". For the others you should configure ssh access as for usual Linux system, i.e. you should add the public key to .ssh/authorized_keys.

Mentallurg

Posted 2012-09-30T14:26:57.303

Reputation:

1I use Linux instance – None – 2012-09-30T14:43:43.353

0

So if you use different OS type, you might want to do following:

  1. Drop the current instance
  2. Create a new instance of type "Amazon Linux AMI"

Keep in mind, that it is based on Red Hat, not Ubuntu. That's why "apt-get" (answer of Igor Serko) will not work. You should use "yum install".

Mentallurg

Posted 2012-09-30T14:26:57.303

Reputation:

i installed apache succussfully – None – 2012-09-30T15:01:46.050

now hot to upload files – None – 2012-09-30T15:02:31.200

Apache has nothing to do with your problem with "scp". Which Linux of following have you installed: "Amazon Linux AMI" ? "Red Hat"? "SUSE"? "Ubuntu"? – None – 2012-09-30T15:39:51.860

Amazon linux ami – None – 2012-09-30T16:22:04.567