Amazon AWS Hosted Web Site, start to finish
Jump to navigation
Jump to search
Contents
Buy the Domain
- Buy the domain using Mydomain.com
Initial EC2 Setup
- Sign up for Amazon Web Services, create a Key Pair, and create a security group
- Sign up for AWS Free Usage Tier
Create Key Pair for SSHing
- Not possible to specify password when logging into instance, need public key (btw which only works for the region it was created):
- Open up Amazon Web Services Console
- Open up EC2 Console
- Choose your correct region via navigation bar at the top right
- On the left navigation pane under "NETWORK & SECURITY," choose Key Pairs
- Click Create Key Pair, choose a name for the key pair, probably including the region for which the key pair was created. A .pem file will automatically be downloaded locally.
chmod 400
the file. Need to specify the .pem file when SSHing.
Create Security Group
- Looks like EC2 is pedantic about who can connect. Need to create a white list of which IPs the instance can communicate, both inbound and outbound. Need to put your IP on the list.
- checkip.amazonaws.com is pretty simple
- Command line utility traceroute is helpful in figuring out ISP, also has built in IP utility
- Open up EC2 Console
- If necessary, choose your correct region via navigation bar at the top right
- On the left navigation pane under "NETWORK & SECURITY," choose Security Groups
- Click Create Security Group, and fill in the details
- Click on the Inbound tab and add Rules for HTTP (source=0.0.0.0), HTTPS (source=0.0.0.0), and SSH (your ip address with your.ip.address.boom/32) (always /32 if its your local machine, apparently)
Launch an instance
- Console, launch instance
- Top choice should be Amazon Linux AMI, default is 64bit instance (Figure out the difference between EBS and HVM)
- Micro instance is free tier eligible, selected by default
- Click Review and Launch
- Edit security group and select the one your just created, then click Review and Launch
- Click Launch, bringing up the Key Pair dialog, and select the one you just created, or create a new pair, or select the option not to specify pair
- The instance will show up on the dashboard.
Enable billing alert
- Will let you know when your 12 months are over and your bill will exceed $0.00
- New style is in the console navigation under Services->Billing
- Services->CloudWatch, create alarm when billing rises above $0 (Don't forget to change the >= operator to a >)
- Use 6 hour period, or it might trip the alarm for insufficient data
Connect To Your Instance
- Get the public DNS via console, something like
ec2-184-73-8-87.compute-1.amazonaws.com
ssh -i /path/key_pair.pem ec2-user@public_dns_name