LoginSignup
24
31

More than 5 years have passed since last update.

Linux + bitnami で redmine 環境を作る

Posted at

はじめに

bitnamiでredmineを構築した際の覚書き。

前提

  • インフラ : AWS
  • OS : Red Hat Enterprise Linux Server release 6.5 (Santiago)
  • Memory : 2.0GB
  • IP:52.68.142.178 (※動的割り振りのため現在参照できません)
  • bitnami-redmine : bitnami-redmine-3.3.1

セットアップファイルは下記サイトから入手できます。
https://bitnami.com/stack/redmine/installer

また上で強調していますがMemoryは2.0GBは必要です。
(つまりAWSのEC2で言えばt2.small以上のインスタンス)
https://bitnami.com/forums/forums/redmine/topics/unable-to-create-symlink

構築手順

bitnami-redmineインストール

基本、導入作業はsudoコマンドで行うか、rootユーザにスイッチして行います。
インストール中にキーボード入力を行う必要のある箇所は★マークを置いてます。
コメント部分には☆を置いています。

# cd /tmp
  (WinSCPで/tmpにセットアップファイルを転送)
# ls -l /tmp
total 153168
-rw-rw-r--. 1 redmine1 redmine1 156842595 Oct 21 08:50 bitnami-redmine-3.3.1-0-linux-x64-installer.run
# chmod 755 bitnami-redmine-3.3.1-0-linux-x64-installer.run
# sudo ./bitnami-redmine-3.3.1-0-linux-x64-installer.run

Language Selection

Please select the installation language
[1] English - English
[2] Spanish - Espanol
[3] Japanese - 日本語
[4] Korean - ???
[5] Simplified Chinese - ?体中文
[6] Hebrew - ?????
[7] German - Deutsch
[8] Romanian - Roman?
[9] Russian - Русский
Please choose an option [1] : ★Enter押下 (1:Englishとなる)

Bitnami Redmine Stack requires at least 2000MB of memory and the installer has detected 1838MB of memory. This may prevent the application from installing, working properly or cause it to stop functioning due to lack of memory. Visit the following link to learn how to increase the swap space.

https://bitnami.com/lowmemory

Continue with installation? [Y/n]: ★Enter押下 (Yとなる)
☆メモリが2000MB以上でない(1838MBと認識されている)ため、警告が出ます。
☆2000MB以上と認識されていれば該当の警告は出ません。
☆1838MBあれば問題なくインストールできるため、そのまま進みます。

----------------------------------------------------------------------------
Welcome to the Bitnami Redmine Stack Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

Subversion [Y/n] : ★Enter押下 (Yとなる)

PhpMyAdmin [Y/n] : ★Enter押下 (Yとなる)

Redmine : Y (Cannot be edited)

Git [Y/n] : ★Enter押下 (Yとなる)

Is the selection above correct? [Y/n]: ★Enter押下 (Yとなる)

----------------------------------------------------------------------------
Installation folder

Please, choose a folder to install Bitnami Redmine Stack


Select a folder [/opt/redmine-3.3.1-0]: ★Enter押下 (/opt/redmine-3.3.1-0となる)
☆インストールディレクトリを指定しています。
----------------------------------------------------------------------------
Create Admin account

Bitnami Redmine Stack admin user creation

Your real name [User Name]: admin ★「admin」と入力してEnter押下

Email Address [user@example.com]: ★Enter押下 (user@example.comとなる)

Login [user]: admin ★「admin」と入力してEnter押下

Password : ★適当なパスワード(ここでは「redmine1610」)を入力してEnter押下
Please confirm your password : ★上と同じパスワードを入力してEnter押下

☆ここで作成したユーザデータは後から編集できるので適当でOKです。
☆ただしパスワードはmysqlのrootパスワードになるので記録必須です。

----------------------------------------------------------------------------
Language for default data configuration

Select your language for default data configuration:

[1] Bosnian
[2] Bulgarian
[3] Catalan
[4] Czech
[5] Danish
[6] German
[7] English
[8] Spanish
[9] French
[10] Galician
[11] Hebrew
[12] Hungarian
[13] Italian
[14] Japanese
[15] Korean
[16] Lithuanian
[17] Dutch
[18] Norwegian
[19] Polish
[20] Portuguese
[21] Romanian
[22] Russian
[23] Slovak
[24] Slovenian
[25] Serbian
[26] Swedish
[27] Turkish
[28] Ukrainian
[29] Vietnamese
[30] Chinese
Please choose an option [7] : ★Enter押下 (7:English)となる
☆日本語にしたい場合は14を入力してEnterを押してください。

Do you want to configure mail support? [y/N]: ★Enter押下 (Nとなる)
☆メール設定は後ほどできるのでここではスキップ

----------------------------------------------------------------------------
Setup is now ready to begin installing Bitnami Redmine Stack on your computer.

Do you want to continue? [Y/n]: ★Enter押下 (Yとなる)

----------------------------------------------------------------------------
Please wait while Setup installs Bitnami Redmine Stack on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
Setup has finished installing Bitnami Redmine Stack on your computer.

Launch Redmine application. [Y/n]: ★Enter押下 (Yとなる)

Info: To access the Bitnami Redmine Stack, go to
http://127.0.0.1:80 from your browser.
Press [Enter] to continue: ★Enter押下

以上でインストール完了です。
なおメモリが少なすぎると以下のようなエラーが多数出てインストールできません。

Unable to create symbolic link /opt/redmine-3.3.1-0/php/bin/phar -> phar.phar

インストールが完了し、サーバ上でbitnami-redmineが起動している。
ブラウザでURL「http://52.68.142.178/」にアクセスし動作を確認する。
※URL「http://52.68.142.178/」は現在参照できません。

image

サーバ上でbitnamiのwebサービスが立ち上がっていることが確認できます。
ページ内の「Access Redmine」のリンクを辿るかURL「http://52.68.142.178/redmine」にアクセスします

image

redmineのサービスが立ち上がっていることが確認できます。
メニューの「ログイン」を押下し、ログインIDとパスワードを入力し、インストール時に作ったユーザでログインしてみます。(今回の場合、ログインIDとパスワードは「admin:redmine1610」)

image

image

正常にadminユーザでredmineにログインできました。
以上でインストールおよび動作確認が完了です。

起動・停止・状態確認手順

redmineの起動・停止手順と、redmineに内包されているWEBサーバ(apache)、DBサーバ(mysql)を個別に起動・停止する手順です。個別に起動・停止する場面ってあんまりないと思いますが。
なお起動・停止スクリプト(ctlscript.sh)へのパスはインストールディレクトリに依存します。(今回の場合「/opt/redmine-3.3.1-0」配下)

redmine起動・停止手順

■ 起動
# sudo /opt/redmine-3.3.1-0/ctlscript.sh start
161111 02:08:50 mysqld_safe Logging to '/opt/redmine-3.3.1-0/mysql/data/mysqld.log'.
161111 02:08:50 mysqld_safe Starting mysqld.bin daemon with databases from /opt/redmine-3.3.1-0/mysql/data
/opt/redmine-3.3.1-0/mysql/scripts/ctl.sh : mysql  started at port 3306
Syntax OK
/opt/redmine-3.3.1-0/apache2/scripts/ctl.sh : httpd started at port 80
/opt/redmine-3.3.1-0/subversion/scripts/ctl.sh : subversion started at port 3690

■ 状態確認(起動時)
# sudo /opt/redmine-3.3.1-0/ctlscript.sh status
subversion already running
apache already running
mysql already running

■ 停止
# sudo /opt/redmine-3.3.1-0/ctlscript.sh stop
/opt/redmine-3.3.1-0/subversion/scripts/ctl.sh : subversion stopped
Syntax OK
/opt/redmine-3.3.1-0/apache2/scripts/ctl.sh : httpd stopped
/opt/redmine-3.3.1-0/mysql/scripts/ctl.sh : mysql stopped 

■ 状態確認(停止時)
# sudo /opt/redmine-3.3.1-0/ctlscript.sh status
subversion not running
apache not running
mysql not running

apache起動・停止手順

■ 起動
# sudo /opt/redmine-3.3.1-0/ctlscript.sh start apache
Syntax OK
/opt/redmine-3.3.1-0/apache2/scripts/ctl.sh : httpd started at port 80

■ 状態確認(起動時)
# sudo /opt/redmine-3.3.1-0/ctlscript.sh status apache
apache already running

■ 停止
# sudo /opt/redmine-3.3.1-0/ctlscript.sh stop apache
Syntax OK
/opt/redmine-3.3.1-0/apache2/scripts/ctl.sh : httpd stopped

■ 状態確認(停止時)
# sudo /opt/redmine-3.3.1-0/ctlscript.sh status apache
apache not running

mysql起動・停止手順

■ 起動
# sudo /opt/redmine-3.3.1-0/ctlscript.sh start mysql
161111 02:17:02 mysqld_safe Logging to '/opt/redmine-3.3.1-0/mysql/data/mysqld.log'.
161111 02:17:02 mysqld_safe Starting mysqld.bin daemon with databases from /opt/redmine-3.3.1-0/mysql/data
/opt/redmine-3.3.1-0/mysql/scripts/ctl.sh : mysql  started at port 3306

