Minggu, 17 Juni 2012

Speedtest kang ucok

Speedtest


apt-get install apache2 php5
masuk ke folder tempat file web berada
cd /var/www
download file speedtest
wget http://c.speedtest.net/mini/mini.zip
dilanjut dengan extrac file tersebut
apt-get install unzip
unzip mini.zip
=====================================================================

apabila dns cache anda menggunakan mikrotik copy paste baris dibawah ini, tentunya dengan mengganti ipnya dengan ip proxy,

ip dns static add address=192.168.17.2 ttl=1d name="speedtest.indosatm2.com"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.sby.dnet.net.id"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.biznetnetworks.com"
ip dns static add address=192.168.17.2 ttl=1d name="jogja.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="www.speedtest.mygreenlinks.net"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.sby.dnet.net.id"
ip dns static add address=192.168.17.2 ttl=1d name="1.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="2.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="3.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="4.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="5.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="6.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="7.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="8.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="9.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="10.speedtest.telkomspeedy.com"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.elnus.net.id"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.wigo.co.id"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest-surabaya.biznetnetworks.com"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.cbn.net.id"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.vqbn.com"
ip dns static add address=192.168.17.2 ttl=1d name="speedtest.singnet.com.sg"


/ip fi ma

add chain=prerouting action=mark-packet new-packet-mark=btest passthrough=no protocol=tcp src-address=192.168.17.2 src-port=80

add chain=prerouting action=mark-packet new-packet-mark=btest passthrough=no protocol=tcp dst-address=192.168.17.2 dst-port=80


/queue simple

add name="Bandwidt Test" dst-address=0.0.0.0/0 packet-marks=btest priority=1 limit-at=500M/500M max-limit=1000M/1000M

Partisi Auto Manual Ubuntu

Partisi manual + auto, ubuntu server

  • pilih partisi manual, sesuaikan kebutuhan utk cache1, cache2 dst (serta utk partisi videocache dll bila diperlukan)
  • pilih selesai (tulis perubahan pada partisi hdd)
  • scroll ke atas lagi, pilih partisi terpandu
  • pilih gunakan seluruh hardisk tanpa LVM 
  • pilh hdd yg direncanakan utk system
  • aktifkan kembali partisi yg dibuat langkah awal dg cara :
    • arahkan cursor ke partisi cache1 -enter  (yg telah di buat sebelumnya)
    • pilih gunakan partisi 
    • tarik cursur paling bawah - enter (selesai melakukan perubahan)
    • ulangi langkah tsb pd partisi cache yg lain
  • selesai melakukan perubahan, tulis perubahan  (yes)
  • selesaikan installasi system spt biasa

lusca ubuntu server 11.10

install lusca di ubuntu server 11.10

Login ke root cek Ping google, jika ok  lanjutkan,..

1. Copas kode dibawah ini dan pastekan di terminal PuTTY ( klik kanan lalu Enter )

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install squid -y && apt-get install squid squidclient squid-cgi -y && apt-get install gcc -y && apt-get install build-essential -y && apt-get install sharutils -y && apt-get install ccze -y && apt-get install libzip-dev -y && apt-get install automake1.9 -y && wget http://proxy-ku.googlecode.com/files/LUSCA_FMI.tar.gz && tar xzvf LUSCA_FMI.tar.gz && cd LUSCA_FMI/ && make distclean

2. Copas kode Compile dibawah ini dan pastekan di terminal PuTTY


./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-http-gzip --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs --enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=lru,heap --with-aio --with-dl --enable-snmp --enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files --enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536 && make && make install

3. Copy file-file berikut dengan Program WinSCP
- File "squid.conf" yang telah disesuaikan ke folder: /etc/squid/
- File "storeurl.pl" ke folder: /etc/squid/
- File "squid" ke folder: /etc/init.d/
(file2 racikan sdh di sharing di google.doc)

4. Memberikan izin akses  user  + install perl

chmod +x /etc/init.d/squid && /etc/init.d/squid stop
apt-get install perl
perl -v (sinkronkan versi perl dg storeurl nya)

ln -s /usr/local/bin/perl5.12.4 /usr/local/bin/perl


5. Permission pada folder cache (utk 10 partisi cache)

chown proxy:proxy /cache1 && chmod 777 /cache1
chown proxy:proxy /cache2 && chmod 777 /cache2
chown proxy:proxy /cache3 && chmod 777 /cache3
chown proxy:proxy /cache4 && chmod 777 /cache4
chown proxy:proxy /cache5 && chmod 777 /cache5
chown proxy:proxy /cache6 && chmod 777 /cache6
chown proxy:proxy /cache7 && chmod 777 /cache7
chown proxy:proxy /cache8 && chmod 777 /cache8
chown proxy:proxy /cache9 && chmod 777 /cache9
chown proxy:proxy /cache10 && chmod 777 /cache10
chown proxy:proxy /etc/squid/storeurl.pl && chmod 777 /etc/squid/storeurl.pl && chmod +x /etc/init.d/squid


6. Membuat folder swap/cache di dalam folder cache
============================================
/etc/init.d/squid stop
squid -f /etc/squid/squid.conf -z && /etc/init.d/squid restart

7. auto shutdown dengan tombol power

apt-get install acpid

reboot

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 ^_^