Buat squid proxy server pada fedora core 13  ncuptea blog

Buat squid proxy server pada fedora core 13

Karena belakang ini saya mempunyai sistem operasi fedora core 13 pada komputer akhirnya saya coba iseng dengan mengaplikasikan squid proxy server. Pada dasarnya seting dan konfigurasi squid ini sudah pernah di bahas pada artikel sebelumnya namun pada ubuntu lucid, langkahnya pun hampir sama hanya ada sedikit penyesuaian dan sedikit berbedaa isi dari file squid.conf yang kebetulan pada saat install squid ini pada squid versi 3.1.10-1.

Sebelumnya file squid.conf versi 2.7 pada ubuntu di artikel terdahulu begitu panjang lengkap bersama deskripsi dari tiap tag-nya namun tidak jika pada squid versi 3.1 di fedora core 13 ini sangat simple dan ringkas isi dari squid.conf nya, berikut ialah isi default dari squid 3.1


#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# 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

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

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

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

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320


Bagaimana ringkas bukan jika dibandingan dengan squid versi 2.7 pada ubuntu biasanya? nah sekarang kita bahas aja langsung dari mulai install dan konfigurasi squid 3.1 pada fedora core 13 ini.

  • lakukan pengecekan apakah squid sudah terinstall atau belum dengan perintah rpm -qa|grep squid jika sudah ada maka akan terlihat pada output cli-nya sebagi berikut
[root@ncuptea ncuptea]# rpm -qa|grep squid
squid-3.1.10-1.fc13.i686
[root@ncuptea ncuptea]#
  • Jika belum ada silahkan install dengan perintah; yum install squid
  • Stop service squid : /etc/init.d squid stop
  • Edit file squid.conf pada direktory /etc/squid.conf dan tambahkan rule,access list, delay_pools dan lainnya seperti tulisan yang di warnai merah di bawah ini
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl bonanza src 192.168.1.0/24
acl multymedia url_regex -i \.mp3$ \.mp4$ \.avi$ \.rar$ \.mpeg$ \.3gp$ \.flv$ \.pdf$ \.exe$

# 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

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

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS


# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost
http_access allow bonanza

# And finally deny all other access to this proxy

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 5000 19 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

cache_mgr ncupz@hotmail.com

# TAG: delay_class
#Default:
delay_pools 1
delay_class 1 1

# TAG: delay_access
#Default:
delay_access 1 allow multymedia
delay_access 1 deny all

# TAG: delay_parameters
#Default:
delay_parameters 1 10000/32000

# TAG: delay_initial_bucket_level (percent, 0-100)
#Default:
delay_initial_bucket_level 50

  • Jika sudah Save dan keluar dari editor teks nano
  • Ketikan squid -z
  • Selesai tahapan install dan konfigurasi squid di fedora core 13.
  • Lakukan ublock port squid di firewal, masuk System/Administration/Firewall.
  • Pada kotak katalog firewall yang muncul pilih Other Ports pada tab kiri lalu klik Add dan Pilih port 3128, Protocol tcp, dan Service Squid
  • Klik Apply lalu tutup kotak dialog Firewall
  • Lakukan reload service squid; /etc/init.d/squid reload
  • lakukan restart service squid; /etc/init.d/squid restart
  • Selesai intallasi dan konfigurasi pembuatan proxy server serta bandwidth management dengan delay_pools squid pada fedora core 13, untuk tes silahkan masukan ip fedora dan port 3128 pada browser klien

1 comment:

  1. My programmer is trying to convince me to move to .net
    from PHP. I have always disliked the idea because of the expenses.
    But he's tryiong none the less. I've been using WordPress on numerous websites for about a year and am worried about switching to another platform.
    I have heard good things about blogengine.net. Is there a way I can transfer all
    my wordpress posts into it? Any help would be greatly appreciated!


    Also visit my web blog - How To Build Any Versus Form Body ?

    ReplyDelete

Berkomentarlah dengan bijak untuk pengembangan dan sekaligus menjadi pembelajaran kita bersama.

Pilih Name/Url untuk mempermudah memasukan id anda!