Getting Started
To get started, pick up Amazon's public (fedora) image and make a clone of it. This can be started/stopped on demand.
- Go to the AWS site and sign up.
- Set AWS up to pay with the credit card of your choice. That may or may not be the HP Amex card. I started using a US bank account, as it was easier than dealing with exchange rates.
- Add your AWS access key and secret key. These are your gateway to the billing system. Make sure there are no trailing spaces on the end of either key, which appears to happen by default when you select the keys in firefox from the AWS web site. I've found pasting the keys into an editor the best way to check that they are clean, as the EC2 GUI hides the secret key value -so you cannot see the trailing speace.
- in the Firefox Gui Create a new keypair, and save the private key (a .pem) file to ${user.home}/.ec2/private-key.pem
- Go to the AWS settings page again, and download your 'certificate'. Save it to ${user.home}/.ec2/certificate.pem
- Create a new SSH key, or look out the public key of whatever you want to SSH in with
- Go to the security group pane, hit refresh and then edit the default security group. Add port 22 (ssh) and 3800 (smartfrog). For my settings, I've opened up ports 5050-5059 and 8080-8089 for HTTP experiments
Command line setup
- Pull down the Ec2 command line clients and unzip them into a locations
- set up the environment variable EC2_HOME to point to the unzipped location, EC2_HOME. You also need to set up the private key and certificate environment variables, otherwise you have to set it on every command. Here are my settings:
setenv EC2_HOME /home/slo/Java/Apps/ec2-api-tools
setenv EC2_JVM_ARGS "-Dhttp.proxyHost=web-proxy -Dhttp.proxyPort=8088 -Dhttps.proxyHost=web-proxy -Dhttps.proxyPort=8088"
setenv EC2_PRIVATE_KEY /home/slo/.ec2/private-key.pem
setenv EC2_CERT /home/slo/.ec2/certificate.pem
set -l path = ( $path $EC2_HOME/bin )
#Once installed, the version command tests that the base path is set up right
> ec2-version
1.2-13740 2007-08-29
This command doesn't go out on the web; it just runs the local executable. To go onto the web, a command like ec2-describe-keypairs is needed,
> ec2-describe-keypairs
Unable to connect to host: 'https:
This error means the proxy is not set up. The toolkit uses Apache HttpClient, and not the built in Java libraries. While there are good reasons for this (the java libraries are very low quality), proxy setup is an issue. The java5 automatic proxy option (-Djava.net.useSystemProxies=true) is not supported.
S3 Organizer Setup
The Firefox S3 organizer is a XUL component for working with the S3 filestore. Although designed to synchronize bits of a filesystem, you can use it to create and delete buckets.
The left hand pane shows a local directory; the RHS the remote system.
- start the organiser (look under tools)
- edit it with your AWS ID and secret key
- pick a new bucketname of your choice (e.g mysmartfrog)
- you can test that this is present by going to the corresponding web page http://mysmartfrog.s3.amazonaws.com/ . You should expect to see an error
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist</Message>
<RequestId>13D9980704160E63</RequestId>
<BucketName>mysmartfrog</BucketName>
<HostId>UCqJZWGauP97z7sSC7g5mCESnNx7k/Ncvwz8IP3W4WQtoSOH6x9aV+AqUa/Px2Uo</HostId>
</Error>
This means there is no bucket at that hostname.
- In the Right hand directory, create a new directory. This creates a new bucket. Do not create one in europe, as xfer between that an EC2 is not free!
- Check that the bucket is now there by getting the page
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>49C817E22C99A2B0</RequestId>
<HostId>
p5CzvBxuedHOlz9Dgq2xnYLTaFZrBTxhpbhR6uWGjuup0jmKVom0OmILAclbrCbL
</HostId>
</Error>
The error message has changed; from nonexistent to no permissions. This indicates the bucket is there, but private.
- to make it public, select the new bucket and bring up the right button menu -go to 'edit ACLS'
- Add 'read' to everyone by double clicking on them. Make sure you don't enable write, as you get to pay for all the stuff they upload. Even Read comes at a fee.
- check the URL again. The result is now an XML list of artifacts underneath. If you had a page called index.html, that would apparently come back instead.
<ListBucketResult>
<Name>smartfrog</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
</ListBucketResult>
- delete the bucket using the delete operation. This is permanent!
Getting your key into PuTTY
To get the EC2 key into putty, run PuttyGen and import the private key. Give it a meaningful name and save it somewhere as a .ppk file, then load it in the pageant server