Squid Proxy Server Di Fedora

Pada artikel sebelumnya telah dibahas tentang fedora sebagai gateway router.untuk kali ini saya akan coba instalasi Squid Proxy Server di Fedora.

1.Dowload dulu squid terbaru di sini

2.Biasanya di fedora sudah ada Squid bawaan yang sudah terinstall jadi hapus dulu squid bawaannya dengan perintah

# rpm –e squid

3.Install squid yang sudah anda download tadi dengan perintah

# rpm –ivh squid-2.5.STABLE13-1.FC4.i386.rpm

4.File config terletak pada /etc/squid/squid.conf  backup file asli dengan cara

# mv /etc/squid/squid.conf /etc/squid/squid.conf.backup

5.Kemudian edit squid.conf

# vi /etc/squid/squid.conf

6.Copy paste script untuk squid.conf dibawah ini :
http_port 3121
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
visible_hostname adeblink.wordpress.com
cache_mgr adeblink.idebuntu.net
hierarchy_stoplist cgi-bin ? localhost adeblink.wordpress.com
acl QUERY urlpath_regex cgi-bin \? localhost adeblink.wordpress.com
no_cache deny QUERY
cache_mem 4 MB
cache_swap_low 90
cache_swap_high 98
maximum_object_size 16 MB
maximum_object_size_in_memory 8 KB
ipcache_size 750
ipcache_low 90
ipcache_high 98
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
refresh_pattern ^ftp: 10080 95% 241920 reload-into-ims override-lastmod
refresh_pattern . 180 95% 120960 reload-into-ims override-lastmod
shutdown_lifetime 10 seconds
memory_pools off
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
cache_dir ufs /var/spool/squid 7500 16 256
pid_filename /var/run/squid.pid
mime_table /etc/squid/mime.conf
#logfile_rotate 500
cache_effective_user squid
cache_effective_group squid
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 SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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
acl user src 192.168.30.0/24
http_access deny CONNECT !SSL_ports
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access allow user
http_access deny all
http_reply_access allow all
icp_access allow all
reload_into_ims on
pipeline_prefetch on
ie_refresh on
vary_ignore_expire on
quick_abort_min 0
quick_abort_max 0
quick_abort_pct 98

Save Konfigurasi tersebut Ctrl+S

7.Kemudian membuat file log squid

# mkdir /var/log/squid

# vi access.log
# vi cache.log
# vi store.log
# touch access.log cache.log store.log

8.rubah kepemilikannya

# chown –R squid.squid access.log cache.log store.log

9.Buat direktori spool squid

# mkdir /var/spool/squid
# chown –R squid.squid /var/spool/squid

10.Membuat direktori cache

# squid -z

11.Sebelum menjalankan squid terlebih dahulu kita harus me-nat agar user yang akan browsing request ke squid terlebih dahulu

sebelum langsung ke internet. Yaitu dengan menambahkan iptables redirect nya

# vi /etc/sysconfig/iptables

Tambahkan baris berikut diatas COMMIT

-A PREROUTING –s 192.168.30.0/24 –p tcp –dport 80 –j REDIRECT –to-port 3121

(perhatikan huruf besar dan kecil)

12.Jalankan squid nya

# /etc/init.d/squid start

Untuk melihat apakah squid sudah berfungsi,dapat dilihat debgab perintah

# tail –f /var/log/squid/access.log

Selamat mencoba….good luck

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: