Maxの日記: [外鯖] Apache+Zope with Pound(3)
日記 by
Max
sslをかませたZopeの挙動がちょっとおかしいのは未解決だが、
とりあえずパッケージを再作成。
poundとpoundsslを別々に起動させることにする。
中身は同一なんだけど、起動スクリプトとかなんだかんだややこしい
のでこうした(厨
/etc/init.d/pound--------------------------------------------
#!/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
# See how we were called.
case "$1" in
start)
# Check if the normal service is already running?
if [ ! -f /var/lock/subsys/pound ]; then
#msg_starting pound
gprintf "Starting pound:"
pound -f /etc/pound/pound.cfg
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound
echo ${base}
else
#msg_Already_Running pound
gprintf "pound already started.\n"
# exit 1
fi
;;
stop)
# Stop daemons.
if [ -f /var/lock/subsys/pound ]; then
#msg_stopping pound
gprintf "Stopping pound:"
killall /usr/bin/pound
rm -f /var/lock/subsys/pound > /dev/null 2>&1
echo
else
gprintf "pound is not running.\n"
exit 1
fi
;;
restart|reload)
$0 stop
$0 start
;;
*)
gprintf "usage: %s {start|stop|restart}\n" "$0"
exit 1
;;
esac
exit $RETVAL
-----------------------------------------------------------
/etc/init.d/poundsslはそれぞれ/etc/pound/pound.cfg
と/etc/pound/pound-ssl.cfgを読みとって起動することと、
/var/lock/subsys/poundがpoundsslになっているのが違う程度
なので割愛。
pound.cfgとpound-ssl.cfgでどう記述するかだが・・
たとえば http://www.hogehoge/nagios/へのアクセスは禁止し
https://www.hogehoge/nagios/だけを有効にさせる場合
pound.cfg---------
ListenHTTP xxx.xxx.xxx.xxx,80
[..snip..]
UrlGroup ".*/nagios/.*"
EndGroup
pound-ssl.cfg-----
ListenHTTPS xxx.xxx.xxx.xxx,443 /path/to/your.pem
[..snip..]
UrlGroup ".*/nagios/.*"
HeadRequire Host "www.hogehoge.*"
BackEnd 127.0.0.1,80,1
EndGroup
のように書く。
httpでのアクセスには"503 Service Unavailable"が返る。
ZMIへのアクセスをすべてhttpsにするやり方についてはまだ調査中。
当面の回避策としてhttp接続によるデフォルトと同じ設定にしておく。
とりあえずパッケージを再作成。
poundとpoundsslを別々に起動させることにする。
中身は同一なんだけど、起動スクリプトとかなんだかんだややこしい
のでこうした(厨
/etc/init.d/pound--------------------------------------------
#!/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
# See how we were called.
case "$1" in
start)
# Check if the normal service is already running?
if [ ! -f /var/lock/subsys/pound ]; then
#msg_starting pound
gprintf "Starting pound:"
pound -f /etc/pound/pound.cfg
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound
echo ${base}
else
#msg_Already_Running pound
gprintf "pound already started.\n"
# exit 1
fi
;;
stop)
# Stop daemons.
if [ -f /var/lock/subsys/pound ]; then
#msg_stopping pound
gprintf "Stopping pound:"
killall /usr/bin/pound
rm -f /var/lock/subsys/pound > /dev/null 2>&1
echo
else
gprintf "pound is not running.\n"
exit 1
fi
;;
restart|reload)
$0 stop
$0 start
;;
*)
gprintf "usage: %s {start|stop|restart}\n" "$0"
exit 1
;;
esac
exit $RETVAL
-----------------------------------------------------------
/etc/init.d/poundsslはそれぞれ/etc/pound/pound.cfg
と/etc/pound/pound-ssl.cfgを読みとって起動することと、
/var/lock/subsys/poundがpoundsslになっているのが違う程度
なので割愛。
pound.cfgとpound-ssl.cfgでどう記述するかだが・・
たとえば http://www.hogehoge/nagios/へのアクセスは禁止し
https://www.hogehoge/nagios/だけを有効にさせる場合
pound.cfg---------
ListenHTTP xxx.xxx.xxx.xxx,80
[..snip..]
UrlGroup ".*/nagios/.*"
EndGroup
pound-ssl.cfg-----
ListenHTTPS xxx.xxx.xxx.xxx,443 /path/to/your.pem
[..snip..]
UrlGroup ".*/nagios/.*"
HeadRequire Host "www.hogehoge.*"
BackEnd 127.0.0.1,80,1
EndGroup
のように書く。
httpでのアクセスには"503 Service Unavailable"が返る。
ZMIへのアクセスをすべてhttpsにするやり方についてはまだ調査中。
当面の回避策としてhttp接続によるデフォルトと同じ設定にしておく。
[外鯖] Apache+Zope with Pound(3) More ログイン