Rubyのインストール
$ tar jxf ruby-1.8.6-p111.tar.bz2
$ cd ruby-1.8.6-p111
$ ./configure
$ sudo make install
Rubygemsのインストール
$ tar zxf rubygems-0.9.4.tgz
$ cd rubygems-0.9.4
$ su
# ruby setup.rb
Railsのインストール
# gem install rails --include-dependencies
ImageMagickのインストール
$ tar jxf ImageMagick-6.3.7-0.tar.bz2
$ cd ImageMagick-6.3.7
$ ./configure --disable-static --with-modules
$ make
$ sudo make install
RMagickのインストール
# gem install RMagick
MySQLセットアップ
# yum install mysql*
# mysql -b -u root -p
mysql> create database redmine
mysql> use mysql
mysql> grant all on redmine.* to USERNAME@localhost identified by 'PASSWORD';
Redmineセットアップ
# svn checkout http://redmine.rubyforge.org/svn/trunk/
# mv trunk/ redmine/
# cd redmine/config/
# cp database.yml.example database.yml
# vi database.yml
“database.yml” の"production"を書き換え
production:
adapter: mysql
database: redmine
host: localhost
username: USERNAME
password: PASSWORD
development:
adapter: mysql
database: redmine
host: localhost
username: USERNAME
password: PASSWORD
# cd $REDMINE_HOME
# rake migrate RAILS_ENV="production"
とするとエラー
rake aborted!
No such file or directory - /tmp/mysql.sock
(See full trace by running task with --trace)
# vi $REDMINE_HOME/config/database.yml
“database.yml” の"production"に追加
production:
adapter: mysql
database: redmine
host: localhost
username: USERNAME
password: PASSWORD
socket: /var/lib/mysql/mysql.sock
development:
adapter: mysql
database: redmine
host: localhost
username: USERNAME
password: PASSWORD
socket: /var/lib/mysql/mysql.sock
続いて下記
# rake load_default_data RAILS_ENV="production"
(at /PATH/redmine)
Select language: bg, cs, de, en, es, fr, he, it, ja, ko, nl, pl, pt, pt-br, ro, ru, sr, sv, zh [en] ja
# "ja" を選択
FastCGIのインストール
$ tar zxf fcgi-2.4.0.tar.gz
$ cd fcgi-2.4.0
$ ./configure
$ make
$ sudo make install
mod_fcgidのインストール
$ tar zxf mod_fcgid.2.2.tgz
$ cd mod_fcgid.2.2
$ make
$ sudo make install
# gem install fcgi
httpd.conf 編集
# 追記
LoadModule fcgid_module modules/mod_fcgid.so
# 追記
<IfModule !mod_fcgid.c>
LoadModule fcgid_module modules/mod_fcgid.so
DefaultInitEnv RAILS_ENV development
IPCCommTimeout 300
IPCConnectTimeout 300
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
redmine.conf 編集
<VirtualHost *:80>
ServerAdmin admin@HOST
DocumentRoot "/PATH/redmine/public/"
ServerName VHOST
ServerAlias VHOST.DOMAIN
ErrorLog "|/usr/local/apache2/bin/rotatelogs /PATH/redmine/log/error_log 604800"
CustomLog "|/usr/local/apache2/bin/rotatelogs /PATH/redmine/log/access_log 604800" common
<Directory /PATH/redmine/public/>
Options ExecCGI +FollowSymLinks
AddHandler fcgid-script .fcgi
AllowOverride all
Satisfy Any
Order deny,allow
Deny from all
Allow from MYHOST.LOCAL
AuthUserFile /PATH/redmine/.htpasswd
AuthGroupFile /dev/null
AuthName "REDMINE"
AuthType Basic
</Directory>
</VirtualHost>
$REDMINE_HOME/public/.htaccess の編集
# コメントアウト
#AddHandler fastcgi-script .fcgi
# 追加
AddHandler fcgid-script .fcgi
FCGIWrapper "/usr/local/bin/ruby /PATH/redmine/public/dispatch.fcgi" .fcgi
RewriteBase /
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]