Advertisement
ujiajah1

manual script installing squid-3.5.xx vritualbox no tproxy

Jan 18th, 2016
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #manual for debian7 ubuntu12/14
  2. # after finish your installing of ubuntu / debian
  3. # change or replace /etc/apt/sources.list with  a local repository  
  4. debian 7 indonesia=
  5. deb http://kambing.ui.ac.id/debian/ wheezy main contrib non-free
  6. deb http://kambing.ui.ac.id/debian/ wheezy-updates main contrib non-free
  7. deb http://kambing.ui.ac.id/debian-security/ wheezy/updates main contrib non-free
  8.  
  9. for debian error key=
  10. aptitude install debian-keyring debian-archive-keyring
  11. apt-key update
  12. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553
  13. =========================================================================================
  14. #edit tuning limits.conf at /security/limits.conf
  15. add /etc/security/limits.conf
  16. =========================================================================================
  17. *         soft        nofile          65536
  18. *         hard        nofile          65536
  19. root      soft        nofile          65536
  20. root      hard        nofile          65536
  21. proxy     soft        nofile          65536
  22. proxy     hard        nofile          65536
  23. ===========================================================================================
  24. # install web server
  25. apt-get install apache2 php5 php5-mysql mysql-server phpmyadmin -y
  26. configure apache2.conf @/etc/apache2/apache2.conf
  27. # Include the virtual host configurations:
  28. Include sites-enabled/
  29. ServerName localhost <<<<... add this scripts
  30.  
  31. #configure squid proxy
  32. # install packet
  33. 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
  34.  
  35. #libecap
  36. download libecap= http://www.4shared.com/archive/uMVmB3ADce/libecap-100tar.html
  37. download DSI_ecap_youtube.so=  http://www.4shared.com/file/rYJcJqyVce/DSI_ecap_youtube.html
  38. tar -xzf libecap-1.0.0.tar.gz
  39. cd libecap-1.0.0/
  40. ./configure && make && make install
  41. echo "/usr/local/lib" >> /etc/ld.so.conf
  42. ldconfig
  43.  
  44. #ecap_adapter
  45. apt-get install pkg-config
  46. wget http://www.measurement-factory.com/tmp/ecap/ecap_adapter_sample-1.0.0.tar.gz
  47. tar -xzf ecap_adapter_sample-1.0.0.tar.gz
  48. # cd ecap_adapter_sample-1.0.0
  49. # download patch ecap_adapter in mikrotik squid indonesia group / thanks to Mikrotike N SquidLovers
  50. https://www.facebook.com/download/989568241123182/patch_ecap_adapter_sample.patch
  51. # move patch_ecap_adapter_sample.patch > #to directory= /ecap_adapter_sample-1.0.0
  52. # and then input the scripts below >>>
  53. # patch -p1 < patch_ecap_adapter_sample.patch
  54. # ./configure && make && sudo make install
  55.  
  56. #squid installation
  57. wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.12.tar.gz
  58. tar -xzvf squid-3.5.12.tar.gz
  59. cd squid-3* >> add script below
  60.  
  61. ./configure \
  62. CHOST="x86_64-pc-linux-gnu" \
  63. CFLAGS="-march=core2 -O2 -pipe" \
  64. CXXFLAGS="${CFLAGS}" \
  65. --build=x86_64-linux-gnu \
  66. --prefix=/usr \
  67. --exec-prefix=/usr \
  68. --bindir=/usr/bin \
  69. --sbindir=/usr/sbin \
  70. --libdir=/usr/lib \
  71. --sharedstatedir=/usr/com \
  72. --includedir=/usr/include \
  73. --localstatedir=/var \
  74. --libexecdir=/usr/lib/squid \
  75. --srcdir=. \
  76. --datadir=/usr/share/squid \
  77. --sysconfdir=/etc/squid \
  78. --infodir=/usr/share/info \
  79. --mandir=/usr/share/man \
  80. --x-includes=/usr/include \
  81. --x-libraries=/usr/lib \
  82. --with-default-user=proxy \
  83. --with-logdir=/var/log/squid \
  84. --with-swapdir=/cache/cache \
  85. --with-pidfile=/var/run/squid.pid \
  86. --enable-err-languages=English \
  87. --enable-default-err-language=English \
  88. --enable-storeio=ufs,aufs,diskd \
  89. --enable-linux-netfilter \
  90. --enable-removal-policies=lru,heap \
  91. --enable-gnuregex \
  92. --enable-follow-x-forwarded-for \
  93. --enable-x-accelerator-vary \
  94. --enable-zph-qos \
  95. --enable-delay-pools \
  96. --enable-snmp \
  97. --enable-underscores \
  98. --with-openssl \
  99. --enable-ssl-crtd \
  100. --enable-http-violations \
  101. --enable-async-io=24 \
  102. --enable-storeid-rewrite-helpers \
  103. --with-large-files \
  104. --with-libcap \
  105. --with-libnetfilter-conntrack \
  106. --with-included-ltdl \
  107. --with-maxfd=65536 \
  108. --with-filedescriptors=65536 \
  109. --with-pthreads \
  110. --without-gnutls \
  111. --without-mit-krb5 \
  112. --without-heimdal-krb5 \
  113. --without-gnugss \
  114. --disable-icap-client \
  115. --disable-wccp \
  116. --disable-wccpv2 \
  117. --disable-dependency-tracking \
  118. --disable-auth --disable-epoll \
  119. --disable-ident-lookups \
  120. --disable-icmp \
  121. --enable-ecap \
  122. PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  123.  
  124. make && make install
  125.  
  126. chown -R proxy:proxy /cache/cache/
  127. chmod -R 777 /cache/cache/
  128.  
  129. cd /etc/squid
  130. mkdir ssl_certs
  131.  
  132. cd /ssl_certs
  133. openssl genrsa -out squid.key 2048
  134. openssl req -new -key squid.key -out squid.csr -nodes
  135. #input  data for certificate squid#
  136. openssl x509 -req -days 3652 -in squid.csr -signkey squid.key -out squid.crt
  137.  
  138. #edit squid.conf
  139. my squid.conf non tproxy only virtualbox= http://pastebin.com/uvtLinw8
  140. my store-id.pl= http://pastebin.com/pLK4Jk81
  141. chown -R nobody /etc/squid/
  142. chown -R proxy:proxy /etc/squid/
  143. chmod -R 777 /etc/squid/
  144.  
  145. /usr/lib/squid/ssl_crtd -c -s /etc/squid/ssl_db
  146.  
  147. cd /var/log/squid/
  148. touch /var/log/access.log
  149. touch /var/log/cache.log
  150. chown -R proxy:proxy /var/log/squid/access.log
  151. chown -R proxy:proxy /var/log/squid/cache.log
  152. chmod -R 777 /var/log/squid/access.log
  153. chmod -R 777 /var/log/squid/cache.log
  154. squid -z
  155.  
  156. #autostart squid
  157. cd /etc/init.d/
  158. touch squid >> add scripts
  159. /etc/init.d/squid= http://pastebin.com/W8xQAD0d
  160. chmod +x /etc/init.d/squid
  161. update-rc.d squid defaults
  162. /etc/init.d/squid stop
  163. <<< chown -R nobody /etc/squid/ssl_db/
  164. <<< chown -R proxy:proxy /etc/squid/ssl_db/
  165. <<< chmod -R 777 /etc/squid/ssl_db/
  166. reboot
  167. #back to proxy and login
  168. input= /etc/init.d/squid restart
  169.  
  170. #ssl_cert import
  171. download ssl_cert your squid directory
  172. using winscp >> download ssl_certs on directory /etc/squid/ >> to your computer windows/....
  173.  
  174. #setting non tproxy manual browser input
  175. #add setting your browser mozilla / chrome or etc....
  176. # google chrome= setting > network > change proxy setting
  177. add your ipproxy and port 3127
  178. still on setting chrome ,>> add https/ssl >> manage certificates >> click trusted root certification
  179. click buttin import >> and import your
  180. # mozilla/firefox
  181. click tools >> advanced >> click network >> check opsi manual proxy config
  182. add >> http proxy= your ip proxy port= 3128
  183. add >> ssl proxy= your ip proxy  port= 3127
  184.  
  185.  
  186.  
  187. =================================================================================================================================
  188. #for tuning kernel
  189. =================================================================================================================================
  190. #edit @ .. /etc/sysctl.conf
  191. =================================================================================================================================
  192. #remove all contents and replace with config below
  193. ################################################################
  194. << ..................................................................................... >>
  195. kernel.panic = 30
  196. kernel.panic_on_oops = 30
  197. kernel.sysrq = 0
  198. kernel.core_uses_pid = 1
  199. kernel.msgmnb = 65536
  200. kernel.msgmax = 65536
  201. fs.file-max = 65536
  202. vm.swappiness = 5
  203. vm.vfs_cache_pressure=50
  204. vm.mmap_min_addr = 4096
  205. vm.overcommit_ratio = 0
  206. vm.overcommit_memory = 0
  207. kernel.shmmax = 268435456
  208. kernel.shmall = 268435456
  209. vm.min_free_kbytes = 65536
  210. net.ipv4.tcp_syncookies = 1
  211. net.ipv4.tcp_syn_retries = 5
  212. net.ipv4.tcp_synack_retries = 2
  213. net.ipv4.tcp_max_syn_backlog = 4096
  214. net.ipv4.ip_forward = 1
  215. net.ipv4.conf.all.forwarding = 1
  216. net.ipv4.conf.default.forwarding = 1
  217. net.ipv4.conf.all.accept_source_route = 0
  218. net.ipv4.conf.default.accept_source_route = 0
  219. net.ipv4.conf.all.rp_filter = 0
  220. net.ipv4.conf.default.rp_filter = 0
  221. net.ipv4.conf.eth0.rp_filter = 0
  222. net.ipv4.conf.all.accept_redirects = 0
  223. net.ipv4.conf.default.accept_redirects = 0
  224. net.ipv4.conf.all.log_martians = 0
  225. net.ipv4.conf.default.log_martians = 0
  226. net.ipv4.tcp_fin_timeout = 15
  227. net.ipv4.tcp_keepalive_time = 300
  228. net.ipv4.tcp_keepalive_probes = 5
  229. net.ipv4.tcp_keepalive_intvl = 15
  230. net.ipv4.conf.all.bootp_relay = 0
  231. net.ipv4.conf.all.proxy_arp = 0
  232. net.ipv4.tcp_dsack = 1
  233. net.ipv4.tcp_sack = 1
  234. net.ipv4.tcp_fack = 1
  235. net.ipv4.tcp_timestamps = 1
  236. net.ipv4.icmp_echo_ignore_all = 0
  237. net.ipv4.icmp_echo_ignore_broadcasts = 1
  238. net.ipv4.icmp_ignore_bogus_error_responses = 1
  239. net.ipv4.ip_local_port_range = 1024 65535
  240. net.ipv4.tcp_rfc1337 = 1
  241. net.ipv4.tcp_congestion_control = cubic
  242. net.ipv4.tcp_window_scaling = 1
  243. net.ipv4.tcp_mem = 65536 131072 262144
  244. net.ipv4.udp_mem = 65536 131072 262144
  245. net.ipv4.tcp_rmem = 8192 87380 16777216
  246. net.ipv4.udp_rmem_min = 16384
  247. net.core.rmem_default = 87380
  248. net.core.rmem_max = 16777216
  249. net.ipv4.tcp_wmem = 8192 65536 16777216
  250. net.ipv4.udp_wmem_min = 16384
  251. net.core.wmem_default = 65536
  252. net.core.wmem_max = 16777216
  253. net.core.somaxconn = 32768
  254. net.core.netdev_max_backlog = 4096
  255. net.core.dev_weight = 64
  256. net.core.optmem_max = 65536
  257. net.ipv4.tcp_max_tw_buckets = 1440000
  258. net.ipv4.tcp_tw_recycle = 1
  259. net.ipv4.tcp_tw_reuse = 1
  260. net.ipv4.tcp_max_orphans = 16384
  261. net.ipv4.tcp_orphan_retries = 0
  262. net.ipv4.ipfrag_high_thresh = 512000
  263. net.ipv4.ipfrag_low_thresh = 446464
  264. net.ipv4.tcp_no_metrics_save = 1
  265. net.ipv4.tcp_moderate_rcvbuf = 1
  266. net.unix.max_dgram_qlen = 50
  267. net.ipv4.neigh.default.gc_thresh3 = 2048
  268. net.ipv4.neigh.default.gc_thresh2 = 1024
  269. net.ipv4.neigh.default.gc_thresh1 = 32
  270. net.ipv4.neigh.default.gc_interval = 30
  271. net.ipv4.neigh.default.proxy_qlen = 96
  272. net.ipv4.neigh.default.unres_qlen = 6
  273. net.ipv4.tcp_ecn = 1
  274. net.ipv4.tcp_reordering = 3
  275. net.ipv4.tcp_retries2 = 15
  276. net.ipv4.tcp_retries1 = 3
  277. <<<...........................................................................................................>>>
  278. ==================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement