From 8269c4d4c5be52494f88cbb13767b2b51349aa3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 8 Oct 2015 08:37:25 +0200 Subject: [PATCH 1/4] Bump ruby version in installation guide --- doc/operation_guides/manual/installation-guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/operation_guides/manual/installation-guide.md b/doc/operation_guides/manual/installation-guide.md index 62bcdf5ae1..cadfb771bf 100644 --- a/doc/operation_guides/manual/installation-guide.md +++ b/doc/operation_guides/manual/installation-guide.md @@ -94,16 +94,16 @@ use [rbenv](http://rbenv.org/). [openproject@host] source ~/.profile [openproject@host] git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build -[openproject@host] rbenv install 2.1.6 +[openproject@host] rbenv install 2.1.7 [openproject@host] rbenv rehash -[openproject@host] rbenv global 2.1.6 +[openproject@host] rbenv global 2.1.7 ``` To check our Ruby installation we run `ruby --version`. It should output something very similar to: ``` -ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux] +ruby 2.1.7p400 (2015-08-18 revision 51632) [x86_64-linux] ``` ## Installation of Node From 42e9f877b0b28564c58da49c3c111f057eb867a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 8 Oct 2015 08:57:40 +0200 Subject: [PATCH 2/4] Use Rails 4 scripts instead of bundle exec [ci skip] --- .../manual/installation-guide.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/operation_guides/manual/installation-guide.md b/doc/operation_guides/manual/installation-guide.md index cadfb771bf..825901de1b 100644 --- a/doc/operation_guides/manual/installation-guide.md +++ b/doc/operation_guides/manual/installation-guide.md @@ -219,16 +219,16 @@ prevents you from such errors. ```bash [openproject@host] cd ~/openproject -[openproject@host] bundle exec rake db:create:all -[openproject@host] bundle exec rake generate_secret_token -[openproject@host] RAILS_ENV="production" bundle exec rake db:migrate -[openproject@host] RAILS_ENV="production" bundle exec rake db:seed -[openproject@host] RAILS_ENV="production" bundle exec rake assets:precompile +[openproject@host] ./bin/rake db:create:all +[openproject@host] ./bin/rake generate_secret_token +[openproject@host] RAILS_ENV="production" ./bin/rake db:migrate +[openproject@host] RAILS_ENV="production" ./bin/rake db:seed +[openproject@host] RAILS_ENV="production" ./bin/rake assets:precompile ``` **NOTE:** When not specified differently, the default data loaded via db:seed will have an english localization. You can choose to seed in a different language by specifying the language via the `LOCALE` environment variable on the call to `db:seed`. E.g. ```bash -[openproject@all] RAILS_ENV="production" LOCALE=fr bundle exec rake db:seed +[openproject@all] RAILS_ENV="production" LOCALE=fr ./bin/rake db:seed ``` will seed the database in the french language. @@ -389,9 +389,9 @@ If you have modified the `Gemfile.plugin` file, always repeat the following step [openproject@all] cd ~/openproject [openproject@all] bundle install [openproject@all] npm install -[openproject@all] RAILS_ENV="production" bundle exec rake db:migrate -[openproject@all] RAILS_ENV="production" bundle exec rake db:seed -[openproject@all] RAILS_ENV="production" bundle exec rake assets:precompile +[openproject@all] RAILS_ENV="production" ./bin/rake db:migrate +[openproject@all] RAILS_ENV="production" ./bin/rake db:seed +[openproject@all] RAILS_ENV="production" ./bin/rake assets:precompile ``` Restart the OpenProject server afterwards: @@ -428,7 +428,7 @@ If you need to restart the server (for example after a configuration change), do If you cannot login as the admin user, make sure that you have executed the `db:seed` command. ```bash - [openproject@all] RAILS_ENV="production" bundle exec rake db:seed + [openproject@all] RAILS_ENV="production" ./bin/rake db:seed ``` * **When accessing OpenProject, I get an error page. How do I find out what went wrong?** From 387e4c3a96cbc1ae8f971e9e7dc09d4660476712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 8 Oct 2015 09:03:59 +0200 Subject: [PATCH 3/4] Avoid creating all database in production case [ci skip] --- doc/operation_guides/manual/installation-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/operation_guides/manual/installation-guide.md b/doc/operation_guides/manual/installation-guide.md index 825901de1b..cfcbdd61ca 100644 --- a/doc/operation_guides/manual/installation-guide.md +++ b/doc/operation_guides/manual/installation-guide.md @@ -219,7 +219,7 @@ prevents you from such errors. ```bash [openproject@host] cd ~/openproject -[openproject@host] ./bin/rake db:create:all +[openproject@host] ./bin/rake db:create [openproject@host] ./bin/rake generate_secret_token [openproject@host] RAILS_ENV="production" ./bin/rake db:migrate [openproject@host] RAILS_ENV="production" ./bin/rake db:seed From f47316bb06bc8d5f6423ec601676312f30d38772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 8 Oct 2015 09:20:58 +0200 Subject: [PATCH 4/4] Correct section on secret token generation [ci skip] --- doc/operation_guides/manual/installation-guide.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/operation_guides/manual/installation-guide.md b/doc/operation_guides/manual/installation-guide.md index cfcbdd61ca..aa54851eb3 100644 --- a/doc/operation_guides/manual/installation-guide.md +++ b/doc/operation_guides/manual/installation-guide.md @@ -219,8 +219,7 @@ prevents you from such errors. ```bash [openproject@host] cd ~/openproject -[openproject@host] ./bin/rake db:create -[openproject@host] ./bin/rake generate_secret_token +[openproject@host] RAILS_ENV="production" ./bin/rake db:create [openproject@host] RAILS_ENV="production" ./bin/rake db:migrate [openproject@host] RAILS_ENV="production" ./bin/rake db:seed [openproject@host] RAILS_ENV="production" ./bin/rake assets:precompile @@ -232,6 +231,16 @@ prevents you from such errors. ``` will seed the database in the french language. +### Secret Token + +You need to generate a secret key base for the production environment with `./bin/rake secret` and make that available through the environment variable `SECRET_KEY_BASE`. +In this installation guide, we will use the local `.profile` of the OpenProject user. You may alternatively put set the environment variable in `/etc/environment` or pass it to the server upon start manually. + +```bash +[openproject@host] echo "export SECRET_KEY_BASE="`./bin/rake secret`" >> ~/.profile +[openproject@host] source ~/.profile +``` + ## Serve OpenProject with Apache and Passenger First, we exit the current bash session with the openproject user,