Advertisement
budiana

Raptor on Debian 6.06 AMD 64

Mar 12th, 2013
1,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. STEP by STEP Raptor on Debian 6.06 AMD 64 for Testing only ( X3 Ram=8 G HD=80 G)
  2. Installasi awal paket hanya openssh server dan basic system dengan partisi ext4 sbb :
  3.  
  4. /swap       4 G
  5. /       6 G B
  6. /cache-1    25 G    noatime /dev/sda5
  7. /raptorcache    40 G    noatime /dev/sda6
  8. /var        5 G
  9.  
  10. If you need to know your drives labels type the following:
  11. mount|grep ^'/dev'
  12.  
  13. Optimalkan file system untuk cache
  14.  
  15. tune2fs -m 0 /dev/sda5
  16. tune2fs -m 0 /dev/sda6
  17. tune2fs -o journal_data_writeback /dev/sda5
  18. tune2fs -o journal_data_writeback /dev/sda6
  19.  
  20. Disabled fsck (file system check)
  21.  
  22. nano /etc/fstab
  23. /cache-1  ext4  noatime,barrier=0,nodiratime,relatime,errors=remount-ro,data=writeback   0   0
  24. /raptorcache  ext4  noatime,barrier=0,nodiratime,relatime,errors=remount-ro,data=writeback   0   0
  25.  
  26. touch raptor10b-64-debian.sh; chmod 777 raptor10b-64-debian.sh
  27. nano raptor10b-64-debian.sh
  28.  
  29. insert all script below, save, than run by type "bash raptor10b-64-debian.sh"
  30.  
  31. # Copy mulai dari sini
  32. # bash raptor10b-64-debian.sh
  33. echo 4 > /proc/sys/net/ipv4/tcp_fin_timeout
  34. mv /etc/sysctl.conf /etc/sysctl.conf_
  35. touch /etc/sysctl.conf
  36.  
  37. echo "kernel.panic = 30
  38. kernel.panic_on_oops = 30
  39. kernel.sysrq = 0
  40. kernel.core_uses_pid = 1
  41. kernel.msgmnb = 65536
  42. kernel.msgmax = 65536
  43. fs.file-max = 65536
  44. vm.swappiness = 0
  45. vm.vfs_cache_pressure=50
  46. vm.mmap_min_addr = 4096
  47. vm.overcommit_ratio = 0
  48. vm.overcommit_memory = 0
  49. kernel.shmmax = 268435456
  50. kernel.shmall = 268435456
  51. vm.min_free_kbytes = 65536
  52. net.ipv6.conf.all.disable_ipv6 = 1
  53. net.ipv4.tcp_syncookies = 1
  54. net.ipv4.tcp_syn_retries = 5
  55. net.ipv4.tcp_synack_retries = 2
  56. net.ipv4.tcp_max_syn_backlog = 4096
  57. net.ipv4.ip_forward = 0
  58. net.ipv4.conf.all.forwarding = 0
  59. net.ipv4.conf.default.forwarding = 0
  60. net.ipv4.conf.all.accept_source_route = 0
  61. net.ipv4.conf.default.accept_source_route = 0
  62. net.ipv4.conf.all.rp_filter = 1
  63. net.ipv4.conf.default.rp_filter = 1
  64. net.ipv4.conf.all.accept_redirects = 0
  65. net.ipv4.conf.default.accept_redirects = 0
  66. net.ipv4.conf.all.log_martians = 0
  67. net.ipv4.conf.default.log_martians = 0
  68. net.ipv4.tcp_fin_timeout = 15
  69. net.ipv4.tcp_keepalive_time = 300
  70. net.ipv4.tcp_keepalive_probes = 5
  71. net.ipv4.tcp_keepalive_intvl = 15
  72. net.ipv4.conf.all.bootp_relay = 0
  73. net.ipv4.conf.all.proxy_arp = 0
  74. net.ipv4.tcp_dsack = 1
  75. net.ipv4.tcp_sack = 1
  76. net.ipv4.tcp_fack = 1
  77. net.ipv4.tcp_timestamps = 1
  78. net.ipv4.icmp_echo_ignore_all = 0
  79. net.ipv4.icmp_echo_ignore_broadcasts = 1
  80. net.ipv4.icmp_ignore_bogus_error_responses = 1
  81. net.ipv4.ip_local_port_range = 1024 65535
  82. net.ipv4.tcp_rfc1337 = 1
  83. net.ipv4.tcp_congestion_control = cubic
  84. net.ipv4.tcp_window_scaling = 1
  85. net.ipv4.tcp_mem = 65536 131072 262144
  86. net.ipv4.udp_mem = 65536 131072 262144
  87. net.ipv4.tcp_rmem = 8192 87380 16777216
  88. net.ipv4.udp_rmem_min = 16384
  89. net.core.rmem_default = 87380
  90. net.core.rmem_max = 16777216
  91. net.ipv4.tcp_wmem = 8192 65536 16777216
  92. net.ipv4.udp_wmem_min = 16384
  93. net.core.wmem_default = 65536
  94. net.core.wmem_max = 16777216
  95. net.core.somaxconn = 32768
  96. net.core.netdev_max_backlog = 4096
  97. net.core.dev_weight = 64
  98. net.core.optmem_max = 65536
  99. net.ipv4.tcp_max_tw_buckets = 1440000
  100. net.ipv4.tcp_tw_recycle = 1
  101. net.ipv4.tcp_tw_reuse = 1
  102. net.ipv4.tcp_max_orphans = 16384
  103. net.ipv4.tcp_orphan_retries = 0
  104. net.ipv4.ipfrag_high_thresh = 512000
  105. net.ipv4.ipfrag_low_thresh = 446464
  106. net.ipv4.tcp_no_metrics_save = 1
  107. net.ipv4.tcp_moderate_rcvbuf = 1
  108. net.unix.max_dgram_qlen = 50
  109. net.ipv4.neigh.default.gc_thresh3 = 2048
  110. net.ipv4.neigh.default.gc_thresh2 = 1024
  111. net.ipv4.neigh.default.gc_thresh1 = 32
  112. net.ipv4.neigh.default.gc_interval = 30
  113. net.ipv4.neigh.default.proxy_qlen = 96
  114. net.ipv4.neigh.default.unres_qlen = 6
  115. net.ipv4.tcp_ecn = 1
  116. net.ipv4.tcp_reordering = 3
  117. net.ipv4.tcp_retries2 = 15
  118. net.ipv4.tcp_retries1 = 3" >> /etc/sysctl.conf
  119.  
  120. echo "ulimit -Hn 65536
  121. ulimit -Sn 65535">> /etc/profile
  122.  
  123. echo 65536 > /proc/sys/fs/file-max
  124. echo "*         soft        nofile          65536" >> /etc/security/limits.conf
  125. echo "*         hard        nofile          65536" >> /etc/security/limits.conf
  126. echo "root      soft        nofile          65536" >> /etc/security/limits.conf
  127. echo "root      hard        nofile          65536" >> /etc/security/limits.conf
  128. echo "proxy     soft        nofile          65536" >> /etc/security/limits.conf
  129. echo "proxy     hard        nofile          65536" >> /etc/security/limits.conf
  130. echo "session required        pam_limits.so" >> /etc/pam.d/common-session
  131. modprobe ip_conntrack
  132.  
  133. echo "ip_conntrack">> /etc/modules
  134.  
  135. echo deb http://kambing.ui.ac.id/debian/ squeeze main non-free contrib | tee -a /etc/apt/sources.list
  136. echo deb-src http://kambing.ui.ac.id/debian/ squeeze main non-free contrib | tee -a /etc/apt/sources.list
  137.  
  138. IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')      
  139. HOST_NAME=$(hostname -a)
  140. DOMAIN_NAME=$(hostname -d)                                       
  141.  
  142. sleep 2
  143.  
  144. apt-get update
  145. mkdir /cache-1 && chmod 777 /cache-1 && chown proxy:proxy /cache-1
  146.  
  147. echo Y | apt-get install squid3 squid3-cgi ccze
  148.  
  149. sleep 3
  150. touch /etc/squid3/denegados.lst
  151. echo "cracks.st" >> /etc/squid3/denegados.lst
  152.  
  153. rm -rf /etc/squid3/squid.conf
  154. touch /etc/squid3/squid.conf
  155.  
  156. echo "#========================== Squid 3.x Conf ===========================#
  157. # Port Option SQUID 3.x
  158. #----------------------------------------------------------------------
  159. http_port 3128 intercept
  160. visible_hostname www.$DOMAIN_NAME
  161. icp_port 0
  162. #----------------------------------------------------------------------
  163. error_directory /usr/share/squid3/errors/English
  164. #----------------------------------------------------------------------
  165. acl denegados url_regex -i "/etc/squid3/denegados.lst"
  166. #----------------------------------------------------------------------
  167. # DNS Option
  168. #----------------------------------------------------------------------
  169. dns_nameservers 8.8.8.8 8.8.4.4
  170. dns_retransmit_interval 5 seconds
  171. dns_timeout 2 minutes
  172. #----------------------------------------------------------------------
  173. acl manager proto cache_object
  174. acl localhost src 127.0.0.1/32 ::1
  175. acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
  176. acl CONNECT method CONNECT
  177. ####################################################################
  178. # acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
  179. # acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
  180. acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
  181. ####################################################################
  182. acl Safe_ports port 21 70 80 210 280 443 488 563 591 631 777 901 81 3128 1025-65535
  183. acl SSL_ports port 443 563 81
  184.  
  185. http_access allow manager localhost
  186. http_access deny manager all
  187. http_access deny !Safe_ports
  188. http_access deny CONNECT !SSL_ports
  189. http_access allow localhost
  190. http_access deny denegados
  191.  
  192. # Always allow localhost connections
  193. http_access allow localhost
  194.  
  195. # Allow local network(s) on interface(s)
  196. http_access allow localnet
  197.  
  198. # Default block all to be sure
  199. http_access deny all
  200. #----------------------------------------------------------------------
  201. coredump_dir /cache-1
  202. #----------------------------------------------------------------------
  203. # Reserved memory for cache
  204. # It is recommended that you take approx. 5 MB of RAM per 1GB assigned to cache_dir
  205. #----------------------------------------------------------------------
  206. cache_mem 125 MB
  207. #----------------------------------------------------------------------
  208. # Maximum size of a file in cache memory
  209. #----------------------------------------------------------------------
  210. maximum_object_size_in_memory 128 KB
  211. #----------------------------------------------------------------------
  212. # Maximum and minimum size of files in the disk cache
  213. #----------------------------------------------------------------------
  214. maximum_object_size 30 MB
  215. minimum_object_size 4 KB
  216. #----------------------------------------------------------------------
  217. # Replace cache files when disk cache reach 96% full
  218. #----------------------------------------------------------------------
  219. cache_swap_low 92
  220. cache_swap_high 96
  221. #----------------------------------------------------------------------
  222. # Total HD space to be used by the cache, number of folders,
  223. # Number of subfolders in cache
  224. # 25000 = 25 GB
  225. #----------------------------------------------------------------------
  226. cache_dir aufs /cache-1 25000   25  256
  227. #----------------------------------------------------------------------
  228. # Standard update cache
  229. # 1 month = 10080 mins, 1 day = 1440 mins
  230. #----------------------------------------------------------------------
  231. refresh_pattern -i .(gif|png|jp?g|ico|bmp|tiff?)$ 14400 80% 43200 reload-into-ims
  232. refresh_pattern -i .(swf|htm|html|shtm|shtml|nub)$ 14400 80% 43200 reload-into-ims
  233. refresh_pattern -i .(rpm|cab|deb|exe|msi|msu|zip|tar|xz|bz|bz2|lzma|gz|tgz|rar|bin|7z|doc?|xls?|ppt?|pdf|nth|psd|sis)$ 14400 80% 43200
  234. refresh_pattern -i .(avi|iso|wav|mid|mp?|mpe?g?|mpeg|mov|3gp|wm?|flv|x-flv|axd)$ 14400 80% 43200
  235. refresh_pattern -i .(qtm?|viv|au|ram?|snd|sit|hqx|arj|lzh|lha|txt|rtf|tex|latex|class|js|ico)$ 14400 80% 43200
  236. refresh_pattern -i \.a[0-9][0-9]$ 14400 80% 43200
  237. refresh_pattern -i \.r[0-9][0-9]$ 14400 80% 43200
  238. refresh_pattern -i \.css$ 10 20% 4320
  239. #----------------------------------------------------------------------
  240. refresh_pattern ^ftp:           1440    20%     10080
  241. refresh_pattern ^gopher:        1440    0%      1440
  242. refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
  243. refresh_pattern (Release|Package(.gz)*)$       0       20%     2880
  244. refresh_pattern .               0       20%     4320
  245. #----------------------------------------------------------------------
  246. # Access log for the cache or to SARG
  247. #----------------------------------------------------------------------
  248. logfile_rotate 1
  249. access_log /var/log/squid3/access.log
  250. access_log /var/log/squid3/error.log
  251. cache_store_log none
  252. #----------------------------------------------------------------------
  253. # other configurations
  254. #----------------------------------------------------------------------
  255. half_closed_clients off
  256. server_persistent_connections off
  257. client_persistent_connections off
  258. log_fqdn off
  259. quick_abort_min 0 KB
  260. quick_abort_max 0 KB
  261. quick_abort_pct 100
  262. max_filedescriptors 65536
  263. cache_effective_user proxy
  264. cache_effective_group proxy
  265. #----------------------------------------------------------------------
  266. # Keeping small objects in recent memory
  267. #----------------------------------------------------------------------
  268. memory_replacement_policy heap GDSF
  269. cache_replacement_policy heap LFUDA
  270. #----------------------------------------------------------------------
  271. # Sites that are denied to store files in squid cache
  272. #----------------------------------------------------------------------
  273. acl nocache dstdomain .4shared.com .youtube.com .windowsupdate.com .gl$
  274. no_cache deny nocache
  275. #----------------------------------------------------------------------
  276. # Denying cache for files with extension. *.asx and. *.asf | streaming |
  277. #----------------------------------------------------------------------
  278. acl asxf url_regex -i .(asx|asf)$
  279. cache deny asxf" >> /etc/squid3/squid.conf
  280.  
  281. /etc/init.d/squid3 stop
  282. sleep 1
  283.  
  284. squid3 -z
  285. sleep 1
  286.  
  287. /etc/init.d/squid3 restart
  288.  
  289. sleep 3
  290.  
  291. IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')      
  292. HOST_NAME=$(hostname -a)
  293. DOMAIN_NAME=$(hostname -d)                 
  294.  
  295. echo Y | apt-get install sqlite gcc libsqlite3-dev libapache2-mod-php5 php-db libstdc++6 g++ unzip libmysqlclient15-dev libblkid-dev libcurl3-dev lynx ffmpeg lsb-release sudo make php5-dev php-pear apache2-prefork-dev libpcre3-dev  
  296.  
  297. sleep 3
  298.  
  299. wget http://www.raptorcache.com/install/64/raptor64.tar.gz
  300. cp raptor64.tar.gz /tmp
  301. tar -xzvf /tmp/raptor64.tar.gz -C /
  302. rm -rf raptor64.tar.gz
  303. chmod a+x /usr/sbin/raptor
  304.  
  305. mkdir /var/log/raptor && mkdir /var/tmp/raptor && mkdir /var/run/raptor && mkdir /raptorcache &&
  306. chmod a+rwx /var/log/raptor && chmod a+rwx /var/tmp/raptor && chmod a+rwx /var/run/raptor && chmod a+x /etc/init.d/raptor &&
  307. chown -R www-data /raptorcache/
  308. chmod -R 777 /raptorcache/
  309. umask 000 /raptorcache/
  310.  
  311. echo "extension=pdo.so" >> /etc/php5/apache2/php.ini
  312. echo "vm.swappiness=10" >> /etc/sysctl.conf
  313.  
  314. update-rc.d raptor defaults
  315.  
  316. sleep 3
  317.  
  318. echo "#----------------------------------------------------------------------
  319. acl raptor_lst url_regex -i \"/etc/raptor/raptor.lst\"
  320. cache deny raptor_lst
  321. cache_peer $IPSERV parent 8080 0 proxy-only no-digest
  322. dead_peer_timeout 2 seconds
  323. cache_peer_access $IPSERV allow raptor_lst
  324. cache_peer_access $IPSERV deny all
  325. #----------------------------------------------------------------------" >> /etc/squid3/squid.conf
  326.  
  327. sleep 3
  328.  
  329. wget http://www.raptorcache.com/install/clean/64/clean.zip
  330. unzip clean.zip
  331. mv clean /etc/raptor/
  332. chmod 777 /etc/raptor/clean
  333. rm -rf clean.zip
  334.  
  335. wget http://www.raptorcache.com/install/var/pluginmaker.tar.gz
  336. tar -xzvf pluginmaker.tar.gz
  337. mv pluginmaker /etc/raptor/
  338. rm -rf pluginmaker.tar.gz
  339.  
  340. touch /etc/raptor/raptor.lst
  341.  
  342. wget http://www.raptorcache.com/install/64/plugins/plugins.tar.gz
  343. tar -xzvf plugins.tar.gz
  344. mv plugins /etc/raptor/
  345. rm -rf plugins.tar.gz
  346. clear
  347. chmod 777 /etc/raptor/plugins/*
  348. chmod 777 /etc/raptor/cl0
  349.  
  350. # wget -O /usr/lib64/libmysqlclient.so.16 http://www.joemg.host56.com/lib/64bits/libmysqlclient.so.16
  351. wget -O /usr/lib/libmysqlclient.so.16 http://www.joemg.host56.com/lib/64bits/libmysqlclient.so.16
  352.  
  353. # wget http://repo.undip.ac.id/ubuntu//pool/main/m/mysql-5.1/libmysqlclient16_5.1.67-0ubuntu0.11.10.1_amd64.deb
  354. # dpkg -i libmysqlclient16_5.1.67-0ubuntu0.11.10.1_amd64.deb
  355.  
  356. wget http://security.debian.org/debian-security/pool/updates/main/m/mysql-5.1/libmysqlclient16_5.1.66-0+squeeze1_amd64.deb
  357. dpkg -i libmysqlclient16_5.1.67-0ubuntu0.11.10.1_amd64.deb
  358.  
  359. /etc/init.d/raptor start
  360.  
  361. chmod 777 /etc/raptor/clean
  362.  
  363. sleep 3
  364.  
  365. ## Raptor
  366. # m     h   dom     mon     dow     user    command
  367. 59      1   *       *       *       root    /etc/raptor/./clean 45
  368. 30      23  *       *       *       root    squid3 -k rotate
  369. *       */1 *       *       *       root    /etc/raptor/./cl0
  370. 59      22  *       *       *       root    /etc/raptor/rprotate
  371. */2     *   *       *       *       root    serv
  372. */1     *   *       *       *       root    vnstat -u -i eth0
  373.  
  374. sleep 6
  375. #-------------------------------------------------------------------------------------------
  376. clear
  377. echo ""
  378. echo ""
  379. echo "+-------------------------------------------------------------+"
  380. echo "|                       Installing Mysql                      |"
  381. echo "|   It is important to set the password of Mysql = raptor     |"
  382. echo "+-------------------------------------------------------------+"
  383. echo Press enter to continue...
  384. read -n 0 -ers
  385.  
  386. echo Y | apt-get install mysql-server mysql-client php5-mysql &&
  387. echo Y | aptitude install php5-cgi &&
  388.  
  389. wget http://www.raptorcache.com/install/var/raptor.sql
  390. cp raptor.sql /var/tmp/
  391. rm -rf raptor.sql
  392. echo
  393.  
  394. mysql -u root -praptor << eof
  395. CREATE DATABASE raptor;
  396. eof
  397. mysql -u root -praptor raptor < /var/tmp/raptor.sql
  398.  
  399. sleep 6
  400.  
  401. IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')      
  402. HOST_NAME=$(hostname -a)
  403. DOMAIN_NAME=$(hostname -d)                 
  404.  
  405. sleep 3
  406.  
  407. mv /etc/hosts /etc/hosts_
  408. touch /etc/hosts
  409.  
  410. echo "127.0.0.1 localhost.localdomain   localhost
  411. $IPSERV $HOST_NAME.$DOMAIN_NAME $HOST_NAME
  412. #
  413. ::1 localhost   ip6-localhost   ip6-loopback
  414. fe00::0 ip6-localnet
  415. fe00::0 ip6-mcastprefix
  416. ff02:1 ip6-allnodes
  417. ff02::2 ip6-allrouters
  418. ff02::3 ip6-allhosts" >> /etc/hosts
  419.  
  420. sleep 3
  421.  
  422. mv /etc/network/interfaces /etc/network/interfaces_
  423. touch
  424. echo "# This file describes the network interfaces available on your system
  425. # and how to activate them. For more information, see interfaces(5).
  426.  
  427. # The loopback network interface
  428. auto lo
  429. iface lo inet loopback
  430.  
  431. # The primary network interface
  432. allow-hotplug eth0
  433. iface eth0 inet static
  434.     address $IPSERV
  435.     netmask 255.255.255.0
  436.     network 192.168.1.0
  437.     broadcast 192.168.1.255
  438.     gateway 192.168.1.1
  439.     dns-nameservers 127.0.0.1 8.8.8.8 8.8.4.4
  440.     search $HOST_NAME.$DOMAIN_NAME" >> /etc/network/interfaces
  441.    
  442. sleep 3
  443.  
  444. echo Y | apt-get install bind9 dnsutils bind9-doc resolvconf
  445.  
  446. sleep 3
  447.  
  448. mv /etc/bind/named.conf.options /etc/bind/named.conf.options_
  449. wget http://data-servers.googlecode.com/files/named.conf.options
  450.  
  451. echo "include "/etc/bind/zones.rfc1918";
  452. };" > /etc/bind/named.conf.local
  453.  
  454. echo "logging {
  455. category lame-servers {null; };
  456. category edns-disabled { null; };
  457. };" >> /etc/bind/named.conf.local
  458.  
  459. echo "ServerName $HOST_NAME.$DOMAIN_NAME" >> /etc/apache2/apache2.conf
  460.  
  461. mv /etc/apache2/httpd.conf /etc/apache2/httpd.conf_
  462. mkdir /etc/cacti
  463. touch /etc/cacti/httpd.conf
  464. echo "Listen 82
  465. <VirtualHost *:82>
  466. DocumentRoot /var/raptor
  467. ServerName www.$DOMAIN_NAME
  468. ErrorLog /var/log/virtual82-error_log
  469. CustomLog /var/log/virtual82-access_log common
  470. </VirtualHost>
  471. Listen 84
  472. <VirtualHost *:84>
  473. DocumentRoot /var/www/sarg
  474. ServerName www.$DOMAIN_NAME
  475. </VirtualHost>" >> /etc/apache2/httpd.conf
  476.  
  477. sleep 6
  478.  
  479. clear
  480.  
  481. sleep 3
  482. echo "
  483. # Repository Sarg for debian
  484. deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list
  485. apt-get update
  486. echo Y | aptitude install sarg
  487. mv /etc/sarg/sarg.conf  /etc/sarg/sarg.conf_old
  488. wget http://www.raptorcache.com/install/var/sarg.conf
  489. mv sarg.conf /etc/sarg/sarg.conf
  490. echo "
  491. # Schedulle of Sarg
  492. 59              21               *       *               *       root    sarg" >> /etc/crontab
  493. mkdir /var/www/sarg/
  494. sarg -x
  495.  
  496. sleep 1
  497. wget http://joemg.host56.com/wpanel/raptor.tar.gz
  498. tar -xzvf raptor.tar.gz
  499. mv raptor /var/
  500. rm -rf raptor.tar.gz
  501. clear
  502. chmod 777 /var/raptor/*
  503. chmod 777 /var/raptor/mail/*
  504. chmod 777 /etc/raptor/raptor.lst
  505. chmod 777 /etc/squid3/squid.conf
  506. chmod 777 /etc/raptor/raptor.conf
  507. chmod 777 /etc/squid3/denegados.lst
  508. chmod 777 /etc/network/interfaces
  509. chmod 777 /etc/resolv.conf
  510. clear
  511.  
  512. sleep 1
  513. echo Y | apt-get install snmpd
  514. mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf_
  515. touch /etc/snmp/snmpd.conf
  516. echo "rocommunity  public
  517. syslocation  "PDC, Proxy DataCenter"
  518. syscontact  admin@$DOMAIN_NAME" >>  /etc/snmp/snmpd.conf
  519. rm -rf /etc/default/snmpd
  520. wget http://www.raptorcache.com/install/var/snmpd
  521. mv snmpd /etc/default/
  522. /etc/init.d/snmpd restart
  523. sleep 3
  524. clear
  525. echo ""
  526. echo ""
  527. echo "+--------------------------------------------------------------------------------------+"
  528. echo "|                                    Installing Cacti                                  |"
  529. echo "|         Choose Apache2 as web server and then enter the password Mysql(raptor)       |"
  530. echo "+--------------------------------------------------------------------------------------+"
  531. echo Press enter to continue...
  532. read -n 0 -ers
  533. echo Y | apt-get install cacti
  534. wget http://www.raptorcache.com/install/var/raptor-cacti.sql
  535. mv raptor-cacti.sql /var/tmp/
  536. mysql -u root -praptor cacti < /var/tmp/raptor-cacti.sql
  537. sleep 1
  538. mv /etc/cacti/apache.conf /etc/cacti/apache.conf_
  539. touch /etc/cacti/apache.conf
  540. echo "Alias /graphcacti /usr/share/cacti/site
  541.  
  542. <Directory /usr/share/cacti/site>
  543.        Options +FollowSymLinks
  544.        AllowOverride None
  545.        order allow,deny
  546.        allow from all
  547.  
  548.        AddType application/x-httpd-php .php
  549.  
  550.        <IfModule mod_php5.c>
  551.                php_flag magic_quotes_gpc Off
  552.                php_flag short_open_tag On
  553.                php_flag register_globals Off
  554.                php_flag register_argc_argv On
  555.                php_flag track_vars On
  556.                # this setting is necessary for some locales
  557.                php_value mbstring.func_overload 0
  558.                php_value include_path .
  559.        </IfModule>
  560.  
  561.        DirectoryIndex index.php
  562. </Directory>" >> /etc/cacti/apache.conf
  563. /etc/init.d/apache2 restart
  564.  
  565. echo Y | apt-get install vnstat
  566. vnstat -u -i eth0
  567.  
  568. echo Y | apt-get install smartmontools lvm2 hdparm
  569. sleep 1
  570.  
  571. echo Y | apt-get install lm-sensors
  572. clear
  573. echo ""
  574. echo ""
  575. echo "+---------------------------------------------+"
  576. echo "|        temperature sensors Installation     |"
  577. echo "+---------------------------------------------+"
  578. echo Press enter to continue...
  579. read -n 0 -ers
  580. sensors-detect
  581. service module-init-tools restart
  582. /etc/init.d/module-init-tools restart
  583. echo "
  584. # DNS Cache
  585. */2               *               *       *               *       root    rndc dumpdb" >> /etc/crontab
  586.  
  587. clear
  588. wget http://www.raptorcache.com/install/var/upload.cgi
  589. mv upload.cgi /usr/lib/cgi-bin/
  590. chmod 777 /usr/lib/cgi-bin/upload.cgi
  591. # echo Y | apt-get --purge remove sudo
  592. # echo Y | apt-get install sudo
  593. # echo "www-data  ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
  594. # chmod 777/etc/sudoers
  595. clear
  596.  
  597. echo | pecl install apc --with-apxs='/usr/bin/apxs2'
  598. echo "Alias /var/raptor/apc /usr/share/php/apc.php
  599.  
  600. <Directory /usr/share/php/apc.php>
  601.        Options +FollowSymLinks
  602.        AllowOverride None
  603.        order allow,deny
  604.        allow from all
  605.  
  606.        AddType application/x-httpd-php .php
  607.  
  608.        <IfModule mod_php5.c>
  609.                php_flag magic_quotes_gpc Off
  610.                php_flag short_open_tag On
  611.                php_flag register_globals Off
  612.                php_flag register_argc_argv On
  613.                php_flag track_vars On
  614.                # this setting is necessary for some locales
  615.                php_value mbstring.func_overload 0
  616.                php_value include_path .
  617.        </IfModule>
  618.  
  619.        DirectoryIndex index.php
  620. </Directory>" >> /etc/apache2/conf.d/apc.conf
  621. echo "extension=apc.so" >> /etc/php5/conf.d/apc.ini
  622. echo "; APC Configuration
  623. apc.enabled = 1
  624. ; Memory allocated to APC. Use Munin or APC Info to see if more is needed.
  625. apc.shm_size=32M
  626. ; rfc1867 allow file upload progression display.
  627. apc.rfc1867 = on" >> /etc/php5/conf.d/apc-config.ini
  628. clear
  629. rm -rf /var/tmp/*
  630.  
  631. touch /sbin/tail-squid /sbin/tail-raptor
  632. echo "tail -f /var/log/squid3/access.log | ccze" >> /sbin/tail-squid
  633. echo "tail -f /var/log/squid3/access.log | ccze" >> /sbin/tail-raptor
  634. chmod 755 /sbin/tail-raptor /sbin/tail-squid
  635. # chown root:root /sbin/tail-raptor /sbin/tail-squid
  636.  
  637. iptables -F
  638. iptables -X
  639. iptables -t nat -F
  640. iptables -t nat -X
  641. iptables -t mangle -F
  642. iptables -t mangle -X
  643. iptables -P INPUT ACCEPT
  644. iptables -P OUTPUT ACCEPT
  645. iptables -A INPUT -s 192.168.0.0/16 -m state --state NEW -p tcp --dport 53 -j ACCEPT
  646. iptables -A INPUT -s 192.168.0.0/16 -m state --state NEW -p udp --dport 53 -j ACCEPT
  647. iptables -A INPUT -p tcp -s 192.168.0.0/16 --dport 80 -j ACCEPT
  648. iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
  649. iptables-save -c > /etc/iptables.up.rules
  650.  
  651. echo ""
  652. echo "+==========================================================================+"
  653. echo "|                            Installation Complete                         |"
  654. echo "|            Reboot your system to complete the installation               |"
  655. echo "+==========================================================================+"
  656. echo ""
  657. # Copy stop sini
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement