Home Computer Install server FreeBSD dg ZFS File System Part6 : “Jesred Redirector”
formats

Install server FreeBSD dg ZFS File System Part6 : “Jesred Redirector”

Jesred adalah redirector yang sangat cepat untuk squid. Oprekan dari program Squirm buatan Chris Foote’s and Wayne Piekarski’s dan ditambahkan beberapa code dari squid itu sendiri, diklaim 2-3x lebih  cepat  dari versi originalnya dan ditambahkan beberapa fitur tambahan.

Kegunaan jesred diwarnet biasanya saya gunakan untuk mengarahkan pesan pages blocked dari opendns ke situs google sehingga filtering jadi lebih smooth.
Atau mengarahkan user dari situs-situs berbahaya ke situs yang baik dan benar  he..he..
Selain itu redirector bisa diakalin untuk mengarahkan user ke program referall kita ;)
Kalo dulu saya pernah bahas tentang instalasi jesred  di ubuntu, sekarang kita akan menerapkan jesred di freebsd.

Langkah-langkah instalasi :

  •  Pindah ke direktori ports jesred :

#cd /usr/ports/www/jesred

#make install clean

#rehash

  • Masuk ke directori konfigurasi jesred :

#cd /usr/local/etc/jesred

seharusnya disini ada file jesred.conf, redirect.acl, redirect.rules  jika belum ada copy dari file samplenya :

# cp jesred.conf.sample  jesred.conf

#cp redirect.acl.sample redirect.acl

#cp redirect.rules.sample redirect.rules

  • edit jesred.conf, kira2 seperti ini :
# file with IP addresses, for which URL rewriting is [not] allowed
allow = /usr/local/etc/jesred/redirect.acl

# file with rules for URL rewriting
rules = /usr/local/etc/jesred/redirect.rules

# log file for general, error and debug messages (empty value or commenting
# this out disables logging)
redirect_log = usr/local/etc/jesred/redirect.log

# log file for URL rewrites (empty value or commenting this out disables
# logging of URL rewrites)
# Log file format: Timestamp Client/Ident URL RURL NO
rewrite_log = /usr/local/etc/jesred/rewrite.log

# Debug mode: if set to yes and DEBUG option was compiled in, this enables
# debug logging to redirect_log
#debug = true

# Allow ICP_QUERY request to be rewritten, if a rule applies
#siblings = true

 

 

  • edit file redirect.acl  kira-kira seperti ini ingat sesuaikan dengan network anda:
# Example: IP access pattern file

# the following CDIR notation is allowed ONLY:
# a.b.c.d/m	with a, b, c, d ... {0..255} and	m ... {0..32}
# and is referred as IP access pattern.
#
# you can prefix any IP access pattern with a '!`, which explicitly says,
# "Do not rewrite the passed URL from this client"

#############################################################################
# Since jesred uses a linear list of ip access patterns, the order of the   #
# ip access patterns in this file is important!!!                           #
#############################################################################

# jesred uses a linear IP Access pattern list. As long as no match is found,
# it compares the clients IP address with the next pattern, listed below.
# If the end of the list is reached and no match was found, jesred echo's
# back a "\n", which indicates no URL replacement to squid.
# If the client IP address matches an entry below, rewrite rules
# are applied immediately (i.e. no further checks for other IP access
# pattern matches will be done).
#

# These are my children caches which have their own redirectors running
!141.44.251.15/32
!149.203.102.1/32
# rewrite all URLs from
192.168.0.0/24
  • edit file redirect.rules,

disinilah kita konfigurasi situs-situs yang akan dialihkan

tambahkan opsi pengalihan situs dg format :

regexi  ^http://situsasli.com    http://situsalih.com    

dimana maksudnya setiap permintaan dg awalan http://situsasli.com akan dialihkan  ke http://situsalih.com

tentunya masih banyak variasi regex yang bisa diaplikasikan disini untuk bermacam-macam kasus dan kebutuhan.

Anda bisa beracuan pada sample-sample yang ada di files jesred.rules tersebut

terakhir tambahkan baris berikut di file squid.conf :

#Redirector
redirect_program /usr/local/libexec/jesred

 

terakhir tinggal restart service squid  atau kalo bingung restart servernya sekalian :)

 

 

 

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

All original content on these pages is fingerprinted and certified by Digiprove