Advertisement
adhiefree

Speedtest DEWA (haya bagi yg extreme saja)

Dec 21st, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. apt-get install unzip apache2 php5
  2. cd /var/www
  3. wget http://c.speedtest.net/mini/mini.zip
  4. unzip mini.zip
  5.  
  6. # script untuk Rewriter.pl
  7. #!/usr/bin/perl
  8.  
  9. $|=1;
  10. while (<>) {
  11. chomp;
  12. @X = split;
  13. $url = $X[1];
  14. if ($url =~ /^http\:\/\/.*\/(speedtest\/.*)/) {
  15. print $X[0] . " http://IP.PROXY.ANDA/" . $1 . "\n";
  16. } else {
  17. print $X[0]." \n";
  18. }
  19. }
  20.  
  21. #permission
  22. chown proxy:proxy /etc/squid/rewriter.pl && chmod 777 /etc/squid/rewriter.pl
  23.  
  24. # tambahan di squid.conf
  25. acl RW url_regex \/speedtest\/.*\.(jpg|txt|php).*
  26. url_rewrite_access allow RW
  27. url_rewrite_program /etc/squid/rewriter.pl
  28. url_rewrite_children 7
  29. url_rewrite_concurrency 10
  30. redirector_bypass on
  31.  
  32. # Pastekan di mikrotik taruh paling atas di mangle
  33. /ip firewall layer7-protocol
  34. add name="btest down" regexp="\\/speedtest\\/random.*\\.(jpg|txt|php).*"
  35. add name="btest up" regexp="\\/speedtest\\/upload.*\\.(jpg|txt|php).*"
  36.  
  37. /ip firewall mangle
  38. add action=mark-connection chain=forward comment=Speedtest disabled=no \
  39. layer7-protocol="btest down" new-connection-mark=speed passthrough=yes
  40. add action=mark-connection chain=forward disabled=no layer7-protocol=\
  41. "btest up" new-connection-mark=speed passthrough=yes
  42. add action=mark-packet chain=forward connection-mark=speed disabled=no \
  43. new-packet-mark=speedtest passthrough=no
  44.  
  45. /queue tree
  46. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  47. max-limit=0 name="A. Speedtest" packet-mark=speedtest parent=global-out \
  48. priority=1 queue=default
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement