0% found this document useful (0 votes)
2K views

Install Raptor

This document provides instructions for installing Raptor 1.0b caching software on a 64-bit Linux system. It includes steps to configure Squid and install additional packages needed for Raptor. Configuration files are modified and Raptor files are downloaded, extracted, and permissions are set. Cron jobs are added to perform cleanup and maintenance tasks on a schedule. MySQL is also installed and configured to support the Raptor database.

Uploaded by

Robert Scott
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Install Raptor

This document provides instructions for installing Raptor 1.0b caching software on a 64-bit Linux system. It includes steps to configure Squid and install additional packages needed for Raptor. Configuration files are modified and Raptor files are downloaded, extracted, and permissions are set. Cron jobs are added to perform cleanup and maintenance tasks on a schedule. MySQL is also installed and configured to support the Raptor database.

Uploaded by

Robert Scott
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 12

#!

/bin/bash clear echo "|=====================================================================|" echo "" echo " _ __ __ _____ " echo " | | | \/ |/ ____|" echo " | | ___ ___| \ / | | __ " echo " _ | |/ _ \ / _ \ |\/| | | |_ |" echo " | |__| | (_) | __/ | | | |__| |" echo " \____/ \___/ \___|_| |_|\_____|" echo "" echo "+=====================================================================+" echo "| INSTALACION Raptor 1.0b - Squid 3.x |" echo "| 64 bits |" echo "+=====================================================================+" echo "" V='|-------------------------> Version 64 bits <-------------------------|' ER='ERROR, su version de linux no es de 64 bits' ER2='Use el script adecuado para su version' P=`uname -m` if [ $P = x86_64 ] ; then echo $V else echo $ER echo "" echo $ER2 echo "" exit 0 fi echo "" IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') HOST_NAME="os.com" sleep 3 rm -rf /etc/apt/sources.list touch /etc/apt/sources.list echo "deb http://ftp.br.debian.org/debian/ squeeze main deb-src http://ftp.br.debian.org/debian/ squeeze main deb http://security.debian.org/ squeeze/updates main deb-src http://security.debian.org/ squeeze/updates main deb http://ftp.br.debian.org/debian/ squeeze-updates main deb-src http://ftp.br.debian.org/debian/ squeeze-updates main" >> /etc/apt/sourc es.list apt-get update apt-get upgrade cd / mkdir /temp cd /temp wget http://lusca-cache.googlecode.com/files/LUSCA_HEAD-r14809.tar.gz tar xzvf LUSCA_HEAD-r14809.tar.gz #baixar pacotes necessarios para a instalacao apt-get install gcc build-essential sharutils ccze libzip-dev automake1.9 cd LUSCA_HEAD-r14809

#configurar Squid Cache: Version LUSCA_HEAD-r14809 ./configure '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/sbin' '--sbindir =/usr/sbin' '--libexecdir=/usr/lib/squid3' '--sysconfdir=/etc/squid3' '--localst atedir=/var/spool/squid3' '--datadir=/usr/share/squid3' '--disable-dependency-tr acking' '--disable-arp-acl' '--disable-cache-digests' '--enable-cachemgr-hostnam e=localhost' '--disable-delay-pools' '--enable-epoll' '--enable-external-acl-hel pers=ip_user' '--disable-ident-lookups' '--enable-linux-netfilter' '--disable-re ferer-log' '--enable-removal-policies=heap,lru' '--enable-snmp' '--disable-ssl' '--enable-storeio=aufs,null,coss' '--disable-useragent-log' '--disable-wccpv2' ' --with-aio' '--with-maxfd=1048576' '--with-dl' '--with-pthreads' 'build_alias=i6 86-redhat-linux-gnu' 'host_alias=i686-redhat-linux-gnu' 'targe_alias=i686-redhat -linux-gnu--enable-truncate' '--disable-unlinkd' '--with-large-files' '--disable -htcp' make all make install echo "CONFIGURANDO O LUSCA E FAZENDO AJUSTES" echo "/" sleep 5 cd / mkdir mkdir mkdir mkdir mkdir chmod chmod chmod chmod chmod chmod /var/log/squid /var/log/squid3 /var/spool/squid /var/spool/squid3 /cache1 777 /cache1 777 /cache1/* 777 777 777 777 /var/log/squid /var/log/squid3 /var/spool/squid /var/spool/squid3

rm -rf /etc/squid3/squid.conf touch /etc/squid3/squid.conf echo Y | apt-get install lib32stdc++6 beep sleep 3 touch /etc/squid3/denegados.lst echo "cracks.st" >> /etc/squid3/denegados.lst rm -rf /etc/squid3/squid.conf touch /etc/squid3/squid.conf echo "# SQUID 2.7/ LUSCA TEST CONFIG FILE http_port 3128 transparent server_http11 on icp_port 0 #ACL Section acl all src 0.0.0.0/0.0.0.0

acl acl acl acl acl acl acl acl acl acl acl acl acl acl acl acl acl acl acl acl

manager proto cache_object localhost src 127.0.0.1/255.255.255.255 to_localhost dst 127.0.0.0/8 SSL_ports port 443 563 # https, snews SSL_ports port 873 # rsync Safe_ports port 80 # http Safe_ports port 21 # ftp Safe_ports port 443 563 # https, snews Safe_ports port 70 # gopher Safe_ports port 210 # wais Safe_ports port 1025-65535 # unregistered ports Safe_ports port 280 # http-mgmt Safe_ports port 488 # gss-http Safe_ports port 591 # filemaker Safe_ports port 777 # multiling http Safe_ports port 631 # cups Safe_ports port 873 # rsync Safe_ports port 901 # SWAT purge method PURGE CONNECT method CONNECT allow manager localhost deny manager allow purge localhost deny purge deny !Safe_ports deny CONNECT !SSL_ports

http_access http_access http_access http_access http_access http_access

http_access allow localhost http_access allow all http_reply_access allow all icp_access allow all acl snmppublic snmp_community public icp_access deny all quick_abort_min 16 KB quick_abort_max 16 KB quick_abort_pct 95 range_offset_limit 0 #mascar ZPH tcp_outgoing_tos 0x30 zph_mode tos zph_local 0x30 zph_parent 0 zph_option 136 cache_mem 1500 MB maximum_object_size_in_memory 1024 KB memory_replacement_policy heap GDSF cache_replacement_policy heap LFUDA cache_dir aufs /cache1 250000 357 256 store_dir_select_algorithm round-robin minimum_object_size 0 KB maximum_object_size 51200 KB cache_swap_low 97 cache_swap_high 99 # arquivos de log retirados para melhor desempenho

access_log /var/log/squid3/access.log cache_access_log /dev/null cache_log /dev/null cache_store_log /dev/null debug_options ALL,1 strip_query_terms off buffered_logs on max_stale 1 year negative_dns_ttl 1 second negative_ttl 0 second positive_dns_ttl 24 hours offline_mode off acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9] upgrade_http0.9 deny shoutcast acl apache rep_header Server ^Apache broken_vary_encoding allow apache vary_ignore_expire on #forwarded_for off header_access header_access header_access header_access header_access From deny all Server deny all Link deny all Via deny all X-Forwarded-For deny all

httpd_suppress_version_string on connect_timeout 30 seconds request_timeout 1 minutes shutdown_lifetime 10 seconds cache_effective_user proxy cache_effective_group root cache_mgr webmaster visible_hostname fspeed unique_hostname none #error_directory /usr/local/squid/share/errors/Portuguese client_persistent_connections on server_persistent_connections on #tcp_reset_on_all_errors on #blank_error_pages on max_filedescriptors 65536 tcp_recv_bufsize 64 KB dns_timeout 1 minutes dns_nameservers 127.0.0.1 dns_testnames 127.0.0.1 ipcache_size 10240 ipcache_low 95 ipcache_high 98 fqdncache_size 100 memory_pools off reload_into_ims on maximum_single_addr_tries 2

coredump_dir /cache1 pipeline_prefetch on #cachemgr_passwd none info cachemgr_passwd none all client_db on global_internal_static off max_stale 10 years retry_on_error on read_ahead_gap 32 KB # LUSCA n_aiops_threads 24 load_check_stopen on load_check_stcreate on download_fastest_client_speed on #CACHE PEER RAPTOR acl raptor_lst url_regex -i cache deny raptor_lst cache_peer 127.0.0.1 parent dead_peer_timeout 2 seconds cache_peer_access 127.0.0.1 cache_peer_access 127.0.0.1 sleep 1 squid -z sleep 1 /etc/init.d/squid3 restart sleep 6 beep -f 999.9 beep -f 999.9 IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') sleep 3 apt-get update apt-get upgrade echo Y | apt-get install apache2 sleep 1 echo Y | apt-get install sqlite gcc libsqlite3-dev libapache2-mod-php5 php-db li bstdc++6 g++ unzip libmysqlclient15-dev libblkid-dev libcurl3-dev lynx ffmpeg ls b-release sudo make php5-dev php-pear apache2-prefork-dev libpcre3-dev echo Y | apt-get -f upgrade cd /root sleep 3 "/etc/raptor/raptor.lst" 8080 0 proxy-only no-digest allow raptor_lst deny all" >> /etc/squid3/squid.conf

wget http://www.raptorcache.com/install/64/raptor64.tar.gz cp raptor64.tar.gz /tmp tar -xzvf /tmp/raptor64.tar.gz -C / rm -rf raptor64.tar.gz chmod a+x /usr/sbin/raptor mkdir /var/log/raptor && mkdir /var/tmp/raptor && mkdir /var/run/raptor && mkdir /raptorcache && chmod a+rwx /var/log/raptor && chmod a+rwx /var/tmp/raptor && chmod a+rwx /var/r un/raptor && chmod a+x /etc/init.d/raptor && chown -R www-data /raptorcache/ chmod -R 777 /raptorcache/ umask 000 /raptorcache/ echo "extension=pdo.so" >> /etc/php5/apache2/php.ini echo "vm.swappiness=10" >> /etc/sysctl.conf update-rc.d raptor defaults sleep 3 wget http://www.raptorcache.com/install/clean/64/clean.zip unzip clean.zip mv clean /etc/raptor/ chmod 777 /etc/raptor/clean rm -rf clean.zip wget http://www.raptorcache.com/install/var/pluginmaker.tar.gz tar -xzvf pluginmaker.tar.gz mv pluginmaker /etc/raptor/ rm -rf pluginmaker.tar.gz touch /etc/raptor/raptor.lst wget http://www.raptorcache.com/install/64/plugins/plugins.tar.gz tar -xzvf plugins.tar.gz mv plugins /etc/raptor/ rm -rf plugins.tar.gz clear chmod 777 /etc/raptor/plugins/* chmod 777 /etc/raptor/cl0 /etc/init.d/raptor start chmod 777 /etc/raptor/clean sleep 3 echo "## Raptor # min(0-59) hora(0-23) diames(1-31) mes(1-12) diasem(0-7) user comando 59 1 * * * root /etc/rap tor/./clean 45 30 23 * * * root squid3 k rotate * */1 * * * root /etc/rap tor/./cl0 59 22 * * * root /etc/rap tor/rprotate */2 * * * * root serv

*/1 * u -i eth0" >> /etc/crontab sleep 6 beep -f 999.9 beep -f 999.9 sleep 1

root

vnstat -

apt-get update apt-get upgrade clear echo "" echo "" echo "+-------------------------------------------------------------+" echo "| Instalacion del Mysql |" echo "| Es importante que ponga la contrasea del Mysql = raptor |" echo "+-------------------------------------------------------------+" echo Pulse enter para continuar... read -n 0 -ers echo Y | apt-get install mysql-server mysql-client php5-mysql && echo Y | aptitude install php5-cgi && echo Y | apt-get -f upgrade && wget http://www.raptorcache.com/install/var/raptor.sql cp raptor.sql /var/tmp/ rm -rf raptor.sql echo mysql -u root -praptor << eof CREATE DATABASE raptor; eof mysql -u root -praptor raptor < /var/tmp/raptor.sql sleep 6 beep -f 999.9 beep -f 999.9 sleep 1 IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') HOST_NAME="os.com" sleep 3 mv /etc/hosts /etc/hosts_ touch /etc/hosts echo "127.0.0.1 localhost.localdomain $IPSERV proxy.$HOST_NAME proxy # ::1 localhost ip6-localhost fe00::0 ip6-localnet fe00::0 ip6-mcastprefix ff02:1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts" >> /etc/hosts localhost ip6-loopback

sleep 3 mv /etc/hostname /etc/hostname_ touch /etc/hostname echo "proxy.$HOST_NAME" >> /etc/hostname mv /etc/resolv.conf /etc/resolv.conf_ touch /etc/resolv.conf echo "search proxy.$HOST_NAME nameserver 127.0.0.1 nameserver 8.8.8.8 nameserver 8.8.4.4" >> /etc/resolv.conf sleep 3 apt-get update apt-get upgrade echo Y | apt-get install bind9 dnsutils bind9-doc sleep 3 mv /etc/bind/named.conf.options /etc/bind/named.conf.options_old touch /etc/bind/named.conf.options echo "options { directory \"/var/cache/bind\"; forwarders { 8.8.8.8; 8.8.4.4; }; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; };" >> /etc/bind/named.conf.options echo "include \"/etc/bind/zones.rfc1918\"; logging { category lame-servers {null; }; category edns-disabled { null; }; };" >> /etc/bind/named.conf.local echo "ServerName proxy.$HOST_NAME" >> /etc/apache2/apache2.conf mv /etc/apache2/httpd.conf /etc/apache2/httpd.conf_ touch /etc/apache2/httpd.conf echo "Listen 82 <VirtualHost *:82> DocumentRoot /var/raptor ServerName www.raptorcache.com ErrorLog /var/log/virtual82-error_log CustomLog /var/log/virtual82-access_log common </VirtualHost> Listen 84 <VirtualHost *:84> DocumentRoot /var/www/sarg ServerName www.raptorcache.com </VirtualHost>" >> /etc/apache2/httpd.conf

sleep 6 beep -f 999.9 beep -f 999.9 clear sleep 3 echo " #Repositorio Sarg deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc /apt/sources.list apt-get update apt-get upgrade echo Y | aptitude install sarg apt-get -f upgrade mv /etc/sarg/sarg.conf /etc/sarg/sarg.conf_old wget http://www.raptorcache.com/install/var/sarg.conf mv sarg.conf /etc/sarg/sarg.conf echo " # Agendamiento Sarg 59 21 * * * root sarg" > > /etc/crontab mkdir /var/www/sarg/ sarg sleep 1 wget http://joemg.host56.com/wpanel/raptor.tar.gz tar -xzvf raptor.tar.gz mv raptor /var/ rm -rf raptor.tar.gz clear chmod 777 /var/raptor/* chmod 777 /var/raptor/mail/* chmod 777 /etc/raptor/raptor.lst chmod 777 /etc/squid3/squid.conf chmod 777 /etc/raptor/raptor.conf chmod 777 /etc/squid3/denegados.lst chmod 777 /etc/network/interfaces chmod 777 /etc/resolv.conf clear sleep 1 echo Y | apt-get install snmpd mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old touch /etc/snmp/snmpd.conf echo 'rocommunity public syslocation "PDC, Peters DataCenter" syscontact [email protected]' > /etc/snmp/snmpd.conf rm -rf /etc/default/snmpd wget http://www.raptorcache.com/install/var/snmpd mv snmpd /etc/default/ /etc/init.d/snmpd restart sleep 3 clear echo "" echo "" echo "+-------------------------------------------------------------------------------------+" echo "| Instalacion del Cacti |"

