poundのinit.dファイルと設定ファイル
20年ぶりにpoundを動かした。20年前はThinkapd 230CSで動かしていた。tarballからコンパイルしたのでinit.dファイルと設定ファイルを自分で書かなくてはならなかった。試行錯誤でできあがったのがこれ。
init.dのファイル
#!/bin/bash POUND_BIN=/usr/local/sbin/pound POUND_PID=/var/run/pound.pid POUND_CONF=/usr/local/etc/pound.cfg if [ ! -x $POUND_BIN ] ; then echo -n "Pound not installed ! " exit 5 fi . /etc/init.d/functions RETVAL=0 case "$1" in start) echo -n $"Starting pound " daemon $POUND_BIN RETVAL=$? [ $RETVAL = 0 ] && touch /var/lock/subsys/pound echo ;; stop) echo -n $"Shutting down pound " killproc $POUND_BIN RETVAL=$? [ $RETVAL = 0 ] && rm -f /var/lock/subsys/pound && rm -f $POUND_PID.* echo ;; restart) $0 stop $0 start ;; status) echo -n "Checking for Pound " status $POUND_BIN ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 1 esac exit $RETVAL
pound.cfgの内容
User "daemon" Group "daemon" LogLevel 3 Alive 30 ListenHTTP Address 0.0.0.0 Port 80 RewriteLocation 0 Service HeadRequire "Host: www\.hogehoge\.jp" BackEnd Address xx.xx.xx.xx Port 8080 End End End