kingate是一个多线程的程序(采用线程池的方式),所以短时间内大量的连接请求,kingate还能保持很高的性能。
kingate还支持tcp端口映射,可以实现别人访问你的内网主机。
kingate有强大的规则控制,包括源IP地址,目的IP地址,目的端口,及采用的代理协议。
kingate也支持时间控制。即可以设置什么时间内,所设置的规则才有效。
kingate内置了用户认证,以及记录用户的使用情况,包括用户的使用时间,接收和发送的数据量,可以很容易实现对用户的记费。
kingate采用http来进行管理,使得管理kingate及查看运行信息变得一件很轻松的事情,也可以远程管理。
kingate还支持内存及硬盘共二级缓存(仅限http代理).
最新版本的kingate还可以用来加速web服务器(采用缓存原理)。提升你的web服务器的性能。
kingate还是一款国人开发的代理服务器。下面我们来全面了解kingate服务器。
1:下载最新的kingate.
http://sourceforge.net/projects/kingate/
如果你是windows版本请看第8项.
2:解压
tar xzf kingate-xxxxx.tar.gz
cd kingate
3:安装
./configure --prefix=安装目录
如:./configure --prefix=/tmp/kingate
make install
4:使用
prefix/bin/kingate 启动kingate
prefix/bin/kingate -f 强行启动kingate,如果启动kingate提示有一个在运行,而你又确实kingate没有运行,可以使用这个。
prefix/bin/kingate -h 查看kingate用法
prefix/bin/kingate -q 关闭kingate
prefix/bin/kingate -v 查看kingate版本
prefix/bin/kingate -d # 以调试方式运行程序。#为调试级别,(0-3)。数字越高显示信息也越多。
5:配置
kingate配置文件是etc/kingate.conf,打开这个文件,里面有详细的说明及用法.
6:关于Bug
运行kingate之前最好运行:ulimit -c unlimited
请访问:http://sourceforge.net/tracker/?group_id=54802&atid=474891,说明bug的现象,及重现办法,以及kingate的版本号。注意,如果kingate在退出时产生了core文件,这很好,
使用:
gdb prefix/bin/kingate core文件
再输入:bt
把显示的信息也帖上去.
或者发邮件给作者:khj99@tom.com
7:关于dnsproxy
专门代理dns服务请求,请用root用户指行此程序.
8.windows用户
解压:
使用winzip或winrar之类的解压工具。
安装
c:\>prefix\bin\kingate --install
c:\>prefix\bin\kingate -z
反安装
c:\>prefix\bin\kingate --uninstall
启动kingate代理
c:\>net start kingate
停止kingate代理
c:\>net stop kingate
启动dns代理:
c:\>prefix\bin\dnsproxy.exe -h use_dns_host -b bindaddr -m max_thread
9.kingate的配置文件说明:
#配置文件开始
#service
#以下是告诉kingate代理哪些协议,如果要打开的请设置on,否则设为off
http on
ftp on
pop3 on
smtp on
telnet on
socks on
mms on
rtsp on
manage on
#bind_addr用来告诉kingate绑定的IP地址。
#bind_addr 192.168.0.1
#run_user指kingate的运行者。请注意,如果设置了run_user.请以root启动kingate.并且把kingate的etc和var目录设置该用户可以读写。
#run_user nobody
#max指kingate最多同时接受多少个连接请求。超过此数,多余的连接kingate将马上关闭。
max 500
#max_per_ip用来表明每个IP,同时最多有多少个连接请求。设置为0,表示不限制
max_per_ip 0
#min_free_thread 表明kingate关闭一些超时空闭的线程时,最少会留多少个不关闭。
min_free_thread 3
#[http]
http_port 8082
#http_port表时http代理的端口
http_accelerate off
#http_accelerate这个参数很重要。如果你只是使用代理时请设置为off.
#如果你用kingate来加速web服务器时,设置为on,并且加上:
#http_redirect { * * http_host:http_port none }
x_forwarded_for off
#在http请求中加入客户端的IP地址。如果你用kingate来加速web服务器时,建议设置on.
http_time_out 300
#http_time_out http代理发送接收超时时间(秒)
#http重定向:
#http_redirect { dst[/dst_mask][:dst_port] file redirect_host:redirect_port flag }
#http_redirect { * * 210.15.29.16:80 none }
#http_redirect { 211. * 210.15.29.16:8082 proxy }
#[ftp]
ftp_port 2121
ftp_time_out 300
#[pop3]
pop3_port 1100
pop3_time_out 300
#[smtp]
smtp_port 2525
smtp_time_out 300
#[telnet]
telnet_port 2323
telnet_time_out 300
#[socks]
socks_port 1082
socks_time_out 300
socks5_user off
#socks5_user设置是否在socks5代理中运行用户认证。
#[mms]
mms_port 1755
mms_time_out 300
#[rtsp]
rtsp_port 5540
rtsp_time_out 300
#[manage]
manage_port 2222
manage_time_out 300
#log section
log_model user
log_level 2
log_rotate { 0 0 * * * }
log_close_msg off
#the log_close_msg first add in v1.5 when it on the kingate will log the connect close msg to log_file.
#and when it set off kingate won't log the connect close msg to log_file
#缓存部分
#cache section
mem_min_cache 20m
mem_max_cache 30m
disk_min_cache 100m
disk_max_cache 120m
use_disk_cache on
refresh never
refresh_time 0
#端口重定向
#redirect port_host:port #端口重定向功能,所有port端口的请求发送至host:port
#redirect 9999_211.141.90.201:23
#redirect 3333_127.0.0.1:23
#配置文件结束
10.kingate管理
kingate从1.5版开始远程管理使用单独的端口来管理。我们有了远程管理可以动态改变控制规则,用户及用户组的管理。相

投稿指南


