From eb317b35bba1535261f27e6117f91db371d6b014 Mon Sep 17 00:00:00 2001 From: Charlotte Fields Date: Sat, 17 Jun 2017 23:16:48 +1000 Subject: [PATCH] added some missing info to prod. (#306) * added some missing info * changed login and user creation * corrected user creation and login hopefully --- Running-Mastodon/Production-guide.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Running-Mastodon/Production-guide.md b/Running-Mastodon/Production-guide.md index f99107c1..a064e155 100644 --- a/Running-Mastodon/Production-guide.md +++ b/Running-Mastodon/Production-guide.md @@ -111,7 +111,14 @@ server { ## Running in production without Docker -It is recommended to create a special user for mastodon on the server (you could call the user `mastodon`), though remember to disable outside login for it. You should only be able to get into that user through `sudo -u mastodon`. +It is recommended to create a special user for mastodon on the server (you could call the user `mastodon`), though remember to disable outside login for it. You should only be able to get into that user through `sudo -iu mastodon`. + +This command will create the user as needed: + + sudo useradd --system --user-group --shell /bin/false --create-home --home /home/mastodon mastodon + +home can be changed as needed + ## General dependencies @@ -207,13 +214,18 @@ It is recommended to use rbenv (exclusively from the `mastodon` user) to install [2]: https://github.com/rbenv/ruby-build#installation [3]: https://github.com/rbenv/ruby-build/wiki#suggested-build-environment -Then once `rbenv` is ready, run `rbenv install 2.4.1` to install the Ruby version for Mastodon. +Then once `rbenv` is ready, install and enable the Ruby version for Mastodon using: + +``` +rbenv install 2.4.1 +rbenv global 2.4.1 +``` ## Git You need the `git-core` package installed on your system. If it is so, run the shell from the `mastodon` user: - sudo -su mastodon + sudo -iu mastodon And enter the following commands: