Redmine on Apache with Passenger(mod_rails)

BitNamiを使わずに、Redmineを使用する方法。Apache,MySQLはインストール済み前提。

■EPELリポジトリ追加
http://kz10.net/memo/2011/1109_021523.html

■Ruby関連ライブラリインストール

yum --enablerepo=epel install libyaml-devel
yum install gcc gcc-c++ make curl-devel readline-devel openssl-devel zlib-devel httpd-devel mysql-devel ImageMagick ImageMagick-devel ipa-pgothic-fonts

■Rubyインストール

wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz
tar xvzf ruby-2.0.0-p353.tar.gz
cd ruby-2.0.0-p353
./configure
make
make install
gem install bundler

■DB設定
DB名:redmine
DBユーザ:redmine
DBパスワード:hogehoge

mysql -u root -p
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'hogehoge';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
mysql> flush privileges;

■Redmineインストール

wget http://www.redmine.org/releases/redmine-2.4.1.tar.gz
tar xvzf redmine-2.4.1.tar.gz
mv redmine-2.4.1 /var/www/html/redmine.hogehoge.net
chown -R apache:apache redmine.hogehoge.kazooo.net
cd /var/www/html/redmine.hogehoge.net
cp config/database.yml.example config/database.yml
vi config/database.yml

DBのパラメータ投入

cp config/configuration.yml.example config/configuration.yml
vi config/configuration.yml

SMTPなどの設定。日本語フォント対策で以下の行追加。
rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf

bundle install --without development test
bundle exec rake generate_secret_token
RAILS_ENV=production rake db:migrate

■Passengerインストール

gem install passenger
passenger-install-apache2-module
vi /etc/httpd/conf.d/passenger.conf

LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.29/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.29
PassengerDefaultRuby /usr/local/bin/ruby

/etc/init.d/httpd graceful

■ブラウザでアクセスしてadmin/adminでログイン。


So, what do you think ?