CentOS7.5、Mastodon v2.4.5(非Docker)インストールメモ。

本ページはアフィリエイトプログラムによる収益を得ています。


1年ぶりぐらいにDockerを諦め
インストールしてみたメモ。

参考:Mastodon構築手順・非Docker版

前提:CentOS7.5

Yumでアップデートできるものはアップデート済み。

 

 

細かいところはアップデートガイドを。

documentation/Production-guide.md at master · tootsuite/documentation · GitHub

参考にしたページ
CentOS6.9にMastodonを導入する(Docker 不使用) – ごらくらいふ

PostgreSQLのアップグレード

9.xが要求されるものの

CentOSのyumで提供されているバージョンでは

バージョンが古いためセットアップが進まない。

yarnにお願いする。

curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo

 

yumを叩いてみる。

yum install postgresql96-server postgresql96-libs

 

configを修正

config作るやつがあるらしい
PGTune – calculate configuration for PostgreSQL based on the maximum performance for a given hardware configuration

 

 

自動起動の設定と起動。

sudo systemctl enable postgresql
sudo systemctl start postgresql

 

mastodon用ユーザの作成。

node.js をインストール

curl -sL https://rpm.nodesource.com/setup_8.x | sudo bash

いろいろインストール

sudo yum install -y redis nodejs yarn ffmpeg ImageMagick bzip2 tar make gcc-c++ git protobuf-compiler {openssl,readline,zlib,postgresql,protobuf,libicu,libidn}-devel 

 

masutodonのユーザ作成

sudo useradd mastodon
sudo su - mastodon

 

なんかいろいろ

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src && cd ~
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile && source ~/.bash_profile
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.5.1 && rbenv global $_ && rbenv rehash

 

masutodonを持ってくる。

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

 

git tagでいまの存在するバージョンを探す

 

はじめに入れたときは2.4.5が新しかった。

git checkout vX.X.X ← 選んだバージョンを指定する
gem install bundler
bundle install --deployment --without development test
yarn install

 

セットアップウィザード装備されたので従う。

cd ~/live
RAILS_ENV=production bundle exec rake mastodon:setup

 

 

 

サービス設定ファイルの作成

公式サイトに記載されている設定ファイルを書き込む

Mastodon systemd Service Files

 

sudo systemctl daemon-reload
sudo systemctl start mastodon-{web,sidekiq,streaming}
sudo systemctl enable mastodon-{web,sidekiq,streaming}

 

documentation/Administration-guide.md at master · tootsuite/documentation · GitHub

アドミンアカウントを更に追加するには

RAILS_ENV=production bundle exec rails mastodon:make_admin USERNAME=alice

参考
Nginxによるリバースプロキシの設定方法
PostgreSQL RPM Repository (with Yum)
非Docker運営にてWe’re sorry, but something went wrong on our end. – 設置・運用 – Mastodon日本語メタフォーラム
postgresql – Rails and jsonb type “jsonb” does not exist – Stack Overflow
GitHub – simonfrey/mastodon_wordpress_autopost: A WordPress Plugin that automatically posts your new articles to Mastodon


おすすめ

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

コメントは承認待ちです。表示されるまでしばらく時間がかかるかもしれません。

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください