83's

Top > Tags > lighttpd

lighttpd

タイトル一覧を表示 | 本文を表示

JSONPのキャッシュ戦略 August 09, 2007 22:06

どうしよう。コールバック別にキャッシュするのもなんかもったいない。

単にコールバックのところだけ変わる場合はJSON部分だけキャッシュしといて コールバックはLuaで付け足したら……とか考えてみた。節約してる感じがして心が落ち着く。

lighttpd with mod_magnetの例。

if string.find(lighty.env["uri.path"], '^/json/') then
  s, e, f = string.find(lighty.env["uri.query"] or "", "jsonp=([^&]+)")

  if f then
    lighty.header["Content-type"] = "text/javascript"
    lighty.content = {f, '(', {filename = lighty.env["physical.path"]}, ');'}
    return 200
  end
end

でも今Apacheなんだよなぁ。そっちはどうなるんだろ。

一番いいのは無駄な汎用性は捨ててコールバックの関数名決め打ちにすることだな。 オレしか使わないし……(´Д⊂)

lighttpdのluaサポートつきコンパイル July 23, 2007 22:08

忘れるのでメモ。

./configure --with-lua=lua5.1 --with-memcache
make
make install

よく以下のように載ってるんだけど、

./configure --with-lua --with-memcache

ubuntuでやってたらエラーになった(2回目)。

checking if lua-support is requested... yes
checking for LUA... configure: error: Package requirements (lua >= 5.1) were not met:

No package 'lua' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LUA_CFLAGS
and LUA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

このへんの仕組みはわかってないなぁ。

404のはずが200 July 09, 2007 00:09

lighttpdでmod_proxy使いつつserver.error-handler-404をコメントアウトし忘れてたんだけど、 その間404のはずのURLが200で返ってくるようになってた。

HTTP/1.x 200 OK
Status: 404 Not Found

こんな感じで返ってくる。 多分lighttpd forum - Proxy status code problemと 同じ症状。

Statusてのはlighttpd独自のなんだろうか……。

lighttpdのバグ February 26, 2007 22:08

毎日ではないんだけどときどき7:30ころlighttpdが止まってログ見ても エラーじゃないしなんだろうと思いながらここ2ヶ月を過ごしていたけど(サボりすぎ)、 lighttpd 1.4.11あたりバグだった。ログをローテートしたあと再起動しない、という。

This bug will make web server admin crazy bcoz you will never know if lighttpd will be still running tomorrow!

この2ヶ月はまったくcrazyだったぜ! サーバ監視サービスから サーバ停止のメールがね、オレが寝てるところに容赦なくくるもんだから、 携帯マナーモードにして寝てアラームが使えずに起きられない日々だった。

てか前はほっとんど起こらなかったのに、最近頻発してるのはログの流れが 早くなったってことですかね。アクセスあざーす。あ、スパマーか……。

この機会に、サーバのubuntuもdapperからedgyへあげておいた。 ちなみにここのサーバではないです。

lighttpdがmod_authとmod_fastcgiで無限ループって怖くね?みたいになる件 January 18, 2007 12:16

ずーーっとレスポンスを待っているか、lightyを止めたり再起動したりすると 認証のダイアログが出る。

$ dpkg -s lighttpd | grep Version
Version: 1.4.11-3ubuntu3

設定ミスかと思ったらバグみたい。いや、設定ミスか。

どうやらserver.modulesでのmod_authとmod_fastcgiの順番が問題らしい。

> server.modules = ("mod_fastcgi","mod_alias","mod_setenv","mod_auth")
                     ^^^^^^^^^^^^                           ^^^^^^^^^^

That was the culprit! Apearantly, the order is important here. Moving mod_auth to the beginning made things work.

ひえぇ