Amazon Web Services

Introduction
Amazon Web Services (AWS), a collection of remote computing services, also called web services, make up a cloud-computing platform offered by Amazon.com. These services operate from 11 geographical regions across the world. The most central and well-known of these services arguably include Amazon Elastic Compute Cloud and Amazon S3. Amazon markets these products as a service to provide large computing-capacity more quickly and more cheaply than a client company building an actual physical server farm.

S3
Amazon Simple Storage Service (S3) provides a simple web-services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, secure, fast, inexpensive infrastructure that Amazon uses to run its own global network of web sites. The service aims to maximize benefits of scale and to pass those benefits on to developers.

AWS Free Tier includes 5GB storage, 20,000 Get Requests, and 2,000 Put Requests with Amazon S3.

http://aws.amazon.com/s3/

Introduction
http://amzn.to/1rlFqoH

Pricing
http://aws.amazon.com/s3/pricing/

http://calculator.s3.amazonaws.com/index.html

s3cmd
S3cmd is a tool for managing objects in Amazon S3 storage. It allows for making and removing "buckets" and uploading, downloading and removing "objects" from these buckets. It runs on Linux and Mac.

http://s3tools.org

HOWTO: Install
cd /root/misc git clone https://github.com/s3tools/s3cmd.git cd s3cmd sudo python setup.py install s3cmd --version

HOWTO: Configure
s3cmd --configure

HOWTO: Tweak Settings
nano ~/.s3cfg

bucket_location = EU host_bucket = %(bucket)s.s3-external-3.amazonaws.com

HOWTO: Create A Bucket
s3cmd mb s3://uniquename.subname.whatever

HOWTO: List Buckets
s3cmd ls

HOWTO: Upload Files
s3cmd put --recursive --dry-run ~/folder s3://uniquename.subname.whatever/

HOWTO: Sync Files
s3cmd sync --verbose ~/folder s3://uniquename.subname.whatever/

HOWTO: Fix: WARNING: Redirected To
Replace the bucket_host in the .s3cfg file with the one from the warning.

~/.s3cfg host_bucket = %(bucket)s.s3-external-3.amazonaws.com

Thanks - http://serverfault.com/questions/330453/s3cmd-fails-too-many-times

Glacier
Amazon Glacier is an extremely low-cost storage service that provides secure and durable storage for data archiving and backup. In order to keep costs low, Amazon Glacier is optimized for data that is infrequently accessed and for which retrieval times of several hours are suitable. With Amazon Glacier, customers can reliably store large or small amounts of data for as little as $0.01 per gigabyte per month, a significant savings compared to on-premises solutions.

http://aws.amazon.com/glacier/

FAQs
http://aws.amazon.com/glacier/faqs/

glaciercmd
Linux command-line app for accessing Amazon Glacier secure slow storage.

http://blog.nekoconeko.nl/blog/2012/08/25/Amazon-Glacier.html

https://github.com/LordGaav/glaciercmd

Virtual Private Cloud (VPC) Dashboard
https://eu-west-1.console.aws.amazon.com/vpc/home?region=eu-west-1

Helpful YouTube Video
https://www.youtube.com/watch?v=TjVWpNZfTPE

Default Username and Password
Thanks - http://askubuntu.com/questions/62599/what-is-the-default-username-for-amazon-ami-images-of-ubuntu-server

Locale Error
If you receive this error on SSH login...

bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.utf8)

...then fix it with these commands...

sudo aptitude install language-pack-en-base sudo update-locale LC_ALL="en_GB.UTF-8" sudo locale-gen sudo dpkg-reconfigure locales locale sudo nano /etc/environment LANG="en_GB.UTF-8" sudo reboot

Thanks - http://askubuntu.com/questions/412495/setlocale-lc-ctype-cannot-change-locale-utf-8

Copy Instance To A Different Amazon Geographic Region
This is an example of copying an Amazon EC2 Instance from the USA to Ireland.


 * 1) Log in to AWS Console
 * 2) Select AWS Region (top right of screen).
 * 3) Stop Instance.
 * 4) Create Snapshot.
 * 5) Copy Snapshot (to EU West Region - Ireland).
 * 6) Switch AWS Region.
 * 7) Snapshots > right click on Snapshot and choose Create Image.
 * 8) AMI > right click on AMI and choose Launch.
 * 9) Configure Instance as needed.

Official Doc - http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#migrating-instance-availability-zone

Kernel Fix - http://serverfault.com/questions/447980/correct-process-for-starting-new-ec2-instance-from-an-ebs-snapshot

First Doc - http://stackoverflow.com/questions/5402013/move-amazon-ec2-amis-between-regions-via-web-interface

Ubuntu EC2 Images - http://cloud-images.ubuntu.com/locator/ec2/

Install Web Server
sudo aptitude install -y -v lighttpd sudo touch /var/www/favicon.ico sudo nano /var/www/index.html

Web Server Log File
sudo nano /etc/lighttpd/lighttpd.conf

Enable the access log module...

server.modules = (   ...    "mod_accesslog" )

Create and add the access log line...

accesslog.filename         = "/var/log/lighttpd/access.log"

Reload the configuarion...

sudo service lighttpd reload

Thanks - http://www.error418.org/2013/02/lighttpd-access-log.html

Rotation - http://www.cyberciti.biz/tips/lighttpd-rotating-logs-with-logrotate.html

Allow PING
Security Groups > Select Group > Edit > Add Rule > Custom ICMP Rule > Echo Request > Custom IP

Web Server Virtual Hosts
TBA.

Thanks - http://www.cyberciti.biz/tips/howto-lighttpd-web-server-setting-up-virtual-hosting.html