Skip to content
sebbacon edited this page Aug 2, 2011 · 20 revisions

We try to maintain an up-to-date, out-of-the-box version of the software as an AMI (Amazon Machine Image).

This means you can use Amazon's EC2 service to get started very quickly with hosting the software. For new users, you can get a "micro" EC2 instance free for a year. However, you should note that a micro instance will only be suitable for running the lowest-traffic of sites; and there are cheaper hosting options than EC2's larger instances.

The id of the most recent AMI is ami-212ee848. To get started with EC2, follow one of the many online tutorials, such as this one. (Note that you won't necessarily need a static IP address to start with; they cost you (a tiny amount of) money).

Once you have set up and started an instance, you can log in as user ubuntu. The software is owned by a user alaveteli and lives in /home/alaveteli/alaveteli/. If you want to upgrade to the latest version of Alaveteli, you should:

$ cd ~/alaveteli
$ git pull
$ ./script/rails-post-deploy

When you log into the server, it automatically calls (via /etc/rc.local) a script at /home/alaveteli/ec2-update-domain.sh. It looks up the current domain name for this instance (usually something like ec2-50-19-48-171.compute-1.amazonaws.com) and sets that as the hostname in various configuration files, in order to make the software work correctly.

Once the instance is booted, you should be able to access it at its Amazon host name (e.g. http://ec2-50-19-48-171.compute-1.amazonaws.com). By default all the ports are locked down, so make sure you open the ports for SSH (22), web (80) and mail (25):

$ ec2-authorize default -p 80

It is set up using Varnish listening on port 80 on the external interface (see /etc/varnish/default.vcl, forwarding to Apache + Passenger listening on port 80 on localhost (see /etc/apache2/sites-enabled/alaveteli), memcached, and exim for local delivery.

When testing, you should probably check your spam folder if you're expecting to receive emails (see below for notes about SPF and deliverability).

If you were to use it as the basis for a live host, you would want to:

  • Set up the instance with a static IP
  • Create DNS records pointing to that IP
  • Disable the ec2-update-domain.sh script and set up your new domain name in the places that script goes
  • Set up SPF records for the domain
  • Consider using an external SMTP server, rather than the local one, as anecdotally email from within the AWS infrastructure has low deliverability rates
Clone this wiki locally