Update anchors, line breaks, tootctl options (#745)

* update anchors

* remove extraneous anchors

* fix line breaks

* wrap tootctl tokens in code blocks

* change anchors to hugo format

* fix mistaken search-and-replace

* fix mistaken search-and-replace
This commit is contained in:
trwnh 2020-01-12 07:11:56 -06:00 committed by Eugen Rochko
parent 32d4dd5803
commit 7ceae9fe36
72 changed files with 1219 additions and 1223 deletions

View file

@ -1,12 +1,13 @@
---
title: Installing from source
description: Instructional guide on creating your own Mastodon-powered website.
menu:
docs:
weight: 20
parent: admin
---
## Pre-requisites <a id="pre-requisites"></a>
## Pre-requisites {#pre-requisites}
* A machine running **Ubuntu 18.04** that you have root access to
* A **domain name** \(or a subdomain\) for the Mastodon server, e.g. `example.com`
@ -14,24 +15,24 @@ menu:
You will be running the commands as root. If you arent already root, switch to root:
### System repositories <a id="system-repositories"></a>
### System repositories {#system-repositories}
Make sure curl is installed first:
#### Node.js <a id="node-js"></a>
#### Node.js {#node-js}
```bash
curl -sL https://deb.nodesource.com/setup_8.x | bash -
```
#### Yarn <a id="yarn"></a>
#### Yarn {#yarn}
```bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
```
### System packages <a id="system-packages"></a>
### System packages {#system-packages}
```bash
apt update
@ -44,7 +45,7 @@ apt install -y \
certbot python-certbot-nginx yarn libidn11-dev libicu-dev libjemalloc-dev
```
### Installing Ruby <a id="installing-ruby"></a>
### Installing Ruby {#installing-ruby}
We will be using rbenv to manage Ruby versions, because its easier to get the right versions and to update once a newer release comes out. rbenv must be installed for a single Linux user, therefore, first we must create the user Mastodon will be running as:
@ -94,15 +95,15 @@ Return to the root user:
exit
```
## Setup <a id="setup"></a>
## Setup {#setup}
### Setting up PostgreSQL <a id="setting-up-postgresql"></a>
### Setting up PostgreSQL {#setting-up-postgresql}
#### Performance configuration \(optional\) <a id="performance-configuration-optional"></a>
#### Performance configuration \(optional\) {#performance-configuration-optional}
For optimal performance, you may use [pgTune](https://pgtune.leopard.in.ua/#/) to generate an appropriate configuration and edit values in `/etc/postgresql/9.6/main/postgresql.conf` before restarting PostgreSQL with `systemctl restart postgresql`
#### Creating a user <a id="creating-a-user"></a>
#### Creating a user {#creating-a-user}
You will need to create a PostgreSQL user that Mastodon could use. It is easiest to go with “ident” authentication in a simple setup, i.e. the PostgreSQL user does not have a separate password and can be used by the Linux user with the same username.
@ -121,7 +122,7 @@ CREATE USER mastodon CREATEDB;
Done!
### Setting up Mastodon <a id="setting-up-mastodon"></a>
### Setting up Mastodon {#setting-up-mastodon}
It is time to download the Mastodon code. Switch to the mastodon user:
@ -129,7 +130,7 @@ It is time to download the Mastodon code. Switch to the mastodon user:
su - mastodon
```
#### Checking out the code <a id="checking-out-the-code"></a>
#### Checking out the code {#checking-out-the-code}
Use git to download the latest stable release of Mastodon:
@ -138,7 +139,7 @@ git clone https://github.com/tootsuite/mastodon.git live && cd live
git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
```
#### Installing the last dependencies <a id="installing-the-last-dependencies"></a>
#### Installing the last dependencies {#installing-the-last-dependencies}
Now to install Ruby and JavaScript dependencies:
@ -149,7 +150,7 @@ bundle install \
yarn install --pure-lockfile
```
#### Generating a configuration <a id="generating-a-configuration"></a>
#### Generating a configuration {#generating-a-configuration}
Run the interactive setup wizard:
@ -171,7 +172,7 @@ Youre done with the mastodon user for now, so switch back to root:
exit
```
### Setting up nginx <a id="setting-up-nginx"></a>
### Setting up nginx {#setting-up-nginx}
Copy the configuration template for nginx from the Mastodon directory:
@ -184,7 +185,7 @@ Then edit `/etc/nginx/sites-available/mastodon` to replace `example.com` with yo
Reload nginx for the changes to take effect:
### Acquiring a SSL certificate <a id="acquiring-a-ssl-certificate"></a>
### Acquiring a SSL certificate {#acquiring-a-ssl-certificate}
Well use Lets Encrypt to get a free SSL certificate:
@ -196,7 +197,7 @@ This will obtain the certificate, automatically update `/etc/nginx/sites-availab
At this point you should be able to visit your domain in the browser and see the elephant hitting the computer screen error page. This is because we havent started the Mastodon process yet.
### Setting up systemd services <a id="setting-up-systemd-services"></a>
### Setting up systemd services {#setting-up-systemd-services}
Copy the systemd service templates from the Mastodon directory: