Need a step by step guide to host a website on AWS
Asked Answered
D

1

6

I've been browsing for a week on how to use AWS. I've always been using cpanel (I'm new to web) but someone recommended AWS to me. From the info I pieced together from various websites, I think I'm supposed to do the following?:

1) copy my website files to S3

2) set up an instance in EC2

3) set up volume in EBS and attach to instance

4) set up elastic IP and attach to instance.

5) ??

The questions are,

1) is this correct?

2) Where and how do I create mySQL database? Do I use SimpleDB, Where can you find it in the management console? I'm using Windows Server 2008 32b on EC2, should I connect to remote desktop, install XAMPP and then create the database on localhost?

3) How can I get S3 files from EC2? or should I just copy all the website files to EBS?

4) How do I copy files from my computer to EC2/EBS? Only S3 seems to be easily accessible

5) when it finally work, what do I connect my domain to? The elastic IP? or the Public DNS?

Sorry if this is unclear, I'll do my best to explain.

Thank you in advance for your help David

Demos answered 11/4, 2011 at 10:40 Comment(1)
If all you know is CPanel and PhpMyAdmin, and have no knowledge in connecting to your server with SSH, installing software on Linux server machines, installing MySQL, etc, I would recommend not to jump into Amazon Web Services (AWS) EC2 for the time being.Simonasimonds
B
10

First some concepts:

EC2 instances are just virtual machines. Once started, you manage them by Remote Desktoping into the instance (using the public dns address or an attached elastic ip address). Then its as though you are sitting in front of the computer. You can install anything you like on the instance and you are responsible for installing patches/updates etc. I guess, if you like, you could install cPanel on an EC2 instance and manage it that way.

You would install your webserver, database etc on your EC2 instance.

Think of EBS as a way to add additional hard disks to your instance. These persist beyond your instances - eg if you shut down an instance, the EBS volume will still be available.

S3 is purely a storage medium. Its basically an ever expanding, highly scalable storage space but you only pay for the amount that you are using. You might use this to store any static files associated with your website. eg images, videos etc or even javascript, css etc. But you don't need to use S3 with EC2. Both can operate independently.

Answers to your questions:

  1. See above
  2. Logon to your server using remote desktop and install mySql and any other software you need. If you don't no what SimpleDB is, you probably dont need it. It's Amazons noSql offering which is probably not something you are looking use.
  3. The easiest way to access S3 from your EC2 instance is by using one of the Amazon SDK's. Files on S3 can also be linked to using standard urls. Remember, not all your website files should be on S3, only the static resources if any. You don't need to use s3 at all.
  4. One option is to setup an FTP server on your EC2 instance to copy files to EC2.
  5. Attach an elastic ip address to your server and point your domain at that ip address.
Blastoff answered 11/4, 2011 at 12:13 Comment(6)
Thanks! your answer really helps. On no 3, can you tell me more on how to use the SDK to access S3? how do I link to them using standard urls? Thanks!Demos
@David - what programming language are you using?Blastoff
I'm using PHP and MySQL. I user windows server as Linux will need some time to learn how to use.Demos
@David - check out the php sdk docs for more info on managing your S3 assets. eg Here's the docs for uploading an object: docs.amazonwebservices.com/AWSSDKforPHP/latest/…. Links to your S3 files are in the format: s3.amazonaws.com/[bucket]/[key] or for private files you can create a url using get_object_url in the php sdk. docs.amazonwebservices.com/AWSSDKforPHP/latest/…Blastoff
So... for a simple site that stores just a few users (e.g. their name, address, photo - all that is usually stored in MySQL db on a regular host), would you suggest using S3 for storage or EC2?Figurant
@drozzy Use EC2 with MySql or one of Amazons DB services to store things you would normally put in a database. S3 is not a replacement for a database. Only use S3 to store files - in your example consider storing the photos on S3.Blastoff

© 2022 - 2024 — McMap. All rights reserved.