lenny にアップグレード時の問題

Redmine サーバーを Debian etch から lenny にアップグレードしてみた。覚悟はしていたが、案の定色々引っかかってしまった。

Apache 関連

[Fri Mar 20 13:58:37 2009] [warn] NameVirtualHost *:80 has no VirtualHosts

という警告が出るようになった。/etc/apache2/sites-available 以下のファイルを修正した。

  • NameVirtualHost の行を削除。 (設定は /etc/apache2/ports.conf に移動した)
  • <VirtualHost *> から <VirtualHost *:80> に変更。

Ruby 関連(その1)

アップグレード後、Passenger がうまく起動してくれなくなってしまった。
rubygems がバージョンアップされたのが原因っぽい。残念なことに、衝突していた libgems-ruby1.8 パッケージを削除したら、/var/lib/gems 以下が Passenger もろとも消えてしまった・・・。とりあえず、作業メモは、この日記にかかれているため特に問題にはならなかったが、ちょっとびっくり。

また、lenny アップグレードの際、ruby1.8-dev や libopenssl-ruby1.8 も削除されてしまったので入れ直した。

 # apt-get install ruby1.8-dev libopenssl-ruby1.8
 # gem install postgres
 # gem install passenger
 # cd /var/lib/gems/1.8/gems/passenger-2.1.2/bin
 # ruby passenger-install-apache2-module
 # vi /etc/apache2/mods-available/passenger.load
 (LoadModule と PassengerRoot のパスを修正)
 # /etc/init.d/apache2 restart

Ruby 関連(その2)

ruby 1.8.7 にバージョンアップした関係で、一部 Redmine 0.7.3 が動作しなくなった。
以下に対処法がかかれてあった。

http://d.hatena.ne.jp/takihiro/20080728

--- vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb.orig       2008-07-28 23:22:04.000000000 +0900
+++ vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb   2008-07-28 23:14:26.000000000 +0900
@@ -3,6 +3,13 @@
     module String #:nodoc:
       # Define methods for handling unicode data.
       module Unicode
+        def self.append_features(base)
+         if '1.8.7'.respond_to?(:chars)
+           base.class_eval { remove_method :chars }
+         end
+         super
+       end
+
         # +chars+ is a Unicode safe proxy for string methods. It creates and returns an instance of the
         # ActiveSupport::Multibyte::Chars class which encapsulates the original string. A Unicode safe version of all
         # the String methods are defined on this proxy class. Undefined methods are forwarded to String, so all of the

PostgreSQL 関連

PostgreSQL 8.1 は Obsolete なため、8.3 にアップグレードする必要がある。

以下を実行。

 # apt-get install postgresql-8.3
 # pg_dropcluster --stop 8.3 main
 # pg_upgradecluster 8.1 main

ただし、postgresql.conf はデフォルトの設定のままなので、
別途チューニングが必要になる。