openSUSE 10.3でredMineのインストール&設定を行います。
仕事でTracを評価してたんですが、最近Ruby on Railsで動作するプロジェクト管理ツールがあることを知りました。
自宅サーバーのopenSUSEにセットアップしてみます。
[yast] ⇒ [Software] ⇒ [Software Management] より、インストール。
ruby ruby-devel
RubyForge:RubyGems:ProjectInfoより最新版をダウンロード。
# wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz # tar xvzf rubygems-1.2.0.tgz # cd rubygems-1.2.0 # ruby setup.rb
# gem install rails --include-dependencies
まず、MySQLクライアントよりRedMine用のスキーマを作成します。
インストール&設定はMySQLを参照
mysql> create database redminedb default character set UTF8;
mysql> grant all on redminedb.* to redmine@localhost
-> identified by 'redmine';
RubyForge:Redmine:ファイルリストより最新版をダウンロード。
$ wget http://rubyforge.org/frs/download.php/36468/redmine-0.7.1.tar.gz $ tar xvzf redmine-0.7.1.tar.gz
もしくは、redMineのトランク環境からチェックアウトします。
$ svn checkout http://redmine.rubyforge.org/svn/trunk/
展開後、config/database.yml.exampleを元にdatabase.ymlを作成します。
以下のproductionを修正します。
production: adapter: mysql database: redminedb host: localhost username: redmine password: redmine encoding: utf8
以下のコマンドでredMineが起動します。
# cd redmine-0.7.1 # rake db:migrate RAILS_ENV="production" # rake load_default_data RAILS_ENV="production" Select language: bg, cs, da, de, en, es, fi, fr, he, it, ja, ko, lt, nl, no , pl, pt, pt-br, ro, ru, sr, sv, th, uk, zh, zh-tw [en] ja <== 「ja」を入力する。 ==================================== Default configuration data loaded. Note: The rake task load_default_data has been deprecated, please use the replacement version redmine:load_default_data # ruby script/server -e production
まず、Phusion Passengerをインストールします。
# gem install passenger # passenger-install-apache2-module
ビルドに成功すると、Passengerを組み込むためのhttpd.confの設定が表示されます。
-------------------------------------------- The Apache 2 module was successfully installed. Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server RailsRuby /usr/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!
これをコピペして、/etc/apache2/conf.dの下にpassenger.confというファイル名で置いときます。
次に、VirtualHostへの設定サンプルが表示されます。
--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Ruby on Rails application in /somewhere. Add a virtual host
to your Apache configuration file, and set its DocumentRoot to
/somewhere/public, like this:
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public
</VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:
/usr/lib/ruby/gems/1.8/gems/passenger-1.0.5/doc/Users guide.html
上記を参考に、/etc/apache2/vhosts.d/rails.confを作成しました。
<VirtualHost *:80>
ServerName rails.powerdee.com
DocumentRoot <インストールDir>/public
</VirtualHost>
こちらの方法でも可能らしいです。 Apache+MongrelでRailsを動かす
/<インストールDir>/config/email.yml.exampleをemail.ymlへコピーして以下の箇所を修正しました。
メールサーバーの設定で、SMTP-Authの設定をしていない場合は、下3行はコメントしておくこと。
production:
delivery_method: :smtp
smtp_settings:
address: 127.0.0.1
port: 25
domain: powerdee.com
#authentication: :login
#user_name: redmine@somenet.foo
#password: redmine
あとの設定は、Webの画面から行うことが可能です。
デフォルトで登録されている管理者ユーザー(ログイン:admin、パスワード:admin)でログインします。
[管理]→[設定]→(全般タブ内の”規定の言語”)をJapanease(日本語)にする。
あと個人設定で、[マイアカウント]→言語をJapanease(日本語)にする。
[管理]→[設定]→[リポジトリ(タブ)]内の”リポジトリのエンコーディング”を以下にする。
ISO-2022-JP, EUC-JP, UTF-8, SHIF_JIS, WINDOWS-31J
管理者ユーザーでログインして、
[管理]→[設定]→[認証]→[LDAP認証]→[新しい認証モード]を選択。
認証モード入力フォーム内を、以下のように入力。
あわせてユーザを作成にチェック
上記の設定により、uid・cn・sn・mail属性を持つ、LDAPユーザーが認証時にredmineユーザーとして自動登録されます。
trunkよりチェックアウトしてインストールした場合は、
RedmineのRAILS_ROOTに移動して、以下のコマンドを実行します。
svn update
次にデータベースをバックアップして、マイグレーションを行います。
rake db:migrate RAILS_ENV="production"
キャッシュおよびセッションを消去します。
rake tmp:cache:clear rake tmp:sessions:clear
アプリケーションの再起動を行った後、”管理 → ロールと権限 → 権限”を開き、
新しく追加された機能に対する権限の確認・設定を行ってください。
lang/ja.yml -general_pdf_encoding: UTF-8 +general_pdf_encoding: SJIS
とりあえずの暫定処置らしいです。 参考:人・時・空の間 redmine の PDF の文字化け解消!?