From 546562983a2594c049cabf4248a4a0dea55d2050 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:13:08 +0100 Subject: Remove shell prompt and always assume root privs - Remove the shell prompt from all commands so that they are easier to copy and paste - Remove use of sudo to elevate privileges - Move the notice of root privilege requirement to the top of the guide --- docs/installing/manual_install.md | 47 ++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 7eac53ae3..7c291845e 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -17,14 +17,19 @@ title: Manual installation Note that there are [other ways to install Alaveteli]({{ site.baseurl }}docs/installing/). +
+ +
+ ## Target operating system These instructions assume a 64-bit version of Debian 6 (Wheezy), Debian 7 (Squeeze) or Ubuntu 12.04 LTS (Precise). Debian is the best supported deployment platform. We also have instructions for [installing on MacOS]({{ site.baseurl }}docs/installing/macos/). -Commands are intended to be run via the terminal or over ssh. - ## Set the locale **Debian Wheezy or Squeeze** @@ -33,13 +38,13 @@ Follow the [Debian guide](https://wiki.debian.org/Locale#Standard) for configuri Generate the locales you wish to make available. When the interactive screen asks you to pick a default locale, choose "None", as the SSH session will provide the locale required. - # dpkg-reconfigure locales + dpkg-reconfigure locales Start a new SSH session to use your SSH locale. ## Get Alaveteli -To start with, you may need to install git, e.g. with `sudo apt-get install +To start with, you may need to install git, e.g. with `apt-get install git-core` Next, get hold of the Alaveteli source code from github: @@ -66,10 +71,6 @@ These are packages that the software depends on: third-party software used to parse documents, host the site, and so on. There are also packages that contain headers necessary to compile some of the gem dependencies in the next step. -
-Note the commands in this section will require root privileges -
- ### Using other repositories to get more recent packages Add the following repositories to `/etc/apt/sources.list`: @@ -151,7 +152,7 @@ The repository above lets you install `wkhtmltopdf-static` and `pdftk` (for sque Add the GPG key from the [mySociety Debian Package Repository](http://debian.mysociety.org/). - wget -O - https://debian.mysociety.org/debian.mysociety.org.gpg.key | sudo apt-key add - + wget -O - https://debian.mysociety.org/debian.mysociety.org.gpg.key | apt-key add - **Debian Wheezy or Ubuntu Precise** @@ -197,18 +198,18 @@ compiled by mySociety (see link in [issue Refresh the sources after adding the extra repositories: - sudo apt-get update + apt-get update Now install the packages relevant to your system: # Debian Wheezy - sudo apt-get install $(cat config/packages.debian-wheezy) + apt-get install $(cat config/packages.debian-wheezy) # Debian Squeeze - sudo apt-get install $(cat config/packages.debian-squeeze) + apt-get install $(cat config/packages.debian-squeeze) # Ubuntu Precise - sudo apt-get install $(cat config/packages.ubuntu-precise) + apt-get install $(cat config/packages.ubuntu-precise) 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 @@ -220,7 +221,7 @@ To install Alaveteli's Ruby dependencies, you need to install bundler. In Debian and Ubuntu, this is provided as a package (installed as part of the package install process above). You could also install it as a gem: - sudo gem install bundler + gem install bundler ## Configure Database @@ -230,26 +231,26 @@ databases (e.g., SQLite), but the currently supported database is PostgreSQL If you don't have postgres installed: - $ sudo apt-get install postgresql postgresql-client + apt-get -y install postgresql postgresql-client Create a `foi` user from the command line, like this: - # sudo -u postgres createuser -s -P foi + sudo -u postgres createuser -s -P foi _Note:_ Leaving the password blank will cause great confusion if you're new to PostgreSQL. We'll create a template for our Alaveteli databases: - # sudo -u postgres createdb -T template0 -E UTF-8 template_utf8 - # echo "update pg_database set datistemplate=true where datname='template_utf8';" > /tmp/update-template.sql - # sudo -u postgres psql -f /tmp/update-template.sql + sudo -u postgres createdb -T template0 -E UTF-8 template_utf8 + echo "update pg_database set datistemplate=true where datname='template_utf8';" > /tmp/update-template.sql + sudo -u postgres psql -f /tmp/update-template.sql Then create the databases: - # sudo -u postgres createdb -T template_utf8 -O foi alaveteli_production - # sudo -u postgres createdb -T template_utf8 -O foi alaveteli_test - # sudo -u postgres createdb -T template_utf8 -O foi alaveteli_development + sudo -u postgres createdb -T template_utf8 -O foi alaveteli_production + sudo -u postgres createdb -T template_utf8 -O foi alaveteli_test + sudo -u postgres createdb -T template_utf8 -O foi alaveteli_development Now you need to set up the database config file so that the application can connect to the postgres database. @@ -293,7 +294,7 @@ application directory. If you just want to get the tests to pass, you will at a minimum need to allow sending emails via a `sendmail` command (a requirement met, for example, with -`sudo apt-get install exim4`). +`apt-get install exim4`). ### Detailed -- cgit v1.2.3 From a36ad1680d46f36e78afa37d917c2833c21f1cd4 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:26:07 +0100 Subject: Group OS setup instructions together --- docs/installing/manual_install.md | 66 +++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 31 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 7c291845e..498692443 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -24,13 +24,15 @@ Note that there are [other ways to install Alaveteli]({{ site.baseurl }}docs/ins -## Target operating system +## Configure the Operating System + +### Target operating system These instructions assume a 64-bit version of Debian 6 (Wheezy), Debian 7 (Squeeze) or Ubuntu 12.04 LTS (Precise). Debian is the best supported deployment platform. We also have instructions for [installing on MacOS]({{ site.baseurl }}docs/installing/macos/). -## Set the locale +### Set the locale **Debian Wheezy or Squeeze** @@ -42,36 +44,13 @@ Generate the locales you wish to make available. When the interactive screen ask Start a new SSH session to use your SSH locale. -## Get Alaveteli - -To start with, you may need to install git, e.g. with `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 rails-3-develop 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 mySociety libraries - -Next, install mySociety's common ruby libraries. To fetch the contents of the -submodules, run: - - git submodule update --init - -## Prepare to install system dependencies using OS packages +### Prepare to install system dependencies using OS packages These are packages that the software depends on: third-party software used to parse documents, host the site, and so on. There are also packages that contain headers necessary to compile some of the gem dependencies in the next step. -### Using other repositories to get more recent packages +#### Using other repositories to get more recent packages Add the following repositories to `/etc/apt/sources.list`: @@ -136,7 +115,7 @@ The raring repo is used here to get a more recent version of bundler and pdftk. EOF -### Packages customised by mySociety +#### Packages customised by mySociety If you're using Debian or Ubuntu, you should add the mySociety Debian archive to your apt sources. Note that mySociety packages are currently only built for 64-bit Debian. @@ -171,7 +150,7 @@ repository - we only want to pull wkhtmltopdf-static from mysociety. No special package pinning is required. -### Other platforms +#### Other platforms If you're using some other linux platform, you can optionally install these dependencies manually, as follows: @@ -194,11 +173,36 @@ you kill it), patch it yourself, or use the Debian package compiled by mySociety (see link in [issue 305](https://github.com/mysociety/alaveteli/issues/305)) -## Install the dependencies +#### Refresh sources Refresh the sources after adding the extra repositories: - apt-get update + apt-get -y update + +## Get Alaveteli + +To start with, you may need to install git, e.g. with `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 rails-3-develop 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 mySociety libraries + +Next, install mySociety's common ruby libraries. To fetch the contents of the +submodules, run: + + git submodule update --init + +## Install the dependencies Now install the packages relevant to your system: -- cgit v1.2.3 From 3ea0618041b9d403052000d5877da0447708aeb0 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:30:35 +0100 Subject: Add section on upgrading the OS packages --- docs/installing/manual_install.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 498692443..2962a0a58 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -44,6 +44,17 @@ Generate the locales you wish to make available. When the interactive screen ask Start a new SSH session to use your SSH locale. +### Update the OS + +Update the Operating System with the latest packages + + apt-get update -y + apt-get upgrade -y + +`sudo` is not installed on Debian by default. Install it along with `vim` (a useful text editor) and `git` (the version control tool we'll use to get a copy of the Alaveteli code). + + apt-get install -y sudo vim git-core + ### Prepare to install system dependencies using OS packages These are packages that the software depends on: third-party software used to -- cgit v1.2.3 From acace29a8d443e30316ba784286d1556975f0895 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:40:35 +0100 Subject: Add section on creating alaveteli linux user --- docs/installing/manual_install.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 2962a0a58..6f244d3d5 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -190,6 +190,12 @@ Refresh the sources after adding the extra repositories: apt-get -y update +### Create Alaveteli User + +Create a new linux user to run the Alaveteli application. + + adduser --quiet --disabled-password --gecos "Alaveteli" alaveteli + ## Get Alaveteli To start with, you may need to install git, e.g. with `apt-get install -- cgit v1.2.3 From 2c52581f703b3c85c45b4e15db6a3ede743655d6 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:44:02 +0100 Subject: Update instructions on getting Alaveteli - Clone master by default because stable releases will cause less problems for new users - Use recursive option to clone and init submodules --- docs/installing/manual_install.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 6f244d3d5..9c554f035 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -198,26 +198,21 @@ Create a new linux user to run the Alaveteli application. ## Get Alaveteli -To start with, you may need to install git, e.g. with `apt-get install -git-core` +Create the target directory and clone the Alaveteli source code in to this directory: -Next, get hold of the Alaveteli source code from github: + mkdir -p /var/www/alaveteli + chown alaveteli:alaveteli /var/www/alaveteli + sudo -u alaveteli git clone --recursive \ + --branch master \ + https://github.com/mysociety/alaveteli.git /var/www/alaveteli - git clone https://github.com/mysociety/alaveteli.git - cd alaveteli +This clones the master branch which always contains the latest stable release. If you want to try out the latest (possibly buggy) code you can switch to the `rails-3-develop` branch. -This will get the rails-3-develop 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): + pushd /var/www/alaveteli + sudo -u alaveteli git checkout rails-3-develop + popd - git checkout master - -## Install mySociety libraries - -Next, install mySociety's common ruby libraries. To fetch the contents of the -submodules, run: - - git submodule update --init +The `--recursive` option installs mySociety's common libraries which are required to run Alaveteli. ## Install the dependencies -- cgit v1.2.3 From 28a86232ef2dd708a8a48d0f5a2afb645ed2165b Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:47:00 +0100 Subject: Use full path to package dependencies file --- docs/installing/manual_install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 9c554f035..1ddbe984e 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -219,13 +219,13 @@ The `--recursive` option installs mySociety's common libraries which are require Now install the packages relevant to your system: # Debian Wheezy - apt-get install $(cat config/packages.debian-wheezy) + apt-get -y install $(cat /var/www/alaveteli/config/packages.debian-wheezy) # Debian Squeeze - apt-get install $(cat config/packages.debian-squeeze) + apt-get -y install $(cat /var/www/alaveteli/config/packages.debian-squeeze) # Ubuntu Precise - apt-get install $(cat config/packages.ubuntu-precise) + apt-get -y install $(cat /var/www/alaveteli/config/packages.ubuntu-precise) 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 -- cgit v1.2.3 From e43bc11480cbfe6480de81c6390500cb2f82171e Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:52:52 +0100 Subject: Remove unneeded heading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “Install Ruby Dependencies” sounds like it’s going to install Alaveteli’s Gemfile, and we now have a solution for installing bundler from packages anyway. --- docs/installing/manual_install.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 1ddbe984e..d6601aa76 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -231,13 +231,11 @@ 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 - To install Alaveteli's Ruby dependencies, you need to install bundler. In -Debian and Ubuntu, this is provided as a package (installed as part of the package install -process above). You could also install it as a gem: +Debian and Ubuntu, this is provided as a package (installed as part of the +package install process above). You could also install it as a gem: - gem install bundler + gem install bundler --no-rdoc --no-ri ## Configure Database -- cgit v1.2.3 From 1fcd24708a3cf27daee67057b9f9d241d86f4c4d Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:55:48 +0100 Subject: Remove tmp artefact from creating db template --- docs/installing/manual_install.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index d6601aa76..394ca7b29 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -259,6 +259,7 @@ We'll create a template for our Alaveteli databases: sudo -u postgres createdb -T template0 -E UTF-8 template_utf8 echo "update pg_database set datistemplate=true where datname='template_utf8';" > /tmp/update-template.sql sudo -u postgres psql -f /tmp/update-template.sql + rm /tmp/update-template.sql Then create the databases: -- cgit v1.2.3 From ebe9fb00cd2ed43351b2672d9aadf846681dcbbe Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 16:00:44 +0100 Subject: Remove email configuration This has a separate guide so link to that. The guide here just leaves a half-installed MTA so its bound to cause trouble. We can include a brief guide in the installing MTA docs if desired. --- docs/installing/manual_install.md | 41 +++------------------------------------ 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 394ca7b29..9748d894b 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -300,45 +300,10 @@ You will need to set up an email server (MTA) to send and receive emails. Full configuration for an MTA is beyond the scope of this document -- see this [example configs for Exim4 and Postfix]({{ site.baseurl }}docs/installing/email/). -Note that in development mode mail is handled by mailcatcher by default so -that you can see the mails in a browser - see [http://mailcatcher.me/](http://mailcatcher.me/) for more -details. Start mailcatcher by running `bundle exec mailcatcher` in your -application directory. +Full configuration for an MTA is beyond the scope of this document -- see the guide for [configuring the Exim4 or Postfix MTAs]({{ site.baseurl }}docs/installing/email/). -### Minimal - -If you just want to get the tests to pass, you will at a minimum need to allow -sending emails via a `sendmail` command (a requirement met, for example, with -`apt-get install exim4`). - -### Detailed - -When an authority receives an email, the email's `reply-to` field is a magic -address which is parsed and consumed by the Rails app. - -To receive such email in a production setup, you will need to configure your -MTA to pipe incoming emails to the Alaveteli script `script/mailin`. Therefore, -you will need to configure your MTA to accept emails to magic addresses, and to -pipe such emails to this script. - -Magic email addresses are of the form: - - - -The respective parts of this address are controlled with options in -`config/general.yml`, thus: - - INCOMING_EMAIL_PREFIX = 'foi+' - INCOMING_EMAIL_DOMAIN = 'example.com' - -When you set up your MTA, if there is some error inside Rails, the -email is returned with an exit code 75, which for Exim at least means the MTA -will try again later. Additionally, a stacktrace is emailed to `CONTACT_EMAIL`. - -See [this example]({{ site.baseurl }}docs/installing/email/) for a possible configuration for Exim (>=1.9). - -A well-configured installation of this code will have had Exim make -a backup copy of the email in a separate mailbox, just in case. +Note that in development mode mail is handled by [`mailcatcher`](http://mailcatcher.me/) by default so +that you can see the mails in a browser. Start mailcatcher by running `bundle exec mailcatcher` in the application directory. ## Set up configs -- cgit v1.2.3 From d40c4b2811d6b51a8d008696dd17f468d0e538e0 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 16:12:14 +0100 Subject: Update configuring alaveteli section - Add notes about each file - Move database _configuration_ to this section --- docs/installing/manual_install.md | 65 +++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 27 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 9748d894b..34de3a90c 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -267,12 +267,37 @@ Then create the databases: sudo -u postgres createdb -T template_utf8 -O foi alaveteli_test sudo -u postgres createdb -T template_utf8 -O foi alaveteli_development +## Configure email + +You will need to set up an email server – or Mail Transfer Agent (MTA) – to +send and receive emails. + +Full configuration for an MTA is beyond the scope of this document -- see the guide for [configuring the Exim4 or Postfix MTAs]({{ site.baseurl }}docs/installing/email/). + +Note that in development mode mail is handled by [`mailcatcher`](http://mailcatcher.me/) by default so +that you can see the mails in a browser. Start mailcatcher by running `bundle exec mailcatcher` in the application directory. + +## Configure Alaveteli + +Alaveteli has three main configuration files: + - `config/database.yml`: Configures Alaveteli to communicate with the database + - `config/general.yml`: The general Alaveteli application settings + - `config/newrelic.yml`: Configuration for the [NewRelic](http://newrelic.com) monitoring service + +Copy the configuration files and update their permissions: + + cp /var/www/alaveteli/config/database.yml-example /var/www/alaveteli/config/database.yml + cp /var/www/alaveteli/config/general.yml-example /var/www/alaveteli/config/general.yml + cp /var/www/alaveteli/config/newrelic.yml-example /var/www/alaveteli/config/newrelic.yml + chown alaveteli:alaveteli /var/www/alaveteli/config/{database,general,newrelic}.yml + chmod 640 /var/www/alaveteli/config/{database,general,newrelic}.yml + +### database.yml + Now you need to set up the database config file so that the application can connect to the postgres database. -* Copy `database.yml-example` to `database.yml` in `alaveteli/config` -* Edit it to point to your local postgresql database in the development - and test sections. +Edit each section to point to the relevant local postgresql database. Example `development` section of `config/database.yml`: @@ -286,43 +311,29 @@ Example `development` section of `config/database.yml`: port: 5432 Make sure that the user specified in `database.yml` exists, and has full -permissions on these databases. As they need the ability to turn off -constraints whilst running the tests they also need to be a superuser +permissions on these databases. -If you don't want your database user to be a superuser, you can add this line -to the test config in `database.yml` (as seen in `database.yml-example`) +As the user needs the ability to turn off constraints whilst running the tests they also need to be a superuser. If you don't want your database user to be a superuser, you can add this line to the `test` section in `database.yml` (as seen in `config/database.yml-example`): constraint_disabling: false -## Configure email - -You will need to set up an email server (MTA) to send and receive emails. Full -configuration for an MTA is beyond the scope of this document -- see this -[example configs for Exim4 and Postfix]({{ site.baseurl }}docs/installing/email/). +### general.yml -Full configuration for an MTA is beyond the scope of this document -- see the guide for [configuring the Exim4 or Postfix MTAs]({{ site.baseurl }}docs/installing/email/). +We have a full [guide to Alaveteli configuration]({{ site.baseurl }}docs/customising/config/) which covers all the settings in `config/general.yml`. -Note that in development mode mail is handled by [`mailcatcher`](http://mailcatcher.me/) by default so -that you can see the mails in a browser. Start mailcatcher by running `bundle exec mailcatcher` in the application directory. - -## Set up configs - -Copy `config/general.yml-example` to `config/general.yml` and edit to your -taste. - -Note that the default settings for frontpage examples are designed to work with +The default settings for frontpage examples are designed to work with the dummy data shipped with Alaveteli; once you have real data, you should certainly edit these. The default theme is the "Alaveteli" theme. When you run `rails-post-deploy` (see below), that theme gets installed automatically. -Finally, copy `config/newrelic.yml-example` to `config/newrelic.yml`. This file -contains configuration information for the New Relic performance management -system. By default, monitoring is switched off by the `agent_enabled: false` -setting. See New Relic's [remote performance analysis](https://github.com/newrelic/rpm) instructions for switching it on -for both local and remote analysis. +### newrelic.yml +This file contains configuration information for the New Relic performance +management system. By default, monitoring is switched off by the +`agent_enabled: false` setting. See New Relic's [remote performance analysis](https://github.com/newrelic/rpm) instructions for switching it on +for both local and remote analysis. ## Deployment -- cgit v1.2.3 From 020357d24a79109f860871f3dabbc0f998b7a9bf Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 16:14:00 +0100 Subject: Move creating test data to Next Steps page --- docs/installing/manual_install.md | 5 ----- 1 file changed, 5 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 34de3a90c..40aede638 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -349,11 +349,6 @@ One of the things the script does is install dependencies (using `bundle install`). Note that the first time you run it, part of the `bundle install` that compiles `xapian-full` takes a *long* time! -If you want some dummy data to play with, you can try loading the fixtures that -the test suite uses into your development database. You can do this with: - - script/load-sample-data - Next, create the index for the search engine (Xapian): script/rebuild-xapian-index -- cgit v1.2.3 From 4f3e35c3bd214b1846d548628db41b7843bcf8cc Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 16:16:26 +0100 Subject: Move run the tests and glibc workaround MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move to troubleshooting as these aren’t directly related to installing Alaveteli --- docs/installing/manual_install.md | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 40aede638..a0ba1b6a7 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -356,28 +356,6 @@ Next, create the index for the search engine (Xapian): If this fails, the site should still mostly run, but it's a core component so you should really try to get this working. -## Run the Tests - -Make sure everything looks OK: - - bundle exec rake spec - -If there are failures here, something has gone wrong with the preceding steps -(see the next section for a common problem and workaround). You might be able -to move on to the next step, depending on how serious they are, but ideally you -should try to find out what's gone wrong. - -### glibc bug workaround - -There's a [bug in -glibc](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637239) which causes -Xapian to segfault when running the tests. Although the bug report linked to -claims it's fixed in the current Debian stable, it's not as of version -`2.11.3-2`. - -Until it's fixed (e.g. `libc6 2.13-26` does work), you can get the tests to -pass by setting `export LD_PRELOAD=/lib/libuuid.so.1`. - ## Run the Server Run the following to get the server running: @@ -534,6 +512,28 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). ## Troubleshooting +* **Run the Tests** + + Make sure everything looks OK: + + bundle exec rake spec + + If there are failures here, something has gone wrong with the preceding + steps (see the next section for a common problem and workaround). You might + be able to move on to the next step, depending on how serious they are, but + ideally you should try to find out what's gone wrong. + +* **glibc bug workaround** + + There's a [bug in + glibc](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637239) which causes + Xapian to segfault when running the tests. Although the bug report linked to + claims it's fixed in the current Debian stable, it's not as of version + `2.11.3-2`. + + Until it's fixed (e.g. `libc6 2.13-26` does work), you can get the tests to + pass by setting `export LD_PRELOAD=/lib/libuuid.so.1`. + * **Incoming emails aren't appearing in my Alaveteli install** First, you need to check that your MTA is delivering relevant -- cgit v1.2.3 From 1b81139381469187194d2b616fe8df5cf5770b03 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 16:19:09 +0100 Subject: Scripts should be +x through git mode Git should clone with +x privileges. --- docs/installing/manual_install.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index a0ba1b6a7..23b8ea1b6 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -341,9 +341,8 @@ In the `alaveteli` directory, run: script/rails-post-deploy -(This will need execute privs so `chmod 755` if necessary.) This sets up -directory structures, creates logs, installs/updates themes, runs database -migrations, etc. You should run it after each new software update. +This sets up directory structures, creates logs, installs/updates themes, runs +database migrations, etc. You should run it after each new software update. One of the things the script does is install dependencies (using `bundle install`). Note that the first time you run it, part of the `bundle install` -- cgit v1.2.3 From 4fcc402212d16916233ba44095b61f96c3a3eae2 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 16:25:44 +0100 Subject: Update post-install commands section --- docs/installing/manual_install.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 23b8ea1b6..c84600e6a 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -337,24 +337,38 @@ for both local and remote analysis. ## Deployment -In the `alaveteli` directory, run: +You should run the `rails-post-deploy` script after each new software upgrade: - script/rails-post-deploy + sudo -u alaveteli RAILS_ENV=production \ + /var/www/alaveteli/script/rails-post-deploy -This sets up directory structures, creates logs, installs/updates themes, runs -database migrations, etc. You should run it after each new software update. +This sets up installs Ruby dependencies, installs/updates themes, runs database +migrations, updates shared directories and runs other tasks that need to be run +after a software update. -One of the things the script does is install dependencies (using `bundle -install`). Note that the first time you run it, part of the `bundle install` -that compiles `xapian-full` takes a *long* time! +That the first time you run this script can take a *long* time, as it must +compile native dependencies for `xapian-full`. -Next, create the index for the search engine (Xapian): +Precompile the static assets: - script/rebuild-xapian-index + sudo -u alaveteli \ + bash -c 'RAILS_ENV=production cd /var/www/alaveteli && \ + bundle exec rake assets:precompile' + +Create the index for the search engine (Xapian): + + sudo -u alaveteli RAILS_ENV=production \ + /var/www/alaveteli/script/rebuild-xapian-index If this fails, the site should still mostly run, but it's a core component so you should really try to get this working. +
+ Note that we set RAILS_ENV=production. Use + RAILS_ENV=development if you are installing Alaveteli to make + changes to the code. +
+ ## Run the Server Run the following to get the server running: -- cgit v1.2.3 From 61559c07cab586734702be4c74b591227269f959 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 17:21:53 +0100 Subject: Update application server section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove use of `rails server`. It boots thin anyway (as it’s in the Gemfile) but doesn’t allow all of thin’s options. - Add more info about thin - Add notes about installing passenger --- docs/installing/manual_install.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index c84600e6a..c257ffeac 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -369,11 +369,35 @@ you should really try to get this working. changes to the code. -## Run the Server +## Configure the Application Server + +Alaveteli can run under many popular application servers. mySociety recommends +the use of [Phusion Passenger](https://www.phusionpassenger.com) (AKA +mod_rails) or [thin](http://code.macournoyer.com/thin). + +### Using Phusion Passenger + +Passenger is the recommended application server as it is well proven in +production environments. It is implemented as an Apache mod, so it cannot be +run independently. + + apt-get install -y libapache2-mod-passenger + +See later in the guide for configuring the Apache web server with Passenger. + +### Using Thin + +Thin is a lighter-weight application server which can be run independently of +a web server. Run the following to get the server running: - bundle exec rails server --environment=development + cd /var/www/alaveteli + bundle exec thin \ + --environment=production \ + --user=alaveteli \ + --group=alaveteli \ + start By default the server listens on all interfaces. You can restrict it to the localhost interface by adding `--binding=127.0.0.1` @@ -381,6 +405,8 @@ localhost interface by adding `--binding=127.0.0.1` The server should have told you the URL to access in your browser to see the site in action. +You can daemonize the process by starting it with the `--daemonize` option. + ## Cron jobs and init scripts The crontab and init scripts use the `.ugly` file format, which is a strange -- cgit v1.2.3 From 0ced0b713ab8d28e53b781bfed83495d757a73a2 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 21 Jul 2014 17:31:27 +0100 Subject: Fix thin interface binding option Was --binding; now --address --- docs/installing/manual_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index c257ffeac..85bc8aab2 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -400,7 +400,7 @@ Run the following to get the server running: start By default the server listens on all interfaces. You can restrict it to the -localhost interface by adding `--binding=127.0.0.1` +localhost interface by adding `--address=127.0.0.1` The server should have told you the URL to access in your browser to see the site in action. -- cgit v1.2.3 From f29568b9b4fb53d26b9ce5cf9a63493cfba34747 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 17:31:04 +0100 Subject: Minor updates to daemon generation --- docs/installing/manual_install.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 85bc8aab2..95400a0af 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -407,7 +407,7 @@ site in action. You can daemonize the process by starting it with the `--daemonize` option. -## Cron jobs and init scripts +## Cron jobs and Daemons The crontab and init scripts use the `.ugly` file format, which is a strange templating format used by mySociety. @@ -434,13 +434,18 @@ and then drop it in `/etc/cron.d/` on the server. There is a rake task that will help to rewrite this file into one that is useful to you. Change the variables to suit your installation. + pushd /var/www/alaveteli bundle exec rake config_files:convert_crontab \ - DEPLOY_USER=deploy \ + DEPLOY_USER=alaveteli \ VHOST_DIR=/var/www \ VCSPATH=alaveteli \ SITE=alaveteli \ MAILTO=cron-alaveteli@example.org \ - CRONTAB=config/crontab-example > /etc/cron.d/alaveteli + CRONTAB=/var/www/alaveteli/config/crontab-example > /etc/cron.d/alaveteli + popd + + chown root:alaveteli /etc/cron.d/alaveteli + chmod 754 /etc/cron.d/alaveteli ### Generate alert daemon @@ -452,15 +457,29 @@ is an init script, which can be generated from the * `vhost_dir`: the full path to the directory where alaveteli is checked out. e.g. If your checkout is at `/var/www/alaveteli` then set this to `/var/www` +* `vcspath`: the name of the directory that contains the alaveteli code. + e.g. `alaveteli` +* `site`: a string to identify your alaveteli instance * `user`: the user that the software runs as There is a rake task that will help to rewrite this file into one that is useful to you. Change the variables to suit your installation. + pushd /var/www/alaveteli bundle exec rake config_files:convert_init_script \ - DEPLOY_USER=deploy \ + DEPLOY_USER=alaveteli \ VHOST_DIR=/var/www \ - SCRIPT_FILE=config/alert-tracks-debian.ugly > /etc/init.d/foi-alert-tracks + VCSPATH=alaveteli \ + SITE=alaveteli \ + SCRIPT_FILE=/var/www/alaveteli/config/alert-tracks-debian.ugly > /etc/init.d/alaveteli-alert-tracks + popd + + chown root:alaveteli /etc/init.d/alaveteli-alert-tracks + chmod 754 /etc/init.d/alaveteli-alert-tracks + +Start the alert tracks daemon: + + service alaveteli-alert-tracks start ### Generate varnish purge daemon -- cgit v1.2.3 From 3db2295bfc2172b2ea32b21eede16edc7dfa2704 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 21 Jul 2014 14:44:21 +0100 Subject: Add detailed apache setup instructions --- docs/installing/manual_install.md | 142 +++++++++++++++++++++++++++----------- 1 file changed, 103 insertions(+), 39 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 95400a0af..ea7533e9f 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -513,53 +513,117 @@ this by copying it to `/etc/init.d/alaveteli` and setting the that's done, you can restart Alaveteli with `/etc/init.d/alaveteli restart`. -## Set up production web server +## Configure the web server -It is not recommended to run the website using the default Rails web server. -There are various recommendations here: http://rubyonrails.org/deploy +In almost all scenarios, we recommend running the Alaveteli Rails application +behind a web server. This allows the web server to serve static content without +going through the Rails stack, which improves performance. -We usually use Passenger / mod_rails. The file at `conf/httpd.conf-example` -gives you an example config file for WhatDoTheyKnow. At a minimum, you should -include the following in an Apache configuration file: +We recommend two main combinations of application and web server: - PassengerResolveSymlinksInDocumentRoot on - PassengerMaxPoolSize 6 # Recommend setting this to 3 or less on servers with 512MB RAM +- Apache & Passenger +- Nginx & Thin + +There are ways to run Passenger with Nginx, and indeed Thin with Apache, but +that's out of scope for this guide. If you want to do something that isn't +documented here, get in touch on [alaveteli-dev](https://groups.google.com/forum/#!forum/alaveteli-dev) and we'll +be more than happy to help you get set up. + +You should have already installed an application server if you have followed +this guide, so pick the appropriate web server to configure. + +### Apache (with Passenger) + +Install Apache: + + apt-get install -y apache2 + +Enable the required modules + + a2enmod actions + a2enmod expires + a2enmod headers + a2enmod passenger + a2enmod proxy + a2enmod proxy_http + a2enmod rewrite + a2enmod suexec + +Link the application `public` directory to the document root for the VirtualHost + + ln -s /var/www/alaveteli/public/ /srv/alaveteli + +Create a directory for optional Alaveteli configuration + + mkdir -p /etc/apache2/vhost.d/alaveteli + +Copy the example VirtualHost configuration file. You will need to change all +occurrences of `www.example.com` to your URL + + cp /var/www/alaveteli/config/httpd.conf-example \ + /etc/apache2/sites-available/alaveteli + +Disable the default site and enable the `alaveteli` VirtualHost + + a2dissite default + a2ensite alaveteli + +Check the configuration and fix any issues + + apachectl configtest + +Restart apache to load the new Alaveteli config + + service apache2 graceful + +It's strongly recommended that you run the site over SSL. (Set `FORCE_SSL` to +true in `config/general.yml`). For this you will need an SSL certificate for your domain. + +Enable the SSL apache mod + + a2enmod ssl + +Copy the SSL configuration – again changing `www.example.com` to your domain – +and enable the VirtualHost + + cp /var/www/alaveteli/config/httpd-ssl.conf-example \ + /etc/apache2/sites-available/alaveteli_https + a2ensite alaveteli_https + +Force HTTPS requests from the HTTP VirtualHost + + cp /var/www/alaveteli/config/httpd-force-ssl.conf-example \ + /etc/apache2/vhost.d/alaveteli/force-ssl.conf + +If you are testing Alaveteli or setting up an internal staging site, generate +self-signed SSL certificates. **Do not use self-signed certificates for a +production server**. Replace `www.example.com` with your domain name. + + openssl genrsa -out /etc/ssl/private/www.example.com.key 2048 + chmod 640 /etc/ssl/private/www.example.com.key + + openssl req -new -x509 \ + -key /etc/ssl/private/www.example.com.key \ + -out /etc/ssl/certs/www.example.com.cert \ + -days 3650 \ + -subj /CN=www.example.com + chmod 640 /etc/ssl/certs/www.example.com.cert + +Check the configuration and fix any issues + + apachectl configtest + +Restart apache to load the new Alaveteli config + + service apache2 graceful Under all but light loads, it is strongly recommended to run the server behind an http accelerator like Varnish. A sample varnish VCL is supplied in `conf/varnish-alaveteli.vcl`. -It's strongly recommended that you run the site over SSL. (Set FORCE_SSL to -true in config/general.yml). For this you will need an SSL certificate for your -domain and you will need to configure an SSL terminator to sit in front of -Varnish. If you're already using Apache as a web server you could simply use -Apache as the SSL terminator. A minimal configuration would look something like -this: - - - ServerName www.yourdomain - - ProxyRequests Off - ProxyPreserveHost On - ProxyPass / http://localhost:80/ - ProxyPassReverse / http://localhost:80/ - RequestHeader set X-Forwarded-Proto 'https' - - SSLEngine on - SSLProtocol all -SSLv2 - SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM - - SSLCertificateFile /etc/apache2/ssl/ssl.crt - SSLCertificateKeyFile /etc/apache2/ssl/ssl.key - SSLCertificateChainFile /etc/apache2/ssl/sub.class2.server.ca.pem - SSLCACertificateFile /etc/apache2/ssl/ca.pem - SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown - - - -Notice the line `RequestHeader` that sets the `X-Forwarded-Proto` header. This -is important. This ultimately tells Rails that it's serving a page over https -and so it knows to include that in any absolute urls it serves. +If you are using SSL you will need to configure an SSL terminator to sit in +front of Varnish. If you're already using Apache as a web server you could +simply use Apache as the SSL terminator. We have some [production server best practice notes]({{ site.baseurl}}docs/running/server/). -- cgit v1.2.3 From e9774cfbfb02bbad337452e5c7da8beccd364d10 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 21 Jul 2014 17:32:21 +0100 Subject: Add nginx & thin setup guide --- docs/installing/manual_install.md | 80 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index ea7533e9f..c355fc0eb 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -617,6 +617,86 @@ Restart apache to load the new Alaveteli config service apache2 graceful +### Nginx (with Thin) + +Install nginx + + apt-get install -y nginx + +Link the application `public` directory to the document root for the VirtualHost + + ln -s /var/www/alaveteli/public/ /srv/alaveteli + +Copy the example nginx config + + cp /var/www/alaveteli/config/nginx.conf.example \ + /etc/nginx/sites-available/alaveteli + +Disable the default site and enable the `alaveteli` server + + rm /etc/nginx/sites-enabled/default + ln -s /etc/nginx/sites-available/alaveteli \ + /etc/nginx/sites-enabled/alaveteli + +Check the configuration and fix any issues + + service nginx configtest + +Start the rails application with thin (if you haven't already). + + cd /var/www/alaveteli + bundle exec thin \ + --environment=production \ + --user=alaveteli \ + --group=alaveteli \ + --address=127.0.0.1 \ + --daemonize \ + start + +Reload the nginx configuration + + service nginx reload + +It's strongly recommended that you run the site over SSL. (Set `FORCE_SSL` to +true in `config/general.yml`). For this you will need an SSL certificate for your domain. + +Copy the SSL configuration – again changing `www.example.com` to your domain – +and enable the server + + cp /var/www/alaveteli/config/nginx-ssl.conf-example \ + /etc/nginx/sites-available/alaveteli_https + ln -s /etc/nginx/sites-available/alaveteli_https \ + /etc/nginx/sites-enabled/alaveteli_https + + + +If you are testing Alaveteli or setting up an internal staging site, generate +self-signed SSL certificates. **Do not use self-signed certificates for a +production server**. Replace `www.example.com` with your domain name. + + openssl genrsa -out /etc/ssl/private/www.example.com.key 2048 + chmod 640 /etc/ssl/private/www.example.com.key + + openssl req -new -x509 \ + -key /etc/ssl/private/www.example.com.key \ + -out /etc/ssl/certs/www.example.com.cert \ + -days 3650 \ + -subj /CN=www.example.com + chmod 640 /etc/ssl/certs/www.example.com.cert + +Check the configuration and fix any issues + + service nginx configtest + +Reload the new nginx configuration + + service nginx reload + +--- + Under all but light loads, it is strongly recommended to run the server behind an http accelerator like Varnish. A sample varnish VCL is supplied in `conf/varnish-alaveteli.vcl`. -- cgit v1.2.3 From 6a1eef1af33b6f4cb0c9df7e1546538767849dc0 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 6 Aug 2014 11:47:56 +0100 Subject: Use legacy document root Too difficult to change to FSH standard at this point --- docs/installing/manual_install.md | 8 -------- 1 file changed, 8 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index c355fc0eb..ad9c88966 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -549,10 +549,6 @@ Enable the required modules a2enmod rewrite a2enmod suexec -Link the application `public` directory to the document root for the VirtualHost - - ln -s /var/www/alaveteli/public/ /srv/alaveteli - Create a directory for optional Alaveteli configuration mkdir -p /etc/apache2/vhost.d/alaveteli @@ -623,10 +619,6 @@ Install nginx apt-get install -y nginx -Link the application `public` directory to the document root for the VirtualHost - - ln -s /var/www/alaveteli/public/ /srv/alaveteli - Copy the example nginx config cp /var/www/alaveteli/config/nginx.conf.example \ -- cgit v1.2.3 From e7b7bb92a174ffa51092978db2b187ab7876ff7f Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 7 Aug 2014 16:56:28 +0100 Subject: Add documentation on generating app daemon --- docs/installing/manual_install.md | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index ad9c88966..2d3a3aff2 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -447,6 +447,71 @@ useful to you. Change the variables to suit your installation. chown root:alaveteli /etc/cron.d/alaveteli chmod 754 /etc/cron.d/alaveteli +### Generate application daemon + +Generate a daemon based on the application server you installed. This allows you +to use the native `service` command to stop, start and restart the application. + +#### Passenger + +**Template Variables:** + +* `vhost_dir`: the full path to the directory where alaveteli is checked out. + e.g. If your checkout is at `/var/www/alaveteli` then set this to `/var/www` +* `vcspath`: the name of the directory that contains the alaveteli code. + e.g. `alaveteli` +* `site`: a string to identify your alaveteli instance +* `user`: the user that the software runs as + +There is a rake task that will help to rewrite this file into one that is +useful to you. Change the variables to suit your installation. + + pushd /var/www/alaveteli + bundle exec rake config_files:convert_init_script \ + DEPLOY_USER=alaveteli \ + VHOST_DIR=/var/www \ + VCSPATH=alaveteli \ + SITE=alaveteli \ + SCRIPT_FILE=/var/www/alaveteli/config/sysvinit-passenger.ugly > /etc/init.d/alaveteli + popd + + chown root:alaveteli /etc/init.d/alaveteli + chmod 754 /etc/init.d/alaveteli + +Start the application: + + service alaveteli start + +#### Thin + +**Template Variables:** + +* `vhost_dir`: the full path to the directory where alaveteli is checked out. + e.g. If your checkout is at `/var/www/alaveteli` then set this to `/var/www` +* `vcspath`: the name of the directory that contains the alaveteli code. + e.g. `alaveteli` +* `site`: a string to identify your alaveteli instance +* `user`: the user that the software runs as + +There is a rake task that will help to rewrite this file into one that is +useful to you. Change the variables to suit your installation. + + pushd /var/www/alaveteli + bundle exec rake config_files:convert_init_script \ + DEPLOY_USER=alaveteli \ + VHOST_DIR=/var/www \ + VCSPATH=alaveteli \ + SITE=alaveteli \ + SCRIPT_FILE=/var/www/alaveteli/config/sysvinit-thin.ugly > /etc/init.d/alaveteli + popd + + chown root:alaveteli /etc/init.d/alaveteli + chmod 754 /etc/init.d/alaveteli + +Start the application: + + service alaveteli start + ### Generate alert daemon One of the cron jobs refers to a script at `/etc/init.d/foi-alert-tracks`. This -- cgit v1.2.3 From 20abfbc8ae03c08eebb48c9316309c3650c0655e Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 7 Aug 2014 16:58:23 +0100 Subject: Use service to restart the application servers --- docs/installing/manual_install.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 2d3a3aff2..b63a137f4 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -674,7 +674,8 @@ Check the configuration and fix any issues apachectl configtest -Restart apache to load the new Alaveteli config +Restart apache to load the new Alaveteli config. This will also restart +Passenger (the application server). service apache2 graceful @@ -701,14 +702,7 @@ Check the configuration and fix any issues Start the rails application with thin (if you haven't already). - cd /var/www/alaveteli - bundle exec thin \ - --environment=production \ - --user=alaveteli \ - --group=alaveteli \ - --address=127.0.0.1 \ - --daemonize \ - start + service alaveteli start Reload the nginx configuration @@ -748,9 +742,10 @@ Check the configuration and fix any issues service nginx configtest -Reload the new nginx configuration +Reload the new nginx configuration and restart the application service nginx reload + service alaveteli restart --- -- cgit v1.2.3 From 70a7f15a2827ead6a406e1bb4c93b986782d58fe Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 8 Aug 2014 10:12:44 +0100 Subject: Instructions to generate alaveteli-purge-varnish --- docs/installing/manual_install.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index b63a137f4..68e3eff6b 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -556,9 +556,29 @@ and not required if you choose not to run your site behind Varnish (see below). * `daemon_name`: The name of the daemon. Set this to `purge-varnish`. * `vhost_dir`: the full path to the directory where alaveteli is checked out. e.g. If your checkout is at `/var/www/alaveteli` then set this to `/var/www` +* `vcspath`: the name of the directory that contains the alaveteli code. + e.g. `alaveteli` +* `site`: a string to identify your alaveteli instance * `user`: the user that the software runs as -This template does not yet have a rake task to generate it. +There is a rake task that will help to rewrite this file into one that is +useful to you. Change the variables to suit your installation. + + pushd /var/www/alaveteli + bundle exec rake config_files:convert_init_script \ + DEPLOY_USER=alaveteli \ + VHOST_DIR=/var/www \ + VCSPATH=alaveteli \ + SITE=alaveteli \ + SCRIPT_FILE=/var/www/alaveteli/config/purge-varnish-debian.ugly > /etc/init.d/alaveteli-purge-varnish + popd + + chown root:alaveteli /etc/init.d/alaveteli-purge-varnish + chmod 754 /etc/init.d/alaveteli-purge-varnish + +Start the alert tracks daemon: + + service alaveteli-purge-varnish start ### Init script permissions -- cgit v1.2.3 From 1355fd9694f842a9029b114b026fba35620cc206 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 8 Aug 2014 15:24:45 +0100 Subject: Add additional squeeze repos This is what gets added by the install script --- docs/installing/manual_install.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 68e3eff6b..8bc5ec1aa 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -68,8 +68,17 @@ Add the following repositories to `/etc/apt/sources.list`: **Debian Squeeze** cat > /etc/apt/sources.list.d/debian-extra.list < Date: Tue, 12 Aug 2014 12:37:32 +0100 Subject: Update httpd SSL example file paths > Files in the vhost repo config directory with '-example' suffixes > are currently used as a prompt for our deployment system to find and > process a matching '.ugly' config file from our internal templates > path (and the deployment system errors if those '.ugly' files > don't exist). See fbc718b1b74ffc6d53d2381b7e628cac323dd4fc --- docs/installing/manual_install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 8bc5ec1aa..5669f0160 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -676,13 +676,13 @@ Enable the SSL apache mod Copy the SSL configuration – again changing `www.example.com` to your domain – and enable the VirtualHost - cp /var/www/alaveteli/config/httpd-ssl.conf-example \ + cp /var/www/alaveteli/config/httpd-ssl.conf.example \ /etc/apache2/sites-available/alaveteli_https a2ensite alaveteli_https Force HTTPS requests from the HTTP VirtualHost - cp /var/www/alaveteli/config/httpd-force-ssl.conf-example \ + cp /var/www/alaveteli/config/httpd-force-ssl.conf.example \ /etc/apache2/vhost.d/alaveteli/force-ssl.conf If you are testing Alaveteli or setting up an internal staging site, generate -- cgit v1.2.3 From 61092230fd08deac523bdc919df97397de68e937 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Fri, 15 Aug 2014 15:39:55 +0100 Subject: Raring's gone from the Ubuntu archive. Just get bundler from trusty. --- docs/installing/manual_install.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 5669f0160..c8f10c093 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -113,24 +113,20 @@ The squeeze-backports repository is providing a more recent version of rubygems, deb-src http://de.archive.ubuntu.com/ubuntu/ precise multiverse deb http://de.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ precise-updates multiverse - deb http://de.archive.ubuntu.com/ubuntu/ raring universe - deb-src http://de.archive.ubuntu.com/ubuntu/ raring universe + deb http://de.archive.ubuntu.com/ubuntu/ trusty universe + deb-src http://de.archive.ubuntu.com/ubuntu/ trusty universe EOF -The raring repo is used here to get a more recent version of bundler and pdftk. You should configure package-pinning to reduce the priority of the raring repository so other packages aren't pulled from it. +The trusty repo is used here to get a more recent version of bundler. You should configure package-pinning to reduce the priority of the trusty repository so other packages aren't pulled from it. cat >> /etc/apt/preferences < Date: Fri, 15 Aug 2014 15:40:54 +0100 Subject: Pull a backport of pdftk from our repo on launchpad --- docs/installing/manual_install.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index c8f10c093..e565fb5d3 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -149,11 +149,26 @@ Add the GPG key from the wget -O - https://debian.mysociety.org/debian.mysociety.org.gpg.key | apt-key add - +**Ubuntu Precise only** + + cat > /etc/apt/sources.list.d/mysociety-launchpad.list <> /etc/apt/preferences < Date: Fri, 15 Aug 2014 15:41:49 +0100 Subject: Better links for our own versions of pdftk --- docs/installing/manual_install.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index e565fb5d3..edc6093cd 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -198,11 +198,13 @@ their requests when they download them. 2. Version 1.44 of `pdftk` contains a bug which makes it loop forever in certain edge conditions. This is fixed in the standard 1.44.7 package which is available in wheezy (Debian) and raring (Ubuntu). -If you can't get an official release for your OS with the fix, you -can either hope you don't encounter the bug (it ties up a rails process until -you kill it), patch it yourself, or use the Debian package -compiled by mySociety (see link in [issue -305](https://github.com/mysociety/alaveteli/issues/305)) +If you can't get an official release for your OS with the fix, you can +either hope you don't encounter the bug (it ties up a rails process +until you kill it), patch it yourself, or use the +[Debian](http://debian.mysociety.org/dists/squeeze/main/binary-amd64/) +or +[Ubuntu](https://launchpad.net/~mysociety/+archive/ubuntu/alaveteli/+packages) +packages compiled by mySociety. #### Refresh sources -- cgit v1.2.3 From 6dd3c0e05b3a7ec7e698939362340dd322f2d35b Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 18 Aug 2014 15:24:31 +0100 Subject: Add note about nginx config paths --- docs/installing/manual_install.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index edc6093cd..2621e15ea 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -732,6 +732,10 @@ Copy the example nginx config cp /var/www/alaveteli/config/nginx.conf.example \ /etc/nginx/sites-available/alaveteli +
+ Note: For historical reasons, nginx.conf.example has the path to Alaveteli set as /var/www/alaveteli/alaveteli – you will need to manually change this to /var/www/alaveteli, or to the root of your Alaveteli install +
+ Disable the default site and enable the `alaveteli` server rm /etc/nginx/sites-enabled/default @@ -761,6 +765,10 @@ and enable the server ln -s /etc/nginx/sites-available/alaveteli_https \ /etc/nginx/sites-enabled/alaveteli_https +
+ Note: For historical reasons, nginx-ssl.conf-example has the path to Alaveteli set as /var/www/alaveteli/alaveteli – you will need to manually change this to /var/www/alaveteli, or to the root of your Alaveteli install +
+ - If you are testing Alaveteli or setting up an internal staging site, generate self-signed SSL certificates. **Do not use self-signed certificates for a production server**. Replace `www.example.com` with your domain name. -- cgit v1.2.3 From 544b2d2ec20e2e0c0e0708b9732150480a8cba20 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 18 Aug 2014 15:27:20 +0100 Subject: Remove old section on application sysvinit --- docs/installing/manual_install.md | 9 --------- 1 file changed, 9 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index fc6c65d06..22fad59bb 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -610,15 +610,6 @@ by your deploy user (named `deploy` in this case). deploy ALL = NOPASSWD: /etc/init.d/foi-alert-tracks, /etc/init.d/foi-purge-varnish -There is also an example config for stopping and starting the -Alaveteli app server as a service in `config/sysvinit.example`. This -example assumes you're using Thin as an application server, so will -need tweaking for Passenger or any other app server. You can install -this by copying it to `/etc/init.d/alaveteli` and setting the -`SITE_HOME` variable to the path where Alaveteli is running, and the -`USER` variable to the Unix user that will be running Alaveteli. Once -that's done, you can restart Alaveteli with `/etc/init.d/alaveteli -restart`. ## Configure the web server -- cgit v1.2.3 From 3be5ada363a3b11d66c0096f164a1a24d0e0a5f7 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 18 Aug 2014 15:27:33 +0100 Subject: use alaveteli rather than deploy user --- docs/installing/manual_install.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 22fad59bb..66923ca5a 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -606,10 +606,9 @@ Start the alert tracks daemon: Either tweak the file permissions to make the scripts executable by your deploy user, or add the following line to your sudoers file to allow these to be run -by your deploy user (named `deploy` in this case). - - deploy ALL = NOPASSWD: /etc/init.d/foi-alert-tracks, /etc/init.d/foi-purge-varnish +by your deploy user (named `alaveteli` in this case). + alaveteli ALL = NOPASSWD: /etc/init.d/foi-alert-tracks, /etc/init.d/foi-purge-varnish ## Configure the web server -- cgit v1.2.3 From 8eb9f1aecb683a475f2d75adba92cbaeb6c37a6f Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 11:42:46 +0100 Subject: Instructions for unsetting default locale in Ubuntu. --- docs/installing/manual_install.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 66923ca5a..6c8b37230 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -44,6 +44,14 @@ Generate the locales you wish to make available. When the interactive screen ask Start a new SSH session to use your SSH locale. +**Ubuntu Precise** + +Unset the default locale, as the SSH session should provide the locale required. + + update-locale LC_ALL= + +Start a new SSH session to use your SSH locale. + ### Update the OS Update the Operating System with the latest packages -- cgit v1.2.3 From 7ab9396aa245ed67ec58adc300b6b8d5429d7302 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 11:52:31 +0100 Subject: Assume yes flag for python-software-properties. --- docs/installing/manual_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 6c8b37230..9904081d6 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -169,7 +169,7 @@ The repository above lets you install a recent version of `pdftk` using `apt`. Add the GPG key from the [mySociety Alaveteli Ubuntu Package Repository](https://launchpad.net/~mysociety/+archive/ubuntu/alaveteli). - apt-get install python-software-properties + apt-get install -y python-software-properties add-apt-repository -y ppa:mysociety/alaveteli **Debian Wheezy or Ubuntu Precise** -- cgit v1.2.3 From 0efb967cabce8269b787f50b91ec364263173d36 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 11:57:02 +0100 Subject: Make sure we're in a dir that the alaveteli user can access Otherwise, can get the error 'fatal: Could not change back to '/root': Permission denied' --- docs/installing/manual_install.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 9904081d6..0721bd104 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -232,6 +232,7 @@ Create the target directory and clone the Alaveteli source code in to this direc mkdir -p /var/www/alaveteli chown alaveteli:alaveteli /var/www/alaveteli + cd /home/alaveteli sudo -u alaveteli git clone --recursive \ --branch master \ https://github.com/mysociety/alaveteli.git /var/www/alaveteli -- cgit v1.2.3 From 2c19f1f33ad5a5de419bb4693364d51f188c18ff Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 12:09:58 +0100 Subject: Make clearer that gem install of bundler is not on default path. --- docs/installing/manual_install.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 0721bd104..a96f51596 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -262,11 +262,16 @@ 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. -To install Alaveteli's Ruby dependencies, you need to install bundler. In +
+ +Note: To install Alaveteli's Ruby dependencies, you need to install bundler. In Debian and Ubuntu, this is provided as a package (installed as part of the -package install process above). You could also install it as a gem: +package install process above). For other OSes, you could also install it as a gem: + +
 gem install bundler --no-rdoc --no-ri
