Retrospectiva公式サイトが502 Bad Gateway
retrospectivaのインストール - 黒糖々日記/kokutoto diaryで紹介したRuby on Rails製のTracクローンRetrospectivaですが、何日か前から公式サイト(http://retrospectiva.org/)にアクセスしても502 Bad Gatewayと言われてしまう状態が続いています。Google CodeとRubyForgeの方は生きているのでソースコードの入手は可能ですが、Quick Installなどのドキュメントは公式サイトが落ちたことで閲覧不可能になっています。
チェンジセットを眺めると最終更新は2008年3月15日…それまでは頻繁にコミットされていたのに既に丸1ヶ月も間が空いているようです。Retrospectivaは後発の利点を活かしてTracの不便な所を補おうとしているように見え、実際にデフォルトでTracと比較してかなり使いやすくなっていると思います。どうにかはやく復活してほしいところです。
Debian etchにPlaggerをインストールする
気まぐれでPlaggerをインストールしようとしたら、PerlにもCPANにも馴染みがなかったのでPlaggerのインストールは想像以上に難航。
実際には手動でインストールしなければならないものも多いのに、CPANはaptitudeみたいに依存関係のあるものを勝手にインストールしてくれると思いこんでいて、CPANのインストール後いきなりinstall Plaggerしたら以下のようなエラーで悩んでいました。
YAML Error: Error in require YAML::Loader - Base class package "YAML::Loader::Base" is empty. (Perhaps you need to 'use' the module which defines that package first.) at inc/YAML/Loader.pm line 4 BEGIN failed--compilation aborted at inc/YAML/Loader.pm line 4, <$IN> line 1. Compilation failed in require at (eval 12) line 3, <$IN> line 1. Code: Error in require YAML::Loader - Base class package "YAML::Loader::Base" is empty. (Perhaps you need to 'use' the module which defines that package first.) at inc/YAML/Loader.pm line 4 BEGIN failed--compilation aborted at inc/YAML/Loader.pm line 4, <$IN> line 1. Compilation failed in require at (eval 12) line 3, <$IN> line 1.
幸いetchでの詳細なインストール方法を解説しているBlog(http://xcezx.net/blog/linux/plagger-on-naked-etch.html)を見つけ、どうにかインストールできました。システムにもCPANにも結構たくさんのパッケージが必要だった模様…うむむ。
解説が書かれた2006年5月当時とは若干状況が変わっているらしく、2つほど手順の異なる箇所がありました。
PuTTY 0.60 ごった煮版 2007年8月6日版はVistaで動かない?
研究室のPC(Windows Vista Busines 無印)に愛用のPuTTY(ごった煮版)をインストールしたら、UACもファイアウォールも切ってあるのに
Unable to open connection to x.x.x.x Network error: Network is down
と言われ、あらゆるホストに接続することができないという謎の現象に遭遇しました。本家の対応は調べていません。
手元のXPでは動作したのでVistaに固有の問題のような気がします。ごった煮の0.59はちゃんと動いたので、Vistaマシンではしばらく0.59を使った方が良さそうです。うーん。
http://yebisuya.dip.jp/yeblog/archives/a000552.html
(2008/04/18訂正)
別のVista入りPCでは正常に動作しました…一体何が原因なのかわかりません。
「PuTTY 0.60 ごった煮版 2007年8月6日版がVistaで動かない」というのは再現性がないようですので訂正します。
WordPress MEとWordPress 日本語版
WordPressをインストールする機会があったのでメモ。ブログシステムの動向をウォッチしている人には常識なのかもしれませんが、日本語化されたWordPressにはWordPress MEとWordPress 日本語版があります。
WordPress 日本語版の公式サイトからリンクされている比較(http://spreadsheets.google.com/pub?key=pmWPhdiErlxR74Iy0Y4OLBA)を見ても、どちらをインストールすべきか悩むのですが、2008年3月現在はじめてWordPressを使うのであれば、WordPress 日本語版を選択した方が良さそうです。
というのも、最新のWordPress ME 2.2.3の登録メール送信機能はちょっと具合が悪く、うちの環境では送信されるメールのタイトルが文字化けする問題が起こりました。WordPress 日本語版 2.3.3でこういった問題は発生しなかったため、WordPress MEに特有の問題なのではないかと思います。
この登録メールの文字化けは他にも再現した人がいるようで、文字化けを解消するパッチやプラグインが作成されています。以下のサイトを参考に対策したところ、WordPress ME 2.2.3でも文字化けが発生しなくなりました。
Nippon 2 – iDeasilo
http://miniturbo.org/2007/06/07/173627
このように一手間かければWordPress MEも問題なく動くようですが、デフォルトでちゃんと動くWordPress 日本語版と比較してやや面倒くさいです。WordPress MEはリリースから3ヶ月経っても本家最新の2.3系に追従できておらず、開発もやや停滞している印象なので、僕はWordPress 日本語版を使うことにしました。
retrospectivaのインストール
RoRによるTracクローンretrospectivaをインストールしてみました。retrospectivaの公式サイトではGitHub - dim/retrospectiva: Open source, web-based agile project management, featuring: Goal planner, Story management, Issue-tracker, Code review, SCM Integration, Wiki & Blog. It is intended to assist the collaborative aspect of work carried out by software development teams.でかなり親切なインストール手順が説明されていて、使いはじめる前から好印象です。
以前インストールしたTypoはApacheをリバースプロキシにしてMongrelで動かしましたが、今回は親切な公式ドキュメントを読みつつ、Apacheのmod_fcgidでの動作にチャレンジしてみることにします。
retrospectivaはtrunk(r493)を使いました。railsのバージョンは2.0.2です。はじめにリリース1.0を試してみたのですが、rakeするときにActionView::Base.load_helpers()でwrong number of argumentsが出てしまい、動かせませんでした。詳しく調べていませんがrailsのバージョン依存があるのかもしれません。
svn co http://retrospectiva.googlecode.com/svn/trunk retrospectiva
retrospectivaに付属のconfig/database.yml.todoはMySQLを使う設定になっていますが、SQLite3を使う方が何かと小回りが利くため、config/database.ymlを以下のように設定してみました。データベースの設定が終わったらrakeします。
production: adapter: sqlite3 database: retrospectiva development: adapter: sqlite3 database: retrospectiva_development <%= ['sqlite3', 'lt3'].include?(ENV['TDB']) ? 'test' : 'test_sqlite3' %>: adapter: sqlite3 database: tmp/test_db <%= ['postgresql', 'pg'].include?(ENV['TDB']) ? 'test' : 'test_postgresql' %>: adapter: postgresql database: retrospectiva_test username: root password: host: localhost <%= ['mysql', 'my', '', nil].include?(ENV['TDB']) ? 'test' : 'test_mysql' %>: adapter: mysql database: retrospectiva_test username: root password: encoding: utf8 socket: /var/run/mysqld/mysqld.sock
rake RAILS_ENV=production db:retro:load
WEBRickで動かす場合はscript/serverを実行すればすぐに使用可能ですが、Apache+mod_fcgidで動かすには、Apacheの設定とpublic/.htaccessをいじる必要があります。この方法もGitHub - dim/retrospectiva: Open source, web-based agile project management, featuring: Goal planner, Story management, Issue-tracker, Code review, SCM Integration, Wiki & Blog. It is intended to assist the collaborative aspect of work carried out by software development teams.に詳しく書かれています。
まずApache側はRAILS_ENVの設定と、retrospectivaのpublicディレクトリで.htaccessが有効になるよう、AllowOverrideディレクティブを設定します。以下は公式ドキュメントからの転載です。
<VirtualHost *> ServerName your.site.com ServerAdmin webmaster@your.site.com DocumentRoot /var/www/retrospectiva/public/ ErrorLog /var/log/apache2/retrospectiva-error.log CustomLog /var/log/apache2/retrospectiva-access.log combined DefaultInitEnv RAILS_ENV production <Directory /var/www/retrospectiva/public/ > Options ExecCGI FollowSymLinks AllowOverride all Order allow,deny Allow from all </Directory> </VirtualHost>
続いてpublic/.htaccessを編集して、単なるFastCGIではなくfcgidで動作するよう設定します。編集するのは2箇所だけ。.fcgiをfastcgi-scriptではなくfcgid-scriptで処理するよう設定し、rewriteにより実行されるスクリプトを.cgiから.fcgiへ変更します。僕の最終的な.htaccessは以下のようになりました。
# General Apache options #AddHandler fastcgi-script .fcgi AddHandler fcgid-script .fcgi #AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI # If you don't want Rails to look in certain directories, # use the following rewrite rules so that Apache won't rewrite certain requests # # Example: # RewriteCond %{REQUEST_URI} ^/notrails.* # RewriteRule .* - [L] # Redirect all requests not available on the filesystem to Rails # By default the cgi dispatcher is used which is very slow # # For better performance replace the dispatcher with the fastcgi one # # Example: # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] RewriteEngine On # If your Rails application is accessed via an Alias directive, # then you MUST also set the RewriteBase in this htaccess file. # # Example: # Alias /myrailsapp /path/to/myrailsapp/public # RewriteBase /myrailsapp RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] # In case Rails experiences terminal errors # Instead of displaying this message you can supply a file here which will be rendered instead # # Example: # ErrorDocument 500 /500.html ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
以上でインストールは終わりです。この状態でhttp://your.site.com/retrospectiva/public/へアクセスするとretrospectivaのログイン画面が表示されます。もしURLを整えるためApacheの設定でaliasする場合は、.htaccessもコメント通りにRewriteBaseを設定すれば良いようです。