目次



環境の構築

下記の通り順繰りやっていけばOK。

  1. CentOS 6.3 をインストール

  2. OS時刻の同期設定

  3. OpenSSL 1.0.1d
    ソースからのインストール(上書き?)はやめとく。

  4. zlib 1.2.3

  5. OpenSSH 6.1p1

  6. Apache 2.2.23

  7. PostgreSQL 9.2.2

    インストール後に下記。
    • Redmine用ユーザーとDBの作成
      # su - postgres
      $ createuser -S -D -R redmine
      $ createdb -O redmine redmine --encoding=utf8 --template=template0

  8. Ruby 1.9.3

  9. Subversion 1.7.8
    Subversion 1.7.1をインストールしたらRedmineで異常発生。
    ログイン画面は開くがログインを実行すると「Internal Server Error」。
    Http.confで
    LoadModule dav_svn_module     modules/mod_dav_svn.so
    LoadModule authz_svn_module   modules/mod_authz_svn.so
    の2つをコメントアウトするとログインは正常にできるようになった。
    1.7.1ではダメなよう(深くは調べない)なので、1.6の最新である1.6.17をインストール。

Redmine のインストール

  1. ダウンロード
    # wget -P /usr/local/src http://rubyforge.org/frs/download.php/76722/redmine-2.2.2.tar.gz

  2. 解凍
    # cd /usr/local/src
    # tar zxvf redmine-2.2.2.tar.gz

  3. 解凍したディレクトリを公開用ディレクトリに移動
    # mv redmine-2.2.2 /home/htdocs/

  4. シンボリックリンク作成
    以下のようにしておくとサブディレクトリとしてRedmineにアクセスできる。
    # ln -s /home/htdocs/redmine-2.2.2 /home/htdocs/redmine 
    # ln -s /home/htdocs/redmine/public /usr/local/apache2/htdocs/redmine

  5. database.ymlの作成
    # /home/htdocs/redmine-2.2.2/config
    # vi database.yml
    以下を記述する。
    production:
      adapter: postgresql
      database: redmine
      host: localhost
      username: redmine
      password: "redmine"
      encoding: utf8

  6. configuration.ymlの作成
    # /home/htdocs/redmine-2.2.2/config
    # cp configuration.yml.example configuration.yml
    # vi configuration.yml
    環境に合わせて設定する。
    (例)メール環境
    # default configuration options for all environments
    default:
      # Outgoing emails configuration (see examples above)
      email_delivery:
        delivery_method: :smtp
        smtp_settings:
          address: smtp.hogehoge.com
          port: 25
          domain: hogehoge.com
          authentication: :login
          user_name: "redmine@hogehoge.com"
          password: "redmine"

  7. PostgreSQL用のGemをインストール
    #  gem install pg -- --with-pg-dir=/usr/local/pgsql
    Building native extensions.  This could take a while...
    Successfully installed pg-0.14.1
    1 gem installed
    Installing ri documentation for pg-0.14.1...
    unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for Contributors.rdoc, skipping
    unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for History.rdoc, skipping
    unable to convert "\xEF" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for ext/pg.c, skipping
    Installing RDoc documentation for pg-0.14.1...
    unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for Contributors.rdoc, skipping
    unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for History.rdoc, skipping
    unable to convert "\xEF" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for ext/pg.c, skipping

  8. Redmineで使用するGemをインストール
    Redmineのインストールディレクトリで以下のコマンドを実行。
    # bundle install --without development test mysql sqlite

  9. 初期設定とデータベースのテーブル作成
    セッションデータ改竄防止用鍵の生成とテーブル作成を行う。
    Redmineのインストールディレクトリで以下のコマンドを実行。
    # bundle exec rake generate_secret_token
    # RAILS_ENV=production bundle exec rake db:migrate

  10. Passengerのインストール
    # gem install passenger --no-rdoc --no-ri

  11. PassengerのApache用モジュールのインストール
    curl-devel を yum でインストールしておく。
    # yum install curl-devel

    一時的にPATHを指定する。
    # export APXS2=/usr/local/apache2/bin/apxs
    # export PATH=/usr/local/apache2/bin:$PATH

    Apache用モジュールのインストール
    # passenger-install-apache2-module
    ※途中で下記のように環境チェックが行われ、not foundが無ければインストールされる。
    not foundがあると先に進めない。
    --------------------------------------------
    
    Checking for required software...
    
     * GNU C++ compiler... found at /usr/bin/g++
     * Curl development headers with SSL support... found
     * OpenSSL development headers... found
     * Zlib development headers... found
     * Ruby development headers... found
     * OpenSSL support for Ruby... found
     * RubyGems... found
     * Rake... found at /usr/local/bin/rake
     * rack... found
     * Apache 2... found at /usr/local/httpd-2.2.23/bin/httpd
     * Apache 2 development headers... found at /usr/local/apache2/bin/apxs
     * Apache Portable Runtime (APR) development headers... found at /usr/local/httpd-2.2.23/apr/bin/apr-1-config
     * Apache Portable Runtime Utility (APU) development headers... found at /usr/local/httpd-2.2.23/apr-util/bin/apu-1-config
    
    --------------------------------------------

    インストールが完了した際に表示されるPassenger用のApache設定を保存しておく。
    The Apache 2 module was successfully installed.
    
    Please edit your Apache configuration file, and add these lines:
    
       LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
       PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19
       PassengerRuby /usr/local/bin/ruby
    
    After you restart Apache, you are ready to deploy any number of Ruby on Rails
    applications on Apache, without any further Ruby on Rails-specific
    configuration!

  12. Apacheの設定
    Passenger用の設定ファイルを作成する。
    # vi /usr/local/apache2/conf/extra/httpd-passenger.conf
    以下を記述。 (※以下の3行は直前に表示されていた設定)
    LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
    PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19
    PassengerRuby /usr/local/bin/ruby
    
    RailsBaseURI /redmine
    Passenger用の設定ファイルをインクルード。
    # vi /usr/local/apache2/conf/httpd.conf
    
    以下の記述を追記。
    Include conf/extra/httpd-passenger.conf

  13. Apache再起動
    # /etc/rc.d/init.d/httpd restart
    httpd を停止中:                                            [  OK  ]
    httpd を起動中:                                            [  OK  ]

プラグイン導入


Redmineのプラグインのインストールに使用するGitをインストールしておく。
Gitのインストール

プラグインのインストールはvendor/pluginsディレクトリにプラグインを展開するだけだが、DBを使用するプラグインでは下記の実行が必要。

# rake db:migrate_plugins RAILS_ENV="production"

DBを使用しないプラグインでも上記コマンドによる影響はないので、インストール後は毎回上記コマンドを実行しとけばOK。

HTTP Authentication plugin

Basic認証でRedmineにログインできるようになる。
インストールしてHttpdを再起動するとプラグインがデフォルトで有効になり、RedmineユーザーにBasic認証ユーザーと同じ名前が登録されていないと何も出来なくなる。
前以ってBasic認証ユーザーと同じ名前のRedmine管理者を登録しておく必要がある。
(調べてないので詳細は不明だが、Redmine管理者をインストール前に作っておくのが楽。)

Redmine Code Review plugin

リポジトリ表示からコードレビューを追加できる。
(参考:r-labs - Code Review

Redmine Glossary Plugin

用語集プラグイン。
(参考:r-labs - Glossary


トップ   編集 凍結解除 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-05-10 (水) 20:53:56