Instalasi Squid Proxy di Ubuntu
-
Upload
isus-isusay -
Category
Documents
-
view
1.519 -
download
1
description
Transcript of Instalasi Squid Proxy di Ubuntu
http://issss.us/
In s t all S q uid U buntu S e r v er 9 . 0 4
Kebutuhan sistem operasi untuk implementasi server dalam jaringan baik skala besar
maupun kecil sangat berpengaruh peranannya untuk optimasi kebutuhan akan kelancaran
akses.Ubuntu server salah satu solusi yang memberikan kemudahan baik konfigurasinya
maupun dalam installasi serta perawatan untuk update scurity.Kemudahan tersebut salah
satunya dengan satu kali syntax sudo “apt-get update” dan kemdian install squid dengan cara
“sudo apt-get install squid”, maka squid yang di install squid yg terbaru dan tidak perlu
mencari atau download dulu sorce squid.Karena installasi pakednya sudah ada langsung dari
repositori.Ini berarti di sisi scurity jg secara otomatis sudah ter-update.Untuk membangun
proxy server dengan ubuntu diperlukan salah satunya dengan squid.
Berikut ini tutorial singkat cepat install squid proxy server di ubuntu.Dengan sedikit bekal ini
penulis berharap dapat menghantarkan bagi pemula belajar squid proxy Ubuntu server untuk
bisa dikembangkan lebih jauh.
1. Update path repository untuk mendapatkan source terbaru
$sudo apt-get update
2. Mengunduh berkas dan menginstall
$sudo apt-install squid
3. Backup script squid yg asli jika mengalami error saat di edit bisa di gunakan lagi script squid default
$sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.original
4. Edit sesuai kebutuhan file konfigurasi squid
$sudo vi /ect/squid/squid.conf
contoh squid yang sudah di custumize seperti di bawah ini :
#==========================================================#konfigurasi squid.conf #==========================================================
http://issss.us/
http_port 3128 transparenticp_port 3130
acl query urlpath_regex cgi-bin \? \.php$ \.asp$ \.shtml$ \.cfm$ \.cfml$ \.phtml$ \.php3$ \.js \.jspacl nocache-domain dstdomain javatechno.net uns.ac.id siakad.uns.ac.idalways_direct allow queryalways_direct allow nocache-domainno_cache deny queryno_cache deny nocache-domain
cache_mem 128 MBcache_swap_low 90cache_swap_high 95maximum_object_size 128 MBmaximum_object_size_in_memory 32 KB
#file mp3, exe, zip, dat, avi, 3gp tidak disimpan di cache hardiskacl mp3 urlpath_regex -i \.mp3$acl exe urlpath_regex -i \.exe$acl zip urlpath_regex -i \.zip$acl dat urlpath_regex -i \.dat$acl avi urlpath_regex -i \.avi$acl 3gp urlpath_regex -i \.3gp$no_cache deny mp3no_cache deny exeno_cache deny zipno_cache deny datno_cache deny avino_cache deny 3gp
#cache_dir aufs /cache0/aufs 6000 16 128#cache_dir aufs /cache1/aufs 6000 16 128#cache_dir diskd /cache0/diskd 8000 16 256 Q1=72 Q2=64#cache_dir diskd /cache1/diskd 8000 16 256 Q1=72 Q2=64#cache_dir coss /cache0/coss 2000 block-size=512 max-size=131072#cache_dir coss /cache1/coss 2000 block-size=512 max-size=131072cache_dir ufs /cache0/ufs 900 16 256cache_dir ufs /cache1/ufs 900 16 256cache_access_log /usr/local/etc/squid/var/logs/access.logcache_log /usr/local/etc/squid/var/logs/cache.logcache_swap_log /usr/local/etc/squid/var/logs/%scache_store_log none
#ACL Network#acl all src 0.0.0.0/0.0.0.0acl client src 192.168.0.0/24acl private src 192.168.0.222acl jnp src 222.124.162.0/24acl localhost src 127.0.0.1/255.255.255.255acl to_localhost dst 127.0.0.0/8acl manager proto cache_object
#Port yang diijinkan untuk di request
http://issss.us/
acl SSL_ports port 443 563acl SSL_ports port 2083 2096acl Safe_ports port 80 # httpacl Safe_ports port 21 # ftpacl Safe_ports port 443 563 # https, snewsacl Safe_ports port 70 # gopheracl Safe_ports port 210 # waisacl Safe_ports port 1025-65535 # unregistered portsacl Safe_ports port 280 # http-mgmtacl Safe_ports port 488 # gss-httpacl Safe_ports port 591 # filemakeracl Safe_ports port 631 # cupsacl Safe_ports port 777 # multiling httpacl Safe_ports port 901 # SWATacl purge method PURGEacl CONNECT method CONNECTacl FTP proto FTP
http_access allow localhosthttp_access allow jnphttp_access allow privatehttp_access allow clienthttp_access deny allhttp_access deny managerhttp_access deny !Safe_portshttp_access deny CONNECT !SSL_portsicp_access allow localhosticp_access allow jnpicp_access allow privateicp_access allow clienticp_access deny allmiss_access allow allalways_direct allow clientalways_direct allow FTP
acl cachemgr proto cache_objecthttp_access allow cachemgr clienthttp_access allow cachemgr privatehttp_access allow cachemgr localhosthttp_access deny cachemgr allcachemgr_passwd admin info stats/objectscachemgr_passwd admin all
cache_effective_user squidcache_effective_group squid
visible_hostname http://cache.javatechno.netcache_mgr NOC-JNPforwarded_for off
5. Membuat file log dan direktory untuk cacheMembuat direktori squid
http://issss.us/
$ mkdir /usr/local/squid
Membuat direktori cache
$ mkdir /usr/local/squid/cache
Membuat file cache log yg berfungsi untuk melihat dan memonitoring aktivitas yg
sedang di lakukan client
$touch /usr/local/squid/cache.log
Membuat file access log berfungsi untuk memonitoring aktivitas yg dilakukan oleh
cache server
$touch /usr/local/squid/access.log
Membuat user dan group squid sebagai pemilik dari proses squid dan logingnya, ini
dibuat dengan alasan keamanan jika sistem squid diserang cracker dan bisa di akses
oleh cracker bukan root yg di ambil alih
$sudo adduser squid
Memberikan attribut dan hak milik atas direktori squid berserta sub sub direktori + file
file yg ada didalamnya
$chown -Rf squid.squid /usr/local/squid
$sudo chown squid.squid /var/spool/squid -Rf
$ sudo chown squid.squid -Rf /etc/squid
6) Membuat struktur cache directory
root@kuthuknet:/etc/squid# squid -z
2009/05/19 05:19:49| Squid is already running! Process ID 4971
7) Test Squid
root@kuthuknet:/etc/squid# squid -d 1 -D
2009/05/19 05:20:55| Squid is already running! Process ID 4971
8) Menjalankan Squid
root@kuthuknet:/etc/squid# squid -sYD
http://issss.us/
2009/05/19 05:21:37| Squid is already running! Process ID 4971
9) Melihat log access client
root@kuthuknet:~# tail -f /usr/local/squid/access.log
1242725175.667 1212 192.168.0.200 TCP_MISS/302 898 GET
http://www.google.com/search?q=install+squid+ubuntu&ie=utf-8&oe=utf-
8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a - DIRECT/74.125.19.147
text/html
Selamat mencoba....