Rabu, 24 Juli 2013
Cara mudah install proxy videocache pada Ubuntu with htproxy
Jumat, 08 Juni 2012
Squid. Youtube an error occured. Please try again later.
$|=1;
while (<>) {
@X = split;
# $X[1] =~ s/&sig=.*//;
$x = $X[0] . " ";
$_ = $X[1];
$u = $X[1];
if ($X[1] =~ /(youtube|google).*videoplayback\?/){
@itag = m/[&?](itag=[0-9]*)/;
@id = m/[&?](id=[^\&]*)/;
@range = m/[&?](range=[^\&\s]*)/;
@begin = m/[&?](begin=[^\&\s]*)/;
@redirect = m/[&?](redirect_counter=[^\&]*)/;
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/@itag&@id&@range@begin@redirect\n";
#speedtest
}elsif (m/^http:\/\/(.*)\/speedtest\/(.*\.(jpg|txt))\?(.*)/) {
print $x . "http://www.speedtest.net.SQUIDINTERNAL/speedtest/" . $2 . "\n";
#mediafire
}elsif (m/^http:\/\/199\.91\.15\d\.\d*\/\w{12}\/(\w*)\/(.*)/) {
print $x . "http://www.mediafire.com.SQUIDINTERNAL/" . $1 ."/" . $2 . "\n";
#fileserve
}elsif (m/^http:\/\/fs\w*\.fileserve\.com\/file\/(\w*)\/[\w-]*\.\/(.*)/) {
print $x . "http://www.fileserve.com.SQUIDINTERNAL/" . $1 . "./" . $2 . "\n";
#filesonic
}elsif (m/^http:\/\/s[0-9]*\.filesonic\.com\/download\/([0-9]*)\/(.*)/) {
print $x . "http://www.filesonic.com.SQUIDINTERNAL/" . $1 . "\n";
#4shared
}elsif (m/^http:\/\/[a-zA-Z]{2}\d*\.4shared\.com(:8080|)\/download\/(.*)\/(.*\..*)\?.*/) {
print $x . "http://www.4shared.com.SQUIDINTERNAL/download/$2\/$3\n";
#4shared preview
}elsif (m/^http:\/\/[a-zA-Z]{2}\d*\.4shared\.com(:8080|)\/img\/(\d*)\/\w*\/dlink__2Fdownload_2F(\w*)_3Ftsid_3D[\w-]*\/preview\.mp3\?sId=\w*/) {
print $x . "http://www.4shared.com.SQUIDINTERNAL/$2\n";
#photos-X.ak.fbcdn.net where X a-z
}elsif (m/^http:\/\/photos-[a-z](\.ak\.fbcdn\.net)(\/.*\/)(.*\.jpg)/) {
print $x . "http://photos" . $1 . "/" . $2 . $3 . "\n";
#YX.sphotos.ak.fbcdn.net where X 1-9, Y a-z
} elsif (m/^http:\/\/[a-z][0-9]\.sphotos\.ak\.fbcdn\.net\/(.*)\/(.*)/) {
print $x . "http://photos.ak.fbcdn.net/" . $1 ."/". $2 . "\n";
#maps.google.com
} elsif (m/^http:\/\/(cbk|mt|khm|mlt|tbn)[0-9]?(.google\.co(m|\.uk|\.id).*)/) {
print $x . "http://" . $1 . $2 . "\n";
# compatibility for old cached get_video?video_id
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?(videoplayback\?id=.*?|video_id=.*?)\&(.*?)/) {
$z = $2; $z =~ s/video_id=/get_video?video_id=/;
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $z . "\n";
} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
print $x . "http://www.google-analytics.com/__utm.gif\n";
#Cache High Latency Ads
} elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
$y = $3;$z = $2;
for ($y) {
s/pixel;.*/pixel/;
s/activity;.*/activity/;
s/(imgad[^&]*).*/\1/;
s/;ord=[?0-9]*//;
s/;×tamp=[0-9]*//;
s/[&?]correlator=[0-9]*//;
s/&cookie=[^&]*//;
s/&ga_hid=[^&]*//;
s/&ga_vid=[^&]*//;
s/&ga_sid=[^&]*//;
# s/&prev_slotnames=[^&]*//
# s/&u_his=[^&]*//;
s/&dt=[^&]*//;
s/&dtd=[^&]*//;
s/&lmt=[^&]*//;
s/(&alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/(&url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/(&ref=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/(&cookie=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/[;&?]ord=[?0-9]*//;
s/[;&]mpvid=[^&;]*//;
s/&xpc=[^&]*//;
# yieldmanager
s/\?clickTag=[^&]*//;
s/&u=[^&]*//;
s/&slotname=[^&]*//;
s/&page_slots=[^&]*//;
}
print $x . "http://" . $1 . $2 . $y . "\n";
#cache high latency ads
} elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
print $x . "http://" . $1 . "/" . $2 . "\n";
# spicific servers starts here....
} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
print $x . "http://" . $1 . "\n";
#cdn, varialble 1st path
} elsif (($u =~ /filehippo/) && (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
@y = ($1,$2,$4,$5);
$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";
#rapidshare
} elsif (($u =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
print $x . "http://cdn." . $3 . "/SQUIDINTERNAL/" . $5 . "\n";
} elsif (($u =~ /maxporn/) && (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
print $x . "http://" . $1 . "/SQUIDINTERNAL/" . $3 . "\n";
#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($u =~ /tube8|pornhub|xvideos/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?(\.[a-z]*)?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
print $x . "http://cdn." . $4 . $6 . "\n";
#...spicific servers end here.
#photos-X.ak.fbcdn.net where X a-z
} elsif (m/^http:\/\/photos-[a-z].ak.fbcdn.net\/(.*)/) {
print $x . "http://photos.ak.fbcdn.net/" . $1 . "\n";
#for yimg.com video
} elsif (m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
print $x . "http://cdn.yimg.com//" . $3 . "\n";
#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
print $x . "http://cdn.yimg.com/" . $3 . "\n";
#for yimg.com with &sig=
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*)/) {
@y = ($1,$2);
$y[0] =~ s/[a-z]+[0-9]+/cdn/;
$y[1] =~ s/&sig=.*//;
print $x . "http://" . $y[0] . ".yimg.com/" . $y[1] . "\n";
#youjizz. We use only domain and filename
} elsif (($u =~ /media[0-9]{2,5}\.youjizz/) && (m/^http:\/\/(.*)(\.[^\.\-]*?\..*?)\/(.*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})((\?|\%).*)?$/)) {
@y = ($1,$2,$4,$5);
$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|(.*cdn.*)|(.*cache.*))/cdn/;
print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";
#general purpose for cdn servers. add above your specific servers.
} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
print $x . "http://squid-cdn-url//" . $2 . "." . $3 . "\n";
#generic http://variable.domain.com/path/filename."ex" "ext" or "exte" with or withour "? or %"
} elsif (m/^http:\/\/(.*)(\.[^\.\-]*?\..*?)\/(.*)\.([^\/\?\&]{2,4})((\?|\%).*)?$/) {
@y = ($1,$2,$3,$4);
$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|(.*cdn.*)|(.*cache.*))/cdn/;
print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";
# generic http://variable.domain.com/...
} elsif (m/^http:\/\/(([A-Za-z]+[0-9-]+)*?|.*cdn.*|.*cache.*)\.(.*?)\.(.*?)\/(.*)$/) {
print $x . "http://cdn." . $3 . "." . $4 . "/" . $5 . "\n";
# spicific extention that ends with ?
} elsif (m/^http:\/\/(.*?)\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|rar|cab|amf|swf)(.*)/) {
print $x . "http://" . $1 . "/" . $2 . "." . $3 . "\n";
# all that ends with ;
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
print $x . "http://" . $1 . "/" . $2 . "\n";
} else {
print $x . $_ . "sucks\n";
}
}
Jangan lupa merubah settingan berikut ini di squid.conf anda:storeurl_rewrite_children 15
storeurl_rewrite_concurrency 100
Sumber
Selasa, 22 November 2011
Tutorial Instalasi Squid Lusca pada Ubuntu 11.04 Server
- Ubuntu 11.04
- Ip proxy 192.168.3.1
- Gatewai 192.168.3.254
- Ip mikrotik ke arah proxy 192.168.3.254/24
- Ram 1 GB
- HDD Sata 250 GB
2. Install Paket
# sudo apt-get update
# sudo apt-get install squid
# sudo apt-get install squid squidclient squid-cgi
# sudo apt-get install gcc
# sudo apt-get install build-essential
grep -E "#define\W+__FD_SETSIZE" /usr/include/*.h /usr/include/*/*.h
# nano /usr/include/linux/posix_types.h
#define __FD_SETSIZE 65536
# nano /usr/include/bits/typesizes.h
#define __FD_SETSIZE 65536
# nano /etc/pam.d/login
Session required /lib/security/pam_limits.so
# sudo apt-get install build-essential
# sudo apt-get install sharutils
# sudo apt-get install ccze
# sudo apt-get install libzip-dev
# sudo apt-get install automake1.9
3.Download Lusca
download lusca lewat terminal ubuntu dengan perintah :
wget http://untuk-kita-semua.googlecode.com/files/LUSCA_FMI.tar.gz
lalu ekstrak dan masuk ke foldernya :
# tar xzvf LUSCA_FMI.tar.gz
# cd LUSCA_FMI/
CATATAN : jika memakai ubuntu 64bit lakukan perintah ini #---------> make distclean
cek procesor
# cat /proc/cpuinfo
di web : http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD
amd athlon II x2 240:
CHOST="x86_64-pc-linux-gnu" \
CFLAGS="-march=amdfam10 -O2 -pipe" \
CXXFLAGS="${CFLAGS}" \
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid \
--localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-http-gzip --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs \
--enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp \
--enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files \
--enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536
CHOST="x86_64-pc-linux-gnu" \
CFLAGS="-march=k8 -O2 -pipe" \
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid \
--localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs \
--enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp \
--enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files \
--enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536
ok..!! sekarang dimulai tahap compile nya :
CHOST="x86_64
-pc-linux-gnu" \lish --enable-default-err-language=English --with-maxfd=65536
CFLAGS="-march=k8 -O2 -pipe" \
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid \
--localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-http-gzip --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs \
--enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp \
--enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files \
--enable-err-languages=Eng
selanjutnya, ketik perintah berikut di terminal ubuntu:
# make
# sudo make install
Quote:
Edit squid.conf
agar perintah sudo /etc/init.d/squid stop jalan di ubuntu 10.10
#copy file squid yg ada di folder tunning ke /etc/init.d/
jgn lupa di :
#sudo chmod +x /etc/init.d/squid
stop dulu squidnya :
#sudo /etc/init.d/squid stop
#paste file squid.conf dan storeur.pl yg di download tadi kedalam folder /etc/squid
4. Langkah selanjutnya
Code:
# Memberikan permission pada folder cache
mkdir /var/log/squid
touch /var/log/squid/access.log
touch /var/log/squid/cache.log
chmod 755 -Rf /cache1/ /cache2/ /cache3/
chmod 755 -Rf /var/log/squid
chown -Rf proxy:proxy /cache1/ /cache2/ /cache3/
chown -Rf proxy:proxy /var/log/squid
chown -Rf proxy:proxy /var/log/squid/access.log
chown -Rf proxy:proxy /var/log/squid/cache.log
chown proxy:proxy /cache1
chown proxy:proxy /cache2
chown proxy:proxy /cache3
chmod 777 /cache1
chmod 777 /cache2
chmod 777 /cache3
chown proxy:proxy /etc/squid/storeurl.pl
chmod 777 /etc/squid/storeurl.pl
# Membuat folder-folder swap/cache di dalam folder cache yang telah ditentukan dengan perintah :
squid -f /etc/squid/squid.conf -z
# Restart squid
sudo /etc/init.d/squid restart
Reboot CPU nya...
Jumat, 04 November 2011
Video Tutorial Lusca Squid
Jumat, 29 Juli 2011
Install Ubuntu Server 10.10 dan Squid (Proxy) + Mikrotik

