[餅] 餅空 blog / Nucleus支店

前の記事: Zend Optimizer 3.0.1 が出た模様
次の記事: SuSE Linux 10.x をpxeブートでネットワークインストール

2006-06-02

Nucleusのウェブサーバをlighttpdに移行

 Apache2からlighttpdに移行してみました。

 pukiwikiは楽に移行でき(外部プラグインがmod_rewriteを使ってたので、そこだけ若干修正)、NucleusはfancyURLで使っている ForceTypeディレクティブで苦しんだものの、なんとか動くようになりました。

 どうしたかについては後でこの下に書く、と。さて、忘れないうちに書いておこう。

 まず、fastcgiとperlのモジュールをインストールしました。
http://www.fastcgi.com/dist/
fcgi-2.4.0.tar.gz
./configure
make
make install

perl -MCPAN -e shell
install FCGI
install CGI::Fast
 次いで libpcreとかいうのをインスコ。per互換lの正規表現ライブラリのようです。ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-6.6.tar.bz2
./configure
make
make install
 次いでPHPをインスコ。
Apacheとは併用しないので、いつも使っているconfigureオプションから --with-apxs2(--with-apxs)を外し、以下を追加しました。

  --enable-fastcgi \
  --enable-discard-path \
  --enable-force-redirect

make
make install
 そしてlighttpdをインストールします。以下のプログラムのバージョンをチェックしましょう。
# automake 1.8 or higher
# autoconf 2.57 or higher
# libtool 1.5 or higher

http://www.lighttpd.net/download/
http://www.lighttpd.net/download/lighttpd-1.4.11.tar.gz
./configure
make
make install
 続いて、起動スクリプトと設定ファイルをコピーします。
cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd
mkdir /etc/lighttpd
cp doc/lighttpd.conf /etc/lighttpd
 lighttpdの基本的な設定は、下のリンクを参考にしてください。

参考にしたサイト。(大変参考になりました。ありがとうございます。)
lighttpd + FastCGI は mod_perl + Apache1.3 より1割ほど高速 :: Drk7jp
TutorialLighttpdAndPHP - lighttpd - Trac


 でもって、NucleusをFancyURLモードで使うために設定を変更します。

1. php.iniに次の1行を加えます。
/usr/local/lib/php.ini
cgi.fix_pathinfo = 1
2. lighttpd.confを変更します。
fastcgi.map-extensions = ( "/item" => ".php", "/archive" => ".php", "/member"
=> ".php", "/archives" => ".php", "/blog" => ".php", "/category" => ".php", "/pa
ge" => ".php" )
fastcgi.server = ( ".php" => ( (
"bin-path" => "/usr/local/bin/php",
"socket" => "/tmp/php-fastcgi.sock-5-" + var.PID,
"min-procs" => 1,
"max-procs" => 1,
"max-load-per-proc" => 3,
"idle-timeout" => 60,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "100",
"PHP_FCGI_MAX_REQUESTS" => "999"
),
"bin-copy-environment" => (
"PATH", "SHELL", "USER"
),
"broken-scriptfilename" => "enable"
)))
 仮想サーバで利用しているので、$HTTP["host"]={} のところに入れ込みました。

 一応、これでlighttpd上でFancyURLモードのNucleusが動いているわけですが、lighttpd.confの変更箇所はもっと簡単な変更でいけるのかも知れません。(いろいろ試行錯誤した結果ではあるのですが、釈然としないので)

 とはいえ結果オーライ。まぁ、動けばいいじゃん、って事で。(いいのか!?)

参考にしたサイト。(大変参考になりました。ありがとうございます。)
lighttpd forum - Any way to do this?


#追記 (2006/7/7)
 lighttpd移行後も、なんの問題もありませんでしたが、諸事情によりapache2に戻しました。
posted at 05:47:00 on 2006-06-02 by mochy - Category: コンピュータ

Amazon

Comments

No comments yet

Add Comments



TrackBack

Trackback
There are currently no trackbacks for this item.
Use this TrackBack url to ping this item (right-click, copy link target). If your blog does not support Trackbacks you can manually add your trackback by using this form.

前後の記事

前の記事: Zend Optimizer 3.0.1 が出た模様
次の記事: SuSE Linux 10.x をpxeブートでネットワークインストール

MyMiniCity

MyMiniCity

死語ステッカー

死語ブログパーツ

著作権保護期間延長反対

著作権保護期間の延長反対

PR

Sony Style(ソニースタイル)

ザッピング

あわせて読みたい

あわせて読みたい

TEAM -6%

今年もクールビズ

Blog Scouter