Working with Amazon Web Services
When all needed services from Amazon have been activated, we should install in our local machine the Amazon EC2 API Tools. The API tools serve as the client interface to the Amazon EC2 web service. Use these tools to register and launch instances, manipulate security groups, and more.
The downloaded file is just a folder with the utilities. We have to extract them wherever we want, but it would be nice if we were able to use them without writing the complete path to reach them. For that we have to include the path to the API Tools to the System Linux PATH variable in the following way:
export EC2_HOME=/usr/local/amazon/ec2-api-tools-1.3-57419 export PATH=$PATH:$EC2_HOME/bin export EC2_PRIVATE_KEY=/usr/local/amazon/keys/pk-blabla.pem export EC2_CERT=/usr/local/amazon/keys/cert-blabla.pem
We have to add these lines into the .bashrc file.
FTP Access.
If we want to have FTP access to the Amazon Server, we have to install a FTP server like vsftp and set up a new user for it.
If we use an already set up Wowza Amazon Server, we don’t need to do anything, because a FTP Server and a Wowza user are already set up.
Using Filezilla FTP Client.
If the case, we have to open the corresponding ports for the FTP connection. That can be performed using the Amazon AMI Tools in the following way:
ftp :> ec2-authorize default --region eu-west-1 -p 21 ssh :> ec2-authorize default --region eu-west-1 -p 22
Now we can use a normal FTP connection within the Filezilla client. The password is “password”. It can be changed using the command passwd wowza.
Creating an image
So, after we have configured our machine, we can save its status creating an image. Remember that when an AMI is shut down, all its configuration and saved data are lost. To avoid the tedious course of configuring the server, we can create images.
To create an image we have to type the following command:
ec2-bundle-vol -d mnt -k pk-asdfasdf.pem -c cert-adfasdf.pem -u 123-123-123 -r i386 -p name
With
ec2-bundle-vol -h
we can discover the meaning of the different options.
The next step is to upload the image to the S3 service. We can do that using the
ec2-upload-bundle
command.
For this image to become available, we have to register it in the AWS console:
ec2-register