User Tools

Site Tools


myhelp:mastodon

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
myhelp:mastodon [2023/08/22 06:26] – [Pre-requisites] ulrichmyhelp:mastodon [2024/03/20 10:16] (current) – [Setting up systemd services] ulrich
Line 1: Line 1:
 I used the instructions from [[https://docs.joinmastodon.org/admin/install/|Mastodon]] and adopted it to fit better for me :) I used the instructions from [[https://docs.joinmastodon.org/admin/install/|Mastodon]] and adopted it to fit better for me :)
  
-====== Install Mastodon on Rocky Linux ======+====== Install Mastodon on Rocky Linux ======
 ===== Pre-requisites ===== ===== Pre-requisites =====
 Enable EPEL is a good idea  Enable EPEL is a good idea 
Line 12: Line 12:
 <code> <code>
 curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
-</code> 
- 
-After a fresh installation, setting some software to the needed release.  
-<code> 
-yum module enable ruby:3.0 -y 
-yum module enable nodejs:12 -y 
-yum module enable postgresql:12 -y 
 </code> </code>
  
Line 26: Line 19:
  postgresql-contrib nodejs.x86_64 yarn make idn2.x86_64 libidn-devel.x86_64 \  postgresql-contrib nodejs.x86_64 yarn make idn2.x86_64 libidn-devel.x86_64 \
  libidn2-devel.x86_64 libidn.x86_64  libicu-devel.x86_64 libicu.x86_64 gcc gcc-c++ \  libidn2-devel.x86_64 libidn.x86_64  libicu-devel.x86_64 libicu.x86_64 gcc gcc-c++ \
- libzstd-devel openssl3-devel openssl-devel tar redis nginx certbot.noarch \+ libzstd-devel openssl-devel tar redis nginx certbot.noarch \
  python3-certbot-nginx.noarch ImageMagick.x86_64 libicu-devel.x86_64 postgresql-contrib.x86_64 \  python3-certbot-nginx.noarch ImageMagick.x86_64 libicu-devel.x86_64 postgresql-contrib.x86_64 \
- libffi-devel.x86_64 libyaml-devel.x86_64 autoconf.noarch protobuf-compiler.x86_64 \ + libffi-devel.x86_64 libyaml.x86_64 autoconf.noarch protobuf.x86_64 \ 
- libxml2-devel.x86_64 bison.x86_64 libpq-devel.x86_64 jemalloc-devel+ libxml2-devel.x86_64 bison.x86_64 libpq-devel.x86_64 jemalloc-devel rbenv
 </code> </code>
  
Line 38: Line 31:
 usermod -d /opt/mastodon mastodon usermod -d /opt/mastodon mastodon
 </code> </code>
 +
 +Start redis
 +<code>systemctl enable --now redis</code>
  
 ===== Preparing the DB ===== ===== Preparing the DB =====
Line 73: Line 69:
 RAILS_ENV=production bundle exec rake mastodon:setup RAILS_ENV=production bundle exec rake mastodon:setup
 </code> </code>
 +
  
 ===== Setting up nginx ===== ===== Setting up nginx =====
Line 103: Line 100:
 <code> <code>
 sed -i 's:/home/mastodon/:/opt/mastodon/:g' /etc/systemd/system/mastodon-* sed -i 's:/home/mastodon/:/opt/mastodon/:g' /etc/systemd/system/mastodon-*
-sed -i 's:/opt/mastodon/.rbenv/shims/bundle:/bin/bundle:g' mastodon-*+sed -i 's:/opt/mastodon/.rbenv/shims/bundle:/opt/mastodon/live/bin/bundle:g' /etc/systemd/system/mastodon-*
 </code> </code>
  
Line 112: Line 109:
 </code> </code>
  
-====== Update Mastodon to 4.0.* ====== 
-That is just a how-to which worked for me. Do a Backup in advance! 
-===== Pre-requisites ===== 
-Backup everything! You do not want to stay up half of the night and fix something.   
  
-With the update to the version 4.0 you need a nodejs 14 and also edit some path in the system files +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
-Update nodejs: +
 <code> <code>
-yum module reset nodejs +# su - mastodon 
-yum module enable nodejs:14 +cd live/ 
-yum -y update+RAILS_ENV=production  gem install bundler
 </code> </code>
-Edit the path for bundle: 
-<code> 
-sed -i 's:ExecStart=/bin/bundle:ExecStart=/opt/mastodon/bin/bundle:g' /etc/systemd/system/mastodon-* 
-</code> 
-That is necessary, because in my installation I changed it before.  
-===== the REAL update ===== 
-Here I just followed the manual from [[https://github.com/mastodon/mastodon/releases/tag/v4.0.0|Mastodon]] on Github.  
  
-This can take some minutes: 
-<code> 
-su - mastodon 
-cd live 
-git fetch && git checkout v4.0.0 
-bundle install 
-yarn install 
-</code> 
- 
-Also this take some minutes 
-<code> 
-SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate 
-RAILS_ENV=production bundle exec rails assets:precompile 
-sudo systemctl restart mastodon-* 
-RAILS_ENV=production bundle exec rails db:migrate 
-sudo systemctl restart mastodon-* 
-</code> 
- 
- 
-===== Update to 4.0.2 ===== 
-<code> 
-su - mastodon 
-cd live 
-git fetch && git checkout v4.0.2 
-bundle install 
-RAILS_ENV=production bundle exec rails assets:precompile 
-sudo systemctl restart mastodon-* 
-</code> 
-YEAH! Welcome to the new version.  
  
 ====== Tuning ====== ====== Tuning ======
Line 166: Line 122:
 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. 
  
-I used the instructions from [[https://docs.joinmastodon.org/admin/install/|Mastodon]] and adopted it to fit better for me :) +====== OLD HOW TO ====== 
- +===== Install Mastodon on Rocky Linux 8 ===== 
-====== Install Mastodon on Rocky Linux 8 ====== +==== Pre-requisites ====
-===== Pre-requisites =====+
 Enable EPEL is a good idea  Enable EPEL is a good idea 
 <code> <code>
Line 179: Line 134:
 <code> <code>
 curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
 +</code>
 +
 +After a fresh installation, setting some software to the needed release. 
 +<code>
 +yum module enable ruby:3.0 -y
 +yum module enable nodejs:12 -y
 +yum module enable postgresql:12 -y
 </code> </code>
  
Line 186: Line 148:
  postgresql-contrib nodejs.x86_64 yarn make idn2.x86_64 libidn-devel.x86_64 \  postgresql-contrib nodejs.x86_64 yarn make idn2.x86_64 libidn-devel.x86_64 \
  libidn2-devel.x86_64 libidn.x86_64  libicu-devel.x86_64 libicu.x86_64 gcc gcc-c++ \  libidn2-devel.x86_64 libidn.x86_64  libicu-devel.x86_64 libicu.x86_64 gcc gcc-c++ \
- libzstd-devel openssl-devel tar redis nginx certbot.noarch \+ libzstd-devel openssl3-devel openssl-devel tar redis nginx certbot.noarch \
  python3-certbot-nginx.noarch ImageMagick.x86_64 libicu-devel.x86_64 postgresql-contrib.x86_64 \  python3-certbot-nginx.noarch ImageMagick.x86_64 libicu-devel.x86_64 postgresql-contrib.x86_64 \
  libffi-devel.x86_64 libyaml-devel.x86_64 autoconf.noarch protobuf-compiler.x86_64 \  libffi-devel.x86_64 libyaml-devel.x86_64 autoconf.noarch protobuf-compiler.x86_64 \
- libxml2-devel.x86_64 bison.x86_64 libpq-devel.x86_64 jemalloc-devel+ libxml2-devel.x86_64 bison.x86_64 libpq-devel.x86_64 jemalloc-devel rbenv
 </code> </code>
  
Line 199: Line 161:
 </code> </code>
  
-===== Preparing the DB =====+==== Preparing the DB ====
 <code> <code>
 systemctl start postgresql.service systemctl start postgresql.service
Line 210: Line 172:
 </code> </code>
  
-===== Setting up Mastodon =====+==== Setting up Mastodon ====
 <code> <code>
 su - mastodon su - mastodon
Line 234: Line 196:
 </code> </code>
  
-===== 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.
 <code> <code>
Line 254: Line 216:
 </code> </code>
  
-===== Setting up systemd services =====+==== Setting up systemd services ====
 copy the files copy the files
 <code> <code>
Line 272: Line 234:
 </code> </code>
  
-====== 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 289: Line 252:
 </code> </code>
 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://github.com/mastodon/mastodon/releases/tag/v4.0.0|Mastodon]] on Github.  Here I just followed the manual from [[https://github.com/mastodon/mastodon/releases/tag/v4.0.0|Mastodon]] on Github. 
  
Line 311: Line 274:
  
  
-===== Update to 4.0.2 =====+==== Update to 4.0.2 ====
 <code> <code>
 su - mastodon su - mastodon
Line 322: 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>[HowTo]}} {{tag>[HowTo]}}
myhelp/mastodon.1692685560.txt.gz · Last modified: by ulrich