Redmine を lighttpd で動かす(まとめ)

参考 Apache + lighttpd で Rails を動かす

redmine-0.6.4.tar.gz を落としてきて、/home/hokorobi/redmine に展開したものとする。

chown -R www-data /home/hokorobi/redmine
cp -p /home/hokorobi/redmine/public/dispatch.fcgi.example /home/hokorobi/redmine/public/dispatch.fcgi
chmod +x /home/hokorobi/redmine/public/dispatch.fcgi

/home/hokorobi/redmine/config/routes.rb の二行目に以下を追加。*1

  ActionController::AbstractRequest.relative_url_root = "/redmine"

/etc/lighttpd/lighttpd.conf

mod_rewrite, mod_redirect, mod_alias を有効にする。
追記
$HTTP["url"] =~ "^/redmine/" {
    server.document-root = "/home/hokorobi/redmine/public"
    alias.url = ( "/redmine/" => "/home/hokorobi/redmine/public/" )
    server.indexfiles = ( "index.html", "dispatch.fcgi" )
    server.error-handler-404 = "/redmine/dispatch.fcgi"
    url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )

    fastcgi.server = (
        ".fcgi" => (
            "localhost" => (
                "socket" => "/tmp/redmine.fcgi.socket",
                "bin-path" => "/home/hokorobi/redmine/public/dispatch.fcgi",
                "bin-environment" => (
                    "RAILS_ENV" => "production",
                    "RAILS_ROOT" => "/home/hokorobi/redmine"
                    ),
                "idol-timeout" => 10,
                "check-local" => "disable",
                "min-procs" => 1,
                "max_procs" => 1
            )
        )
    )
}

再起動

sudo /etc/init.d/lighttpd restart

うごいた

http://localhost/redmine/ にアクセスしたらトップページが表示された。

メモリ使用量

いっぱいいっぱいだ。

$ free
             total       used       free     shared    buffers     cached
Mem:        126340     121284       5056          0       5808      12556
-/+ buffers/cache:     102920      23420
Swap:      1048568     657432     391136

*1:2008-05-01 誤りがあったので修正