centos6.5にpound2.6を設置して動かしたのでそのメモ書きです。
POUND - REVERSE-PROXY AND LOAD-BALANCER
http://www.apsis.ch/pound
opensslを使うのでインストールします。
yum install openssl openssl-devel
Heartbleedがあったのでバージョンを確認しましょう。
Version 1.0.1e-16.el6_5.14
ソースコードを取得して
configureからのmake - make install
cd /usr/local/src
wget http://www.apsis.ch/pound/Pound-2.6.tgz
tar zxvf Pound-2.6.tgz
cd Pound-2.6
./configure --prefix=/usr/local
make
make install
インストールはこれだけです。
あとはpound.cfgのファイルが最初ないので
/usr/local/etc/pound.cfg に作りましょう。
あとserviceに登録されてないとなんだかすっきりしないですよね。
登録しましょう。
vi /etc/init.d/pound
start|stop|configtest|restartを使えるようにします。
# !/bin/sh
#
# pound
#
# chkconfig: 345 85 15
# description: reverse-proxy and load-balancer
#
# Source function library
. /etc/rc.d/init.d/functions
# Get network config
. /etc/sysconfig/network
# Pound Directory
POUND="/usr/local/sbin/pound"
CFG="/usr/local/etc/pound.cfg"
# See how we were called.
case "$1" in
start)
# Check if the normal service is already running?
if [ ! -f /var/lock/subsys/pound ]; then
echo "Starting pound:"
$POUND -f $CFG
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound
echo ${base}
else
#msg_Already_Running pound
echo "pound already started."
# exit 1
fi
;;
stop)
# Stop daemons.
if [ -f /var/lock/subsys/pound ]; then
#msg_stopping pound
echo "Stopping pound:"
killall $POUND
rm -f /var/lock/subsys/pound > /dev/null 2>&1
echo
else
echo "pound is not running."
exit 1
fi
;;
restart|reload)
$0 stop
$0 start
;;
configtest)
$POUND -c -v -f $CFG
;;
*)
echo "usage: pound {start|stop|configtest|restart}"
exit 1
;;
esac
exit $RETVA
実行権限を付けます。
chmod +x /etc/init.d/pound
サービスが自動起動するようにしましょう。
chkconfig pound on
動作するか確認してみましょうか。
設定ファイルがちゃんとある状態なら
service pound configtest
starting...
Config file /usr/local/etc/pound.cfg is OK
こんな感じでOKです。
さっくりSSLProxyやロードバランサーしたい時はpoundを使うのが楽なんですよね。