Ubuntu 22.04
Sponsored Link

Redmine : インストール2022/11/04

 
プロジェクト管理ツール Redmine をインストールします。
[1]
[2]
[3]
[4]
[5] その他必要なパッケージをインストールしておきます。
root@dlp:~#
apt -y install ruby-dev postgresql-server-dev-all libxslt1-dev libxml2-dev libpq-dev libcurl4-openssl-dev zlib1g-dev apache2-dev gcc g++ make patch imagemagick

[6] Redmine 用のユーザーとデータベースを作成しておきます。
# [password] は任意のパスワードを設定

root@dlp:~#
su - postgres

postgres@dlp:~$
createuser redmine

postgres@dlp:~$
createdb redmine -O redmine

postgres@dlp:~$
psql -c "alter user redmine with password 'password'"

ALTER ROLE
[7] Redmine をダウンロードしてインストールします。最新版を確認してダウンロードしてください。
⇒ http://www.redmine.org/projects/redmine/wiki/Download
root@dlp:~#
curl -O https://www.redmine.org/releases/redmine-5.0.3.tar.gz

root@dlp:~#
tar zxvf redmine-5.0.3.tar.gz

root@dlp:~#
mv redmine-5.0.3 /var/www/redmine

root@dlp:~#
cd /var/www/redmine

root@dlp:/var/www/redmine#
vi config/database.yml
# 以下の内容で新規作成

production:
  adapter: postgresql
  # データベース名
  database: redmine
  host: localhost
  # データベースユーザー
  username: redmine
  # データベースユーザーのパスワード
  password: password
  encoding: utf8

root@dlp:/var/www/redmine#
vi config/configuration.yml
# 以下の内容で新規作成 (SMTP の設定)

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: "localhost"
      port: 25
      domain: 'dlp.srv.world'

# bundler インストール

root@dlp:/var/www/redmine#
gem install bundler

# Redmine で使用する Gem をインストール

root@dlp:/var/www/redmine#
bundle config set --local without 'development test mysql sqlite'

root@dlp:/var/www/redmine#
bundle install

# 秘密鍵の生成

root@dlp:/var/www/redmine#
bundle exec rake generate_secret_token

# テーブル生成

root@dlp:/var/www/redmine#
bundle exec rake db:migrate RAILS_ENV=production

# Passenger インストール

root@dlp:/var/www/redmine#
gem install passenger

# Apache2 用モジュールインストール

root@dlp:/var/www/redmine#
passenger-install-apache2-module

Welcome to the Phusion Passenger Apache 2 module installer, v5.3.7.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

 1. The Apache 2 module will be installed for you.
 2. You'll learn how to configure Apache.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.
1

.....
.....

--------------------------------------------
Almost there!

Please edit your Apache configuration file, and add these lines:

   LoadModule passenger_module /var/lib/gems/3.0.0/gems/passenger-6.0.15/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /var/lib/gems/3.0.0/gems/passenger-6.0.15
     PassengerDefaultRuby /usr/bin/ruby3.0
   </IfModule>

After you restart Apache, you are ready to deploy any number of web
applications on Apache, with a minimum amount of configuration!

Press ENTER when you are done editing.

.....
.....

Deploying a web application

To learn how to deploy a web app on Passenger, please follow the deployment
guide:

  https://www.phusionpassenger.com/library/deploy/apache/deploy/

Enjoy Phusion Passenger, a product of Phusion® (www.phusion.nl) :-)
https://www.phusionpassenger.com

Passenger is a registered trademark of Phusion Holding B.V.
[8] Passenger を実行するための Apache2 の設定です。当例ではバーチャルホスト環境で設定します。
root@dlp:/var/www/redmine#
vi /etc/apache2/conf-available/passenger.conf
# 以下の内容で新規作成

LoadModule passenger_module /var/lib/gems/3.0.0/gems/passenger-6.0.15/buildout/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/3.0.0/gems/passenger-6.0.15
PassengerDefaultRuby /usr/bin/ruby3.0
SetEnv LD_LIBRARY_PATH /usr/lib64

<VirtualHost *:80>
    ServerName redmine.srv.world
    DocumentRoot /var/www/redmine/public
</VirtualHost>

<Directory "/var/www/redmine/public">
    Options FollowSymLinks
    AllowOverride All
</Directory>

root@dlp:/var/www/redmine#
chown -R www-data. /var/www/redmine

root@dlp:/var/www/redmine#
a2enconf passenger

root@dlp:/var/www/redmine#
systemctl reload apache2

[9] バーチャルホストで設定した URL にアクセスすると Redmine のサイトが表示されます。[Sign in] をクリックしてログインページへ移動します。
[10] ユーザー名/初期パスワード : [admin/admin] で管理者ログインできます。
[11] 初回ログイン後はパスワードの再設定を求められます。
[12] パスワードの再設定後は、アカウント情報の設定画面になります。必要な情報を入力して設定します。
[13] 以上で完了です。プロジェクトを作成して Redmine を活用ください。
関連コンテンツ