- Menyimpan halaman web di proxy untuk mempercepat akses Internet.
- Akses kontrol Internet berdasarkan IP Address. Menggunakan 2 network yang berbeda (saya fungsikan juga sebagai router – dengan IP Forwarding), untuk ini, saya menggunakan 3 NIC pada 1 server.
- Blacklist daftar situs terlarang secara manual.
- Membatasi ukuran download File dengan ekstension tertentu dan hanya berlaku pada jam tertentu.
- Pesan Error dalam format Bahasa Indonesia.
- Rule untuk memperbolehkan akses Internet hanya protokol tertentu saja.
- Instal aplikasi squid
- Edit file konfigurasi squid
- Buat direktori dan file blacklist untuk blacklist secara manual
- Buat direktori dan file untuk pesan error dalam bahasa indonesia
- Check konfigurasi firewall yang diterapkan di proxy
- Jalankan servicenya
- Test konfigurasi di proxy dan client
#SQUID 2.6.STABLE12
#Author by: http://blog-ollza.blogspot.com/# OPTION JARINGAN
# —————————————————————————–
http_port 3128
icp_port 0# OPTION UKURAN CACHE
# ——————————————————————-
cache_mem 256 MB
cache_swap_low 94
cache_swap_high 96
maximum_object_size 16384 KB
minimum_object_size 4 KB
maximum_object_size_in_memory 2048 KB
fqdncache_size 1024
cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF# DIREKTORI LOG DAN CACHE
# ——————————————————————
cache_dir aufs /var/spool/squid 9000 16 256
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log none# TUNING CACHE PROXY
# ——————————————————————
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
negative_ttl 1 minutes# TIMEOUT
# —————————————————————–
half_closed_clients off
# ————————————-
# Memblok situs terlarang (blacklist)secara manual
# ————————————-
acl noblacklist dstdomain “/etc/squid/blacklist/no-blacklist.txt”
acl katablacklist url_regex -i “/etc/squid/blacklist/kata-blacklist.txt”
acl domainblacklist dstdomain “/etc/squid/blacklist/domain-blacklist.txt”
acl ipblacklist dst “/etc/squid/blacklist/ip-blacklist.txt”acl tdkbebasdownload time 08:00-13:00# AKSES KONTROL
# ——————————————————————
acl all src 0.0.0.0/0.0.0.0
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
# ————————————-
# Daftar IP address
# ————————————-
acl lab1 src 192.168.254.1-192.168.254.40/255.255.255.255
acl staf-it src 192.168.254.41-192.168.254.42/255.255.255.255
acl lab2 src 192.168.254.43-192.168.254.44/255.255.255.255
acl ruang1 src 192.168.1.1-192.168.1.8/255.255.255.255
acl ruang2 src 192.168.1.11-192.168.1.17/255.255.255.255# ————————————-
# Memblok situs terlarang secara manual
# ————————————-
http_access allow noblacklist
http_access deny katablacklist
http_access deny domainblacklist
http_access deny ipblacklisthttp_access allow manager localhost
http_access deny manager
# ————————————-
# Rule yang saya terapkan
# ————————————-
http_access allow lab1
http_access allow staf-it
http_access allow lab2
http_access allow ruang1
http_access allow ruang2acl magic_words2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .tar.bz2 .bz2 .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .raw .wav .iso# Cancel download if file is bigger than 2 MB = 2000×1024 byte = 2048000 byte
reply_body_max_size 2048000 allow magic_words2 tdkbebasdownloadhttp_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow all# PARAMETER ADMINISTRATOR
# —————————————————————–
cache_mgr ollza.techno@gmail.com
cache_effective_user squid
cache_effective_group squid
visible_hostname proxy.ollza.local# PESAN ERROR DALAM BAHASA INDONESIA
# ——————————————————————–
error_directory /usr/share/squid/errors/Indonesian
# mkdir /etc/squid/blacklist
# cd /etc/squid/blacklist/
# vim no-blacklist.txt
# vim kata-blacklist.txt
# vim domain-blacklist.txt
# vim ip-blacklist.txtUntuk melakukannya, tinggal copykan saja pesan Error dalam bahasa Inggris ke direktori lokasi pesan error berbahasa Indonesia.
# cp /usr/share/squid/errors/English /usr/share/squid/errors/Indonesian
# /sbin/service squid start
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3128 -j ACCEPTnet.ipv4.ip_forward = 0 menjadi net.ipv4.ip_forward = 1
sumber http://fxekobudi.net/linux/proxy-server-linux-dengan-squid/

















