Friday, January 20, 2012

Lusca Squid: Install High Performance Proxy CentOS 6x

Memory RAM                : 512 MB
Partisi Squid                  : 2 Partisi Cache
Alokasi Memory Squid  : 25% 

Dengan Alokasi Hardisk Sebesar 25 GB, format dan bagi partisi sebagai berikut:

/                 5  GB     EXT4  ( Flag Boot)
/var             2 GB EXT4
/usr             2 GB EXT4
swap          1  GB EXT4
/cache1     6.4 GB SWAP
/cache2     6.4 GB      EXT4

Login sebagai root

Install paket-paket yang dibutuhkan Lusca Squid:
# sudo yum update
# sudo yum install squid
# sudo yum remove squid
# sudo yum install squidclient squid-cgi gcc build-essential sharutils ccze ibzip-dev automake glibc-devel e2fsprogs-devel

Untuk lebih memudahkan instalasi, pindah diretori ke cd /tmp
# cd /tmp
Download Lusca Squid
# wget http://backcode.googlecode.com/files/squid-2.7.STABLE9+patch.tar.gz
Extract Lusca Squid yang telah didownload:
# tar -xvzf squid-2.7.STABLE9+patch.tar.gz
Masuk ke dalam direktory Lusca Squid
# cd squid-2.7.STABLE9
Compile Lusca Squid dengan perintah berikut: (lokasi instalasi/prefix akan berada pada /etc/squid )
./configure --prefix=/etc/squid --exec-prefix=/etc/squid --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs \
--enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=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 --enable-delay-pools --enable-cache-digests --enable-poll --enable-linux-netfilter --enable-removal-policies --with-maxfd=8192 --enable-storeio=aufs --disable-wccp --enable-x-accelerator-vary --enable-kill-parent-hack --enable-async-io=30 --disable-ident-lookups

Kemudian lakukan instalasi:
# make
# make install
Masuk ke dalam direktory konfigurasi lusca squid:
# cd /etc/squid/etc
Backup terlebih dahulu file konfigurasi squid.conf
# mv squid.conf  squid.conf-backup
Download squid.conf dari link berikut:
# wget http://arievoel.googlecode.com/files/squid.conf

Download file storeurl.pl dari link berikut:
# wget http://kembangcybernet.googlecode.com/files/storeurl.pl

Download file tunning.conf dari link berikut:
# wget http://arievoel.googlecode.com/files/tunning.conf

Download file refresh.conf dari link berikut:
# wget http://arievoel.googlecode.com/files/refresh.conf

Memberikan building/permission pada folder /cache1 dan /cache2
# chown squid:squid /cache1
# chown squid:squid /cache2
# chmod 777 /cache1
# chmod 777 /cache2
# chown squid:squid /etc/squid/etc/storeurl.pl
# chmod 777 /etc/squid/etc/tunning.conf /etc/squid/etc/storeurl.pl
Membuat folder-folder swap/cache di dalam folder cache yang telah ditentukan dengan perintah:
# /etc/squid/sbin/squid -z
Cek apakah ada config error di squid
# /etc/squid/sbin/squid -k parse
Apabila tidak ada error jalankan squid sebagai daemon
# /etc/squid/sbin/squid -NDd1 &
Sekarang arahkan broser anda ke alamat IP Proxy dengan port 3128, coba untuk browsing dan cek access.log squid
# tail -f /cache1/access.log
Untuk menjalankan lusca squid secara otomatis ketika baru dihidupkan, ketik perintah ini di console
# echo "/etc/squid/sbin/squid  -NDd1 &" >> /etc/rc.local
Apabila anda ingin meng-konfigure ulang squid jalankan perintah
# /etc/squid/sbin/squid -k reconfigure

1 comment:

  1. nice work man . . .
    following your blog . . .
    http://linux4everybody.blogspot.in

    ReplyDelete