From cf129147e306abb3b6cfa751913040c728b2487a Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 16 Jun 2014 16:05:42 +0100 Subject: Configure locale on fresh systems --- 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 0c6efb1d9..13d31eea8 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -25,6 +25,17 @@ have instructions for [installing on MacOS]({{ site.baseurl }}docs/installing/ma Commands are intended to be run via the terminal or over ssh. +## Set the locale + +**Debian Squeeze** + +Follow the [Debian guide](https://wiki.debian.org/Locale#Standard) for configuring the locale of the operating system. + +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 + +Start a new SSH session to use your SSH locale. ## Get Alaveteli -- cgit v1.2.3 From d41e59dc1af1880e96a8f13b7efdcc9746aa36d8 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 10:42:00 +0100 Subject: Move Administrator Privileges to Admin Manual Administrator Privileges section has nothing to do with installing, so moved it to the Admin Manual. --- docs/installing/manual_install.md | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 0c6efb1d9..4a98c9be2 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -327,28 +327,6 @@ 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. -## Administrator privileges - -The administrative interface is at the URL `/admin`. - -Only users with the `super` admin level can access the admin interface. Users -create their own accounts in the usual way, and then administrators can give -them `super` privileges. - -There is an emergency user account which can be accessed via -`/admin?emergency=1`, using the credentials `ADMIN_USERNAME` and -`ADMIN_PASSWORD`, which are set in `general.yml`. To bootstrap the -first `super` level accounts, you will need to log in as the emergency -user. You can disable the emergency user account by setting `DISABLE_EMERGENCY_USER` to `true` in `general.yml`. - -Users with the superuser role also have extra privileges in the website -frontend, such as being able to categorise any request, being able to view -items that have been hidden from the search, and being presented with "admin" -links next to individual requests and comments in the front end. - -It is possible completely to override the administrator authentication by -setting `SKIP_ADMIN_AUTH` to `true` in `general.yml`. - ## Cron jobs and init scripts `config/crontab-example` contains the cronjobs run on WhatDoTheyKnow. It's in a -- cgit v1.2.3 From 9f20e09b082bb0762a8581015ee39cbe01835072 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 19 Jun 2014 14:57:05 +0100 Subject: Remove references to run-with-lockfile Once #112 is closed with the replacement of run-with-lockfile by the shell script version, remove references to it from the documentation. --- 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 777d95139..8c6f6d838 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -402,11 +402,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 -The cron jobs refer to a program `run-with-lockfile`. See [this -issue](https://github.com/mysociety/alaveteli/issues/112) for a discussion of -where to find this program, and how you might replace it. This [one line -script](https://gist.github.com/3741194) can install this program system-wide. - ## Set up production web server It is not recommended to run the website using the default Rails web server. -- cgit v1.2.3 From d0a8e9b3eb82176faec6896af3eb0333e794962f Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 6 Jun 2014 16:58:44 +0100 Subject: Use template for setting up postgres databases Seems to be the cleanest way for ensuring databases are always created with UTF-8 encoding, if for example the admin has not configured the system locale. --- docs/installing/manual_install.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index d3a629155..d523a199a 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -175,20 +175,20 @@ Create a `foi` user from the command line, like this: _Note:_ Leaving the password blank will cause great confusion if you're new to PostgreSQL. -Then create the databases: +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 SQL_ASCII -O foi foi_production - # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_test - # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_development +Then create the databases: -We create using the ``SQL_ASCII`` encoding, because in postgres this is means -"no encoding"; and because we handle and store all kinds of data that may not -be valid UTF (for example, data originating from various broken email clients -that's not 8-bit clean), it's safer to be able to store *anything*, than reject -data at runtime. + # sudo -u postgres createdb -T template_utf8 -O foi foi_production + # sudo -u postgres createdb -T template_utf8 -O foi foi_test + # sudo -u postgres createdb -T template_utf8 -O foi foi_development -Now you need to set up the database config file to contain the name, username -and password of your postgres database. +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 @@ -198,6 +198,7 @@ Example `development` section of `config/database.yml`: development: adapter: postgresql + template: template_utf8 database: foi_development username: foi password: secure-password-here -- cgit v1.2.3 From 3cd30c9952f9d174ff4b774b43659900f1d444d8 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 25 Jun 2014 11:43:00 +0100 Subject: Use alaveteli_ as database prefix rather than foi_ Clearer what app the database belongs to --- docs/installing/manual_install.md | 8 ++++---- 1 file changed, 4 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 d523a199a..bf2f9b7cd 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -183,9 +183,9 @@ We'll create a template for our Alaveteli databases: Then create the databases: - # sudo -u postgres createdb -T template_utf8 -O foi foi_production - # sudo -u postgres createdb -T template_utf8 -O foi foi_test - # sudo -u postgres createdb -T template_utf8 -O foi foi_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. @@ -199,7 +199,7 @@ Example `development` section of `config/database.yml`: development: adapter: postgresql template: template_utf8 - database: foi_development + database: alaveteli_development username: foi password: secure-password-here host: localhost -- cgit v1.2.3 From 8e6a72122de1d47a45e7e190b961f4c0a23e52d5 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 11:45:42 +0100 Subject: config_files:convert_crontab now allows MAILTO No longer have to manually edit the crontab as MAILTO can be specified when generating the file. --- docs/installing/manual_install.md | 7 ++++--- 1 file changed, 4 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 bf2f9b7cd..4122aa181 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -385,6 +385,7 @@ The `ugly` format uses simple variable substitution. A variable looks like replaced with `/var/www/alaveteli` in your cron tab * `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 There is a rake task that will help to rewrite this file into one that is useful to you, which can be invoked with: @@ -394,11 +395,11 @@ useful to you, which can be invoked with: VHOST_DIR=/dir/above/alaveteli \ VCSPATH=alaveteli \ SITE=alaveteli \ + MAILTO=cron-alaveteli@example.org \ CRONTAB=config/crontab-example > crontab -You should change the `DEPLOY_USER`, `VHOST_DIR`, `VCSPATH` and `SITE` -environment variables to match your server and installation. You should also -edit the resulting `crontab` file to customize the `MAILTO` variable. +You should change the `DEPLOY_USER`, `VHOST_DIR`, `VCSPATH` `MAILTO` and `SITE` +environment variables to match your server and installation. One of the cron jobs refers to a script at `/etc/init.d/foi-alert-tracks`. This is an init script, a copy of which lives in `config/alert-tracks-debian.ugly`. -- cgit v1.2.3 From ab0a1c3032dbf88e4deddbf66963fc142c5b30f2 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 11:47:13 +0100 Subject: Minor example code formatting --- docs/installing/manual_install.md | 10 +++++----- 1 file changed, 5 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 4122aa181..070f441df 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -392,11 +392,11 @@ useful to you, which can be invoked with: bundle exec rake config_files:convert_crontab \ DEPLOY_USER=deploy \ - VHOST_DIR=/dir/above/alaveteli \ - VCSPATH=alaveteli \ - SITE=alaveteli \ - MAILTO=cron-alaveteli@example.org \ - CRONTAB=config/crontab-example > crontab + VHOST_DIR=/dir/above/alaveteli \ + VCSPATH=alaveteli \ + SITE=alaveteli \ + MAILTO=cron-alaveteli@example.org \ + CRONTAB=config/crontab-example > crontab You should change the `DEPLOY_USER`, `VHOST_DIR`, `VCSPATH` `MAILTO` and `SITE` environment variables to match your server and installation. -- cgit v1.2.3 From 855929f04efcc1033489a2df85c328ddbba73404 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 12:20:20 +0100 Subject: Remove unused cron example variable Not used in config/crontab-example.ugly --- 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 070f441df..abb05f978 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -371,11 +371,6 @@ server. The `ugly` format uses simple variable substitution. A variable looks like `!!(*= $this *)!!`. The variables are: -* `vhost`: part of the path to the directory where the software is - served from. In the mySociety files, it usually comes as - `/data/vhost/!!(*= $vhost *)!!` -- you should replace that whole - port with a path to the directory where your Alaveteli software - installation lives, e.g. `/var/www/` * `vhost_dir`: the entire path to the directory where the software is served from. -- you should replace this with a path to the directory where your Alaveteli software installation lives, -- cgit v1.2.3 From aaa0348f61d48711125dbeba89ef144c53e5cab4 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 12:20:53 +0100 Subject: Update cron variables documentation --- docs/installing/manual_install.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index abb05f978..4cea0f1c8 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -371,13 +371,10 @@ server. The `ugly` format uses simple variable substitution. A variable looks like `!!(*= $this *)!!`. The variables are: -* `vhost_dir`: the entire path to the directory where the software is - served from. -- you should replace this with a path to the - directory where your Alaveteli software installation lives, - e.g. `/var/www/` -* `vcspath`: the name of the alaveteli checkout, e.g. `alaveteli`. - Thus, `/data/vhost/!!(*= $vhost *)!!/!!(*= $vcspath *)!!` might be - replaced with `/var/www/alaveteli` in your cron tab +* `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` * `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 -- cgit v1.2.3 From 7f610e92b64ea5d5259566c624657845ed63d83a Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 12:32:19 +0100 Subject: Remove superfluous crontab docs --- docs/installing/manual_install.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 4cea0f1c8..1f218d2c6 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -380,7 +380,7 @@ The `ugly` format uses simple variable substitution. A variable looks like * `mailto`: The email address that cron output will be sent to There is a rake task that will help to rewrite this file into one that is -useful to you, which can be invoked with: +useful to you. Change the variables to suit your installation. bundle exec rake config_files:convert_crontab \ DEPLOY_USER=deploy \ @@ -390,9 +390,6 @@ useful to you, which can be invoked with: MAILTO=cron-alaveteli@example.org \ CRONTAB=config/crontab-example > crontab -You should change the `DEPLOY_USER`, `VHOST_DIR`, `VCSPATH` `MAILTO` and `SITE` -environment variables to match your server and installation. - One of the cron jobs refers to a script at `/etc/init.d/foi-alert-tracks`. This is an init script, a copy of which lives in `config/alert-tracks-debian.ugly`. As with the cron jobs above, replace the variables (and/or bits near the -- cgit v1.2.3 From 7752e3528aa5f5778be39f98e90630136fe7a9a8 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 12:35:27 +0100 Subject: Generate crontab to /etc/cron.d/ Might as well put it in the right place --- 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 1f218d2c6..14e9b718c 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -388,7 +388,7 @@ useful to you. Change the variables to suit your installation. VCSPATH=alaveteli \ SITE=alaveteli \ MAILTO=cron-alaveteli@example.org \ - CRONTAB=config/crontab-example > crontab + CRONTAB=config/crontab-example > /etc/cron.d/alaveteli One of the cron jobs refers to a script at `/etc/init.d/foi-alert-tracks`. This is an init script, a copy of which lives in `config/alert-tracks-debian.ugly`. -- cgit v1.2.3 From acd70085bb4f8e69d248d5916314012f51da476f Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 12:35:46 +0100 Subject: Use better default for VHOST_DIR in cron example --- 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 14e9b718c..6911ab0e4 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -384,7 +384,7 @@ useful to you. Change the variables to suit your installation. bundle exec rake config_files:convert_crontab \ DEPLOY_USER=deploy \ - VHOST_DIR=/dir/above/alaveteli \ + VHOST_DIR=/var/www \ VCSPATH=alaveteli \ SITE=alaveteli \ MAILTO=cron-alaveteli@example.org \ -- cgit v1.2.3 From ec7ee8389f9e1508635e9910aae51586b5304ec9 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 12:43:28 +0100 Subject: Add better sections to crontab and init setup --- docs/installing/manual_install.md | 20 +++++++++++++++----- 1 file changed, 15 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 6911ab0e4..6002682fe 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -363,13 +363,19 @@ setting `SKIP_ADMIN_AUTH` to `true` in `general.yml`. ## Cron jobs and init scripts -`config/crontab-example` contains the cronjobs run on WhatDoTheyKnow. It's in a -strange templating format they use in mySociety. mySociety render the example -file to reference absolute paths, and then drop it in `/etc/cron.d/` on the -server. +The crontab and init scripts use the `.ugly` file format, which is a strange +templating format used by mySociety. The `ugly` format uses simple variable substitution. A variable looks like -`!!(*= $this *)!!`. The variables are: +`!!(*= $this *)!!`. + +### Generate crontab + +`config/crontab-example` contains the cron jobs that run on +WhatDoTheyKnow. mySociety render the example file to reference absolute paths, +and then drop it in `/etc/cron.d/` on the server. + +The variables are: * `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` @@ -390,12 +396,16 @@ useful to you. Change the variables to suit your installation. MAILTO=cron-alaveteli@example.org \ CRONTAB=config/crontab-example > /etc/cron.d/alaveteli +### Generate alert daemon + One of the cron jobs refers to a script at `/etc/init.d/foi-alert-tracks`. This is an init script, a copy of which lives in `config/alert-tracks-debian.ugly`. As with the cron jobs above, replace the variables (and/or bits near the variables) with paths to your software. You can use the rake task `rake config_files:convert_init_script` to do this. +### 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). Either tweak the file permissions to make the scripts executable by your deploy -- cgit v1.2.3 From f425944c05feeba1a5ad471884474e5cce26a515 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 13:07:36 +0100 Subject: Add better examples for generating the alert daemon --- docs/installing/manual_install.md | 22 +++++++++++++++++----- 1 file changed, 17 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 6002682fe..b9686f7a5 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -375,7 +375,7 @@ The `ugly` format uses simple variable substitution. A variable looks like WhatDoTheyKnow. mySociety render the example file to reference absolute paths, and then drop it in `/etc/cron.d/` on the server. -The variables are: +**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` @@ -399,10 +399,22 @@ useful to you. Change the variables to suit your installation. ### Generate alert daemon One of the cron jobs refers to a script at `/etc/init.d/foi-alert-tracks`. This -is an init script, a copy of which lives in `config/alert-tracks-debian.ugly`. -As with the cron jobs above, replace the variables (and/or bits near the -variables) with paths to your software. You can use the rake task `rake -config_files:convert_init_script` to do this. +is an init script, which can be generated from the +`config/alert-tracks-debian.ugly` template. + +**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` +* `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. + + bundle exec rake config_files:convert_init_script \ + DEPLOY_USER=deploy \ + VHOST_DIR=/var/www \ + SCRIPT_FILE=config/alert-tracks-debian.ugly > /etc/init.d/foi-alert-tracks ### Generate varnish purge daemon -- cgit v1.2.3 From 85163e9a7169025b91536ee43eeb72eb37d90fad Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 13:14:04 +0100 Subject: Add variables for purge varnish init script --- docs/installing/manual_install.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index b9686f7a5..77f915283 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -420,6 +420,16 @@ useful to you. Change the variables to suit your installation. `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). + +**Template Variables:** + +* `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` +* `user`: the user that the software runs as + +This template does not yet have a rake task to generate it. + 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): -- cgit v1.2.3 From 9365ff67895c28d94a8874cd0808a1b8472b1671 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 19 Jun 2014 13:27:23 +0100 Subject: Minor updates to init script setup --- docs/installing/manual_install.md | 6 ++++-- 1 file changed, 4 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 77f915283..c84e0f145 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -430,11 +430,13 @@ and not required if you choose not to run your site behind Varnish (see below). This template does not yet have a rake task to generate it. +### 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 `deploy` in this case): +by your deploy user (named `deploy` in this case). - deploy ALL = NOPASSWD: /etc/init.d/foi-alert-tracks, /etc/init.d/foi-purge-varnish + deploy ALL = NOPASSWD: /etc/init.d/foi-alert-tracks, /etc/init.d/foi-purge-varnish ## Set up production web server -- cgit v1.2.3 From e71d580acd2fa59874e29fa2a11a9b631370f36e Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 7 Jul 2014 16:37:27 +0100 Subject: Add wheezy to the list of OSes Extend the locale instructions to either version of Debian. --- 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 d3a629155..1b9df6abe 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -19,15 +19,15 @@ Note that there are [other ways to install Alaveteli]({{ site.baseurl }}docs/ins ## Target operating system -These instructions assume Debian Squeeze (64-bit) or Ubuntu 12.04 LTS -(precise). Debian Squeeze is the best supported deployment platform. We also +These instructions assume Debian Wheezy or Squeeze (64-bit) 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 Squeeze** +**Debian Wheezy or Squeeze** Follow the [Debian guide](https://wiki.debian.org/Locale#Standard) for configuring the locale of the operating system. -- cgit v1.2.3 From 34e19dea411b1ee8827db05e8bc475b2b0809490 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 7 Jul 2014 16:43:27 +0100 Subject: More descriptive heading and make headings same level --- 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 1b9df6abe..c5110fe55 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -60,7 +60,7 @@ submodules, run: git submodule update --init -## Install system dependencies +## 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 @@ -132,7 +132,7 @@ 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 +## Install the dependencies Refresh the sources after adding the extra repositories: -- cgit v1.2.3 From 2c8bd801014825dbc3763a7c5d5ed19628379d68 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 7 Jul 2014 16:43:57 +0100 Subject: Note requirement for root privileges --- 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 c5110fe55..7f688e813 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -66,6 +66,12 @@ 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`: **Debian Squeeze** -- cgit v1.2.3 From c711394fd62947853fdf15f7d4913b31c899c6b7 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 7 Jul 2014 16:45:24 +0100 Subject: Add wheezy repo for squeeze Give better description of what we're getting from each repository and suggest package pinning for wheezy. --- docs/installing/manual_install.md | 18 +++++++++++++++--- 1 file changed, 15 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 7f688e813..187ba92e8 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -76,12 +76,24 @@ Add the following repositories to `/etc/apt/sources.list`: **Debian Squeeze** - cat > /etc/apt/sources.list.d/debian-backports.list < /etc/apt/sources.list.d/debian-extra.list < /etc/apt/preferences < Date: Mon, 7 Jul 2014 16:46:48 +0100 Subject: Add section for wheezy. --- 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 187ba92e8..3bf241f53 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -94,6 +94,17 @@ The squeeze-backports repository is providing a more recent version of rubygems, Pin-Priority: 50 EOF +**Debian Wheezy** + + cat > /etc/apt/sources.list.d/debian-extra.list < Date: Mon, 7 Jul 2014 16:56:05 +0100 Subject: Add raring repository for precise. This allows us to get a more recent version of bundler and pdftk. Also add package pinning instructions. Switch repo as EC2 was giving 403 on some packages. --- docs/installing/manual_install.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 3bf241f53..47ed92591 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -109,14 +109,31 @@ The squeeze-backports repository is providing a more recent version of rubygems, **Ubuntu Precise** cat > /etc/apt/sources.list.d/ubuntu-extra.list <> /etc/apt/preferences < Date: Mon, 7 Jul 2014 18:07:14 +0100 Subject: Clarify instructions for installing mysociety versions of packages Add wheezy, don't overwrite /etc/apt/preferences if it's already there. Add section for squeeze that says you don't need to do anything. --- docs/installing/manual_install.md | 21 ++++++++++++++++----- 1 file changed, 16 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 47ed92591..f5038a46c 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -83,7 +83,7 @@ Add the following repositories to `/etc/apt/sources.list`: 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. - cat > /etc/apt/preferences <> /etc/apt/preferences < /etc/apt/sources.list.d/mysociety-debian.list <> /etc/apt/preferences < /etc/apt/preferences < Date: Mon, 7 Jul 2014 18:13:13 +0100 Subject: Update instructions on manually installing tricky package dependencies --- docs/installing/manual_install.md | 6 +++++- 1 file changed, 5 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 f5038a46c..b8e559044 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -170,6 +170,8 @@ repository - we only want to pull wkhtmltopdf-static from mysociety. No special package pinning is required. +### Other platforms +If you're using some other linux platform, you can optionally install these dependencies manually, as follows: 1. If you would like users to be able to get pretty PDFs as part of the @@ -183,7 +185,9 @@ everything will still work, but users will get ugly, plain text versions of their requests when they download them. 2. Version 1.44 of `pdftk` contains a bug which makes it loop forever in -certain edge conditions. Until it's incorporated into an official release, you +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 -- cgit v1.2.3 From 266303c2f470d782e236caac487efb322a77c238 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 7 Jul 2014 18:14:01 +0100 Subject: Add wheezy install instructions for the package file --- 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 b8e559044..6b1c24534 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -201,6 +201,9 @@ Refresh the sources after adding the extra repositories: Now install the packages relevant to your system: + # Debian Wheezy + sudo apt-get install $(cat config/packages.debian-wheezy) + # Debian Squeeze sudo apt-get install $(cat config/packages.debian-squeeze) -- cgit v1.2.3 From 4e77f18c28876ca338dad7fe2d8c06d8725abd81 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 7 Jul 2014 18:14:33 +0100 Subject: We're backporting bundler for Ubuntu. Update the instructions to reflect that. --- 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 6b1c24534..fdb836d37 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -217,7 +217,7 @@ choice of packages. ## Install Ruby dependencies To install Alaveteli's Ruby dependencies, you need to install bundler. In -Debian, this is provided as a package (installed as part of the package install +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 -- cgit v1.2.3 From 85abc20d8459c4a8935474faa58cb04ba3d2a233 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 8 Jul 2014 10:29:28 +0100 Subject: Add instructions for updating Alaveteli path in init scripts. --- docs/installing/manual_install.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 821188b85..603db14c0 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -480,6 +480,16 @@ 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`. + ## Set up production web server It is not recommended to run the website using the default Rails web server. -- cgit v1.2.3 From a860b9fca3f2fd2ba33a3a591824190eb74a3e1a Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 16 Jul 2014 16:27:02 +0100 Subject: Add a 'next steps' page, referenced at the end of install guides. --- docs/installing/manual_install.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index 603db14c0..5ab2103a2 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -541,6 +541,10 @@ and so it knows to include that in any absolute urls it serves. We have some [production server best practice notes]({{ site.baseurl}}docs/running/server/). +## What next? + +Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). + ## Troubleshooting * **Incoming emails aren't appearing in my Alaveteli install** -- cgit v1.2.3 From 486bea64611380dbbff7905da0d1f542509fba45 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 18 Jul 2014 15:04:03 +0100 Subject: Tweak target operating systems info Prefer a 64-bit version of all Operating Systems --- 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 5ab2103a2..9631d8e9e 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -19,8 +19,8 @@ Note that there are [other ways to install Alaveteli]({{ site.baseurl }}docs/ins ## Target operating system -These instructions assume Debian Wheezy or Squeeze (64-bit) or Ubuntu 12.04 LTS -(precise). Debian is the best supported deployment platform. We also +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. -- cgit v1.2.3 From b962470c4295f56f4a8b893a832f3b027778c9b8 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 7 Jul 2014 18:34:46 +0100 Subject: Reference Postfix as well as Exim - it's easier to setup. --- docs/installing/manual_install.md | 8 ++++---- 1 file changed, 4 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 8d6403b73..841617477 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -218,7 +218,7 @@ to the test config in `database.yml` (as seen in `database.yml-example`) 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 config for Exim4]({{ site.baseurl }}docs/installing/email/). +[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 @@ -450,9 +450,9 @@ notes]({{ site.baseurl}}docs/running/server/). First, you need to check that your MTA is delivering relevant incoming emails to the `script/mailin` command. There are various ways of setting your MTA up to do this; we have documented - [one way of doing it]({{ site.baseurl }}docs/installing/email/#troubleshooting-exim) - in Exim, including a command you can use to check that the email - routing is set up correctly. + one way of doing it + [in Exim]({{ site.baseurl }}docs/installing/email/#example-setup-on-exim4), including [a command you can use]({{ site.baseurl }}docs/installing/email/#troubleshooting-exim) to check that the email + routing is set up correctly. We've also documented one way of setting up [Postfix]({{ site.baseurl }}docs/installing/email/#example-setup-on-postfix), with a similar [debugging command]({{ site.baseurl }}docs/installing/email/#troubleshooting-postfix). Second, you need to test that the mailin script itself is working correctly, by running it from the command line, First, find a -- cgit v1.2.3 From 6d80b813cc6fc16f31db31ffb161d1ffbb7d62bb Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 12 Aug 2014 12:16:58 +0100 Subject: Add external SMTP check example. --- docs/installing/manual_install.md | 46 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 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 7eac53ae3..20b672856 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -541,7 +541,7 @@ and so it knows to include that in any absolute urls it serves. 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/). @@ -579,10 +579,52 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). 75 The `mailin` script emails the details of any errors to - `CONTACT_EMAIL` (from your `general.yml` file). A common problem is + `CONTACT_EMAIL` (from your `general.yml` file). A common problem is for the user that the MTA runs as not to have write access to `files/raw_emails/`. + If everything seems fine locally, you should also check from another + computer connected to the Internet that the DNS for your chosen + domain indicates that your Alaveteli server is handling mail, and + that your server is receiving mail on port 25. The following + command is a query to ask which server is handling the mail for + the domain `example.com`, which receives the answer `mail.example.com`. + + $ host -t mx example.com + example.com mail is handled by 5 mail.example.com. + + This next command tries to connect to port 25, the standard SMTP + port, on `mail.example.com`, and is refused. + + $ telnet mail.example.com 25 + Trying 10.10.10.30... + telnet: connect to address 10.10.10.30: Connection refused + + The transcript below shows a successful connection where the server + accepts mail for delivery (the commands you would type are prefixed + by a `$`): + + $ telnet 10.10.10.30 25 + Trying 10.10.10.30... + Connected to 10.10.10.30. + Escape character is '^]'. + 220 mail.example.com ESMTP Exim 4.80 Tue, 12 Aug 2014 11:10:39 +0000 + $ HELO X + 250 mail.example.com Hello X [10.10.10.1] + $ MAIL FROM: + 250 OK + $ RCPT TO: + 250 Accepted + $ DATA + 354 Enter message, ending with "." on a line by itself + $ Subject: Test + $ + $ This is a test mail. + $ . + 250 OK id=1XHA03-0001Vx-Qn + QUIT + + * **Various tests fail with "*Your PostgreSQL connection does not support unescape_bytea. Try upgrading to pg 0.9.0 or later.*"** -- cgit v1.2.3 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/). +
+
    +
  • Commands in this guide will require root privileges
  • +
  • Commands are intended to be run via the terminal or over ssh
  • +
+
+ ## 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 From b4b74eaaf70add887891cad33626a32f24c2736c Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Fri, 22 Aug 2014 13:54:19 +0100 Subject: fixup! Add external SMTP check example. --- 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 20b672856..e8a1556dd 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -598,7 +598,7 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). $ telnet mail.example.com 25 Trying 10.10.10.30... - telnet: connect to address 10.10.10.30: Connection refused + telnet: connect to address 10.10.10.30: Connection refused The transcript below shows a successful connection where the server accepts mail for delivery (the commands you would type are prefixed -- cgit v1.2.3 From d3e626ce5876d907fe41849261f957438fdac212 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Fri, 22 Aug 2014 13:59:58 +0100 Subject: fixup! Add external SMTP check example. --- docs/installing/manual_install.md | 76 +-------------------------------------- 1 file changed, 1 insertion(+), 75 deletions(-) (limited to 'docs/installing/manual_install.md') diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md index e8a1556dd..bd23b54ee 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -549,81 +549,7 @@ Check out the [next steps]({{ site.baseurl }}docs/installing/next_steps/). * **Incoming emails aren't appearing in my Alaveteli install** - First, you need to check that your MTA is delivering relevant - incoming emails to the `script/mailin` command. There are various - ways of setting your MTA up to do this; we have documented - one way of doing it - [in Exim]({{ site.baseurl }}docs/installing/email/#example-setup-on-exim4), including [a command you can use]({{ site.baseurl }}docs/installing/email/#troubleshooting-exim) to check that the email - routing is set up correctly. We've also documented one way of setting up [Postfix]({{ site.baseurl }}docs/installing/email/#example-setup-on-postfix), with a similar [debugging command]({{ site.baseurl }}docs/installing/email/#troubleshooting-postfix). - - Second, you need to test that the mailin script itself is working - correctly, by running it from the command line, First, find a - valid "To" address for a request in your system. You can do this - through your site's admin interface, or from the command line, - like so: - - $ ./script/console - Loading development environment (Rails 2.3.14) - >> InfoRequest.find_by_url_title("why_do_you_have_such_a_fancy_dog").incoming_email - => "request-101-50929748@localhost" - - Now take the source of a valid email (there are some sample emails in - `spec/fixtures/files/`); edit the `To:` header to match this address; - and then pipe it through the mailin script. A non-zero exit code - means there was a problem. For example: - - $ cp spec/fixtures/files/incoming-request-plain.email /tmp/ - $ perl -pi -e 's/^To:.*/To: /' /tmp/incoming-request-plain.email - $ ./script/mailin < /tmp/incoming-request-plain.email - $ echo $? - 75 - - The `mailin` script emails the details of any errors to - `CONTACT_EMAIL` (from your `general.yml` file). A common problem is - for the user that the MTA runs as not to have write access to - `files/raw_emails/`. - - If everything seems fine locally, you should also check from another - computer connected to the Internet that the DNS for your chosen - domain indicates that your Alaveteli server is handling mail, and - that your server is receiving mail on port 25. The following - command is a query to ask which server is handling the mail for - the domain `example.com`, which receives the answer `mail.example.com`. - - $ host -t mx example.com - example.com mail is handled by 5 mail.example.com. - - This next command tries to connect to port 25, the standard SMTP - port, on `mail.example.com`, and is refused. - - $ telnet mail.example.com 25 - Trying 10.10.10.30... - telnet: connect to address 10.10.10.30: Connection refused - - The transcript below shows a successful connection where the server - accepts mail for delivery (the commands you would type are prefixed - by a `$`): - - $ telnet 10.10.10.30 25 - Trying 10.10.10.30... - Connected to 10.10.10.30. - Escape character is '^]'. - 220 mail.example.com ESMTP Exim 4.80 Tue, 12 Aug 2014 11:10:39 +0000 - $ HELO X - 250 mail.example.com Hello X [10.10.10.1] - $ MAIL FROM: - 250 OK - $ RCPT TO: - 250 Accepted - $ DATA - 354 Enter message, ending with "." on a line by itself - $ Subject: Test - $ - $ This is a test mail. - $ . - 250 OK id=1XHA03-0001Vx-Qn - QUIT - + See the [general email troubleshooting guide]({{ site.baseurl }}docs/installing/email#general-email-troubleshooting). * **Various tests fail with "*Your PostgreSQL connection does not support unescape_bytea. Try upgrading to pg 0.9.0 or later.*"** -- cgit v1.2.3 From c9234c473c22aa2f909e7b30d82f195186ef0ed3 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Fri, 22 Aug 2014 14:24:26 +0100 Subject: Update daemon_name variable in init script config. It was missing in alert-tracks, and wrongly described in purge-varnish --- 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 7eac53ae3..72657046d 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -446,6 +446,7 @@ is an init script, which can be generated from the **Template Variables:** +* `daemon_name`: The name of the daemon. This is set by the rake task. * `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` * `user`: the user that the software runs as @@ -465,7 +466,7 @@ and not required if you choose not to run your site behind Varnish (see below). **Template Variables:** -* `daemon_name`: The name of the daemon. Set this to `purge-varnish`. +* `daemon_name`: The name of the daemon. This is set by the rake task. * `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` * `user`: the user that the software runs as -- cgit v1.2.3 From 931e54cf6a6289c20ff9fda08fa475b241c8007c Mon Sep 17 00:00:00 2001 From: Dave Whiteland Date: Wed, 7 Jan 2015 15:55:00 +0000 Subject: new entries and small tidies in glossary around admin/superuser --- docs/installing/manual_install.md | 7 ++++++- 1 file changed, 6 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 8c9e2a8d6..9cad6b5b9 100644 --- a/docs/installing/manual_install.md +++ b/docs/installing/manual_install.md @@ -351,7 +351,12 @@ Example `development` section of `config/database.yml`: Make sure that the user specified in `database.yml` exists, and has full permissions on these databases. -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`): +As the user needs the ability to turn off constraints whilst running the tests +they also need to be a superuser (clarification: a Postgres superuser, +not an Alaveteli +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 -- cgit v1.2.3