おらヤリイカなんていやだ!ってかたは
こっちをつかってください。
一応日本製の高機能多機能Proxyとして名を馳せています。
HTTPはもちろんFTP/SSL/SMTP/POP/SOCKS等いろいろ設定ファイルひとつで
出来るらしいですが、今回はとりあえずHTTPのみ設定を行っていきます。
インストール
cd /usr/local/src
wget ftp://ftp.delegate.org/pub/DeleGate/delegate9.9.7.tar.gz
tar zxvf delegate9.9.7.tar.gz
cd delegate.9.9.7
CC=gcc make all
mkdir /usr/local/delegate
mkdir /usr/local/delegate/etc
mkdir /usr/local/delegate/sbin
cd src
cp delegated /usr/local/delegate/sbin
cp -R builtin /usr/local/delegate
設定
/usr/local/delegate/etc/http.conf
SERVER=http
RELIABLE=192.168.xx.x/24,xxx.xxx.xxx.xxx,www.example.com
LOGFILE=${LOGDIR}/${PORT}/log[date+%d].${PROTO}
PROTOLOG=''
EXPIRE=1d
CRON='0 3 * * * -expire 5'
CONNECT=c,d:*:*
MOUNT="/-/builtin/* file://usr/local/delegate/builtin/*"
ADMIN=" webmaster@example.com "
RELAY=proxy,delegate
PERMIT="*:*:xxx.example.com/@"
PERMIT="*:*:xxx.xxx.xxx.xxx/@"
PERMIT="*:*:192.168.xx.x/@"
起動スクリプト
/etc/init.d/delegated
#!/bin/sh
#
# chkconfig: 235 75 75
# description: delegate is proxy server \
#
#
# processname: delegated
# pidfile: /var/spool/delegate-nobody/act/pid/${PORT}
# config: /usr/local/delegate/etc/delehttp.conf
# Source function library.
DOMAIN=initscripts
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1
# binary local
delegate=/usr/local/delegate/sbin/delegated
delehttp=/usr/local/delegate/etc/http.conf
httppid=/var/spool/delegate-nobody/act/pid/8080
[ -f $delegate ] || exit 1
# See how we were called.
case "$1" in
start)
echo -n "delegated : "
$delegate -P8080 +=$delehttp
echo $delegate
echo
touch /var/lock/subsys/delegated
;;
stop)
echo -n "delegated http : "
[ -f $httppid ] && {
kill `cat $httppid`
echo -n "delegated http"
echo ""
}
echo
rm -f /var/lock/subsys/delegated
rm -f $httppid
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
起動
chmod 755 /etc/init.d/delegated
chkconfig --add delegated
/etc/init.d/delegated start
コメントを追加