myhelp:mastodon
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| myhelp:mastodon [2023/05/03 12:12] – ulrich | myhelp:mastodon [2024/03/20 10:16] (current) – [Setting up systemd services] ulrich | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| I used the instructions from [[https:// | I used the instructions from [[https:// | ||
| - | ====== Install Mastodon on Rocky Linux 8 ====== | + | ====== Install Mastodon on Rocky Linux 9 ====== |
| ===== Pre-requisites ===== | ===== Pre-requisites ===== | ||
| + | Enable EPEL is a good idea | ||
| + | < | ||
| + | dnf config-manager --set-enabled powertools | ||
| + | dnf install epel-release | ||
| + | </ | ||
| + | |||
| + | Get the YARN repo | ||
| + | < | ||
| + | curl --silent --location https:// | ||
| + | </ | ||
| + | |||
| + | Installing the needed packages | ||
| + | < | ||
| + | yum install -y git ruby ruby-devel postgresql-devel postgresql-server postgresql \ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Add the user and change the home-dir | ||
| + | < | ||
| + | adduser mastodon | ||
| + | mv / | ||
| + | usermod -d / | ||
| + | </ | ||
| + | |||
| + | Start redis | ||
| + | < | ||
| + | |||
| + | ===== Preparing the DB ===== | ||
| + | < | ||
| + | systemctl start postgresql.service | ||
| + | / | ||
| + | sudo -u postgres psql | ||
| + | </ | ||
| + | < | ||
| + | CREATE USER mastodon CREATEDB; | ||
| + | \q | ||
| + | </ | ||
| + | |||
| + | ===== Setting up Mastodon ===== | ||
| + | < | ||
| + | su - mastodon | ||
| + | </ | ||
| + | |||
| + | Use git to download the latest stable release of Mastodon: | ||
| + | < | ||
| + | git clone https:// | ||
| + | git checkout $(git tag -l | grep -v ' | ||
| + | </ | ||
| + | |||
| + | Now to install Ruby and JavaScript dependencies: | ||
| + | < | ||
| + | bundle config deployment ' | ||
| + | bundle config without ' | ||
| + | bundle install -j$(getconf _NPROCESSORS_ONLN) | ||
| + | yarn install --pure-lockfile | ||
| + | </ | ||
| + | |||
| + | Run the interactive setup wizard: | ||
| + | < | ||
| + | RAILS_ENV=production bundle exec rake mastodon: | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Setting up nginx ===== | ||
| + | Copy the prepared nginx.conf into the nginxc config-dir. Change the hostname and the root-dir. | ||
| + | < | ||
| + | cp / | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | </ | ||
| + | |||
| + | Ensure that the firewall is configured for http and https | ||
| + | < | ||
| + | firewall-cmd --add-service=http --permanent | ||
| + | firewall-cmd --add-service=https --permanent | ||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | Get a certifcate for your host/ | ||
| + | < | ||
| + | certbot --nginx -d social.server17.net | ||
| + | </ | ||
| + | |||
| + | ===== Setting up systemd services ===== | ||
| + | copy the files | ||
| + | < | ||
| + | cp / | ||
| + | </ | ||
| + | |||
| + | and edit the files | ||
| + | < | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | </ | ||
| + | |||
| + | now relaod the systemd and start evertything | ||
| + | < | ||
| + | systemctl daemon-reload | ||
| + | systemctl enable --now mastodon-web mastodon-sidekiq mastodon-streaming | ||
| + | </ | ||
| + | |||
| + | |||
| + | Maybe something went wrong with the install of the bundler gem and the services are not starting. Check if the gem is installed or just install it. | ||
| + | < | ||
| + | # su - mastodon | ||
| + | cd live/ | ||
| + | RAILS_ENV=production | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====== Tuning ====== | ||
| + | ===== Start tuning sidekiq ===== | ||
| + | sidekiq is handling multiple queues. Each of them can run as an own process. Per process you should use a max. of 25 threads. | ||
| + | |||
| + | ====== OLD HOW TO ====== | ||
| + | ===== Install Mastodon on Rocky Linux 8 ===== | ||
| + | ==== Pre-requisites ==== | ||
| Enable EPEL is a good idea | Enable EPEL is a good idea | ||
| < | < | ||
| Line 29: | Line 151: | ||
| | | ||
| | | ||
| - | | + | |
| </ | </ | ||
| Line 39: | Line 161: | ||
| </ | </ | ||
| - | ===== Preparing the DB ===== | + | ==== Preparing the DB ==== |
| < | < | ||
| systemctl start postgresql.service | systemctl start postgresql.service | ||
| Line 50: | Line 172: | ||
| </ | </ | ||
| - | ===== Setting up Mastodon | + | ==== Setting up Mastodon ==== |
| < | < | ||
| su - mastodon | su - mastodon | ||
| Line 74: | Line 196: | ||
| </ | </ | ||
| - | ===== Setting up nginx ===== | + | ==== Setting up nginx ==== |
| Copy the prepared nginx.conf into the nginxc config-dir. Change the hostname and the root-dir. | Copy the prepared nginx.conf into the nginxc config-dir. Change the hostname and the root-dir. | ||
| < | < | ||
| Line 94: | Line 216: | ||
| </ | </ | ||
| - | ===== Setting up systemd services | + | ==== Setting up systemd services ==== |
| copy the files | copy the files | ||
| < | < | ||
| Line 112: | Line 234: | ||
| </ | </ | ||
| - | ====== Update Mastodon to 4.0.* ====== | + | |
| + | ===== Update Mastodon to 4.0.* ===== | ||
| That is just a how-to which worked for me. Do a Backup in advance! | That is just a how-to which worked for me. Do a Backup in advance! | ||
| - | ===== Pre-requisites | + | ==== Pre-requisites ==== |
| Backup everything! You do not want to stay up half of the night and fix something. | Backup everything! You do not want to stay up half of the night and fix something. | ||
| Line 129: | Line 252: | ||
| </ | </ | ||
| That is necessary, because in my installation I changed it before. | That is necessary, because in my installation I changed it before. | ||
| - | ===== the REAL update | + | ==== the REAL update ==== |
| Here I just followed the manual from [[https:// | Here I just followed the manual from [[https:// | ||
| Line 151: | Line 274: | ||
| - | ===== Update to 4.0.2 ===== | + | ==== Update to 4.0.2 ==== |
| < | < | ||
| su - mastodon | su - mastodon | ||
| Line 162: | Line 285: | ||
| YEAH! Welcome to the new version. | YEAH! Welcome to the new version. | ||
| - | ====== Tuning | + | ===== Tuning ===== |
| - | ===== Start tuning sidekiq | + | ==== Start tuning sidekiq ==== |
| sidekiq is handling multiple queues. Each of them can run as an own process. Per process you should use a max. of 25 threads. | sidekiq is handling multiple queues. Each of them can run as an own process. Per process you should use a max. of 25 threads. | ||
| + | |||
| {{tag> | {{tag> | ||
myhelp/mastodon.1683115971.txt.gz · Last modified: by ulrich
