15 Mei 2008

Proxy Server dengan RedHat Enterprise AS4

Ini berawal dari kekacauan yang aku buat dengan proxy server yang ada dikantorku. Aku dengan sukses menghancurkannya (hehehehehe......:D). Karena sudah menghancurkannya aku harus bisa membuatnya lagi padahal aku gak ngerti dengan yang namanya linux, Blank sama sekali. Akhirnya aku mulai mengumpulkan data-data dari sana sini, tanya sana sini dan mulai untuk membuatnya lagi.

Pertama aku install RedHat Enterprise AS4 ke server dengan settingan yang aku anggap paling bener, hehehehehehee... karena masih blom pernah untuk menginstallnya. trus aku mulai mengedit squid.conf yg berada di /etc/squid/squid.conf begini editan yang aku lakukan:

visible_hostname nama_proxy

http_port 3128

cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_dir ufs /cache 20000 94 256
pid_filename /var/run/squid.pid
client_netmask 255.255.252.0
unlinkd_program /usr/lib/squid/unlinkd
logfile_rotate 10

hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

acl domainterlarang dstdomain "/etc/squid/domainx.txt" #untuk memblok domain tertentu
acl kataterlarang url_regex -i "/etc/squid/katax.txt" #untuk memblok kata tertentu
acl ipterlarang dst "/etc/squid/ipx.txt" #untuk memblok IP tertentu
acl noaccess dstdomain "/etc/squid/noaccess.dat" #untuk subdomain tertentu

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 network src 192.168.8.0/255.255.252.0
acl SSL_ports port 443 563
acl Safe_ports port 80 21 443 563 70 210 1024-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl Safe_ports port 8443
acl Safe_ports port 1863
acl Safe_ports port 3389
acl Safe_ports port 4660
acl Safe_ports port 1533
acl CONNECT method CONNECT

acl tdkbbsdownload1 time 08:00-12:00 #jam tidak bisa download1
acl tdkbbsdownload2 time 13:30-17:00 #jam tidak bisa download2

acl network1 src 10.117.2.0/255.255.255.0
acl user1 src 10.117.2.57/255.255.255.0
acl user2 src 10.117.2.56/255.255.255.0

http_access deny noaccess
http_access deny domainterlarang
http_access deny kataterlarang
http_access deny ipterlarang
http_access allow user1 user2
http_access deny network1
http_access allow manager localhost network
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports


reply_body_max_size 1024000 allow tdkbbsdownload1 tdkbbsdownload2 #membatasi besar file download dan jam nya
http_reply_access allow all


cache_mgr email@administrator.com
cache_effective_user squid
cache_effective_group squid

dan setelah itu kita buat file-file tambahannya:
1. File domainx.txt: ketik vi /etc/squid/domainx.txt lalu isi domain domain yang mau diblok. cth: www.domain.com
2. File katax.txt: ketik vi /etc/squid/katax.txt lalu isi dengan kata yang mau diblok. cth: sex
3. File ipx.txt: ketik vi /etc/squid/katax.txt lalu isi dengan IP yang mau diblok. cth: 192.168.11.11
4. File noaccess.dat: ketik vi /etc/squid/noaccess.dat lalu isi dengan domain yang mau di blok. cth: .warez.com

trus dengan jalan kan squidnya dengan command : service squid start

1 komentar: