# mv delegate7.9.3.tar.gz /usr/local/src # cd /usr/local/src # tar zxvf delegate7.9.3.tar.gz
# cd delegate7.9.3/src # make
# cp delegated /usr/local/bin
#!/bin/sh
# Proxy(delegate)
# description: Starts and stops the Proxy daemons
# See how we were called.
case "$1" in
start)
echo -n "Starting Proxy services: "
/usr/local/bin/delegated -P8080 \
CACHE="do" \
ADMIN="root@localhost" \
EXPIRE 14d \
CRON="0 3 * * * -expire 14d" \
LOGDIR=/var/spool/delegate-nobody/log/'[date+/%y/%m/%d]' \
PERMIT="*:*:192.168.0.0/24,202.144.158.192/28" \
PROXY="proxy.parent.com:8080:!*.my.domain,!192.168.0.0/24"
echo -e \n
;;
stop)
echo -n "Shutting down Proxy services: "
/usr/local/bin/delegated -Fkill -P8080
# kill `cat /tmp/delegate/pid/8080`
echo ""
;;
status)
echo | ps ax | grep delegate
;;
restart)
echo -n "Restarting Proxy services: "
$0 stop
sleep 3
$0 start
echo "done."
;;
*)
echo "Usage: rc.proxy {start|stop|restart|status}"
exit 1
esac
| Options Description | ||
|---|---|---|
| Port | 8080 | -P 8080 |
| Validity | 14 days | EXPIRE=14d |
| Custody | 14 days | CRON="0 3 * * * -expire 14d" |
| Forward requests | proxy.parent.com:8080 | PROXY="proxy.parent.com:8080:*" |
| Forward requests except local web server | *.my.domain, *.near.domain |
PROXY="proxy.parent.com:8080:!*.my.domain,!*.near.domain" |
| Administrator Mail Address | hoge@hoge.edu.bt | ADMIN="hoge@hoge.edu.bt" |
| Access Control | Grant Access Proxy Server from 192.168.0.0/24 and 202.144.158.192/28 Network to Anywhere | PERMIT="*:*:192.168.0.0/24" |
# chmod 755 rc.proxy
.............. /etc/rc.d/rc.proxy start
#!/bin/sh
LOGDIR=/var/spool/delegate-nobody/log
PERIOD=30
if test -d $LOGDIR
then
cd ${LOGDIR}
find . -type d -mtime +${PERIOD} -exec rm -rf {} \;
fi
# chmod 755 delegate.cron