Routeros Mikrotik Tutorial - 2.7 Stable 9 vs Ubnt 12.4

sudo apt-get update
sudo apt-get install gcc
sudo apt-get install ccze
sudo apt-get install iptraf
sudo apt-get install build-essential
sudo apt-get install sharutils
sudo apt-get install libzip-dev
sudo apt-get install automake1.9


wget https://dl.dropbox.com/s/7tkdooexrrbr596/squid-2.7.STABLE9.tar.gz
tar -zxvf squid-2.7.STABLE9.tar.gz

cd squid-2.7.STABLE9

kemudian compile, pola menggunakan proc jasus pentium4

CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
 --datadir=/etc/squid --libexecdir=/usr/libexec --sysconfdir=/etc/squid 
--localstatedir=/var/spool/squid --enable-async-io --with-pthreads 
--enable-storeio=aufs,coss,null
--enable-linux-netfilter 
--enable-arp-acl 
--enable-epoll 
--enable-removal-policies=lru,heap --enable-snmp 
--enable-delay-pools --enable-htcp --enable-cache-digests 
--enable-referer-log 
--enable-useragent-log --enable-follow-x-forwarded-for --with-large-files
--enable-large-cache-files --enable-truncate --disable-ident-lookups 
--with-maxfd=65536

hapus file squid.conf dan penambahan file storeurl.pl
rm /etc/squid/squid.conf
cd /etc/squid
wget https://dl.dropbox.com/s/s9k2ssw3osp367j/squid.conf

wget https://dl.dropbox.com/s/ws5nd3lnnlr9j3w/storeurl.pl
catatan : sesuaikan direktori cache_dir dan ip local yg berada di squid.conf sesuai dengan kebutuhan anda

buat direktori & file log
mkdir /var/log/squid
touch /var/log/squid/access.log
touch /var/log/squid/store.log
touch /var/log/squid/cache.log


berikan hak kanal pada dir cache, file log & storeurl.pl
chown proxy:proxy /cache
chown proxy:proxy /etc/squid/storeurl.pl
chown proxy:proxy /var/log/squid/access.log
chown proxy:proxy /var/log/squid/store.log
chown proxy:proxy /var/log/squid/cache.log
chmod +x /cache
chmod +x /etc/squid/storeurl.pl
chmod +x /var/log/squid/access.log
chmod +x /var/log/squid/store.log
chmod +x /var/log/squid/cache.log


agar squid mampu menggunakan perintah service (start|restart|stop)
cd /etc/init.d
wget https://dl.dropbox.com/s/f8z2c68keniu3ii/squid

chown proxy:proxy /etc/init.d/squid
chmod +x /etc/init.d/squid

pengalihan port 80 ke port default squid 3128
nano /etc/rc.local
tambahkan baris di bawah sebelum baris exit 0 yg berada di baris paling bawah
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
catatan : bila squid tidak auto start up, mampu menambahkan baris
"squid start" di bawah-nya tanpa kutip

cek konfigurasi pada squid.conf
squid -k parse
bila tidak ada pemberitahuan lanjutkan membuat dir swap cache
squid -z
bila tidak ada pemberitahuan cek + jalankan squid
squid -d1

perintah-perintah pada squid
squid -k shutdown atau service squid stop    "stop squid"
squid -d1 atau service squid start            "start squid"
tail -f /var/log/squid/access.log|ccze        "cek log akses"
tail -f /var/log/squid/cache.log|ccze        "cek log cache"
tail -f /var/log/squid/store.log|ccze        "cek log store"
tail -f /var/log/squid/access.log|grep HIT  "cek HIT log saja"

Comments