Home > 2010年02月17日

2010年02月17日

mod_websocket for lighttpdをMacで動かそうとしたけど、失敗した

今日昼間、ふとメールチェックしていると、
html5-developers-jpに素敵な投稿がありました。

「lighttpdでwebsocketできるモジュール作ったよ!」

これは試してみるしかないでしょう、と今日はこのことしか考えてませんでした。
が、残業やらなんやらで気づけばこの時間です。
まぁ仕事なんで仕方ない。

愚痴はこのぐらいにして、早速やってみます。

基本的にはINSTALL at master from nori0428's mod_websocket - GitHubの通りのことをやっただけです。
なんかうまく行きませんでしたが、誰かの役に立つかもしれないので、一応ログを残しておきます。

インストール

準備
mdkir lighty
cd lighty

mod_websocketのダウンロード
git clone git://github.com/nori0428/mod_websocket.git

lighttpdのダウンロード
curl -O http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.26.tar.gz
tar xf lighttpd-1.4.26.tar.gz

cd lighttpd-1.4.26

パッチ当て(実は初!)
patch -p1 < ../mod_websocket/src/mod_websocket.patch

cp ../mod_websocket/src/mod_websocket.c src/

./autogen.sh
configure.ac:1: error: possibly undefined macro: dnl
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:71: error: possibly undefined macro: AC_DEFINE
→エラー…

sudo port install autoconf

aclocal.m4:14: error: this file was generated for autoconf 2.61.
You have another version of autoconf.  If you want to use that,
you should regenerate the build system entirely.
→まだエラー

sudo port install Automake
→行けた

./configure --prefix=/Users/t/lighty/
checking for pcre-config... no
configure: error: pcre-config not found, install the pcre-devel package or build with --without-pcre
→またエラー

sudo port install pcre
→ようやく行けた

make
Undefined symbols:
  "_network_write_chunkqueue", referenced from:
      _websocket_write_request in mod_websocket.o
→もうやになってきた…

sudo port install gcc45
※ gccいっぱいありすぎ→MacPortsからインストールしたgccについて混乱中 - hnwの日記4時間かかるらしいので中断

んーわからん。
lighty単体をインストールしてみる
cd ..
rm -rf lighttpd-1.4.26
tar -xf lighttpd-1.4.26.tar.gz
cd lighttpd-1.4.26
./configure --prefix=/Users/t/lighty/
make
make install
→普通にできた。

もっかい1から
cd lighttpd-1.4.26
 :
 :
駄目だこりゃ。 

うーん、今日のところは寝るとしよう。
(gccのせいかもしれないので、アップデートだけ流しておこう)
→gccのアップデートは意味なかったです。[2010/2/17 8:00]

もっとじっくり触りたいのに、時間が足りないなー。
とりあえず、今週末の遊び道具はこいつで決まりかな。
(Cの勉強も兼ねてソースも読もうっと)

Home > 2010年02月17日

Page Top