delegate7.9.3 (PROXY)

DeleGate is a multipurpose proxy server which relays various application protocols on TCP/IP or UDP/IP, including HTTP, FTP, Telnet, NNTP, SMTP, POP, IMAP, LPR, LDAP, ICP, DNS, SSL, Socks, and more. DeleGate mediates communication between servers and clients where direct communication is impossible, inefficient, or inconvenient.

Download from Delegate site.

http://www.delegate.org/delegate/

Install

  • Extract files
    # mv delegate7.9.3.tar.gz /usr/local/src
    # cd /usr/local/src
    # tar zxvf delegate7.9.3.tar.gz
    
  • Compile
    # cd delegate7.9.3/src
    # make
    
  • Copy binary file
    # cp delegated /usr/local/bin
    

    Configure

  • Make /etc/rc.d/rc.proxy
    #!/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
    Validity14 daysEXPIRE=14d
    Custody 14 daysCRON="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.btADMIN="hoge@hoge.edu.bt"
    Access ControlGrant Access Proxy Server from
    192.168.0.0/24 and 202.144.158.192/28 Network to Anywhere
    PERMIT="*:*:192.168.0.0/24"
  • Add Permittion
    # chmod 755 rc.proxy
    

    How to run

  • Add to /etc/rc.local to run automatically
    ..............
    /etc/rc.d/rc.proxy start
    

    Organize log files

  • Make /etc/cron.weekly/delegate.cron. It removes old log files.
    #!/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
    
  • Add permition
    # chmod 755 delegate.cron
    

    Back
    Google
    Web www.grape-info.com