Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com 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. aws.typepad.com/aws/2011/02/… –  iserko Sep 30 '12 at 14:35
show 2 more comments

3 Answers

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
1  
I use Linux instance –  Hem Teja Sep 30 '12 at 14:43
add comment

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
add comment
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
add comment

Your Answer

 
discard

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