wandibudiana

revisi raptor debian

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