Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt-get install unzip apache2 php5
- cd /var/www
- wget http://c.speedtest.net/mini/mini.zip
- unzip mini.zip
- # script untuk Rewriter.pl
- #!/usr/bin/perl
- $|=1;
- while (<>) {
- chomp;
- @X = split;
- $url = $X[1];
- if ($url =~ /^http\:\/\/.*\/(speedtest\/.*)/) {
- print $X[0] . " http://IP.PROXY.ANDA/" . $1 . "\n";
- } else {
- print $X[0]." \n";
- }
- }
- #permission
- chown proxy:proxy /etc/squid/rewriter.pl && chmod 777 /etc/squid/rewriter.pl
- # tambahan di squid.conf
- acl RW url_regex \/speedtest\/.*\.(jpg|txt|php).*
- url_rewrite_access allow RW
- url_rewrite_program /etc/squid/rewriter.pl
- url_rewrite_children 7
- url_rewrite_concurrency 10
- redirector_bypass on
- # Pastekan di mikrotik taruh paling atas di mangle
- /ip firewall layer7-protocol
- add name="btest down" regexp="\\/speedtest\\/random.*\\.(jpg|txt|php).*"
- add name="btest up" regexp="\\/speedtest\\/upload.*\\.(jpg|txt|php).*"
- /ip firewall mangle
- add action=mark-connection chain=forward comment=Speedtest disabled=no \
- layer7-protocol="btest down" new-connection-mark=speed passthrough=yes
- add action=mark-connection chain=forward disabled=no layer7-protocol=\
- "btest up" new-connection-mark=speed passthrough=yes
- add action=mark-packet chain=forward connection-mark=speed disabled=no \
- new-packet-mark=speedtest passthrough=no
- /queue tree
- add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
- max-limit=0 name="A. Speedtest" packet-mark=speedtest parent=global-out \
- priority=1 queue=default
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement