SHOW:
|
|
- or go back to the newest paste.
1 | - | # Ubuntu Version tested on 12.10 |
1 | + | # Ubuntu Version tested for 12.10 |
2 | - | # wget http://www.raptorcache.com/install/raptor10b-64.sh |
2 | + | |
3 | - | # chmod 777 raptor10b-64.sh |
3 | + | |
4 | - | # Edit and replace with script below |
4 | + | |
5 | - | # bash raptor10b-64.sh |
5 | + | |
6 | echo " _ __ __ _____ " | |
7 | echo " | | | \/ |/ ____|" | |
8 | echo " | | ___ ___| \ / | | __ " | |
9 | echo " _ | |/ _ \ / _ \ |\/| | | |_ |" | |
10 | echo " | |__| | (_) | __/ | | | |__| |" | |
11 | echo " \____/ \___/ \___|_| |_|\_____|" | |
12 | echo "" | |
13 | echo "+=====================================================================+" | |
14 | echo "| INSTALLATION Raptor 1.0b - Squid 3.x |" | |
15 | echo "| 64 bits |" | |
16 | echo "+=====================================================================+" | |
17 | echo "" | |
18 | V='|-------------------------> Version 64 bits <-------------------------|' | |
19 | ER='ERROR, Your Linux version is not 64 bits' | |
20 | ER2='Use the appropriate script for your version' | |
21 | P=`uname -m` | |
22 | if [ $P = x86_64 ] ; then | |
23 | echo $V | |
24 | else | |
25 | echo $ER | |
26 | echo "" | |
27 | echo $ER2 | |
28 | echo "" | |
29 | exit 0 | |
30 | fi | |
31 | echo "" | |
32 | ||
33 | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') | |
34 | HOST_NAME=$(hostname -a) DOMAIN_NAME=$(hostname -d) | |
35 | ||
36 | sleep 2 | |
37 | ||
38 | - | HOST_NAME="local.war.net" |
38 | + | |
39 | ||
40 | cd .. | |
41 | mkdir /cache-1; chmod 777 /cache-1; chown proxy:proxy /cache-1; cd /root | |
42 | ||
43 | echo Y | apt-get install squid3 squidclient squid-cgi ccze | |
44 | ||
45 | - | mkdir /cache-1 |
45 | + | |
46 | - | chmod 777 /cache-1 |
46 | + | |
47 | - | cd /root |
47 | + | |
48 | ||
49 | - | echo Y | apt-get install squid3 |
49 | + | |
50 | touch /etc/squid3/squid.conf | |
51 | ||
52 | echo "#========================== Squid 3.x Conf ===========================# | |
53 | # Port Option SQUID 3.x | |
54 | #---------------------------------------------------------------------- | |
55 | http_port 3128 intercept | |
56 | visible_hostname $DOMAIN_NAME | |
57 | icp_port 0 | |
58 | #---------------------------------------------------------------------- | |
59 | error_directory /usr/share/squid3/errors/English | |
60 | #---------------------------------------------------------------------- | |
61 | acl denegados url_regex -i "/etc/squid3/denegados.lst" | |
62 | - | visible_hostname proxy.$HOST_NAME |
62 | + | |
63 | # DNS Option | |
64 | #---------------------------------------------------------------------- | |
65 | dns_nameservers 8.8.8.8 8.8.4.4 | |
66 | dns_retransmit_interval 5 seconds | |
67 | dns_timeout 2 minutes | |
68 | #---------------------------------------------------------------------- | |
69 | acl manager proto cache_object | |
70 | acl localhost src 127.0.0.1/32 ::1 | |
71 | acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 | |
72 | acl CONNECT method CONNECT | |
73 | #################################################################### | |
74 | acl localnet src 10.0.0.0/8 # RFC1918 possible internal network | |
75 | acl localnet src 172.16.0.0/12 # RFC1918 possible internal network | |
76 | acl localnet src 192.168.0.0/16 # RFC1918 possible internal network | |
77 | #################################################################### | |
78 | acl Safe_ports port 21 70 80 210 280 443 488 563 591 631 777 901 81 3128 1025-65535 | |
79 | acl SSL_ports port 443 563 81 | |
80 | - | acl Safe_ports port 80 # http |
80 | + | |
81 | - | acl Safe_ports port 21 # ftp |
81 | + | |
82 | - | acl SSL_ports port 443 |
82 | + | |
83 | - | acl Safe_ports port 443 # https |
83 | + | |
84 | - | acl Safe_ports port 70 # gopher |
84 | + | |
85 | - | acl Safe_ports port 210 # wais |
85 | + | |
86 | - | acl Safe_ports port 1025-65535 # unregistered ports |
86 | + | |
87 | - | acl Safe_ports port 280 # http-mgmt |
87 | + | |
88 | - | acl Safe_ports port 488 # gss-http |
88 | + | # Always allow localhost connections |
89 | - | acl Safe_ports port 591 # filemaker |
89 | + | |
90 | - | acl Safe_ports port 777 # multiling http |
90 | + | |
91 | - | acl Safe_ports port 631 # cups |
91 | + | # Allow local network(s) on interface(s) |
92 | - | acl Safe_ports port 873 # rsync |
92 | + | http_access allow localnet |
93 | - | acl Safe_ports port 901 # SWAT |
93 | + | |
94 | - | acl Safe_ports port 1863 # MSN |
94 | + | # Default block all to be sure |
95 | - | #acl SSL_ports port 443 # https |
95 | + | http_access deny all |
96 | - | acl SSL_ports port 563 # snews |
96 | + | |
97 | - | acl SSL_ports port 873 # rsync |
97 | + | |
98 | #---------------------------------------------------------------------- | |
99 | # Reserved memory for cache | |
100 | # It is recommended that you take approx. 5 MB of RAM per 1GB assigned to cache_dir | |
101 | #---------------------------------------------------------------------- | |
102 | cache_mem 45 MB | |
103 | #---------------------------------------------------------------------- | |
104 | # Maximum size of a file in cache memory | |
105 | #---------------------------------------------------------------------- | |
106 | maximum_object_size_in_memory 128 KB | |
107 | #---------------------------------------------------------------------- | |
108 | # Maximum and minimum size of files in the disk cache | |
109 | #---------------------------------------------------------------------- | |
110 | maximum_object_size 30 MB | |
111 | - | cache_mem 50 MB |
111 | + | |
112 | #---------------------------------------------------------------------- | |
113 | # Replace cache files when disk cache reach 96% full | |
114 | #---------------------------------------------------------------------- | |
115 | cache_swap_low 92 | |
116 | cache_swap_high 96 | |
117 | #---------------------------------------------------------------------- | |
118 | # Total HD space to be used by the cache, number of folders, | |
119 | # Number of subfolders in cache | |
120 | # 15000 = 15 GB | |
121 | #---------------------------------------------------------------------- | |
122 | cache_dir aufs /cache-1 15000 16 256 | |
123 | #---------------------------------------------------------------------- | |
124 | # Standard update cache | |
125 | # 1 month = 10080 mins, 1 day = 1440 mins | |
126 | #---------------------------------------------------------------------- | |
127 | refresh_pattern -i \.jpg$ 14400 80% 43200 reload-into-ims | |
128 | refresh_pattern -i \.gif$ 14400 80% 43200 reload-into-ims | |
129 | - | # 10000 = 10 GB |
129 | + | |
130 | refresh_pattern -i \.jpeg$ 14400 80% 43200 reload-into-ims | |
131 | - | cache_dir aufs /cache-1 10000 16 256 |
131 | + | |
132 | refresh_pattern -i \.tif$ 14400 80% 43200 reload-into-ims | |
133 | refresh_pattern -i \.tiff$ 14400 80% 43200 reload-into-ims | |
134 | refresh_pattern -i \.swf$ 14400 80% 43200 reload-into-ims | |
135 | refresh_pattern -i \.html$ 10 20% 4320 reload-into-ims | |
136 | refresh_pattern -i \.htm$ 10 20% 4320 reload-into-ims | |
137 | refresh_pattern -i \.shtml$ 10 20% 4320 reload-into-ims | |
138 | refresh_pattern -i \.shtm$ 10 20% 4320 reload-into-ims | |
139 | refresh_pattern -i \.nub$ 2880 80% 21600 reload-into-ims | |
140 | refresh_pattern -i \.exe$ 14400 80% 43200 | |
141 | refresh_pattern -i \.zip$ 14400 80% 43200 | |
142 | refresh_pattern -i \.mov$ 14400 80% 43200 | |
143 | refresh_pattern -i \.mpe?g?$ 14400 80% 43200 | |
144 | refresh_pattern -i \.avi$ 14400 80% 43200 | |
145 | refresh_pattern -i \.qtm?$ 14400 80% 43200 | |
146 | refresh_pattern -i \.viv$ 14400 80% 43200 | |
147 | refresh_pattern -i \.wav$ 14400 80% 43200 | |
148 | refresh_pattern -i \.aiff?$ 14400 80% 43200 | |
149 | refresh_pattern -i \.au$ 14400 80% 43200 | |
150 | refresh_pattern -i \.ram?$ 14400 80% 43200 | |
151 | refresh_pattern -i \.snd$ 14400 80% 43200 | |
152 | refresh_pattern -i \.mid$ 14400 80% 43200 | |
153 | refresh_pattern -i \.mp2$ 14400 80% 43200 | |
154 | refresh_pattern -i \.mp3$ 14400 80% 43200 | |
155 | refresh_pattern -i \.sit$ 14400 80% 43200 | |
156 | refresh_pattern -i \.zip$ 14400 80% 43200 | |
157 | refresh_pattern -i \.hqx$ 14400 80% 43200 | |
158 | refresh_pattern -i \.arj$ 14400 80% 43200 | |
159 | refresh_pattern -i \.lzh$ 14400 80% 43200 | |
160 | refresh_pattern -i \.lha$ 14400 80% 43200 | |
161 | refresh_pattern -i \.cab$ 14400 80% 43200 | |
162 | refresh_pattern -i \.rar$ 14400 80% 43200 | |
163 | refresh_pattern -i \.tar$ 14400 80% 43200 | |
164 | refresh_pattern -i \.gz$ 14400 80% 43200 | |
165 | refresh_pattern -i \.z$ 14400 80% 43200 | |
166 | refresh_pattern -i \.a[0-9][0-9]$ 14400 80% 43200 | |
167 | refresh_pattern -i \.r[0-9][0-9]$ 14400 80% 43200 | |
168 | refresh_pattern -i \.txt$ 14400 80% 43200 | |
169 | refresh_pattern -i \.pdf$ 14400 80% 43200 | |
170 | refresh_pattern -i \.doc$ 14400 80% 43200 | |
171 | refresh_pattern -i \.rtf$ 14400 80% 43200 | |
172 | refresh_pattern -i \.tex$ 14400 80% 43200 | |
173 | refresh_pattern -i \.latex$ 14400 80% 43200 | |
174 | refresh_pattern -i \.class$ 14400 80% 43200 | |
175 | refresh_pattern -i \.js$ 14400 80% 43200 | |
176 | refresh_pattern -i \.ico$ 14400 80% 43200 | |
177 | refresh_pattern -i \.css$ 10 20% 4320 | |
178 | #---------------------------------------------------------------------- | |
179 | refresh_pattern ^ftp: 1440 20% 10080 | |
180 | refresh_pattern ^gopher: 1440 0% 1440 | |
181 | refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 | |
182 | #refresh_pattern (Release|Package(.gz)*)$ 0 20% 2880 | |
183 | refresh_pattern . 0 20% 4320 | |
184 | #---------------------------------------------------------------------- | |
185 | # Access log for the cache or to SARG | |
186 | #---------------------------------------------------------------------- | |
187 | logfile_rotate 1 | |
188 | access_log /var/log/squid3/access.log | |
189 | access_log /var/log/squid3/error.log | |
190 | cache_store_log none | |
191 | #---------------------------------------------------------------------- | |
192 | # other configurations | |
193 | #---------------------------------------------------------------------- | |
194 | half_closed_clients off | |
195 | server_persistent_connections off | |
196 | client_persistent_connections off | |
197 | log_fqdn off | |
198 | quick_abort_min 0 KB | |
199 | quick_abort_max 0 KB | |
200 | quick_abort_pct 100 | |
201 | max_filedescriptors 65536 | |
202 | cache_effective_user proxy | |
203 | cache_effective_group proxy | |
204 | #---------------------------------------------------------------------- | |
205 | # Keeping small objects in recent memory | |
206 | #---------------------------------------------------------------------- | |
207 | memory_replacement_policy heap GDSF | |
208 | cache_replacement_policy heap LFUDA | |
209 | #---------------------------------------------------------------------- | |
210 | # Sites that are denied to store files in squid cache | |
211 | #---------------------------------------------------------------------- | |
212 | acl nocache dstdomain .4shared.com .youtube.com .windowsupdate.com .gl$ | |
213 | no_cache deny nocache | |
214 | #---------------------------------------------------------------------- | |
215 | # Denying cache for files with extension. Asx and. Asf | streaming | | |
216 | #---------------------------------------------------------------------- | |
217 | acl asx url_regex -i \.asx$ | |
218 | cache deny asx | |
219 | acl asf url_regex -i \.asf$ | |
220 | cache deny asf" >> /etc/squid3/squid.conf | |
221 | ||
222 | /etc/init.d/squid3 stop | |
223 | sleep 1 | |
224 | ||
225 | squid3 -z | |
226 | sleep 1 | |
227 | ||
228 | /etc/init.d/squid3 restart | |
229 | ||
230 | sleep 6 | |
231 | ||
232 | ||
233 | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') | |
234 | HOST_NAME=$(hostname -a) DOMAIN_NAME=$(hostname -d) | |
235 | ||
236 | echo Y | apt-get install apache2 | |
237 | ||
238 | sleep 1 | |
239 | ||
240 | echo Y | apt-get install sqlite gcc libsqlite3-dev libapache2-mod-php5 php-db libstdc++6 g++ unzip | |
241 | ||
242 | echo Y | apt-get install libmysqlclient15-dev libblkid-dev libcurl3-dev lynx ffmpeg lsb-release sudo | |
243 | ||
244 | echo Y | apt-get install make php5-dev php-pear apache2-prefork-dev libpcre3-dev | |
245 | ||
246 | sleep 3 | |
247 | ||
248 | wget http://www.raptorcache.com/install/64/raptor64.tar.gz | |
249 | cp raptor64.tar.gz /tmp | |
250 | tar -xzvf /tmp/raptor64.tar.gz -C / | |
251 | rm -rf raptor64.tar.gz | |
252 | chmod a+x /usr/sbin/raptor | |
253 | ||
254 | mkdir /var/log/raptor && mkdir /var/tmp/raptor && mkdir /var/run/raptor && mkdir /raptorcache && | |
255 | 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 && | |
256 | chown -R www-data /raptorcache/ | |
257 | chmod -R 777 /raptorcache/ | |
258 | umask 000 /raptorcache/ | |
259 | - | cd /root |
259 | + | |
260 | echo "extension=pdo.so" >> /etc/php5/apache2/php.ini | |
261 | echo "vm.swappiness=10" >> /etc/sysctl.conf | |
262 | ||
263 | update-rc.d raptor defaults | |
264 | ||
265 | sleep 3 | |
266 | ||
267 | echo "#---------------------------------------------------------------------- | |
268 | acl raptor_lst url_regex -i \"/etc/raptor/raptor.lst\" | |
269 | cache deny raptor_lst | |
270 | cache_peer $IPSERV parent 8080 0 proxy-only no-digest | |
271 | dead_peer_timeout 2 seconds | |
272 | cache_peer_access $IPSERV allow raptor_lst | |
273 | cache_peer_access $IPSERV deny all | |
274 | #----------------------------------------------------------------------" >> /etc/squid3/squid.conf | |
275 | ||
276 | sleep 3 | |
277 | ||
278 | wget http://www.raptorcache.com/install/clean/64/clean.zip | |
279 | unzip clean.zip | |
280 | mv clean /etc/raptor/ | |
281 | chmod 777 /etc/raptor/clean | |
282 | rm -rf clean.zip | |
283 | ||
284 | wget http://www.raptorcache.com/install/var/pluginmaker.tar.gz | |
285 | tar -xzvf pluginmaker.tar.gz | |
286 | mv pluginmaker /etc/raptor/ | |
287 | rm -rf pluginmaker.tar.gz | |
288 | ||
289 | touch /etc/raptor/raptor.lst | |
290 | ||
291 | wget http://www.raptorcache.com/install/64/plugins/plugins.tar.gz | |
292 | tar -xzvf plugins.tar.gz | |
293 | mv plugins /etc/raptor/ | |
294 | rm -rf plugins.tar.gz | |
295 | clear | |
296 | chmod 777 /etc/raptor/plugins/* | |
297 | chmod 777 /etc/raptor/cl0 | |
298 | ||
299 | # wget -O /usr/lib64/libmysqlclient.so.16 http://www.joemg.host56.com/lib/64bits/libmysqlclient.so.16 | |
300 | wget -O /usr/lib/libmysqlclient.so.16 http://www.joemg.host56.com/lib/64bits/libmysqlclient.so.16 | |
301 | ||
302 | wget http://repo.undip.ac.id/ubuntu//pool/main/m/mysql-5.1/libmysqlclient16_5.1.67-0ubuntu0.11.10.1_amd64.deb | |
303 | dpkg -i libmysqlclient16_5.1.67-0ubuntu0.11.10.1_amd64.deb | |
304 | ||
305 | /etc/init.d/raptor start | |
306 | ||
307 | chmod 777 /etc/raptor/clean | |
308 | ||
309 | sleep 3 | |
310 | ||
311 | ## Raptor | |
312 | # m h dom mon dow user command | |
313 | 59 1 * * * root /etc/raptor/./clean 45 | |
314 | 30 23 * * * root squid3 -k rotate | |
315 | * */1 * * * root /etc/raptor/./cl0 | |
316 | 59 22 * * * root /etc/raptor/rprotate | |
317 | */2 * * * * root serv | |
318 | */1 * * * * root vnstat -u -i eth0 | |
319 | ||
320 | sleep 6 | |
321 | #------------------------------------------------------------------------------------------- | |
322 | apt-get update | |
323 | clear | |
324 | echo "" | |
325 | echo "" | |
326 | echo "+-------------------------------------------------------------+" | |
327 | echo "| Installing Mysql |" | |
328 | echo "| It is important to set the password of Mysql = raptor |" | |
329 | - | # min(0-59) hour(0-23) days(1-31) month(1-12) weekly(0-7) user command |
329 | + | |
330 | - | 59 1 * * * root /etc/raptor/./clean 45 |
330 | + | |
331 | - | 30 23 * * * root squid3 -k rotate |
331 | + | |
332 | - | * */1 * * * root /etc/raptor/./cl0 |
332 | + | |
333 | - | 59 22 * * * root /etc/raptor/rprotate |
333 | + | |
334 | - | */2 * * * * root serv |
334 | + | |
335 | - | */1 * * * * root vnstat -u -i eth0" >> /etc/crontab |
335 | + | |
336 | ||
337 | wget http://www.raptorcache.com/install/var/raptor.sql | |
338 | cp raptor.sql /var/tmp/ | |
339 | rm -rf raptor.sql | |
340 | echo | |
341 | ||
342 | mysql -u root -praptor << eof | |
343 | CREATE DATABASE raptor; | |
344 | eof | |
345 | mysql -u root -praptor raptor < /var/tmp/raptor.sql | |
346 | ||
347 | sleep 6 | |
348 | ||
349 | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') | |
350 | HOST_NAME=$(hostname -a) DOMAIN_NAME=$(hostname -d) | |
351 | ||
352 | sleep 3 | |
353 | ||
354 | mv /etc/hosts /etc/hosts_ | |
355 | touch /etc/hosts | |
356 | ||
357 | echo "127.0.0.1 localhost.localdomain localhost | |
358 | $IPSERV $HOST_NAME.$DOMAIN_NAME $HOST_NAME | |
359 | # | |
360 | ::1 localhost ip6-localhost ip6-loopback | |
361 | fe00::0 ip6-localnet | |
362 | fe00::0 ip6-mcastprefix | |
363 | ff02:1 ip6-allnodes | |
364 | ff02::2 ip6-allrouters | |
365 | ff02::3 ip6-allhosts" >> /etc/hosts | |
366 | - | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') |
366 | + | |
367 | - | HOST_NAME="local.war.net" |
367 | + | |
368 | ||
369 | # mv /etc/hostname /etc/hostname_ | |
370 | # touch /etc/hostname | |
371 | ||
372 | # echo "proxy.$HOST_NAME" >> /etc/hostname | |
373 | ||
374 | # mv /etc/resolv.conf /etc/resolv.conf_ | |
375 | - | $IPSERV proxy.$HOST_NAME proxy |
375 | + | # mv /etc/resolv.conf /etc/resolv.conf_ |
376 | # touch /etc/resolv.conf | |
377 | ||
378 | # echo "search proxy.$HOST_NAME | |
379 | # nameserver 127.0.0.1 | |
380 | # nameserver 8.8.8.8 | |
381 | # nameserver 8.8.4.4" >> /etc/resolv.conf | |
382 | ||
383 | mv /etc/network/interfaces /etc/network/interfaces_ | |
384 | sed '/dns-nameservers/d' /etc/network/interfaces_ > /etc/network/interfaces | |
385 | echo "dns-nameservers 127.0.0.1 8.8.8.8 8.8.4.4" >> /etc/network/interfaces | |
386 | - | mv /etc/hostname /etc/hostname_ |
386 | + | |
387 | - | touch /etc/hostname |
387 | + | |
388 | ||
389 | - | echo "proxy.$HOST_NAME" >> /etc/hostname |
389 | + | |
390 | ||
391 | - | mv /etc/resolv.conf /etc/resolv.conf_ |
391 | + | |
392 | - | touch /etc/resolv.conf |
392 | + | |
393 | mv /etc/bind/named.conf.options /etc/bind/named.conf.options_old | |
394 | - | echo "search proxy.$HOST_NAME |
394 | + | |
395 | - | nameserver 127.0.0.1 |
395 | + | |
396 | - | nameserver 8.8.8.8 |
396 | + | |
397 | - | nameserver 8.8.4.4" >> /etc/resolv.conf |
397 | + | |
398 | forward only; | |
399 | forwarders { 8.8.8.8; 8.8.4.4; }; | |
400 | auth-nxdomain no; # conform to RFC1035 | |
401 | listen-on-v6 { yes; }; | |
402 | listen-on { 127.0.0.1; }; | |
403 | version none; | |
404 | };" >> /etc/bind/named.conf.options | |
405 | ||
406 | echo "include "/etc/bind/zones.rfc1918"; | |
407 | };" >> /etc/bind/named.conf.local | |
408 | ||
409 | echo "ServerName $HOST_NAME.$DOMAIN_NAME" >> /etc/apache2/apache2.conf | |
410 | ||
411 | mv /etc/apache2/httpd.conf /etc/apache2/httpd.conf_ | |
412 | mkdir /etc/cacti | |
413 | - | listen-on-v6 { none; }; |
413 | + | |
414 | echo "Listen 82 | |
415 | <VirtualHost *:82> | |
416 | DocumentRoot /var/raptor | |
417 | ServerName www.raptorcache.com | |
418 | ErrorLog /var/log/virtual82-error_log | |
419 | - | logging { |
419 | + | |
420 | - | category lame-servers {null; }; |
420 | + | |
421 | - | category edns-disabled { null; }; |
421 | + | |
422 | <VirtualHost *:84> | |
423 | DocumentRoot /var/www/sarg | |
424 | - | echo "ServerName proxy.$HOST_NAME" >> /etc/apache2/apache2.conf |
424 | + | |
425 | </VirtualHost>" >> /etc/apache2/httpd.conf | |
426 | ||
427 | sleep 6 | |
428 | ||
429 | clear | |
430 | ||
431 | sleep 3 | |
432 | echo " | |
433 | # Repository Sarg for debian | |
434 | # deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list | |
435 | apt-get update | |
436 | echo Y | aptitude install sarg | |
437 | mv /etc/sarg/sarg.conf /etc/sarg/sarg.conf_old | |
438 | wget http://www.raptorcache.com/install/var/sarg.conf | |
439 | mv sarg.conf /etc/sarg/sarg.conf | |
440 | echo " | |
441 | # Schedulle of Sarg | |
442 | 59 21 * * * root sarg" >> /etc/crontab | |
443 | mkdir /var/www/sarg/ | |
444 | sarg | |
445 | ||
446 | sleep 1 | |
447 | wget http://joemg.host56.com/wpanel/raptor.tar.gz | |
448 | tar -xzvf raptor.tar.gz | |
449 | mv raptor /var/ | |
450 | rm -rf raptor.tar.gz | |
451 | clear | |
452 | chmod 777 /var/raptor/* | |
453 | chmod 777 /var/raptor/mail/* | |
454 | chmod 777 /etc/raptor/raptor.lst | |
455 | chmod 777 /etc/squid3/squid.conf | |
456 | chmod 777 /etc/raptor/raptor.conf | |
457 | chmod 777 /etc/squid3/denegados.lst | |
458 | chmod 777 /etc/network/interfaces | |
459 | - | sarg -x |
459 | + | |
460 | clear | |
461 | ||
462 | sleep 1 | |
463 | echo Y | apt-get install snmpd | |
464 | mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old | |
465 | touch /etc/snmp/snmpd.conf | |
466 | echo 'rocommunity public | |
467 | syslocation "PDC, Proxy DataCenter" | |
468 | syscontact [email protected]' > /etc/snmp/snmpd.conf | |
469 | rm -rf /etc/default/snmpd | |
470 | wget http://www.raptorcache.com/install/var/snmpd | |
471 | mv snmpd /etc/default/ | |
472 | /etc/init.d/snmpd restart | |
473 | sleep 3 | |
474 | clear | |
475 | echo "" | |
476 | echo "" | |
477 | echo "+--------------------------------------------------------------------------------------+" | |
478 | echo "| Installing Cacti |" | |
479 | echo "| Choose Apache2 as web server and then enter the password Mysql(raptor) |" | |
480 | echo "+--------------------------------------------------------------------------------------+" | |
481 | echo Press enter to continue... | |
482 | read -n 0 -ers | |
483 | echo Y | apt-get install cacti | |
484 | wget http://www.raptorcache.com/install/var/raptor-cacti.sql | |
485 | mv raptor-cacti.sql /var/tmp/ | |
486 | mysql -u root -praptor cacti < /var/tmp/raptor-cacti.sql | |
487 | sleep 1 | |
488 | mv /etc/cacti/apache.conf /etc/cacti/apache.conf_ | |
489 | touch /etc/cacti/apache.conf | |
490 | echo "Alias /graphcacti /usr/share/cacti/site | |
491 | ||
492 | <Directory /usr/share/cacti/site> | |
493 | Options +FollowSymLinks | |
494 | AllowOverride None | |
495 | order allow,deny | |
496 | allow from all | |
497 | ||
498 | AddType application/x-httpd-php .php | |
499 | ||
500 | <IfModule mod_php5.c> | |
501 | php_flag magic_quotes_gpc Off | |
502 | php_flag short_open_tag On | |
503 | php_flag register_globals Off | |
504 | php_flag register_argc_argv On | |
505 | php_flag track_vars On | |
506 | # this setting is necessary for some locales | |
507 | php_value mbstring.func_overload 0 | |
508 | php_value include_path . | |
509 | </IfModule> | |
510 | ||
511 | DirectoryIndex index.php | |
512 | </Directory>" >> /etc/cacti/apache.conf | |
513 | /etc/init.d/apache2 restart | |
514 | ||
515 | echo Y | apt-get install vnstat | |
516 | vnstat -u -i eth0 | |
517 | ||
518 | echo Y | apt-get install smartmontools lvm2 hdparm | |
519 | sleep 1 | |
520 | ||
521 | echo Y | apt-get install lm-sensors | |
522 | clear | |
523 | echo "" | |
524 | echo "" | |
525 | echo "+---------------------------------------------+" | |
526 | echo "| temperature sensors Installation |" | |
527 | echo "+---------------------------------------------+" | |
528 | echo Press enter to continue... | |
529 | read -n 0 -ers | |
530 | sensors-detect | |
531 | service module-init-tools restart | |
532 | /etc/init.d/module-init-tools restart | |
533 | echo " | |
534 | # DNS Cache | |
535 | */2 * * * * root rndc dumpdb" >> /etc/crontab | |
536 | ||
537 | clear | |
538 | wget http://www.raptorcache.com/install/var/upload.cgi | |
539 | mv upload.cgi /usr/lib/cgi-bin/ | |
540 | chmod 777 /usr/lib/cgi-bin/upload.cgi | |
541 | echo Y | apt-get --purge remove sudo | |
542 | echo Y | apt-get install sudo | |
543 | echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
544 | chmod 777/etc/sudoers | |
545 | clear | |
546 | ||
547 | echo | pecl install apc --with-apxs='/usr/bin/apxs2' | |
548 | echo "Alias /var/raptor/apc /usr/share/php/apc.php | |
549 | ||
550 | <Directory /usr/share/php/apc.php> | |
551 | Options +FollowSymLinks | |
552 | AllowOverride None | |
553 | order allow,deny | |
554 | allow from all | |
555 | ||
556 | AddType application/x-httpd-php .php | |
557 | ||
558 | <IfModule mod_php5.c> | |
559 | php_flag magic_quotes_gpc Off | |
560 | php_flag short_open_tag On | |
561 | php_flag register_globals Off | |
562 | php_flag register_argc_argv On | |
563 | php_flag track_vars On | |
564 | # this setting is necessary for some locales | |
565 | php_value mbstring.func_overload 0 | |
566 | php_value include_path . | |
567 | </IfModule> | |
568 | ||
569 | DirectoryIndex index.php | |
570 | </Directory>" >> /etc/apache2/conf.d/apc.conf | |
571 | echo "extension=apc.so" >> /etc/php5/conf.d/apc.ini | |
572 | echo "; APC Configuration | |
573 | apc.enabled = 1 | |
574 | ; Memory allocated to APC. Use Munin or APC Info to see if more is needed. | |
575 | apc.shm_size=32M | |
576 | ; rfc1867 allow file upload progression display. | |
577 | apc.rfc1867 = on" >> /etc/php5/conf.d/apc-config.ini | |
578 | clear | |
579 | rm -rf /var/tmp/* | |
580 | rm -rf web.zip | |
581 | ||
582 | echo "" | |
583 | echo "" | |
584 | echo "" | |
585 | echo "" | |
586 | echo "+==========================================================================+" | |
587 | echo "| |" | |
588 | echo "| Installation Complete |" | |
589 | echo "| |" | |
590 | echo "| Reboot your system to complete the installation |" | |
591 | echo "| |" | |
592 | echo "+==========================================================================+" | |
593 | echo "" | |
594 | echo "" |