Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
by Dmitri (contact@sysadmin.md)
Download and unpack 3proxy
mkdir 3proxy
cd 3proxy
wget http://3proxy.ru/current/3proxy0.7devel.tgz
tar zxf 3proxy0.7devel100812103505.tgz
Create directories
mkdir /usr/local/3proxy
mkdir /usr/local/3proxy/logs
mkdir /usr/local/3proxy/stat
Cleanup
cd ~
rm rf 3proxy*
Configuration
The file /usr/local/3proxy/3proxy.cfg should look like this one
!/usr/local/3proxy/3proxy
# Use Google nameservers
nserver 8.8.8.8
nserver 8.8.4.4
# nscache is good to save speed, traffic and bandwidth
nscache 65536
# Here we can change timeout values
timeouts 1 5 30 60 180 1800 15 60
users dmitri:CL:test123
# now we will not depend on any console (daemonize)
daemon
# log allows to specify log file location and rotation, D means logfile
# is created daily
log /var/log/3proxy.log D
logformat "L%d%m%Y %H:%M:%S %z %N.%p %E %U %C:%c %R:%r %O %I %h %T"
# We will keep last 30 log files
rotate 30
# HTTP
auth strong
# We want to protect internal interface
deny * * 127.0.0.1
# and llow HTTP and HTTPS traffic.
allow * * * 8088,80808088 HTTP
allow * * * 443,8443 HTTPS
allow * * * 21 FTP
proxy n
# SOCKS
auth strong
flush
allow dmitri
maxconn 20
socks
# Admin interface
auth strong
flush
internal 0.0.0.0
allow dmitri *
maxconn 3
admin p8888
counter /usr/local/3proxy/3proxy.3cf
chroot /usr/local/3proxy
setgid 65535
setuid 65535
For more details about configuration options check the template cfg/3proxy.cfg.sample
The file /etc/init.d/3proxy should look like this one:
#!/bin/sh
#
# chkconfig: 2345 20 80
# description: 3proxy tiny proxy server
#
case "$1" in
start)
echo Starting 3Proxy
/usr/local/3proxy/3proxy /usr/local/3proxy/3proxy.cfg
RETVAL=$?
echo
[ $RETVAL ]
;;
stop)
echo Stopping 3Proxy
/usr/bin/killall 9 3proxy
RETVAL=$?
echo
[ $RETVAL ]
;;
*)
echo Usage: $0 "{start|stop}"
exit 1
esac
exit 0
Browser setting
http <hostname from Public DNS field>:3128
socks <hostname from Public DNS field>:1080
admin interface http://<hostname from Public DNS field>:8888