Skip to content

Instantly share code, notes, and snippets.

@momoseijin
momoseijin / How to install WordPress with Nginx and MariaDB on Ubuntu 22.04
Last active December 30, 2023 00:52
How to install WordPress with Nginx and MariaDB on Ubuntu 22.04
# Ubuntu 22.04 はインストール完了しておく
# Nginx のインストール
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# MariaDB のインストール
@momoseijin
momoseijin / How to install Jitsi Meet on Ubuntu 22.04
Last active November 11, 2023 07:57
How to install Jitsi Meet on Ubuntu 22.04
# 取得したドメインのDNS設定を完了しておく(TTL : 1800)
# Ubuntu 22.04 はインストールしておく
# 必要なものを root でインストールとリポジトリ追加
sudo apt install nginx gnupg2 openjdk-11-jdk curl apt-transport-https
sudo apt-add-repository universe
sudo apt update
# ホスト名の設定
sudo hostnamectl set-hostname meet.example.com
@momoseijin
momoseijin / Using S3 on Mastodon
Last active November 11, 2023 06:42
Using S3 on Mastodon
S3_ENABLED=true
S3_BUCKET=media.yourdomain.com ← 自分の作ったバケット名(mediaなどをつけてエイリアスを使う場合はOptionalも設定する)
AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRST ← 設定されたアクセスキー
AWS_SECRET_ACCESS_KEY=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcd ← 設定されたシークレットキー
S3_REGION=ap-northeast-1 ← 東京リージョンならこれ
S3_PROTOCOL=https
S3_ENDPOINT=https://s3-ap-northeast-1.amazonaws.com ← 東京リージョンならこれ
# Optional alias for S3 (e.g. to serve files on a custom domain, possibly using Cloudfront or Cloudflare)
S3_CLOUDFRONT_HOST=media.yourdomain.com ←ここに自分の設定した S3Bucket と Cloudflare で合わせた CNAME 入れる
# systemctl stop mastodon*
# su - mastodon
$ cd ~/.rbenv
$ git pull
$ cd ~/.rbenv/plugins/ruby-build
$ git pull
$ cd ~/.rbenv
$ rbenv install 2.4.2
$ rbenv global 2.4.2
@momoseijin
momoseijin / Upgrade PostgreSQL 9.5 to 10 , Mastodon on Ubuntu 16.04
Last active November 13, 2022 00:16
Upgrade PostgreSQL 9.5 to 10 , Mastodon on Ubuntu 16.04
#Mastodon を止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#まず PostgreSQL のリポジトリを追加して、アップデートする
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
sudo apt update
#今回は PostgreSQL 10 にするのでバージョンを指定してインストール
sudo apt install postgresql-10 postgresql-client-10 postgresql-contrib-10
@momoseijin
momoseijin / Upgrade PostgreSQL 11 to 12 , Mastodon on Ubuntu 16.04
Last active November 13, 2022 00:15
Upgrade PostgreSQL 11 to 12 , Mastodon on Ubuntu 16.04
#Mastodon を止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#クラスタを確認
pg_lsclusters
#下記のように 2 つの PostgreSQL が見えるはず
Ver Cluster Port Status Owner Data directory Log file
11 main 5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log
12 main 5433 online postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
#このときは 12 の接続先が 5433 になっていて、まだ 11 が通常ポートの 5432 につながった状態
@momoseijin
momoseijin / Update from Mastodon v3.0.1 to v3.1.0
Last active May 15, 2020 05:03
Update from Mastodon v3.0.1 to v3.1.0
#まずさっきの Yarn の設定をして、キーを更新して全体のアプデは終わらせておく
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt upgrade -y
#リリースノートにある Node の 10 入れる
curl -sL https://deb.nodesource.com/setup_10.x | bash -
sudo apt update
sudo apt install nodejs
@momoseijin
momoseijin / Update from Mastodon v3.1.2 to v3.1.3
Last active May 13, 2020 00:18
Update from Mastodon v3.1.2 to v3.1.3
#うちはだいぶ前に追加してたんだけど、Ubuntu 16.04 でまだ追加してない人は Redis をバージョンアップするためにこのリポジトリ追加する
#Ubuntu 18.04 の人は大丈夫みたい
add-apt-repository ppa:chris-lea/redis-server
apt update && apt upgrade
#Mastodon を止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#Mastodon ユーザになる
sudo su - mastodon
@momoseijin
momoseijin / Update from Mastodon v2.9.3 to v3.0.0
Last active October 5, 2019 12:06
Update from Mastodon v2.9.3 to v3.0.0
#Mastodon を止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#Mastodon ユーザになる
sudo su - mastodon
#今回の Ruby 2.6.5 のアップデートをするためにrbenvのおいてあるディレクトリに移り最新版をダウンロード
cd ~/.rbenv
git pull
#Mastodonを止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#Mastodonユーザになる
sudo su - mastodon
#Rubyのアップデートをするためにrbenvのおいてあるディレクトリに移り最新版をダウンロード
cd ~/.rbenv
git pull
#同じようにプラグインのディレクトリに移り最新版をダウンロード