Advertisement
teknisiazza

Squid 4

Apr 24th, 2016
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.90 KB | None | 0 0
  1. # Mulai dari install webserver yah
  2. # yuk lanjutt!!
  3. # Install web server
  4. apt-get install apache2 php5 php5-mysql mysql-server phpmyadmin -y
  5. # edit apache2.conf di direktori /etc/apache2/apache2.conf
  6. # cari bagian Include sites-enabled/ kemudian tambahkan
  7. # script ServerName localhost tepat di bawah sites-enabled/
  8.  
  9. Include sites-enabled/
  10. ServerName localhost <<<< masukan script ini di bawah include sites-enabled
  11.  
  12. # untuk install dns server disini saya menggunakan unbound
  13. # install dns server
  14.  
  15. apt-get install unbound
  16. /etc/init.d/unbound stop
  17. cd /etc/unbound
  18.  
  19. wget ftp://ftp.internic.net/domain/named.cache -O /etc/unbound/named.cache
  20.  
  21. # edit unbound.conf >> /etc/unbound/unbound.conf
  22. # bisa lihat unbound.conf saya
  23. # dari link ini = http://pastebin.com/2gTnMNAV
  24.  
  25. # edit dns-nameservers di /etc/netwwork/interfaces ganti dengan ip localhost 127.0.0.1
  26. # lalu copy perintah2 dibawah ini :
  27.  
  28. >>unbound-control-setup
  29. #edit permission
  30. >>chown unbound:root unbound_* && chmod 440 unbound_*
  31. >>/etc/init.d/unbound restart
  32. ## untuk flush unbound cache pakai perintah dibawah ini:
  33. >>/etc/init.d/unbound reload or unbound control-reload
  34. # mulai konfigurasi squid proxy
  35. # install packet2 nya
  36. >>apt-get install devscripts build-essential openssl libssl-dev fakeroot libcppunit-dev libsasl2-dev cdbs ebtables bridge-utils libcap2 libcap-dev libcap2-dev sysv-rc-conf iproute kernel-package libncurses5-dev fakeroot wget bzip2 debhelper linuxdoc-tools libselinux1-dev htop iftop dnstop perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python ccze pastebinit checkinstall libssl-dev htop iftop iptraf mtr-tiny bwm-ng ccze sysv-rc-conf -y
  37.  
  38. # libecap
  39. # download libecap=http://www.4shared.com/archive/uMVmB3ADce/libecap-100tar.html
  40. # download DSI_ecap_youtube.so dari link dibawah ini :
  41. # http://www.4shared.com/file/rYJcJqyVce/DSI_ecap_youtube.html
  42. # pindahkan DSI_ecap_youtube.so ke direktori /usr/local/lib
  43. # kemudian ekstrak, eksekusi dan install
  44. >>tar -xzf libecap-1.0.0.tar.gz
  45. #masuk direktori
  46. >>cd libecap-1.0.0/
  47. >>./configure && make && make install
  48. >>echo "/usr/local/lib" >> /etc/ld.so.conf
  49. >>ldconfig
  50.  
  51. # ecap_adapter
  52. >>apt-get install pkg-config
  53. >>wget http://www.measurement-factory.com/tmp/ecap/ecap_adapter_sample-1.0.0.tar.gz
  54. >>tar -xzf ecap_adapter_sample-1.0.0.tar.gz
  55. # masuk direktori
  56. >>cd ecap_adapter_sample-1.0.0
  57. #download patchecap_adapter dari grooup mikrotik squid indonesia,
  58. #linknya di bawah ini:
  59. https://www.facebook.com/download/989568241123182/patch_ecap_adapter_sample.patch
  60. #pindahkan file patch_ecap_adapter_sample.patch yang di download
  61. #dari group mikrotik tadi ke directory= /ecap_adapter_sample-1.0.0
  62. #kemudian eksekusi patch dengan script di bawah ini :
  63. >>patch -p1 < patch_ecap_adapter_sample.patch
  64. >>./configure && make && make install
  65.  
  66. # squid installation
  67. >>wget http://www.squid-cache.org/Versions/v4/squid-4.0.4.tar.gz
  68. >>tar -xzvf squid-4*
  69. # masuk direktori folder squid
  70. >>cd squid-4*
  71.  
  72. # compile nya bisa ditambah dengan spesifikasi processor
  73. # untuk spesifikasi pc bisa di lihat disini https://wiki.gentoo.org/wiki/Safe_CFLAGS
  74. ############################################################
  75. ./configure '--prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib/squid' '--sysconfdir=/etc/squid' '--localstatedir=/var' '--libdir=/usr/lib' '--includedir=/usr/include' '--datadir=/usr/share/squid' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--disable-dependency-tracking' '--disable-strict-error-checking' '--enable-async-io=24' '--with-aufs-threads=24' '--with-pthreads' '--enable-storeio=aufs,diskd' '--enable-removal-policies=lru,heap' '--with-aio' '--with-dl' '--disable-icmp' '--enable-esi' '--disable-icap-client' '--disable-wccp' '--disable-wccpv2' '--enable-kill-parent-hack' '--enable-cache-digests' '--disable-select' '--enable-http-violations' '--enable-linux-netfilter' '--enable-follow-x-forwarded-for' '--disable-ident-lookups' '--enable-x-accelerator-vary' '--enable-zph-qos' '--with-default-user=proxy' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid' '--with-swapdir=/cache/cache' '--with-openssl' '--with-large-files' '--enable-ltdl-convenience' '--with-filedescriptors=65536' '--with-maxfd=65536' '--enable-storeid-rewrite-helpers' '--enable-ecap' '--enable-ssl-crtd' '--enable-err-languages=English' '--enable-default-err-language=English' '--build=x86_64' 'build_alias=x86_64' 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig'
  76. ############################################################
  77.  
  78. >>make && make install
  79.  
  80. # edit permission
  81. >>chown -R proxy:proxy /cache/cache/
  82. >>chmod -R 777 /cache/cache/
  83.  
  84. # masuk direktori var
  85.  
  86. >>cd /var/log/squid/
  87. # kemudian buat :
  88. >>touch access.log
  89. >>touch cache.log
  90.  
  91. # pindah lagi direktori root
  92.  
  93. >>cd
  94. # edit permission
  95. >>chown -R proxy:proxy /var/log/squid
  96.  
  97. >>chmod -R 777 /var/log/squid
  98.  
  99. # pindah direktori root
  100.  
  101. >>cd
  102.  
  103. >>cd /etc/squid
  104. >>mkdir ssl_certs
  105. # masuk direktori
  106. >>cd ssl_certs/
  107. >openssl genrsa -out squid.key 2048
  108. >>openssl req -new -key squid.key -out squid.csr -nodes
  109. #input data for certificate squid#
  110. >>openssl x509 -req -days 3652 -in squid.csr -signkey squid.key -out squid.crt
  111.  
  112. /usr/lib/squid/ssl_crtd -c -s /etc/squid/ssl_db
  113. #################################################
  114. # File Config Squid
  115. #################################################
  116. #edit squid.conf
  117. # squid.conf for tproxy= http://pastebin.com/ri8204jw
  118. # include /etc/squid/refresh.conf
  119. # refresh.conf = http://pastebin.com/et0XDzij
  120. # store-id.pl= http://pastebin.com/pLK4Jk81
  121. ##################################################
  122. #edit permission file squid
  123. >>chown -R nobody /etc/squid/
  124. >>chown -R proxy:proxy /etc/squid/
  125. >>chmod -R 777 /etc/squid/
  126.  
  127. >>squid -z
  128.  
  129. # edit /etc/rc.local
  130.  
  131. config rc.local >> /etc/rc.local
  132. rc.local=http://pastebin.com/3z3s1Hpy
  133. ##############################################
  134. # edit mangle tproxy di mikrotik
  135. mangle tproxy mikrotik >>> ip/firewall-mangle
  136. mangle tproxy = http://pastebin.com/9uyMpMac
  137. #################################################
  138. # kembali ke ubuntu/debian server
  139. # edit autostart squid
  140. # masuk direktore
  141.  
  142. >> cd /etc/init.d/
  143.  
  144. >> touch squid
  145.  
  146. # copy file /etc/init.d/squid dari sini = http://pastebin.com/W8xQAD0d
  147.  
  148. # edit line 64 di dalam file-auto start squid di >>/etc/init.d/squid >>line 64
  149. # cache_dir=`find_cache_dir cache_dir /cache/cache`
  150.  
  151. #################################
  152. # edit permission
  153. >>chmod +x /etc/init.d/squid
  154. >>update-rc.d squid defaults
  155. >>/etc/init.d/squid stop
  156. #################################
  157. >>reboot server
  158.  
  159. # masuk kembali ke debian/ubuntu server
  160. # kemudian eksekusi perintah
  161.  
  162. >>/etc/init.d/squid restart
  163.  
  164. # ssl_cert import
  165. # download ssl_cert dari directory squid di debian/ubuntu servernya
  166. # lebih gampang pake winscp
  167. # >> pindahkan ssl_certs di directory /etc/squid/
  168. # lalu pindahkan dengan cara drag and drop ke komputer windows kalian.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement