Redmineのインストール
警告
RHEL10系はMariaDB.org からのインストールにまだ対応できていません。
この手順はRockyLinux9で確認しています。
無保証
多分これでいける、というか作業ログを持ってきたので動くはずですがRuby on Railsがよく判っていないので動かなくてもサポートできません。
Redmine5.1に対応(2024/02/03)
Redmineのバージョン5.1がリリースされているので更新しました。
Redmine6.0に対応(2025/02/05)
Ruby 3.3 に対応(2025/08/04)
RHEL系でRuby 3.3Redmineのを使う手順に変更。
MariaDB 11.8に変更。
Ruby 3.3 のセットアップ
# dnf module list ruby
Name Stream Profiles Summary
ruby 3.1 common [d] An interpreter of object-oriented scripting language
ruby 3.3 common [d] An interpreter of object-oriented scripting language
ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled
# dnf module -y reset ruby
# dnf module -y enable ruby:3.3
メタデータの期限切れの最終確認: 0:00:41 前の 2025年08月04日 15時05分39秒 に実施しました。
依存関係が解決しました。
============================================================================================================================================
パッケージ アーキテクチャー バージョン リポジトリー サイズ
============================================================================================================================================
モジュールストリームの有効化中:
ruby 3.3
トランザクションの概要
============================================================================================================================================
完了しました!
# dnf module list ruby
Rocky Linux 9 - AppStream
Name Stream Profiles Summary
ruby 3.1 common [d] An interpreter of object-oriented scripting language
ruby 3.3 [e] common [d] An interpreter of object-oriented scripting language
ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled
# dnf module -y install ruby:3.3/common
メタデータの期限切れの最終確認: 0:01:02 前の 2025年08月04日 15時05分39秒 に実施しました。
依存関係が解決しました。
============================================================================================================================================
パッケージ アーキテクチャー バージョン リポジトリー サイズ
============================================================================================================================================
group/moduleパッケージをインストール:
ruby x86_64 3.3.8-4.module+el9.6.0+31867+3a5bf654 appstream 38 k
<長いので省略>
完了しました!
必要なパッケージをあらかじめ導入しておく
dnf install epel-release
dnf install ruby-devel nodejs nodejs-libs gcc git subversion httpd mod_ssl
dnf config-manager --set-enabled crb
dnf install libyaml-devel
nano 等も入れておくと良いかも。
データベースを入れる、今回はMariaDB.orgからMariaDB 11.8を入れます。
/etc/yum.repos.d/MariaDB.repo
# MariaDB 11.8 RedHatEnterpriseLinux repository list - created 2025-08-04 04:35 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# baseurl = https://rpm.mariadb.org/11.8/rhel/$releasever/$basearch
baseurl = https://mirrors.xtom.jp/mariadb/yum/11.8/rhel/$releasever/$basearch
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://mirrors.xtom.jp/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
dnf -y install MariaDB-server MariaDB-client MariaDB-devel
文字コードなどの規定値や、セキュリティーの設定は先に済ませておいてください。
MariaDBのセットアップ
MariaDBのインストール/初期設定 [CentOS7]
↑ここから少し変更。
TCPでの接続を受け付けずにsocketのみに変更。
コマンド名はmariadbに変更。
ユーザーを追加しておく
adduser redmine
Ruby on Railsの導入
gem install rails
Redmineのチェックアウト
cd /var/www/html/
svn co https://svn.redmine.org/redmine/branches/6.0-stable redmine-6.0
MariaDBに初期データベースを作成する
mariadb -uroot -p
Enter password: <パスワード>
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
作業場所へ移動
cd redmine-6.0
データベースの設定を入れる
config/database.yml
production:
adapter: mysql2
database: redmine
socket: /var/lib/mysql/mysql.sock
username: redmine
password: "my_password"
pumaサーバを使用するのでGemfile.localを作成
Gemfile.local
gem "puma"
Railsの依存関係モジュールをインストールする
gem install bundler
bundle config set --local without 'development test'
bundle install
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
ディレクトリの作成とパーミッションの設定
chown -R apache:apache
mkdir -p tmp tmp/pdf public/plugin_assets
chown -R redmine:redmine files log tmp public/plugin_assets
chmod -R 755 files log public/plugin_assets
chmod -R 777 tmp files
起動してみる
bundle exec rails server -e production
=> Booting Puma
=> Rails 7.2.2.1 application starting in production
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 6.6.1 ("Return to Forever")
* Ruby version: ruby 3.3.8 (2025-04-09 revision b200bad6cd) [x86_64-linux]
* Min threads: 0
* Max threads: 5
* Environment: production
* PID: 23090
* Listening on http://0.0.0.0:3000
Use Ctrl-C to stop
運用に持って行くにはリバースプロキシからの接続を別途セットアップする必要があります。
参考にしたサイト:
Redmine公式