echo "| Elegir Apache2 como Servidor Web y luego ingresar la contrasea del Mysql( raptor) |" echo "+-------------------------------------------------------------------------------------+" echo Pulse enter para continuar... read -n 0 -ers echo Y | apt-get install cacti wget http://www.raptorcache.com/install/var/raptor-cacti.sql mv raptor-cacti.sql /var/tmp/ mysql -u root -praptor cacti < /var/tmp/raptor-cacti.sql sleep 1 mv /etc/cacti/apache.conf /etc/cacti/apache.conf_ touch /etc/cacti/apache.conf echo "Alias /graphcacti /usr/share/cacti/site <Directory /usr/share/cacti/site> Options +FollowSymLinks AllowOverride None order allow,deny allow from all AddType application/x-httpd-php .php <IfModule mod_php5.c> php_flag magic_quotes_gpc Off php_flag short_open_tag On php_flag register_globals Off php_flag register_argc_argv On php_flag track_vars On # this setting is necessary for some locales php_value mbstring.func_overload 0 php_value include_path . </IfModule> DirectoryIndex index.php </Directory>" >> /etc/cacti/apache.conf /etc/init.d/apache2 restart echo Y | apt-get install vnstat vnstat -u -i eth0 echo Y | apt-get install smartmontools lvm2 hdparm sleep 1 echo Y | apt-get install lm-sensors clear echo "" echo "" echo "+---------------------------------------------+" echo "| Se instalaran los sensores de temperatura |" echo "| Ingresar YES en las siguientes opciones |" echo "+---------------------------------------------+" echo Pulse enter para continuar... read -n 0 -ers sensors-detect service module-init-tools restart /etc/init.d/module-init-tools restart echo " # DNS Cache */2 * * *

root

rndc d

umpdb" >> /etc/crontab clear wget http://www.raptorcache.com/install/var/upload.cgi mv upload.cgi /usr/lib/cgi-bin/ chmod 777 /usr/lib/cgi-bin/upload.cgi echo Y | apt-get --purge remove sudo echo Y | apt-get install sudo echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers chmod 777/etc/sudoers clear echo | pecl install apc --with-apxs='/usr/bin/apxs2' echo "Alias /var/raptor/apc /usr/share/php/apc.php <Directory /usr/share/php/apc.php> Options +FollowSymLinks AllowOverride None order allow,deny allow from all AddType application/x-httpd-php .php <IfModule mod_php5.c> php_flag magic_quotes_gpc Off php_flag short_open_tag On php_flag register_globals Off php_flag register_argc_argv On php_flag track_vars On # this setting is necessary for some locales php_value mbstring.func_overload 0 php_value include_path . </IfModule> DirectoryIndex index.php </Directory>" >> /etc/apache2/conf.d/apc.conf echo "extension=apc.so" >> /etc/php5/conf.d/apc.ini echo "; APC Configuration apc.enabled = 1 ; Memory allocated to APC. Use Munin or APC Info to see if more is needed. apc.shm_size=32M ; rfc1867 allow file upload progression display. apc.rfc1867 = on" >> /etc/php5/conf.d/apc-config.ini clear rm -rf /var/tmp/* rm -rf web.zip echo echo echo echo echo =+" echo |" echo |" echo |" echo "" "" "" "" "+========================================================================= "| "| "| "| REINICIE SU SISTEMA PARA CONCLUIR LA INSTALACION INSTALACION FINALIZADA

|" echo |" echo =+" echo echo

"| "+========================================================================= "" ""

You might also like