Membuat Proxy Server ( Using Squid ) Fedora 14

IP Proxy Server 192.168.11.11
My Network Area 192.168.11.0/24

Langsung aja boss

1.Install Squid
- yum install squid

2.Masuk ke direktori squid.conf karena konfigurasi akan tersimpan disini
- vi /etc/squid/squid.conf

==== Networks Yg Di Allow ====
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
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 localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

Note :
Secara default IP Private sudah ada di ACL ( Access Control )

==== Hapus semua acl localnet area ====

==== Buat rule baru acl localnet untuk Networks ====
- acl localnet src 192.168.11.0/24 # My Networks

==== Port yg Di Allow ====
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

==== Tambahkan acl SSL Port Allow untuk Internet Messenger ====
- acl SSL_ports port 5050 # Internet Messenger

==== Tambahkan IP Address dan Port Untuk Proxy Tsb ====
# Squid normally listens to port 3128
http_port 3128
http_port 192.168.11.11:3128

==== Direktori Cache ====
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

==== Hilangkan tanda # pada chace_dir dan ubah menjadi ====
- chace_dir ifs /var/spool/squid 65000 16 256

Note :
65000 adalah satuan dalam MB ( 65 GB ) hardisk yg digunakan karena hardisk saya 80 GB... Baiknya 70% dari total Harddisk

==== Tambahkan Rule Memory Chace ====
# Chace Memory Limit
- cache_mem 100 MB

Note :
Baiknya 10% dari RAM. saya menggunakan RAM 1GB

==== Tambahkan Rule Visible Hostname ====
# Visible Hostname
- visible_hostname proxy-irdhy

==== Biar Lebih Maknyuss Tambahkan Refresh_Pattern ====
refresh_pattern (Release|Package(.gz)*)$ 0 80% 2880
refresh_pattern -i .(jpg|png|jpeg|bmp|gif)$ 10240 90% 43200
refresh_pattern -i .(deb|rpm|tgz|bz2|tar|gz)$ 10240 100% 43200
refresh_pattern -i .(class|css|js|gif|jpg)$ 10080 90% 43200
refresh_pattern -i .(jpe|jpeg|png|bmp|tif)$ 10080 90% 43200
refresh_pattern -i .(tiff|qt)$ 10080 90% 43200
refresh_pattern -i .(gz|arj|lha|lzh)$ 10080 90% 43200
refresh_pattern -i .(rar|tgz|tar|bin)$ 10080 90% 43200
refresh_pattern -i .(hqx|pdf|rtf|doc|swf)$ 10080 90% 43200
refresh_pattern -i .(inc|cab|ad|txt|dll)$ 10080 90% 43200
refresh_pattern -i .(asp|acgi|pl|shtml|php3|php)$ 2 20% 4320
refresh_pattern ^http://mail.yahoo.com/.* 720 100% 4320
refresh_pattern ^http://mail.google.com/.* 720 100% 4320
refresh_pattern ^http://*.yahoo.*/.* 720 100% 4320
refresh_pattern ^http://*.friendster.*/.* 720 100% 4320
refresh_pattern ^http://*.facebook.*/.* 720 100% 4320
refresh_pattern ^http://*.detik.*/.* 720 100% 4320
refresh_pattern ^http://*.detiknews.*/.* 720 100% 4320
refresh_pattern ^http://*.detikfinance.*/.* 720 100% 4320
refresh_pattern ^http://*.detikhot.*/.* 720 100% 4320
refresh_pattern ^http://*.detikinet.*/.* 720 100% 4320
refresh_pattern ^http://*.detiksport.*/.* 720 100% 4320
refresh_pattern ^http://*.detikoto.*/.* 720 100% 4320
refresh_pattern ^http://*.detikfood.*/.* 720 100% 4320
refresh_pattern ^http://*.detikfoto.*/.* 720 100% 4320
refresh_pattern ^http://*.kompas.*/.* 720 100% 4320
refresh_pattern ^http://*.okezone.*/.* 720 100% 4320
refresh_pattern ^http://*.google.*/.* 720 100% 4320
refresh_pattern ^http://*.youtube.*/.* 720 100% 4320
# Images
refresh_pattern -i \.gif$ 10080 90% 43200
refresh_pattern -i \.jpg$ 10080 90% 43200
refresh_pattern -i \.png$ 10080 90% 43200
refresh_pattern -i \.jpeg$ 10080 90% 43200
refresh_pattern -i \.bmp$ 10080 90% 43200
refresh_pattern -i \.psd$ 10080 90% 43200
refresh_pattern -i \.ad$ 10080 90% 43200
refresh_pattern -i \.gif\?$ 10080 90% 43200
refresh_pattern -i \.jpg\?$ 10080 90% 43200
refresh_pattern -i \.png\?$ 10080 90% 43200
refresh_pattern -i \.jpeg\?$ 10080 90% 43200
refresh_pattern -i \.psd\?$ 10080 90% 43200
quick_abort_min 128 KB
quick_abort_max 4098 KB
quick_abort_pct 100%

3. Restart Squid
- /etc/init.d/squid restart
- service squid start
- chkconfig squid on ( Autorun )

4. Chek squid
- squid -z
- squid -k parse
Bila tidak terjadi kesalahan akan muncul
[root@fedora irdhy]# squid -z
2011/06/19 23:03:51| Squid is already running! Process ID 6268


Bila terjadi kesalahan atau peringatan akan muncul pesan WARNING

5. Masukan proxy pada browser dan lihat log squid pada server
- tail -f /var/log/squid/access_log


Selesai

Selamat mencoba..
untuk direktori chace silahkan disesuaikan dengan kebutuhan anda..

Terima kasih..

Note :
Pada squid 3 direkomendasikan untuk konfigurasi seminimal mungkin untuk memperoleh performance maximal dari proxy..

Selamat mencoba