Mastodon bei Hostsharing: Unterschied zwischen den Versionen

Aus Hostsharing Wiki
Zur Navigation springen Zur Suche springen
Zeile 68: Zeile 68:


== Einrichten des Apache VHost ==
== Einrichten des Apache VHost ==
    cd ~/doms/beispiel.social
    rm -rf htdocs-ssl subs/www subs-ssl/www
    ln -s ~/live/public htdocs-ssl
    touch htdocs-ssl/.htaccess
Dann die ''htdocs-ssl/.htaccess'' mit dem Editor der Wahl öffnen und
folgende Konfiguration einfügen:
    DirectoryIndex disabled
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI}  ^/api/v1/streaming    [NC]
    RewriteRule .* ws://localhost:4000%{REQUEST_URI}  [proxy]
    RequestHeader set X-Forwarded-Proto "https"
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* http://localhost:3000%{REQUEST_URI} [proxy]
    RequestHeader set X-Forwarded-Proto "https"
Die Ports 3000 und 4000 sind die Voreinstellung von Mastodon und sollten angepasst werden.


== Links ==
== Links ==

Version vom 9. April 2018, 13:30 Uhr

Baustelle

Diese Seite ist noch nicht fertig.


Für Managed Server

Ein funktionierender Mastodon-Server erfordert mehrere laufende Server-Dienste. Für den Betrieb ist ein Managed Server sinnvoll.


Vorbereitungen

Mit Hilfe von HSAdmin wird angelegt:

  1. Ein User als Service-User mit /bin/bash als Shell, zum Beispiel Beispiel: xyz00-mastodon
  2. Eine Domain mit xyz00-mastodon als Domain-Administrator, zum Beispiel beispiel.social
  3. Einen Postgresql-User xyz00_mastuser mit Passwort meinPasswort
  4. Eine Postgresql-Datenbank xyz00_mastdb mit Datenbank-Owner xyz00_mastuser

Installation von NodeJS

Als User 'xyz00-mastodon: Installation von nvm und nodejs (Version 6) nach der Anleitung NodeJS

Installation von yarn mit:

   npm install -g yarn

Installation von Ruby

Als User xyz00-mastodon: Installation von Ruby mit rbenv mit folgenden Befehlen:

Zunächst rbenv and ruby-build:

   git clone https://github.com/rbenv/rbenv.git ~/.rbenv
   cd ~/.rbenv && src/configure && make -C src
   echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
   echo 'eval "$(rbenv init -)"' >> ~/.bashrc

starte neue Shell:

   exec bash

Überprüfe rbenv-Installation

   type rbenv

Installiere ruby-build als rbenv-Plugin

   git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

Nun kann die benötigte Ruby-Bersion installiert werden:

   rbenv install 2.5.0

Installation der Mastodon Software

Weiterhin Als User xyz00-mastodon:

   cd ~
   git clone https://github.com/tootsuite/mastodon.git live
   cd ~/live

Die stabile Version auschecken:

   git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)

Ruby Pakete installieren:

   gem install bundler
   bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test

Node.js Pakete installieren:

   yarn install --pure-lockfile

Einrichten des Apache VHost

   cd ~/doms/beispiel.social
   rm -rf htdocs-ssl subs/www subs-ssl/www
   ln -s ~/live/public htdocs-ssl
   touch htdocs-ssl/.htaccess

Dann die htdocs-ssl/.htaccess mit dem Editor der Wahl öffnen und folgende Konfiguration einfügen:

   DirectoryIndex disabled
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_URI}  ^/api/v1/streaming    [NC]
   RewriteRule .* ws://localhost:4000%{REQUEST_URI}  [proxy]
   RequestHeader set X-Forwarded-Proto "https"
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule .* http://localhost:3000%{REQUEST_URI} [proxy]
   RequestHeader set X-Forwarded-Proto "https"

Die Ports 3000 und 4000 sind die Voreinstellung von Mastodon und sollten angepasst werden.

Links