Ini adalah catatan saya dalam meng-install Squid Version 3.0.STABLE14 sebagai web cache di jaringan pribadi saya yang terdiri dari 1 ubuntu 8.10 desktop yang juga sebagai proxy server, 3 buah client (campuran linux dan window$).
1. Dalam hal ini saya menggunakan source code yang bisa di download di http://www.squid-cache.org/
2. Extract squid-3.0.STABLE14.tar.bz2 hasil download di home folder;
3. Masuk ke folder squid-3.0.STABLE14
~$ cd /home/mm/squid-3.0.STABLE14
ikuti langkah instalasi mulai dari compile dll, baca di file INSTALL, jalankan sampai proses selesai, makan waktu kira 10 menit.
Kalo ada error sbb :
configure: error: C++ compiler cannot create executables
solusinya sbb :
~$ sudo apt-get install build-essential
ulangi perintah : ./configure –prefix=/usr/local/squid
4. Jika sudah selesai install, edit squid.conf sesuai kebutuhan masing2, untuk setting lebih mendalam silahkan googling aja. Secara default squid sudah bisa berjalan tanpa merubah squid.conf
~$ sudo gedit /usr/local/squid/etc/squid.conf
berikut ini contoh squid.conf milik saya yang masih sangat sederhana :
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl lan src 192.168.0.2/32
acl lan src 192.168.0.3/32
acl lan src 192.168.0.4/32
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow localnet
http_access allow lan
http_access deny all
icp_access allow lan
icp_access allow localnet
icp_access deny all
htcp_access allow localnet
htcp_access deny all
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
cache_dir ufs /usr/local/squid/var/cache 100 16 256
access_log /usr/local/squid/var/logs/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern . 0 20% 4320
cache_mgr webmaster
cache_effective_user nobody
visible_hostname mm
icp_port 3130
coredump_dir /usr/local/squid/var/cache
dns_nameservers 192.168.1.1
5. Buat cache dan logs directory nya
~$ sudo mkdir /usr/local/squid/var/cache
~$ sudo chmod 777 /usr/local/squid/var/cache
~$ sudo chmod 777 /usr/local/squid/var/logs/
6. Jalankan squid untuk yg pertama kali
~$ /usr/local/squid/sbin/squid -z
~$ /usr/local/squid/sbin/squid
7. Setting client web browser agar menggunakan proxy. Pada firefox Isikan HTTP Proxy 192.168.0.1 port 3128 (ini contoh saja) centang pada -use this proxy server for all protocols-
8. Coba browsing dari client, untuk mengetahui aktifitas squid ketik :
~$ sudo tail -f /usr/local/squid/var/logs/cache.log
~$ sudo tail -f /usr/local/squid/var/logs/access.log
Apabila anda ingin meng-kustomisasi file squid.conf, untuk mengaktifkan perubahannya ketik :~$ sudo /usr/local/squid/sbin/squid -k reconfigure
Demikian semoga bermanfaat.
Spesifikasi Server = CPU P4 1,8Ghz, OS : Ubuntu 8.10 Desktop, Browser : Firefox, IP Server:192.168.0.1, Port : 3128, DNS : 192.168.1.1