「Redmineの導入手順」の版間の差分

提供:Software Development Memo
ナビゲーションに移動 検索に移動
258行目: 258行目:


  # /usr/local/apache2/bin/apachectl start
  # /usr/local/apache2/bin/apachectl start
Apache起動後、Redmine初期画面は以下のようになります。
[[ファイル:Redmine install.png]]


== その他 ==
== その他 ==

2011年1月23日 (日) 07:53時点における版


本ページでは、Rubyで作成されたバグトラッキングシステムである「Redmine」の導入手順を記述します。今回、バージョン管理システムは「Mercurial」を使用します。

環境

  • OS : CentOS 5.4
  • Web Server : Apache 2.2.17
  • Database : MySQL 5.1.54
  • Other : Redmine 1.1.0, Ruby 1.8.7, rubygems 1.4.2, Mercurial 1.7.3

インストール

MySQL

入手先 :http://www.mysql.com/

$ tar zxvf mysql-5.1.54.tar.gz
$ cd mysql-5.1.54
$ ./configure
$ make
# make install

Apache

入手先 : http://httpd.apache.org/

$ tar zxvf httpd-2.2.17.tar.gz
$ cd httpd-2.2.17
$ ./configure
$ make
# make install

Ruby

入手先 : http://www.ruby-lang.org/

$ tar zxvf ruby-1.8.7-p330.tar.gz
$ cd ruby-1.8.7-p330
$ ./configure
$ make
# make install

RubyGems

入手先 : http://rubyforge.org/projects/rubygems/

$ tar zxvf rubygems-1.4.2.tgz
$ cd rubygems-1.4.2
# ruby setup.rb

Ruby on Rails

RubyGemsからインストールします。公式サイトにある通り、バージョン2.3.5のRailsをインストールします。

# gem install rails -v 2.3.5

Docutils

Mercurialをインストールするための準備として、Docutilsをインストールします。

入手先 : http://docutils.sourceforge.net/

$ tar zxvf docutils-0.7
$ cd docutils-0.7
# ./setup.py install

Pythonはインストール済みとします。

Mercurial

入手先 : http://mercurial.selenic.com/

$ tar zxvf mercurial-1.7.3.tar.gz
$ cd mercurial-1.7.3
$ make all
# make install

Redmine

入手先 : http://www.redmine.org/

$ tar zxvf redmine-1.1.0.tar.gz
# gem install -v=0.4.2 i18n
# mv redmine-1.1.0 /var/lib/redmine
# cd /var/lib/redmine/
# rake generate_session_store

i18nはrakeに必要なためインストールします。

Passenger

Passengerをインストールします。

# gem install passenger

Apache用モジュールをインストールします。

# export APXS2=/usr/local/apache2/bin/apxs
# export PATH=/usr/local/apache2/bin:$PATH
# passenger-install-apache2-module

「Please edit your Apache configuration file, and add these lines:」の次の3行を控えて置きます。後に「httpd.conf」の設定で必要になります。

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.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
   PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2
   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!

Press ENTER to continue.

MySQL用のデータベースアクセスライブラリ

MySQL用のデータベースアクセスライブラリをインストールします。

# gem install mysql -- --with-mysql-lib=/usr/local/lib/mysql/

インストール中に「No definition for ...」から始まる行がいくつか出力されます。

「ld.so.conf」に「/usr/local/lib/mysql/」を追加します。

# vim /etc/ld.so.conf

共有ライブラリを再認識させます。

# /sbin/ldconfig

設定

MySQL

ユーザ「mysql」を作成し、DBを初期化します。

# /usr/sbin/useradd mysql
# /usr/local/bin/mysql_install_db --user=mysql

DBを起動し、rootのパスワードを設定します。

# /usr/local/bin/mysqld_safe --user=mysql &
# /usr/local/bin/mysqladmin -u root password <password>

Redmineでアクセスするためのユーザ(redmine)を作成し、DBを作成します。

# mysql -u root -p
mysql> grant all privileges on *.* to redmine@localhost identified by '<パスワード>' with grant option;
mysql> create database redmine default character set utf8;

RedmineのDB接続設定を行います。

$ cd /var/lib/redmine/config/
$ cp database.yml.example database.yml
$ vim database.yml

productionのセクションの「username:」に先ほど作成したユーザ名、「password:」にDBパスワードを追記します。

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: <パスワード>
  encoding: utf8

DBを初期化します。

# rake db:migrate RAILS_ENV=production

本コマンドで、以下のメッセージが表示される場合は、共有ライブラリの設定が不十分かもしれません。

(in /var/lib/redmine)
rake aborted!
Object is not missing constant Issue!

(See full trace by running task with --trace)

標準のワークフローを導入します。

# rake redmine:load_default_data RAILS_ENV=production

「Select language:」と表示されたら「ja」を入力します。

Apache

「/usr/local/apache2/conf/httpd.conf」を編集します。

DocumentRootを以下に変更します。

# DocumentRoot "/usr/local/apache2/htdocs"
DocumentRoot "/var/lib/redmine/public"

以下を追記します。

<Directory "/var/lib/redmine/public">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2
PassengerRuby /usr/local/bin/ruby

下の3行は、「passenger-install-apache2-module」の出力結果を必ず貼り付けてください。

起動

MySQL

# /usr/local/bin/mysqld_safe --user=mysql &

Apache

# /usr/local/apache2/bin/apachectl start

Apache起動後、Redmine初期画面は以下のようになります。 Redmine install.png

その他

farend basicというテーマを導入すると、デザインが向上するのでお勧めです。

参考

更新履歴

  • ページ作成 -- 2011年1月23日 (日) 16:35 (JST)