Tools for Amazon™ EC2

This is a description of a number of tools and adaptations which are provided for use when using Diffusion™ with Amazon EC2.

Diffusion includes in tools/ec2/ a number of files useful when deploying Diffusion to an Ubuntu image on an EC2 virtual machine.

diffusion.conf

Ubuntu makes use of the Upstart daemon (opens in new window – external site) as a replacement for init. Copied to/etc/init/diffusion.conf this file contains configuration for Upstart to begin Diffusion at boot-time in a background process as a unprivileged user. It establishes iptables  (opens in new window – external site) rules to route traffic from privileged ports to Diffusion. Users can stop and start Diffusion using Upstart commands. To start Diffusion:

service diffusion start

To stop Diffusion:

service diffusion stop

To check the status of Diffusion:

service diffusion status

In the event that something goes amiss Upstart writes a log file to /var/log/upstart/diffusion.log

etc/Connectors.xml

Except for two port number changes this is an otherwise regular copy of etc/Connectors.xml normally found in a Diffusion installation. This edition however binds the Flash policy connector and the Silverlight policy connector to port numbers greater than 1024, making it possible to run Diffusion as an unprivileged process. Use this file in conjunction with the iptables rules established in diffusion.conf

ec.xml

An illustrative Apache™ Ant™ script that can be used to start, stop, and get status from a Diffusion server running on an Amazon EC2 Linux™ host. It also demonstrates an inelegant means of deploying and undeploying a DAR file to or from the remote server, by copying the file to the remote server, then moving it into the deploy directory.