Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

After that when I accessed, 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

share|improve this question

migrated from Oct 1 '12 at 10:49

This question came from our site for professional and enthusiast programmers.

do you set up a webserver? like apache! – fengd Sep 30 '12 at 14:29
no , how can i do that ? sorry am noob – Hem Teja Sep 30 '12 at 14:29
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 Sep 30 '12 at 14:31
i know , I got Dedicated Servers,, but would like to store files in amazon – Hem Teja Sep 30 '12 at 14:33
Use S3 then.… – iserko Sep 30 '12 at 14:35

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.

share|improve this answer
I use Linux instance – Hem Teja Sep 30 '12 at 14:43

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".

share|improve this answer
i installed apache succussfully – Hem Teja Sep 30 '12 at 15:01
now hot to upload files – Hem Teja Sep 30 '12 at 15:02
Apache has nothing to do with your problem with "scp". Which Linux of following have you installed: "Amazon Linux AMI" ? "Red Hat"? "SUSE"? "Ubuntu"? – Mentallurg Sep 30 '12 at 15:39
Amazon linux ami – Hem Teja Sep 30 '12 at 16:22
up vote 0 down vote accepted
  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?
share|improve this answer

You must log in to answer this question.