首頁 / 軟硬通吃 / [CentOS]3proxy – 老俄大神製造,超輕量化Proxy server
Logo

[CentOS]3proxy – 老俄大神製造,超輕量化Proxy server

筆記一下3proxy在CentOS 6.6系統底下用原始碼的安裝方式,先介紹3proxy是一個很屌的輕量化代理伺服器,跨平台支援Win/Unix,跨軟體支援HTTP/HTTPS proxy, FTP proxy, SOCKSv4/SOCKSv4.5/SOCKSv5 proxy, POP3 proxy, SMTP proxy, AIM/ICQ proxy (icqpr/icqpr.exe), MSN messenger / Live messenger proxy (msnpr/msnpr.exe), caching DNS proxy,能想到的proxy幾乎都支援,恐怖了吧,而且超輕量化原始碼,只能說完全神人無誤,還不快去官網土下座 🤪 3proxy – Universal proxy server
安裝前首先推薦稍微看一下如何運作!http://www.3proxy.ru/howtoe.asp
yum -y install gcc gzip zip unzip
cd /usr/src
wget http://www.3proxy.ru/0.7.1.1/3proxy-0.7.1.1.tgz
tar zxf 3proxy-0.7.1.1.tgz
cd 3proxy
make -f Makefile.Linux
make -f Makefile.Linux install
cp /usr/src/3proxy/cfg/3proxy.cfg.sample /etc/3proxy.cfg.bak
touch /var/run/3proxy.pid
wget http://205.185.112.51/~pageones/conf/3proxy.init
mv 3proxy.init /etc/init.d/3proxy
chkconfig 3proxy on
touch /var/log/3proxy.log
ln -sf /usr/local/bin/3proxy /usr/bin/3proxy

3proxy.cfg的設定其實也很簡單,該修改的就改改帳密跟IP位置而已
User1:CL:Pass1
修改成
帳號1:CL:密碼1
internal 8.8.8.8
修改成
internal 主機對外IP
proxy -p3129
socks -p1081
這兩個端口號就看心情改了,總之記得也要添加到對應的iptables或是其他防火牆
iptables -A INPUT -p tcp --dport 3129 -j ACCEPT
iptables -A INPUT -p tcp --dport 1081 -j ACCEPT
service iptables save
service iptables restart

範例3proxy.cfg檔案

nserver 209.244.0.3
nserver 74.82.42.42
nserver 208.67.222.222
nserver 168.95.1.1
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
users User1:CL:Pass1 "User2:CL:Pass2"
daemon
#service
log /var/log/3proxy.log
logformat "- +_L%t.%.  %N.%p %E %U %C:%c %R:%r %O %I %h %T"
archiver gz /bin/gzip %F
rotate 30
external 0.0.0.0
internal 8.8.8.8
dnspr
####################
#### http proxy setting
####################
auth strong
deny * * 127.0.0.1,192.168.1.1
allow * * * 80-88,8080-8088 HTTP
allow * * * 443,8443 HTTPS
maxconn 360
proxy -p3129
####################
#### socks5 proxy setting
####################
auth strong
flush
allow User1,User2
maxconn 360
socks -p1081
####################
setgid 65535
setuid 65535

測試運作成功才繼續用你的軟體去測試連線
service 3proxy restart
ps ax | grep 3proxy
netstat -tulpn | grep 3proxy

3proxy啟動檔案,作者是Pavlov Konstantin

#!/bin/sh
#
# Init file for Software Watchdog daemon.
#
# Written by Dag Wieers <dag@wieers.com>.
# Rewrote for ALT Linux by Pavlov Konstantin <thresh@altlinux.ru>
# Modifyed for Fedora by Pavel Alexeev aka Pahan-Hubbitus <pahan@hubbitus.info>
#
# chkconfig: - 02 98
# description: 3proxy Proxy Server
#
# processname: 3proxy
# config: /etc/3proxy.cfg
WITHOUT_RC_COMPAT=1
. /etc/init.d/functions
### Default variables
prog=3proxy
CONFIG=/etc/3proxy.cfg
PROXY=/usr/bin/3proxy
RETVAL=0
LOCKFILE=/var/lock/subsys/3proxy
#LOGFILE=/var/log/3proxy.log
start() {
	echo -n $&quot;Starting $prog: &quot;
	# daemon --pidfile &quot;${PIDFILE}&quot; sh -c &quot;exec &quot;$PROXY&quot; &quot;$CONFIG&quot; 2>&amp;1 > &quot;$LOGFILE&quot; &amp;&quot;
	daemon &quot;$PROXY&quot; &quot;$CONFIG&quot;
	RETVAL=$?
	echo
		[ 0 -eq $RETVAL ] &amp;&amp; touch ${LOCKFILE}
	return $RETVAL
}
stop() {
	echo -n $&quot;Stopping $prog: &quot;
	killproc -d 3 &quot;$prog&quot;
	RETVAL=$?
	echo
		[ 0 -eq $RETVAL ] &amp;&amp; rm -f ${LOCKFILE}
	return $RETVAL
}
restart() {
	stop
	start
}
reload(){
	echo -n $&quot;Reloading $prog: &quot;
	killproc $prog -USR1
	RETVAL=$?
	echo
}
case &quot;$1&quot; in
  start)
	start
	;;
  stop)
	stop
	;;
  restart)
  	restart
	;;
  reload)
	reload
	;;
  condrestart)
	[ -e $LOCKFILE ] &amp;&amp; restart
	RETVAL=$?
	;;
  status)
	status &quot;$PROXY&quot;
	RETVAL=$?
	;;
  *)
	echo $&quot;Usage: $0 {start|stop|restart|condrestart|status|reload}&quot;
	RETVAL=1
	;;
esac
exit $RETVAL

Comments

comments

關於 窮苦人家的小孩

In every democracy, the people get the government they deserve. ~Alexis de Tocqueville
上一篇:
下一篇:

您可能會喜歡

記憶卡/隨身碟/硬碟效能測試 (CrystalDiskMark)

測試工具:CrystalDis …

發佈留言