Senin, 11 Juni 2012

squid 2.7.STABLE9 + TPROXY-4.1

install squid 2.7.STABLE9 + TPROXY-4.1 di ubuntu 10.04

Posted: juni 12, 2012 in 

tweaking dulu system ubuntu anda1. tweaking limit open file & ip forwarding
Code:
echo "*      soft    nofile   65535" >> /etc/security/limits.conf
echo "*      hard    nofile   65535" >> /etc/security/limits.conf
echo "net.ipv4.conf.all.rp_filter=0" >> /etc/sysctl.conf
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
2. install build essential & libcap-dev
Code:
apt-get install build-essential
apt-get install libcap-dev
setelah itu selesai semua barulah kita install squid
1. download squid2.7.STABLE9 & patch
Code:
wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.gz
wget http://www.visolve.com/squid/tproxy4/squid-2.7s9-tproxy-4.patch
2. extract & patch squid
Code:
tar -zxvf squid-2.7.STABLE9.tar.gz
cd squid-2.7.STABLE9
patch -p1 < ../squid-2.7s9-tproxy-4.patch
3. compile & install squid
Code:
./configure '--prefix=/usr/local/squid' \
'--enable-async-io=24' \
'--enable-storeio=ufs,aufs,null,diskd' \
'--enable-auth=basic' \
'--enable-err-languages=English' \
'--disable-ident-lookups' \
'--disable-cache-digests' \
'--enable-follow-x-forwarded-for' \
'--enable-delay-pools' \
'--enable-http-violations' \
'--enable-arp-acl' \
'--with-maxfd=65535' \
'--enable-linux-netfilter' \
'--enable-linux-tproxy' \
'--with-libcap'
make
make install
option2 diatas optional bisa ditambah/dikurangi pake option2 yang anda inginkan
4. di squid.conf anda tambahkan option ini pada bagian
Code:
http_port 8080 tansparent tproxy
max_filedescriptors 65535
baris ke2 optional, nilai defaultnya 1024
5. setting iproute2 & iptables untuk intercepting tproxy (transparent proxy)
Code:
ip rule add fwmark 1 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100

iptables -t mangle -N DIVERT
iptables -t mangle -A DIVERT -j MARK --set-mark 1
iptables -t mangle -A DIVERT -j ACCEPT
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 8080
jalankan squid seperti biasa.. selamat mencoba ^_^

Tidak ada komentar:

Posting Komentar