Instalasi Dan Setting Proxy Server Menggunakan Squid Pada Ubuntu 10.04

| Friday, March 23, 2012
Pada kesempatan kali ini, saya akan sedikit mengulas tentang instalasi dan konfigurasi proxy server menggunakan squid pada Ubuntu 10.04. Mengapa saya memilih menggunakan ubuntu?? Karena Ubuntu memiliki repository atau kumpulan paket yang relatif lengkap dan dengan menggunakan perintah apt-get kita dapat menginstallnya dengan begitu mudahnya.
Saya menganggap anda telah melakukan instalasi Ubuntu 10.04 dan telah login sebagai root di mesin ubuntu anda.
Langkah pertama adalah mengupdate repository kita dengan mengetikkan perintah:
#apt-get update
Selanjunya ketikkan perintah berikut
#apt-get install squid
Tunggu proses instalasi yang dilakukan secara otomatis oleh ubuntu anda.
Bila sudah selesai, ketikkan perintah berikut untuk membuat directory squid anda.
#mkdir /cache1 && mkdir /cache2 && mkdir /cache3 && mkdir /cache4
#touch /var/log/squid/access.log
#touch /var/log/squid/cache.log
sesuaikan dengan space HDD anda.
ubah kepemilikan directory /cache anda dengan perintah:
#chmod 777 /cache1
#chmod 777 /cache2
#chmod 777 /cache3
#chmod 777 /cache4
#chmod 777 /var/log/squid/cache.log
#chmod 777 /var/log/squid/access.log
kemudian edit file /etc/squid/squid.conf dengan perintah:
#pico /etc/squid/squid.conf
ini adalah contoh isi dari file /etc/squid/squid.conf
http_port 8080 transparent
cache_mgr support@netsolusindo.com
forwarded_for off
visible_hostname proxy1.netsolusindo.com

cache_mem 6 MB
cache_swap_low 98
cache_swap_high 99

maximum_object_size 128 MB
maximum_object_size_in_memory 32 KB

ipcache_size 2048
ipcache_low 98
ipcache_high 99

memory_pools off
reload_into_ims on
pipeline_prefetch on

cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

cache_dir aufs /cache1 40000 94 256
cache_dir aufs /cache2 40000 94 256
cache_dir aufs /cache3 40000 94 256
cache_dir aufs /cache4 40000 94 256

access_log /var/log/squid/access.log
cache_store_log none
cache_log  /var/log/squid/cache.log

acl all src 0.0.0.0/0.0.0.0
acl localNet src 172.0.0.0/8, 10.14.200.0/24, 192.168.4.0/24, 10.14.201.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
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 allow localhost
http_access allow localNet
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all
icp_access allow all
selanjutnya coba check file /etc/squid/squid.conf anda dengan perintah:
#squid -k parse
bila masih muncul baris errot, edit kembali file /etc/squid/squid.conf anda, setelah tidak ada baris error yang muncul silahkan ketikkan perintah di bawah ini:
#squid -z
#squid -DFY
sekarang check apakah squid anda telah berjalan dengan perintah:
#ps -ax|grep squid
bila muncul baris seperti berikut ini, maka squid anda telah berjalan.
684 ?        Ss   0:00 /usr/sbin/squid
686 ?        Sl    45:47 (squid)
Bila ada pertanyaan, silahkan hubungi:

0 komentar:

Post a Comment

Next Prev
▲Top▲