工作中用到代理服务器软件kingate,将相关内容加以简单总结,也参考了很多文章,也感谢各位前辈的贡献文档:

参考页:
1、安装、配置 http://www.juyimeng.com/proxy-kingate-for-linux-install.html
2、指南 http://www.oschina.net/question/16_6372
下载页:http://sourceforge.net/projects/kingate/
wget http://jaist.dl.sourceforge.net/project/kingate/kingate/2.1/kingate-2.1.tar.gz
在RHEL 6中编译出现以下错误,(注:在RHEL 5.x中没有出现如下错误)
tar zxf kingate-2.1.tar.gz && cd kingate-2.1
./configure --prefix=/usr/local/kingate
make && make install
/usr/local/kingate/bin/kingate
[root@RHEL601 proxy]# tar zxf kingate-2.1.tar.gz
[root@RHEL601 proxy]# cd kingate-2.1
[root@RHEL601 kingate-2.1]# ./configure --prefix=/usr/local/kingate

错误:
1、[root@RHEL601 kingate-2.1]# make
Making all in src
make[1]: Entering directory `/root/workspace/proxy/kingate-2.1/src'
make  all-am
make[2]: Entering directory `/root/workspace/proxy/kingate-2.1/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.     -g -O0 -D_REENTRANT -DLINUX -MT KDnsCache.o -MD -MP -MF ".deps/KDnsCache.Tpo" -c -o KDnsCache.o KDnsCache.cpp; \
        then mv -f ".deps/KDnsCache.Tpo" ".deps/KDnsCache.Po"; else rm -f ".deps/KDnsCache.Tpo"; exit 1; fi
KDnsCache.cpp: In member function ‘unsigned int KDnsCache::GetName(const char*)’:
KDnsCache.cpp:44: error: ‘strlen’ was not declared in this scope
make[2]: *** [KDnsCache.o] Error 1
make[2]: Leaving directory `/root/workspace/proxy/kingate-2.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/workspace/proxy/kingate-2.1/src'
make: *** [all-recursive] Error 1
解决方法:修改src/KDnsCache.cpp文件,头部添加 #include <string.h>
2、
mysocket.cpp: In member function ‘void mysocket::clear_recvq(int)’:
mysocket.cpp:478: error: ‘malloc’ was not declared in this scope
mysocket.cpp:482: error: ‘free’ was not declared in this scope
make[2]: *** [mysocket.o] Error 1
make[2]: Leaving directory `/root/workspace/proxy/kingate-2.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/workspace/proxy/kingate-2.1/src'
make: *** [all-recursive] Error 1
解决方法:修改src/mysocket.cpp,头部添加 #include <malloc.h>

再次运行make && make install,正常。
[root@RHEL601 kingate-2.1]# /usr/local/kingate/bin/kingate
kingate 2.1 Author king(email:khj99@tom.com)
http://sourceforge.net/projects/kingate/
sizeof fd_set is:128
Try to read config file:/usr/local/kingate//etc/kingate.conf ...
success!!
[root@RHEL601 kingate-2.1]# /usr/local/kingate/bin/kingate -q
kingate 2.1 Author king(email:khj99@tom.com)
http://sourceforge.net/projects/kingate/
sizeof fd_set is:128
kingate shutdown success.
3\
(如果你想去掉socks4的功能,只支持socks5请做这一步,否则跳过)
vim ./src/socks.cpp

return create_socks4_connect(m_server);
替换为
goto cleanup;
应该是在第78行
保存退出VI
./configure --prefix=/usr/local/kingate
make
make install
/usr/local/kingate/bin/kingate(启动)
/usr/local/kingate/bin/kingate -q(关闭)