lighttpd
■install lighttpd
% apt-cache search lighttpd % aptitude search lighttpd # aptitude update # aptitude install lighttpd
■起動する
# /etc/init.d/apache2 stop # /etc/init.d/lighttpd start
■設定方法を確認する
- /etc/lighttpd/lighttpd.conf が設定ファイル
- /etc/lighttpd/conf-available/README を読むよろし
■外から接続できるようにする
- lighttpdはdefaultでは外からは接続できないので設定変更する
# cd /etc/lighttpd # mkorg lighttpd.conf
- この一行をコメントアウトする
--- ./lighttpd.conf.org 2006-07-25 13:31:31.670000000 +0900 +++ ./lighttpd.conf 2006-07-25 13:31:35.040000000 +0900 @@ -62 +62 @@ -server.bind = "localhost" +#server.bind = "localhost" # /etc/init.d/lighttpd force-reload
- http://co/ →ちゃんと表示されます。中身はApacheのときのまま。
■Apache2の設定を確認する
- /etc/apache2/sites-available/default
ProxyPass / http://127.0.0.1:9190/
- このような一行を追加していた
- これと同じ設定をしたい
■mod_proxyを使えるようにする
# cd /etc/lighttpd/conf-available # mkorg 10-proxy.conf
- 10-proxy.confの最後に追加
proxy.server = ("/qwik" => ( ( "host" => "127.0.0.1", "port" => 9190 ) ) )
# /usr/sbin/lighty-enable-mod proxy
# /etc/init.d/lighttpd force-reload■確認する
% telnet localhost 80 GET / HTTP/1.0 Server: lighttpd/1.4.11
- ちゃんと動いてますな
% telnet localhost 80 GET /nosuch HTTP/1.0 HTTP/1.0 404 Not Found
- ふむ。問題ない
% telnet localhost 80 GET /qwik/ HTTP/1.0 HTTP/1.0 503 Service Not Available
- うお、何か設定ミスかな
- http://co:3000/
- おっとqwikWebが走ってなかった。起動して再チャレンジ。
% telnet localhost 80 GET /qwik/ HTTP/1.0 HTTP/1.0 404 Not Found Server: qwikWeb/0.8.3+20060722 <head><title>No such site</title>
- うーむ、/ からのパスがそのまま渡っちゃうのか。やだな。
- しょうがないので、rootからそのままという形にしてみよう。
proxy.server = ("/" => ( ( "host" => "127.0.0.1", "port" => 9190 ) ) )
# /etc/init.d/lighttpd force-reload
- 再確認
% telnet localhost 80 GET / HTTP/1.0 HTTP/1.0 200 OK <title>co/qwik - FrontPage</title>
- よっしゃ。問題ない。
- http://co/ →ちゃんと表示された。OK!
Last modified: 2006-09-05