+ +
- gem install bundler --no-rdoc --no-ri ## Configure Database -- cgit v1.2.3 From 43873bb262cbc1c89f762987441db5cfffd178ec Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 12:11:30 +0100 Subject: postgresql and postgresql-client are on the package lists. If you've followed the guide so far, they're now installed. --- docs/installing/manual_install.md | 4 ---- 1 file changed, 4 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index a96f51596..756da5f69 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -279,10 +279,6 @@ There has been a little work done in trying to make the code work with other databases (e.g., SQLite), but the currently supported database is PostgreSQL ("postgres"). -If you don't have postgres installed: - - apt-get -y install postgresql postgresql-client - Create a `foi` user from the command line, like this: sudo -u postgres createuser -s -P foi -- cgit v1.2.3 From c50c6023f601b2b79627c8c2afcafd9e429f3b0b Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 12:26:56 +0100 Subject: Vim not actually required. I suggest we let people figure out their own editor. --- docs/installing/manual_install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 756da5f69..9cfda4704 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -59,9 +59,9 @@ Update the Operating System with the latest packages apt-get update -y apt-get upgrade -y -`sudo` is not installed on Debian by default. Install it along with `vim` (a useful text editor) and `git` (the version control tool we'll use to get a copy of the Alaveteli code). +`sudo` is not installed on Debian by default. Install it along with `git` (the version control tool we'll use to get a copy of the Alaveteli code). - apt-get install -y sudo vim git-core + apt-get install -y sudo git-core ### Prepare to install system dependencies using OS packages -- cgit v1.2.3 From 3778e58720c437dc81674b6533e58dc4c83d090a Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 12:54:00 +0100 Subject: Restore wheezy repo Used to get bundler. --- docs/installing/manual_install.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 9cfda4704..0f16b93ac 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -87,6 +87,9 @@ Add the following repositories to `/etc/apt/sources.list`: # Debian Backports deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free deb-src http://backports.debian.org/debian-backports squeeze-backports main contrib non-free + + # Wheezy + deb http://ftp.uk.debian.org/debian wheezy main contrib non-free EOF The squeeze-backports repository is providing a more recent version of rubygems, and the wheezy repository is providing bundler. You should configure package-pinning to reduce the priority of the wheezy repository so other packages aren't pulled from it. -- cgit v1.2.3 From 1e79267b308dc40d6faf1b17af29a9c7435ea1a5 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 13:22:48 +0100 Subject: Handle the case where the rails-3-develop branch has a different commonlib commit. --- docs/installing/manual_install.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 0f16b93ac..dc1ba200e 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -243,7 +243,8 @@ Create the target directory and clone the Alaveteli source code in to this direc This clones the master branch which always contains the latest stable release. If you want to try out the latest (possibly buggy) code you can switch to the `rails-3-develop` branch. pushd /var/www/alaveteli - sudo -u alaveteli git checkout rails-3-develop + sudo -u alaveteli git checkout rails-3-develop + sudo -u alaveteli git submodule update popd The `--recursive` option installs mySociety's common libraries which are required to run Alaveteli. -- cgit v1.2.3 From 3f0e6a948636d8c645cfaeedd356ea68897b14a9 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 14:00:52 +0100 Subject: Drop reference to WDTK/mysociety. Just tell people what they need to do. --- docs/installing/manual_install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index dc1ba200e..e3ac6787d 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -454,7 +454,7 @@ The `ugly` format uses simple variable substitution. A variable looks like ### Generate crontab `config/crontab-example` contains the cron jobs that run on -WhatDoTheyKnow. mySociety render the example file to reference absolute paths, +Alaveteli. Rewrite the example file to replace the variables, and then drop it in `/etc/cron.d/` on the server. **Template Variables:** @@ -809,7 +809,7 @@ simply use Apache as the SSL terminator. We have some [production server best practice notes]({{ site.baseurl}}docs/running/server/). -## What next? +## What next? Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). @@ -823,7 +823,7 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). If there are failures here, something has gone wrong with the preceding steps (see the next section for a common problem and workaround). You might - be able to move on to the next step, depending on how serious they are, but + be able to move on to the [next steps]({{ site.baseurl }}docs/installing/next_steps/), depending on how serious they are, but ideally you should try to find out what's gone wrong. * **glibc bug workaround** -- cgit v1.2.3 From ca8ee4472040c05eb3cf85f2203f8129e9d96e03 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 14:48:08 +0100 Subject: Set mail recipient as alaveteli user in example To avoid errors if only local delivery is set up. --- docs/installing/manual_install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index e3ac6787d..c2a590147 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -465,10 +465,10 @@ and then drop it in `/etc/cron.d/` on the server. e.g. `alaveteli` * `user`: the user that the software runs as * `site`: a string to identify your alaveteli instance -* `mailto`: The email address that cron output will be sent to +* `mailto`: The email address or local account that cron output will be sent to - setting an email address depends on your MTA having been configured for remote delivery. There is a rake task that will help to rewrite this file into one that is -useful to you. Change the variables to suit your installation. +useful to you. This example sends cron output to the local `alaveteli` user. Change the variables to suit your installation. pushd /var/www/alaveteli bundle exec rake config_files:convert_crontab \ @@ -476,7 +476,7 @@ useful to you. Change the variables to suit your installation. VHOST_DIR=/var/www \ VCSPATH=alaveteli \ SITE=alaveteli \ - MAILTO=cron-alaveteli@example.org \ + MAILTO=alaveteli \ CRONTAB=/var/www/alaveteli/config/crontab-example > /etc/cron.d/alaveteli popd -- cgit v1.2.3 From 2e3618b3b7640f50aff1f744ed75dc127feecbbc Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 15:09:18 +0100 Subject: Consistently reference new init script names. See also https://github.com/mysociety/alaveteli/pull/1801 --- docs/installing/manual_install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index c2a590147..533adbba1 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -550,7 +550,7 @@ Start the application: ### Generate alert daemon -One of the cron jobs refers to a script at `/etc/init.d/foi-alert-tracks`. This +One of the cron jobs refers to a script at `/etc/init.d/alaveteli-alert-tracks`. This is an init script, which can be generated from the `config/alert-tracks-debian.ugly` template. @@ -622,7 +622,7 @@ Either tweak the file permissions to make the scripts executable by your deploy user, or add the following line to your sudoers file to allow these to be run by your deploy user (named `alaveteli` in this case). - alaveteli ALL = NOPASSWD: /etc/init.d/foi-alert-tracks, /etc/init.d/foi-purge-varnish + alaveteli ALL = NOPASSWD: /etc/init.d/alaveteli-alert-tracks, /etc/init.d/alaveteli-purge-varnish ## Configure the web server -- cgit v1.2.3 From c347544f15e89341aff865ed6bd90bc9e904cbfc Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 15:20:58 +0100 Subject: Make clear that init script won't run without varnish --- docs/installing/manual_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 533adbba1..51b5fb56b 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -585,7 +585,7 @@ Start the alert tracks daemon: ### Generate varnish purge daemon `config/purge-varnish-debian.ugly` is a similar init script, which is optional -and not required if you choose not to run your site behind Varnish (see below). +and not required if you choose not to run your site behind Varnish (see below). It will not run if varnish is not installed. **Template Variables:** -- cgit v1.2.3 From 9c5e30bdefe40f270f8285e75aa1445de1e7bf2c Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 15:25:50 +0100 Subject: Set environment for init scripts. Also, add note about setting staging_site. If you don't do this, init scripts don't run in production unless you set the RAILS_ENV in them explicitly. With staging_site set, rails-post-deploy creates config/rails_env.rb to force the production environment. --- docs/installing/manual_install.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 51b5fb56b..98e1a4d10 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -357,6 +357,10 @@ As the user needs the ability to turn off constraints whilst running the tests t We have a full [guide to Alaveteli configuration]({{ site.baseurl }}docs/customising/config/) which covers all the settings in `config/general.yml`. +_Note:_ If you are setting up Alaveteli to run in production, set the [`STAGING_SITE`]({{ site.baseurl }}docs/customising/config/#staging_site) variable to `0` in `/var/www/alaveteli/config/general.yml` now. + + STAGING_SITE: 0 + The default settings for frontpage examples are designed to work with the dummy data shipped with Alaveteli; once you have real data, you should certainly edit these. @@ -567,7 +571,7 @@ There is a rake task that will help to rewrite this file into one that is useful to you. Change the variables to suit your installation. pushd /var/www/alaveteli - bundle exec rake config_files:convert_init_script \ + bundle exec rake RAILS_ENV=production config_files:convert_init_script \ DEPLOY_USER=alaveteli \ VHOST_DIR=/var/www \ VCSPATH=alaveteli \ @@ -601,7 +605,7 @@ There is a rake task that will help to rewrite this file into one that is useful to you. Change the variables to suit your installation. pushd /var/www/alaveteli - bundle exec rake config_files:convert_init_script \ + bundle exec rake RAILS_ENV=production config_files:convert_init_script \ DEPLOY_USER=alaveteli \ VHOST_DIR=/var/www \ VCSPATH=alaveteli \ -- cgit v1.2.3 From d8b996cdb6b29dd7e2d25af40a9ec3c9015cfeec Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 15:30:26 +0100 Subject: The alaveteli user needs to be able to write to /var/www to create cron lock files. --- docs/installing/manual_install.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 98e1a4d10..5ef62c04a 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -234,6 +234,7 @@ Create a new linux user to run the Alaveteli application. Create the target directory and clone the Alaveteli source code in to this directory: mkdir -p /var/www/alaveteli + chown alaveteli:alaveteli /var/www chown alaveteli:alaveteli /var/www/alaveteli cd /home/alaveteli sudo -u alaveteli git clone --recursive \ -- cgit v1.2.3 From 5bd13c8ab119d2abb328556009c0a56d9e96d3f8 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 15:54:09 +0100 Subject: More information on what init scripts do. --- docs/installing/manual_install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 5ef62c04a..ef5ace18b 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -557,7 +557,7 @@ Start the application: One of the cron jobs refers to a script at `/etc/init.d/alaveteli-alert-tracks`. This is an init script, which can be generated from the -`config/alert-tracks-debian.ugly` template. +`config/alert-tracks-debian.ugly` template. This script sends out emails to users subscribed to updates from the site – known as [`tracks`]({{ site.baseurl }}docs/installing/email/#tracks-mail) – when there is something new matching their interests. **Template Variables:** @@ -590,7 +590,7 @@ Start the alert tracks daemon: ### Generate varnish purge daemon `config/purge-varnish-debian.ugly` is a similar init script, which is optional -and not required if you choose not to run your site behind Varnish (see below). It will not run if varnish is not installed. +and not required if you choose not to run your site behind Varnish (see below). It notifies Varnish of cached pages that need to be purged from Varnish's cache. It will not run if Varnish is not installed. **Template Variables:** -- cgit v1.2.3 From d58970052eedf790e5d2ea3616755806db8117d6 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 15:56:40 +0100 Subject: Remove permissions section We've already set the permissions on the init scripts earlier in the guide, so no need to give people an alternative way to make them runnable. --- docs/installing/manual_install.md | 7 ------- 1 file changed, 7 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index ef5ace18b..3d0cada4a 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -621,13 +621,6 @@ Start the alert tracks daemon: service alaveteli-purge-varnish start -### Init script permissions - -Either tweak the file permissions to make the scripts executable by your deploy -user, or add the following line to your sudoers file to allow these to be run -by your deploy user (named `alaveteli` in this case). - - alaveteli ALL = NOPASSWD: /etc/init.d/alaveteli-alert-tracks, /etc/init.d/alaveteli-purge-varnish ## Configure the web server -- cgit v1.2.3 From b8fa8cf2156d621a4c4ffd656447b659aad3fb47 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 15:59:14 +0100 Subject: Fix typo --- docs/installing/manual_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 3d0cada4a..540ca61d1 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -383,7 +383,7 @@ You should run the `rails-post-deploy` script after each new software upgrade: sudo -u alaveteli RAILS_ENV=production \ /var/www/alaveteli/script/rails-post-deploy -This sets up installs Ruby dependencies, installs/updates themes, runs database +This installs Ruby dependencies, installs/updates themes, runs database migrations, updates shared directories and runs other tasks that need to be run after a software update. -- cgit v1.2.3 From 83b6c562a6d4ea65195f0cfd5d9bdc22c7a909a6 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 19 Aug 2014 16:00:49 +0100 Subject: Remove redundant asset precompilation. rails-post-deploy will precompile assets if STAGING_SITE has been set to 0 in general.yml as instructed in ecc0fe6. --- docs/installing/manual_install.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 540ca61d1..10b9d86a9 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -385,17 +385,11 @@ You should run the `rails-post-deploy` script after each new software upgrade: This installs Ruby dependencies, installs/updates themes, runs database migrations, updates shared directories and runs other tasks that need to be run -after a software update. +after a software update, like precompiling static assets for a production install. That the first time you run this script can take a *long* time, as it must compile native dependencies for `xapian-full`. -Precompile the static assets: - - sudo -u alaveteli \ - bash -c 'RAILS_ENV=production cd /var/www/alaveteli && \ - bundle exec rake assets:precompile' - Create the index for the search engine (Xapian): sudo -u alaveteli RAILS_ENV=production \ -- cgit v1.2.3 From 84c197c9982948aaceb79f19389f517b499de80b Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Aug 2014 10:03:37 +0100 Subject: Make it clearer that the SSL and non SSL config files are alternatives. You don't install the non-SSL one and then the SSL one. Promote the SSL one to the first option, and give varnish it's own heading to make clear that it applies to all webserver setups. --- docs/installing/manual_install.md | 65 ++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 28 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 10b9d86a9..25175f152 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -723,41 +723,17 @@ Install nginx apt-get install -y nginx -Copy the example nginx config - - cp /var/www/alaveteli/config/nginx.conf.example \ - /etc/nginx/sites-available/alaveteli - -
- Note: For historical reasons, nginx.conf.example has the path to Alaveteli set as /var/www/alaveteli/alaveteli – you will need to manually change this to /var/www/alaveteli, or to the root of your Alaveteli install -
- -Disable the default site and enable the `alaveteli` server - - rm /etc/nginx/sites-enabled/default - ln -s /etc/nginx/sites-available/alaveteli \ - /etc/nginx/sites-enabled/alaveteli - -Check the configuration and fix any issues - - service nginx configtest - -Start the rails application with thin (if you haven't already). - - service alaveteli start - -Reload the nginx configuration - - service nginx reload +#### Running over SSL It's strongly recommended that you run the site over SSL. (Set `FORCE_SSL` to true in `config/general.yml`). For this you will need an SSL certificate for your domain. -Copy the SSL configuration – again changing `www.example.com` to your domain – -and enable the server +Copy the SSL configuration – changing `www.example.com` to your domain – +and enable the `alaveteli_https` server, disabling the default site. cp /var/www/alaveteli/config/nginx-ssl.conf-example \ /etc/nginx/sites-available/alaveteli_https + rm /etc/nginx/sites-enabled/default ln -s /etc/nginx/sites-available/alaveteli_https \ /etc/nginx/sites-enabled/alaveteli_https @@ -788,8 +764,41 @@ Reload the new nginx configuration and restart the application service nginx reload service alaveteli restart +#### Running without SSL + +Set `FORCE_SSL` to +false in `config/general.yml`. Copy the example nginx config + + cp /var/www/alaveteli/config/nginx.conf.example \ + /etc/nginx/sites-available/alaveteli + +
+ Note: For historical reasons, nginx.conf.example has the path to Alaveteli set as /var/www/alaveteli/alaveteli – you will need to manually change this to /var/www/alaveteli, or to the root of your Alaveteli install +
+ +Disable the default site and enable the `alaveteli` server + + rm /etc/nginx/sites-enabled/default + ln -s /etc/nginx/sites-available/alaveteli \ + /etc/nginx/sites-enabled/alaveteli + +Check the configuration and fix any issues + + service nginx configtest + +Start the rails application with thin (if you haven't already). + + service alaveteli start + +Reload the nginx configuration + + service nginx reload + + --- +## Add varnish as an HTTP accelerator + Under all but light loads, it is strongly recommended to run the server behind an http accelerator like Varnish. A sample varnish VCL is supplied in `conf/varnish-alaveteli.vcl`. -- cgit v1.2.3 From 875aaa3742bb16fbac02667c68a3fb914c39e6e4 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Aug 2014 10:40:54 +0100 Subject: Add notes on how to run tests from a production install. --- docs/installing/manual_install.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 25175f152..4c9897a7a 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -827,6 +827,15 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). be able to move on to the [next steps]({{ site.baseurl }}docs/installing/next_steps/), depending on how serious they are, but ideally you should try to find out what's gone wrong. + +
+ Note: If you have setup your install of Alaveteli for production, you will need to temporarily remove the file config/rails_env.rb, which is used to force the rails environment to production, and edit your .bundle/config file to remove the BUNDLE_WITHOUT line that excludes development dependencies. After you have done this, as the alaveteli user, run bundle install. You should then be able to run the tests. Don't forget to restore config/rails_env.rb when you're done. You will probably see some errors from cron jobs in the meantime, as they'll be running in development mode. + +
+ + + + * **glibc bug workaround** There's a [bug in -- cgit v1.2.3 From 66381dcc0080f816eebd64b525c42d664199089a Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Aug 2014 11:50:21 +0100 Subject: Add the suexec module --- docs/installing/manual_install.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 4c9897a7a..33fc48ff2 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -637,9 +637,10 @@ this guide, so pick the appropriate web server to configure. ### Apache (with Passenger) -Install Apache: +Install Apache with the Suexec wrapper: apt-get install -y apache2 + apt-get install -y apache2-suexec Enable the required modules -- cgit v1.2.3 From 977d4cedfe62fdb2a726a1266233e4042c320900 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Aug 2014 13:02:53 +0100 Subject: Clearer instructions for production test prep. --- docs/installing/manual_install.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 33fc48ff2..44183e64e 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -819,7 +819,7 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). * **Run the Tests** - Make sure everything looks OK: + Make sure everything looks OK. As the alaveteli user, run: bundle exec rake spec @@ -830,12 +830,14 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/).
- Note: If you have setup your install of Alaveteli for production, you will need to temporarily remove the file config/rails_env.rb, which is used to force the rails environment to production, and edit your .bundle/config file to remove the BUNDLE_WITHOUT line that excludes development dependencies. After you have done this, as the alaveteli user, run bundle install. You should then be able to run the tests. Don't forget to restore config/rails_env.rb when you're done. You will probably see some errors from cron jobs in the meantime, as they'll be running in development mode. - -
+ Note: If you have setup your install of Alaveteli for production, you will need to temporarily remove the file config/rails_env.rb, which is used to force the rails environment to production, and edit your .bundle/config file to remove the BUNDLE_WITHOUT line that excludes development dependencies. After you have done this, as the alaveteli user, run bundle install. You will also need to make alaveteli the owner of /var/www/alaveteli/log/development.log, and run the database migrations. +
chown alaveteli:alaveteli /var/www/alaveteli/log/development.log
+sudo -u alaveteli bundle exec rake db:migrate
+You should then be able to run the tests. Don't forget to restore config/rails_env.rb when you're done. You will probably see some errors from cron jobs in the meantime, as they'll be running in development mode. + * **glibc bug workaround** -- cgit v1.2.3 From 3cf6d2b5ba1f20b2f65d146533efc27afe57f4ab Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Aug 2014 13:03:14 +0100 Subject: Remove libc6 workaround - should now not apply. --- docs/installing/manual_install.md | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 44183e64e..8c31f86bb 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -839,16 +839,6 @@ You should then be able to run the tests. Don't forget to restore config/r -* **glibc bug workaround** - - There's a [bug in - glibc](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637239) which causes - Xapian to segfault when running the tests. Although the bug report linked to - claims it's fixed in the current Debian stable, it's not as of version - `2.11.3-2`. - - Until it's fixed (e.g. `libc6 2.13-26` does work), you can get the tests to - pass by setting `export LD_PRELOAD=/lib/libuuid.so.1`. * **Incoming emails aren't appearing in my Alaveteli install** -- cgit v1.2.3 From fce4d7700f178fa7d9cbe2bc2704c739b3bca83b Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Aug 2014 14:37:18 +0100 Subject: Update filename to match https://github.com/mysociety/alaveteli/commit/40abf0831fdf9cd6dee2f8d412be6d19558c46d7 --- docs/installing/manual_install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 8c31f86bb..3fdc206de 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -732,14 +732,14 @@ true in `config/general.yml`). For this you will need an SSL certificate for you Copy the SSL configuration – changing `www.example.com` to your domain – and enable the `alaveteli_https` server, disabling the default site. - cp /var/www/alaveteli/config/nginx-ssl.conf-example \ + cp /var/www/alaveteli/config/nginx-ssl.conf.example \ /etc/nginx/sites-available/alaveteli_https rm /etc/nginx/sites-enabled/default ln -s /etc/nginx/sites-available/alaveteli_https \ /etc/nginx/sites-enabled/alaveteli_https
- Note: For historical reasons, nginx-ssl.conf-example has the path to Alaveteli set as /var/www/alaveteli/alaveteli – you will need to manually change this to /var/www/alaveteli, or to the root of your Alaveteli install + Note: For historical reasons, nginx-ssl.conf.example has the path to Alaveteli set as /var/www/alaveteli/alaveteli – you will need to manually change this to /var/www/alaveteli, or to the root of your Alaveteli install
If you are testing Alaveteli or setting up an internal staging site, generate -- cgit v1.2.3 From 86f51d15e0e7f58e2d62d47ff454fedc04bb380f Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 21 Aug 2014 17:41:30 +0100 Subject: Fix bullet list formatting --- docs/installing/manual_install.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 3fdc206de..9db1e00d7 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -317,6 +317,7 @@ that you can see the mails in a browser. Start mailcatcher by running `bundle ex ## Configure Alaveteli Alaveteli has three main configuration files: + - `config/database.yml`: Configures Alaveteli to communicate with the database - `config/general.yml`: The general Alaveteli application settings - `config/newrelic.yml`: Configuration for the [NewRelic](http://newrelic.com) monitoring service -- cgit v1.2.3 From f8256463bec4d7a704a50ab5e3a42b3113dc5800 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 21 Aug 2014 17:42:45 +0100 Subject: Add link to alavetelitheme --- docs/installing/manual_install.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 9db1e00d7..86e7251f8 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -367,8 +367,7 @@ The default settings for frontpage examples are designed to work with the dummy data shipped with Alaveteli; once you have real data, you should certainly edit these. -The default theme is the "Alaveteli" theme. When you run `rails-post-deploy` -(see below), that theme gets installed automatically. +The default theme is the ["Alaveteli" theme](https://github.com/mysociety/alavetelitheme). When you run `rails-post-deploy` (see below), that theme gets installed automatically. ### newrelic.yml -- cgit v1.2.3 From b74120fcb3aa8a7d0516083baf1310a6ab76e5dd Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 22 Aug 2014 09:34:08 +0100 Subject: Stop thin processes until daemon generation --- docs/installing/manual_install.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 86e7251f8..84338a5c4 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -442,6 +442,8 @@ site in action. You can daemonize the process by starting it with the `--daemonize` option. +Later in this guide we'll actually create a SysVinit daemon to run the application, so stop any thin processes you've started here. + ## Cron jobs and Daemons The crontab and init scripts use the `.ugly` file format, which is a strange -- cgit v1.2.3 From 9b96f35a7975004bc415c02e702663b70a43b675 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 22 Aug 2014 11:25:06 +0100 Subject: Explain how thin is installed Plucked from 018842285cade549d4b238373fb5acf69e7439db (Louise Crow) --- docs/installing/manual_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 84338a5c4..64875e3ab 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -423,7 +423,7 @@ See later in the guide for configuring the Apache web server with Passenger. ### Using Thin Thin is a lighter-weight application server which can be run independently of -a web server. +a web server. Thin will be installed in the application bundle and used to run Alaveteli by default. Run the following to get the server running: -- cgit v1.2.3