■ 状態確認(起動時)
# sudo /opt/redmine-3.3.1-0/ctlscript.sh status mysql
mysql already running

■ 停止
# sudo /opt/redmine-3.3.1-0/ctlscript.sh stop mysql
161111 02:16:17 mysqld_safe mysqld from pid file /opt/redmine-3.3.1-0/mysql/data/mysqld.pid ended
/opt/redmine-3.3.1-0/mysql/scripts/ctl.sh : mysql stopped

■ 状態確認(停止時)
# sudo /opt/redmine-3.3.1-0/ctlscript.sh status mysql
mysql not running

サービス自動起動設定

OS再起動時、自動敵にredmineが起動するよう設定します。

redmineの起動・停止スクリプト(ctlscript.sh)を「/etc/init.d」に「bitnami-redmine」という名前でコピーします。

# sudo cp -p /opt/redmine-3.3.1-0/ctlscript.sh /etc/init.d/bitnami-redmine

chkconfigで自動起動の登録をするため、コピーした起動・停止スクリプトを修正します。

# sudo vi /etc/init.d/bitnami-redmine
bitnami-redmine
#!/bin/sh

# chkconfig: 345 80 30
# description: BitNami Redmine Service

chkconfig:(3行目)とdescription:(4行目)の記述を追加します。
(ランレベル3,4,5でOSが起動した際に、自動でredmineを起動します)

chkconfigにbitnami-redmineを追加

# sudo chkconfig --add bitnami-redmine
# sudo chkconfig --list | grep bitnami
bitnami-redmine 0:off   1:off   2:off   3:on    4:on    5:on    6:off

ログローテート設定

logrotateを使い、ログの肥大化を防ぎます。
bitnamiにはlogrotate.confも用意されているので、必要に応じて閾値を変えて利用することができます。今回はデフォルトのまま使用します。
logrotate.confのシンボリックリンクを「/etc/logrotate.d/」に配置します。

# sudo ln -s /opt/redmine-3.3.1-0/config/logrotate/bitnami.conf /etc/logrotate.d/bitnami.conf

メール通知設定

チケットの更新などの通知をメールで受け取るため、メール通知設定をします。
今回メール通知設定用にyahooのアカウントを使用します。Yahooのメールサーバをsmtpサーバとして使用する場合、ホスト、ポートの指定も必要となります。

■メールアドレス

  • E-mail : onecup_redmine@yahoo.co.jp (※現在使用できません)

■SMTPサーバ

  • Address : smtp.mail.yahoo.co.jp
  • port : 587

メールアカウントの設定は「configuration.yml」を編集することで行います。
(編集箇所に★マークを付けています)

# sudo vi /opt/redmine-3.3.1-0/apps/redmine/htdocs/config/configuration.yml
configuration.yml
# default configuration options for all environments
default:
  # Outgoing emails configuration
  # See the examples below and the Rails guide for more configuration options:
  # http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
  email_delivery:
    delivery_method: :smtp
    smtp_settings:

      address: smtp.mail.yahoo.co.jp     ★ yahooのsmtpサーバ
      port: 587                   ★ smtpサーバのポート
      domain: yahoo.co.jp         ★ yahooのドメイン
      authentication: :plain      ★ 認証形式として「plain」を指定
      user_name: onecup_redmine@yahoo.co.jp  ★  メールアドレス  
      password: ********  ★  パスワード

configuration.ymlを編集したらredmineの画面からメール通知機能を設定します。
redmineにログインした状態でメニューバーの「Administration」、サイドバーの「Settings」を押下します。

image

「Email notifications」タブを押下し、「Emission email address」に送信元E-mailアドレスとして作成したアドレスを入力します。

image

画面左下の「Save」ボタンを押下します。設定はこれで完了です。
画面右下の「Send a test email」を押下してテストメールを送信できます。

image

アンインストール手順

アンインストールは非常に簡単でインストールディレクトリを削除するだけです。
稼働中のサービスを停止させてからアンインストールしましょう

rm -rf /opt/redmine-3.3.1-0

ちなみにredmine全体のバックアップを取りたい時も、インストールディレクトリをコピーするだけでOKです。(停止状態で取らないとDBは壊れそうですが)

終わりに

仕事で構築はしたものの実際の使い方はあまりわからず。
redmine使ってるプロジェクトって最近でも結構あるんですかね。

24
31
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
24
31