<commit_before>These instructions assume Debian Squeeze or Ubuntu 10.04 LTS.
[Install instructions for OS X](https://github.com/mysociety/alaveteli/wiki/OS-X-Quickstart)
are under development.  Debian Squeeze is the best supported
deployment platform.

Commands are intended to be run via the terminal or over ssh.

As an aid to evaluation, there is an
[Amazon AMI](https://github.com/mysociety/alaveteli/wiki/Alaveteli-ec2-ami)
with all these steps configured.  It is *not* production-ready.

# Get Alaveteli

To start with, you may need to install git, e.g. with `sudo apt-get
install git-core`

Next, get hold of the Alaveteli source code from github: 

    git clone https://github.com/mysociety/alaveteli.git
    cd alaveteli

This will get the development branch, which has the latest (possibly
buggy) code. If you don't want to add or try new features, swap to the
master branch (which always contains the latest stable release):

    git checkout master

# Install system dependencies

These are packages that the software depends on: third-party software
used to parse documents, host the site, etc.  There are also packages
that contain headers necessary to compile some of the gem dependencies
in the next step.

If you are running Debian, add the following repositories to
`/etc/apt/sources.list` and run `apt-get update`:

    deb http://debian.mysociety.org squeeze main
    deb http://ftp.debian.org/debian/ testing main non-free contrib

The repositories above allow us to install the packages
`wkthmltopdf-static` and `bundler` using `apt`; so if you're running
Ubuntu, you won't be able to use the above repositories, and you will
need to comment out those two lines in `config/packages` before
following the next step (and install bundler manually).

Now install the packages that are listed in config/packages using apt-get
e.g.:

    sudo apt-get install `cut -d " " -f 1 config/packages | grep -v "^#"`

Some of the files also have a version number listed in config/packages
- check that you have appropriate versions installed. Some also list
"|" and offer a choice of packages.

# Install Ruby dependencies

Install rubygems 1.6.2 (we're not using the Debian package because we
need an older version; see "Troubleshooting" below for an
explanation):

    wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz -O /tmp/rubygems-1.6.2.tgz
    tar zxvf /tmp/rubygems-1.6.2.tgz -C /tmp/
    sudo ruby1.8 /tmp/rubygems-1.6.2/setup.rb
 
To install Alaveteli's Ruby dependencies, we also need to install
bundler.  In Debian, this is provided as a package (installed as part
of the package install process above).  You could also install it as a
gem:

    sudo gem1.8 install bundler<commit_msg>Correct spelling of package<commit_after>These instructions assume Debian Squeeze or Ubuntu 10.04 LTS.
[Install instructions for OS X](https://github.com/mysociety/alaveteli/wiki/OS-X-Quickstart)
are under development.  Debian Squeeze is the best supported
deployment platform.

Commands are intended to be run via the terminal or over ssh.

As an aid to evaluation, there is an
[Amazon AMI](https://github.com/mysociety/alaveteli/wiki/Alaveteli-ec2-ami)
with all these steps configured.  It is *not* production-ready.

# Get Alaveteli

To start with, you may need to install git, e.g. with `sudo apt-get
install git-core`

Next, get hold of the Alaveteli source code from github: 

    git clone https://github.com/mysociety/alaveteli.git
    cd alaveteli

This will get the development branch, which has the latest (possibly
buggy) code. If you don't want to add or try new features, swap to the
master branch (which always contains the latest stable release):

    git checkout master

# Install system dependencies

These are packages that the software depends on: third-party software
used to parse documents, host the site, etc.  There are also packages
that contain headers necessary to compile some of the gem dependencies
in the next step.

If you are running Debian, add the following repositories to
`/etc/apt/sources.list` and run `apt-get update`:

    deb http://debian.mysociety.org squeeze main
    deb http://ftp.debian.org/debian/ testing main non-free contrib

The repositories above allow us to install the packages
`wkhtmltopdf-static` and `bundler` using `apt`; so if you're running
Ubuntu, you won't be able to use the above repositories, and you will
need to comment out those two lines in `config/packages` before
following the next step (and install bundler manually).

Now install the packages that are listed in config/packages using apt-get
e.g.:

    sudo apt-get install `cut -d " " -f 1 config/packages | grep -v "^#"`

Some of the files also have a version number listed in config/packages
- check that you have appropriate versions installed. Some also list
"|" and offer a choice of packages.

# Install Ruby dependencies

Install rubygems 1.6.2 (we're not using the Debian package because we
need an older version; see "Troubleshooting" below for an
explanation):

    wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz -O /tmp/rubygems-1.6.2.tgz
    tar zxvf /tmp/rubygems-1.6.2.tgz -C /tmp/
    sudo ruby1.8 /tmp/rubygems-1.6.2/setup.rb
 
To install Alaveteli's Ruby dependencies, we also need to install
bundler.  In Debian, this is provided as a package (installed as part
of the package install process above).  You could also install it as a
gem:

    sudo gem1.8 install bundler
{'fraction_non_alphanumeric': 0.07323324789454412, 'fraction_numerical': 0.010984987184181618, 'mean_word_length': 3.9039497307001794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3571217', 'n_tokens_mistral': 1701, 'n_tokens_neox': 1558, 'n_words': 734}