Install Ubuntu:
Spek:
- Proc Pentium IV atau Pentium D
- RAM 1 GB.
- HDD 250 GB
- Lan Card.
Install Squid:
Kalau sudah selesai Instalnya mari kita mulai buat instal paket-paket yang dibutuhkan buat proxynya.
Setelah selesai instal Hubungkan Kabel CROSS Dari Pc Ubuntu ke Mikrotik.
setelah itu Buka winbox untuk remote mikrotik, coba Ping IP Ubuntu dari new terminal yang ada di winbox.
lihat dan perhatikan apakah sudah reply atau belum. kalau belum coba diteliti lagi mungkin ada yang belum bener. kalau sudah reply kita lanjutkan.
langkah Berikutnya kita akan menginstal paket yang dibutuhkan, sebelumnya anda download Putty dan Winscp untuk remote ubuntu servernya disini http://www.mediafire.com/?qi7v7r1792d0dc1
kalau sudah anda remote ubuntu lewat Putty dengan mengetikan IP address Pc Ubuntunya (192.168.3.2 ). kalau muncul pesan warning pilih aja Yes.
setelah muncul jendela terminal di Putty login seperti anda login di Ubuntu sebagai #root.
kemudian anda instal paket yang di butuhkan dengan mengetik perintah di bawah ini :
root@proxyku:~# sudo apt-get update
root@proxyku:~# sudo apt-get install squid squidclient squid-cgi
root@proxyku:~# sudo apt-get install gcc
root@proxyku:~# sudo apt-get install build-essential
root@proxyku:~# sudo apt-get install sharutils
root@proxyku:~# sudo apt-get install ccze
root@proxyku:~# sudo apt-get install libzip-dev
root@proxyku:~# sudo apt-get install automake1.9
kalau sudah selesai anda download squid 2.7STABLE9 dengan mengetikan perintah di terminal ubuntu melalui putty :
root@proxyku:~# wget h**p://tempat-sampah.googlecode.com/files/squid-2.7.STABLE9%2Bpatch.tar.gz (**=Ganti tt )
kalau sudah selesai kita extrak filenya dengan perintah :
root@proxyku:~# tar xvf squid-2.7.STABLE9+patch.tar.gz
root@proxyku:~# cd squid-2.7.STABLE9
setelah itu anda lanjutkan dengan kompil file tersebut dengan perintah di bawah ini :
Spoiler for Kompillernyaspoiler:
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid \
--localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs \
--enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp \
--enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files \
--enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536
Kalau anda bingung anda copas aja tiap barisnya terus anda paste di Puttynya dengan klik kanan aja terus anda ENTER.
setelah itu anda lanjutkan dengan perintah :
root@proxyku:~#make
root@proxyku:~#sudo make install
setelah selesai anda STOP squidnya. tapi sebelum anda stop squidnya anda ganti dulu isi yang ada di /etc/init.d/squid dengan perintah :
root@proxyku:~#sudo nano /etc/init.d/squid
kemudian anda hapus semua isinya dan anda ganti dengan ini:
Spoiler for isi /etc/init.d/squid spoiler:
#! /bin/sh
#
# squid Startup script for the SQUID HTTP proxy-cache.
#
# Version: @(#)squid.rc 2.20 01-Oct-2001 miquels@cistron.nl
#
### BEGIN INIT INFO
# Provides: squid
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Squid HTTP Proxy
### END INIT INFO
NAME=squid
DAEMON=/usr/sbin/squid
LIB=/usr/lib/squid
PIDFILE=/var/run/$NAME.pid
SQUID_ARGS="-D -YC"
[ ! -f /etc/default/squid ] || . /etc/default/squid
. /lib/lsb/init-functions
PATH=/bin:/usr/bin:/sbin:/usr/sbin
[ -x $DAEMON ] || exit 0
grepconf () {
w=" " # space tab
sq=/etc/squid/squid.conf
# sed is cool.
res=`sed -ne '
s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
t end;
d;
:end q' < $sq`
[ -n "$res" ] || res=$2
echo "$res"
}
grepconf2 () {
w=" " # space tab
sq=/etc/squid/$NAME.conf
# sed is cool.
res=`sed -ne '
s/^'$1'['"$w"']\+[^'"$w"']\+['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
t end;
d;
:end q' < $sq`
[ -n "$res" ] || res=$2
echo "$res"
}
#
# Try to increase the # of filedescriptors we can open.
#
maxfds () {
[ -n "$SQUID_MAXFD" ] || return
[ -f /proc/sys/fs/file-max ] || return 0
global_file_max=`cat /proc/sys/fs/file-max`
minimal_file_max=$(($SQUID_MAXFD + 4096))
if [ "$global_file_max" -lt $minimal_file_max ]
then
echo $minimal_file_max > /proc/sys/fs/file-max
fi
ulimit -n $SQUID_MAXFD
}
start () {
cdr=`grepconf2 cache_dir /var/spool/$NAME`
ctp=`grepconf cache_dir ufs`
case "$cdr" in
[0-9]*)
log_failure_msg "squid: squid.conf contains 2.2.5 syntax - not starting!"
log_end_msg 1
exit 1
;;
esac
#
# Create spool dirs if they don't exist.
#
if [ -d "$cdr" -a ! -d "$cdr/00" ] || [ "$ctp" = "coss" -a ! -w "$cdr" ]
then
log_warning_msg "Creating squid cache structure"
$DAEMON $SQUID_ARGS -z
fi
if [ "$CHUID" = "" ]; then
CHUID=root
fi
#maxfds
ulimit -n 8192
umask 027
start-stop-daemon --quiet --start \
--pidfile $PIDFILE \
--chuid $CHUID \
--exec $DAEMON -- $SQUID_ARGS < /dev/null
return $?
}
stop () {
PID=`cat $PIDFILE 2>/dev/null`
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name squid
#
# Now we have to wait until squid has _really_ stopped.
#
sleep 2
if test -n "$PID" && kill -0 $PID 2>/dev/null
then
log_action_begin_msg " Waiting"
cnt=0
while kill -0 $PID 2>/dev/null
do
cnt=`expr $cnt + 1`
if [ $cnt -gt 24 ]
then
log_action_end_msg 1
return 1
fi
sleep 5
log_action_cont_msg ""
done
log_action_end_msg 0
return 0
else
return 0
fi
}
case "$1" in
start)
log_daemon_msg "Starting Squid HTTP proxy" "squid"
if start ; then
log_end_msg $?
else
log_end_msg $?
fi
;;
stop)
log_daemon_msg "Stopping Squid HTTP proxy" "squid"
if stop ; then
log_end_msg $?
else
log_end_msg $?
fi
;;
reload|force-reload)
log_action_msg "Reloading Squid configuration files"
$DAEMON -k reconfigure
log_action_end_msg 0
;;
restart)
log_daemon_msg "Restarting Squid HTTP proxy" "squid"
stop
if start ; then
log_end_msg $?
else
log_end_msg $?
fi
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON" squid && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}"
exit 3
;;
esac
exit 0
kalau sudah anda tekan ctrl+x terus anda ketik y terus enter untuk menyimpan hasil perubahan isi di /etc/init.d/squid. terus anda ketik perintah lagi :
root@proxyku:~# sudo chmod +x /etc/init.d/squid
kalau sudah kita bisa stop squidnya dengan perintah:
root@proxyku:~# sudo /etc/init.d/squid stop
kalau sudah anda download dulu squid.conf di sini http://www.mediafire.com/?absca142b42qkdp
terus anda pastekan isinya ke ubuntu lewat WinSCP.
Bagi yang bingung remote dengan winscp, isi Hostname dengan IP addressnya ubuntu (192.168.3.2 ) Username : root password : proxyku .
terus anda tinggal drag and drop file yang ada di cpu anda ke cpu ubuntu.
kalua sudah anda lanjutkan dengan Memberikan permission pada folder cache dengan perintah :
root@proxyku:~#chown proxy : proxy /cache
root@proxyku:~#chmod 777 /cache
root@proxyku:~#chown proxy : proxy /etc/squid/storeurl.pl
root@proxyku:~#chmod 777 /etc/squid/storeurl.pl
kalau sudah selesai lanjuutkan dengan membuat folder-folder swap/cache di dalam folder cache yang telah ditentukan dengan perintah :
root@proxyku:~#squid -f /etc/squid/squid.conf -z
lalu anda restart squidnya dengan perintah :
root@proxyku:~#/etc/init.d/squid restart
kalau sudah selesai anda setting mikrotiknya seperti dibawah ini :
Setting Tambahan pada Mikrotik:
Masukkan ini di mangle :
IP FIREWALL ADDRESS-LIST :
0 ;;; LocalNet
LocalNet 192.168.2.0/24 — IP local sesuaikan dengan IP lokal anda
1 ;;; PROXY
ProxyNet 192.168.3.0/24 – IP network Proxy
2 DNS 202.134.1.10 -- sesuaikan DNS ISP anda
3 DNS 202.134.0.155 -- sesuaikan DNS ISP anda
4 GAMES 63.251.101.0/25
5 GAMES 74.114.8.0/21
IP FIREWALL NAT :
0;;;; Nat Proxy
chain=dstnat action=dst-nat to-addresses=192.168.3.2 to-ports=3128 protocol=tcp src-address=!192.168.3.2
src-address-list=LocalNet dst-address-list=!ProxyNet dst-port=80,8080,3128
connection-mark=http-conn
1 ;;; Added by webbox
chain=srcnat action=masquerade out-interface=ether1-gateway
2 ;;; Proxy Out
chain=srcnat action=src-nat to-addresses=IP INTERNET ANDA/IP PUBLIC misalnya 192.168.1.2
src-address=IP LOKAL ANDA misalnya 192.168.2.1
4 chain=dstnat action=dst-nat to-ports=53 protocol=udp dst-port=53
5 ;;; SSH
chain=dstnat action=dst-nat to-addresses=192.168.3.2 to-ports=22
protocol=tcp dst-address=IP INTERNET ANDA/IP PUBLIC dst-port=22,10000