daybreaksnow's diary

私を私と呼びたい

[Redmine]同一PCで二つRedmineを動かす

同一マシンでRedmineを二つ動かした。
しかし、単純にpassenger.confに二つ目のRedmineへのパスを通すだけだと、複数のRedmineに同時にログインできない。

以下の通り書き換える。
参考:http://qiita.com/yteraoka/items/72b111e69511f254f97e

redmine/config/application.rb
修正前:config.session_store :cookie_store, :key => '_redmine_session'
修正後:config.session_store :cookie_store, :key => '_redmine_session', :path => config.relative_url_root

redmine/config/configuration.yml
修正前:autologin_cookie_path:
修正後:autologin_cookie_path: Redmine::Utils.relative_url_root


それ以外の既存の手順

[Linux]さくらVPSのCentOSにRedmineをインストール - daybreaksnow's diaryのものと同じ。

・DBの用意
create database db_redmine_2 default character set utf8;
grant all on db_redmine_2.* to user_redmine_2 identified by 'パスワード';
flush privileges;

Redmineのインストール
tarballを解凍して、一つ目とはredmineとは別のディレクトリ名にして、/var/libに配置

・DB、メール設定を適当に設定する
/var/lib/redmine_2/config/database.yml
/var/lib/redmine_2/config/configuration.yml

・必要ライブラリのインストール
bundle install

秘密鍵作成
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate

・権限付与
chown -R apache:apache /var/lib/redmine_2

・アクセス可能に
ln -s /var/lib/redmine_2/public /var/www/html/redmine_2

・/etc/httpd/conf.d/passenger.confに以下を追記
RackBaseURI /redmine_2