Advertisement
ujiajah1

squid4.sh backup

Sep 5th, 2016
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 7.13 KB | None | 0 0
  1. #!/bin/bash
  2. read -p 'Masukan User Linux Anda: ' userver
  3. read -sp 'password Linux Anda: ' passserver
  4. echo "Aku Yakin Kamu pasti bisa"
  5. echo -e "selamat datang $userver di program installasi\n"
  6. echo -n "Masukan Nama Anda :"
  7. read nama
  8. echo "Hello $nama"
  9. echo "goodluck $nama"
  10. echo "oh iya ... !sebelumnya clone dari github git clone https://github.com/puji122/squid4-autoinstall.git"
  11. echo "|=====================================================|"
  12. echo "|                   Sajak Suara                       |"
  13. echo "|=====================================================|"
  14. echo "|     sesungguhnya suara itu tak bisa diredam         |"
  15. echo "|                mulut bisa dibungkam                 |"
  16. echo "|  namun siapa mampu menghentikan nyanyian bimbang    |"
  17. echo "|    dan pertanyaan-pertanyaan dari lidah jiwaku      |"
  18. echo "|      suara-suara itu tak bisa dipenjarakan          |"
  19. echo "|          di sana bersemayam kemerdekaan             |"
  20. echo "|           apabila engkau memaksa diam               |"
  21. echo "|       akan kusiapkan untukmu: pemberontakan!        |"
  22. echo "|                                                     |"
  23. echo "|        sesungguhnya suara itu bukan perampok        |"
  24. echo "|             yang ingin meraih hartamu               |"
  25. echo "|                 ia ingin bicara                     |"
  26. echo "|            mengapa kau kokang senjata               |"
  27. echo "|         dan gemetar ketika suara-suara itu          |"
  28. echo "|                menuntut keadilan?                   |"
  29. echo "|                                                     |"
  30. echo "|       sesungguhnya suara itu akan menjadi kata      |"
  31. echo "|          ialah yang mengajari aku bertanya          |"
  32. echo "|          dan pada akhirnya tidak bisa tidak         |"
  33. echo "|                engkau harus menjawabnya             |"
  34. echo "|            apabila engkau tetap bertahan            |"
  35. echo "|         aku akan memburumu seperti kutukan          |"
  36. echo "|           Wiji Thukul - 1996 (Sajak Suara)          |"
  37. echo "|=====================================================|"
  38. echo -e "Selamat datang di installasi server, \n"
  39. while true; do
  40.     read -p "Lanjutkan installasi?" yn
  41.     case $yn in
  42.         [Yy]* ) break;;
  43.         [Nn]* ) exit;;
  44.         * ) echo "Tolong jawab yes atau no";;
  45.     esac
  46. done
  47.  
  48. # informasi perangkat keras                                                    
  49. echo "++ Perangkat keras "                                                      
  50. CPU=`grep "model name" /proc/cpuinfo | head -n 1 | cut -f 2 -d ':'`            
  51. RAM=`grep "MemTotal" /proc/meminfo | cut -f 2 -d ':'`                          
  52. echo " |- CPU : " $CPU                                                          
  53. echo " |- RAM : " $RAM                                                          
  54. echo "++ Sistem Operasi "                                                      
  55. # informasi sistem operasi                                                      
  56. OS=`uname -sr`                                                                  
  57. echo " |- OS : " $OS                                                            
  58. echo " |- Shell : " $SHELL
  59. echo -n "Waktu system   :"; date
  60. echo -n "Distro Info    :"; lsb_release -a
  61. echo -n "Anda           :"; whoami
  62. echo -n "Banyak pemakai :"; who | wc -l
  63. echo "ok langsung ajah"
  64. echo "sambil ngopi brayy duduk yang manis yah"
  65.  
  66. cp sysctl.conf /etc/
  67. cp limits.conf /etc/security/
  68.  
  69. apt-get update && apt-get upgrade -y
  70.  
  71. echo -e "anda telah selesai mengupdate server, \n"
  72. while true; do
  73.     read -p "Lanjuut?" yn
  74.     case $yn in
  75.         [Yy]* ) break;;
  76.         [Nn]* ) exit;;
  77.         * ) echo "jawab aja yes atau no";;
  78.     esac
  79. done      
  80.  
  81. tar -xzf libecap-1.0.0.tar.gz
  82. cp DSI_ecap_youtube.so /usr/local/lib/
  83. cd libecap-1.0.0
  84. ./configure && make && make install
  85. echo '/usr/local/lib' >> /etc/ld.so.conf
  86. ldconfig
  87.  
  88. cd -
  89. tar zxvf ecap_adapter.tar.gz
  90. cd ecap_adapter_sample-1*
  91. ./configure && make && make install
  92.  
  93. cd -
  94. tar -xzvf squid-4.0.4.tar.gz
  95. cd squid-4.0.4
  96. ./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'
  97. make && make install
  98.  
  99. cd -
  100. cp squid.conf /etc/squid/
  101. cp store-id.pl /etc/squid/
  102. cp blok.txt /etc/squid/
  103. cp ad_block.txt /etc/squid/
  104. cp squid /etc/init.d/
  105.  
  106. cd /etc/init.d/
  107. chmod +x /etc/init.d/squid
  108. update-rc.d squid defaults
  109. /etc/init.d/squid stop
  110.  
  111. cd -
  112. chmod +x /etc/squid/store-id.pl
  113. chmod +x /etc/squid/ad_block.txt
  114. chmod +x /etc/squid/blok.txt
  115. chmod +x /etc/init.d/squid
  116. chown -R proxy:proxy /cache/cache/
  117. chmod -R 777 /cache/cache/
  118.  
  119. cd /var/log/squid/
  120. touch access.log
  121. touch cache.log
  122.  
  123. cd
  124. chown -R proxy:proxy /var/log/squid/
  125. chmod -R 777 /var/log/squid/
  126. mkdir /etc/squid/ssl_certs/
  127.  
  128. cd /etc/squid/ssl_certs/
  129. openssl genrsa -out squid.key 2048
  130. openssl req -new -key squid.key -out squid.csr -nodes -subj "/C=ID/ST=Jakarta/L=Jakarta/O=Hipster/CN=Young Hipster"
  131. openssl x509 -req -days 3652 -in squid.csr -signkey squid.key -out squid.crt
  132.  
  133. cd
  134. mkdir /var/lib/squid
  135. chown -R nobody /var/lib/squid/
  136. /usr/lib/squid/ssl_crtd -c -s /var/lib/squid/ssl_db
  137. chown -R proxy:proxy /etc/squid/
  138. chmod -R 777 /etc/squid/
  139. chown -R nobody /var/lib/squid/ssl_db/certs
  140. chown -R proxy:proxy /var/lib/squid/ssl_db/certs
  141. chmod 755 /var/lib/squid/ssl_db/certs
  142.  
  143. echo "================================================================"
  144. echo "setelah reboot"
  145. echo "squid -k reconfigure"
  146. echo "/etc/init.d/squid restart"
  147. echo "copy blok.html to your server local (http://192.168.9.200/blok.html or localhost/blok.html)"
  148. echo "byee sayang"
  149. echo "tail -f /var/log/squid/access.log | ccze"
  150. echo "buat direktory cache"
  151. squid -z
  152. echo "selesai_"
  153. echo -e "Selamat installasi squid proxy version4 telah selesai di laksanakan. , \nHarap Restart dulu server anda."
  154. while true; do
  155.     read -p "Silahkan Direstart bro?" yn
  156.     case $yn in
  157.         [Yy]* ) init 6; break;;
  158.         [Nn]* ) exit;;
  159.         * ) echo "jawab aja yes atau no gitu ajah ko repot";;
  160.     esac
  161. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement