1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RHEL系のLinuxにRedmine 6.1をセットアップする

1
Last updated at Posted at 2023-07-15

Redmineのインストール

無保証
多分これでいける、というか作業ログを持ってきたので動くはずですがRuby on Railsがよく判っていないので動かなくてもサポートできません。

Redmine5.1に対応(2024/02/03)

 Redmineのバージョン5.1がリリースされているので更新しました。

Redmine6.0に対応(2025/02/05)

Redmine6.1に対応(2026/01/08)

Ruby 3.3 に対応(2025/08/04)

RHEL系でRuby 3.3Redmineを使う手順に変更。
MariaDB 11.8に変更。

RHEL10系統のLinuxではdnfのモジュールがなくなったのでモジュールに関する部分は削除

必要なパッケージをあらかじめ導入しておく

dnf install epel-release
dnf install rubygems 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 2026-01-29 01:32 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の依存関係モジュールをインストールする

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

image.png

運用に持って行くにはリバースプロキシからの接続を別途セットアップする必要があります。

参考にしたサイト:
Redmine公式

RedmineをPuma+Apacheで本番環境を構築!再起動後も自動で動く構成を解説

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?