本文所列内容在Linode的VPS上面均测试通过,Debian 7系统。

这个需要手工安装的,先在 http://sourceforge.net/projects/kingate/files/latest/download 下载最新版,比如文件名为 kingate-2.2.tar.gz ,那么依次执行:

apt-get install g++ make insserv

tar zxvf kingate-2.2.tar.gz

cd kingate-2.2

./configure --prefix=/usr/local/kingate

make install

 

 

然后编辑配置文件:

nano /usr/local/kingate/etc/kingate.conf

 

内容:

http off
 ftp off
 pop3 off
 smtp off
 telnet off
 socks on
 mms off
 rtsp off
 manage on
 max 2000
 max_per_ip 0
 min_free_thread 3
 http_port 8082
 http_accelerate off
 x_forwarded_for off
 http_time_out 30
 ftp_port 2121
 ftp_time_out 300
 pop3_port 1100
 pop3_time_out 300
 smtp_port 2525
 smtp_time_out 300
 telnet_port 2323
 telnet_time_out 300
 socks_port 6666
 socks_time_out 300
 socks5_user on
 mms_port 1755
 mms_time_out 300
 rtsp_port 5540
 rtsp_time_out 300
 manage_port 7758
 manage_time_out 300
 log_model user
 log_level 0
 log_rotate {0 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * * }
 log_close_msg off
 mem_min_cache 50m
 mem_max_cache 12m
 disk_min_cache 20m
 disk_max_cache 30m
 use_disk_cache off
 refresh never
 refresh_time 300
 user_time_out 0
 mem_cache 50m
 disk_cache 100m
 max_deny_per_ip 0
 max_queue_thread 15
 min_limit_speed_size 1m
 limit_speed 20000k
 max_request 50
 total_seconds 10
 bind_addr
 run_user
 insert_via off

 

然后做一个便于控制的inetd脚本:

touch /etc/init.d/kingate

nano /etc/init.d/kingate

 

内容:

#!/bin/bash
 #
 # chkconfig: 2345 85 15
 # description: kingate is an proxy server daemon
 # processname: kingate

### BEGIN INIT INFO
 # Provides:          kingate
 # Required-Start:    $all
 # Required-Stop:     $all
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: starts kingate proxy server
 # Description:       starts kingate porxy server
 ### END INIT INFO

# Author:   eaglepride
 # website:  https://old.tingtao.org

prog="kingate"
 kingate="/usr/local/kingate/bin/kingate"

start() {
 echo -n $"Starting $prog: "
 $kingate
 }

stop() {
 echo -n $"Stopping $prog: "
 $kingate -q
 }

restart(){
 echo -n $"Restarting $prog: "
 stop
 start
 }

case "$1" in
 start)
 start
 ;;
 stop)
 stop
 ;;
 restart)
 restart
 ;;
 *)
 echo $"Usage: kingate {start|stop|restart}"
 RETVAL=1
 esac
 exit $RETVA

 

使这个文件可以执行:

chmod +x /etc/init.d/kingate

到这里就结束了,使用方法:

启动:

/etc/init.d/kingate start

停止和重启的参数是 stop 和 restat

这个程序附带有一个web管理,端口就是配置文件里的7758,默认用户名root,密码kingate

 

添加为自动启动的服务:

insserv kingate

ubuntu系统需要增加一行命令:

update-rc.d -f kingate defaults

 

完事

作者 听涛

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注