SHOW:
|
|
- or go back to the newest paste.
| 1 | - | STEP by STEP Raptor on Debian 6.06 AMD 64 for Testing only |
| 1 | + | STEP by STEP Raptor on Debian 6.06 AMD 64 for Testing only ( X3 Ram=8 G HD=80 G) |
| 2 | - | ip 192.168.3.2 |
| 2 | + | Installasi awal paket hanya openssh server dan basic system dengan partisi ext4 sbb : |
| 3 | - | name server 192.168.3.1 |
| 3 | + | |
| 4 | - | hostname proxy |
| 4 | + | |
| 5 | - | domain local.net.work |
| 5 | + | |
| 6 | /cache-1 25 G noatime /dev/sda5 | |
| 7 | - | HD 80 G |
| 7 | + | /raptorcache 40 G noatime /dev/sda6 |
| 8 | /var 5 G | |
| 9 | ||
| 10 | - | /cache-1 40 G noatime /dev/sda5 |
| 10 | + | |
| 11 | - | /raptorcache 25 G noatime /dev/sda6 |
| 11 | + | |
| 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 | - | /raptorcache ext4 noatime,barrier=0,nodiratime,relatime,errors=remount-ro,data=writeback 0 0 |
| 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 | - | apt-get -y update |
| 137 | + | |
| 138 | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
| |
| 139 | - | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
|
| 139 | + | HOST_NAME=$(hostname -a) |
| 140 | - | HOST_NAME="local.war.net" |
| 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 | - | cd .. |
| 146 | + | |
| 147 | - | mkdir /cache-1 |
| 147 | + | echo Y | apt-get install squid3 squid3-cgi ccze |
| 148 | - | chmod 777 /cache-1 |
| 148 | + | |
| 149 | - | cd /root |
| 149 | + | |
| 150 | touch /etc/squid3/denegados.lst | |
| 151 | - | echo Y | apt-get install squid3 |
| 151 | + | |
| 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 | - | visible_hostname proxy.$HOST_NAME |
| 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 80 # http |
| 182 | + | acl Safe_ports port 21 70 80 210 280 443 488 563 591 631 777 901 81 3128 1025-65535 |
| 183 | - | acl Safe_ports port 21 # ftp |
| 183 | + | acl SSL_ports port 443 563 81 |
| 184 | - | acl SSL_ports port 443 |
| 184 | + | |
| 185 | - | acl Safe_ports port 443 # https |
| 185 | + | |
| 186 | - | acl Safe_ports port 70 # gopher |
| 186 | + | |
| 187 | - | acl Safe_ports port 210 # wais |
| 187 | + | |
| 188 | - | acl Safe_ports port 1025-65535 # unregistered ports |
| 188 | + | |
| 189 | - | acl Safe_ports port 280 # http-mgmt |
| 189 | + | |
| 190 | - | acl Safe_ports port 488 # gss-http |
| 190 | + | |
| 191 | - | acl Safe_ports port 591 # filemaker |
| 191 | + | |
| 192 | - | acl Safe_ports port 777 # multiling http |
| 192 | + | # Always allow localhost connections |
| 193 | - | acl Safe_ports port 631 # cups |
| 193 | + | |
| 194 | - | acl Safe_ports port 873 # rsync |
| 194 | + | |
| 195 | - | acl Safe_ports port 901 # SWAT |
| 195 | + | # Allow local network(s) on interface(s) |
| 196 | - | acl Safe_ports port 1863 # MSN |
| 196 | + | http_access allow localnet |
| 197 | - | #acl SSL_ports port 443 # https |
| 197 | + | |
| 198 | - | acl SSL_ports port 563 # snews |
| 198 | + | # Default block all to be sure |
| 199 | - | acl SSL_ports port 873 # rsync |
| 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 | - | cache_mem 50 MB |
| 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 | - | # 10000 = 10 GB |
| 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 | - | cache_dir aufs /cache-1 10000 16 256 |
| 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 \.jpg$ 14400 80% 43200 reload-into-ims |
| 238 | + | |
| 239 | - | refresh_pattern -i \.gif$ 14400 80% 43200 reload-into-ims |
| 239 | + | |
| 240 | - | refresh_pattern -i \.png$ 14400 80% 43200 reload-into-ims |
| 240 | + | |
| 241 | - | refresh_pattern -i \.jpeg$ 14400 80% 43200 reload-into-ims |
| 241 | + | |
| 242 | - | refresh_pattern -i \.bmp$ 14400 80% 43200 reload-into-ims |
| 242 | + | |
| 243 | - | refresh_pattern -i \.tif$ 14400 80% 43200 reload-into-ims |
| 243 | + | refresh_pattern (Release|Package(.gz)*)$ 0 20% 2880 |
| 244 | - | refresh_pattern -i \.tiff$ 14400 80% 43200 reload-into-ims |
| 244 | + | |
| 245 | - | refresh_pattern -i \.swf$ 14400 80% 43200 reload-into-ims |
| 245 | + | |
| 246 | - | refresh_pattern -i \.html$ 10 20% 4320 reload-into-ims |
| 246 | + | |
| 247 | - | refresh_pattern -i \.htm$ 10 20% 4320 reload-into-ims |
| 247 | + | |
| 248 | - | refresh_pattern -i \.shtml$ 10 20% 4320 reload-into-ims |
| 248 | + | |
| 249 | - | refresh_pattern -i \.shtm$ 10 20% 4320 reload-into-ims |
| 249 | + | |
| 250 | - | refresh_pattern -i \.nub$ 2880 80% 21600 reload-into-ims |
| 250 | + | |
| 251 | - | refresh_pattern -i \.exe$ 14400 80% 43200 |
| 251 | + | |
| 252 | - | refresh_pattern -i \.zip$ 14400 80% 43200 |
| 252 | + | |
| 253 | - | refresh_pattern -i \.mov$ 14400 80% 43200 |
| 253 | + | |
| 254 | - | refresh_pattern -i \.mpe?g?$ 14400 80% 43200 |
| 254 | + | |
| 255 | - | refresh_pattern -i \.avi$ 14400 80% 43200 |
| 255 | + | |
| 256 | - | refresh_pattern -i \.qtm?$ 14400 80% 43200 |
| 256 | + | |
| 257 | - | refresh_pattern -i \.viv$ 14400 80% 43200 |
| 257 | + | |
| 258 | - | refresh_pattern -i \.wav$ 14400 80% 43200 |
| 258 | + | |
| 259 | - | refresh_pattern -i \.aiff?$ 14400 80% 43200 |
| 259 | + | |
| 260 | - | refresh_pattern -i \.au$ 14400 80% 43200 |
| 260 | + | |
| 261 | - | refresh_pattern -i \.ram?$ 14400 80% 43200 |
| 261 | + | |
| 262 | - | refresh_pattern -i \.snd$ 14400 80% 43200 |
| 262 | + | |
| 263 | - | refresh_pattern -i \.mid$ 14400 80% 43200 |
| 263 | + | |
| 264 | - | refresh_pattern -i \.mp2$ 14400 80% 43200 |
| 264 | + | |
| 265 | - | refresh_pattern -i \.mp3$ 14400 80% 43200 |
| 265 | + | |
| 266 | - | refresh_pattern -i \.sit$ 14400 80% 43200 |
| 266 | + | |
| 267 | - | refresh_pattern -i \.zip$ 14400 80% 43200 |
| 267 | + | |
| 268 | - | refresh_pattern -i \.hqx$ 14400 80% 43200 |
| 268 | + | |
| 269 | - | refresh_pattern -i \.arj$ 14400 80% 43200 |
| 269 | + | |
| 270 | - | refresh_pattern -i \.lzh$ 14400 80% 43200 |
| 270 | + | |
| 271 | - | refresh_pattern -i \.lha$ 14400 80% 43200 |
| 271 | + | # Sites that are denied to store files in squid cache |
| 272 | - | refresh_pattern -i \.cab$ 14400 80% 43200 |
| 272 | + | |
| 273 | - | refresh_pattern -i \.rar$ 14400 80% 43200 |
| 273 | + | |
| 274 | - | refresh_pattern -i \.tar$ 14400 80% 43200 |
| 274 | + | |
| 275 | - | refresh_pattern -i \.gz$ 14400 80% 43200 |
| 275 | + | |
| 276 | - | refresh_pattern -i \.z$ 14400 80% 43200 |
| 276 | + | # Denying cache for files with extension. *.asx and. *.asf | streaming | |
| 277 | #---------------------------------------------------------------------- | |
| 278 | acl asxf url_regex -i .(asx|asf)$ | |
| 279 | - | refresh_pattern -i \.txt$ 14400 80% 43200 |
| 279 | + | cache deny asxf" >> /etc/squid3/squid.conf |
| 280 | - | refresh_pattern -i \.pdf$ 14400 80% 43200 |
| 280 | + | |
| 281 | - | refresh_pattern -i \.doc$ 14400 80% 43200 |
| 281 | + | |
| 282 | - | refresh_pattern -i \.rtf$ 14400 80% 43200 |
| 282 | + | |
| 283 | - | refresh_pattern -i \.tex$ 14400 80% 43200 |
| 283 | + | |
| 284 | - | refresh_pattern -i \.latex$ 14400 80% 43200 |
| 284 | + | |
| 285 | - | refresh_pattern -i \.class$ 14400 80% 43200 |
| 285 | + | |
| 286 | - | refresh_pattern -i \.js$ 14400 80% 43200 |
| 286 | + | |
| 287 | - | refresh_pattern -i \.ico$ 14400 80% 43200 |
| 287 | + | |
| 288 | ||
| 289 | sleep 3 | |
| 290 | ||
| 291 | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
| |
| 292 | HOST_NAME=$(hostname -a) | |
| 293 | - | #refresh_pattern (Release|Package(.gz)*)$ 0 20% 2880 |
| 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 | - | # Sites that are denied to store files in squid cache |
| 321 | + | |
| 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 | - | # Denying cache for files with extension. Asx and. Asf | streaming | |
| 326 | + | |
| 327 | sleep 3 | |
| 328 | - | acl asx url_regex -i \.asx$ |
| 328 | + | |
| 329 | - | cache deny asx |
| 329 | + | wget http://www.raptorcache.com/install/clean/64/clean.zip |
| 330 | - | acl asf url_regex -i \.asf$ |
| 330 | + | unzip clean.zip |
| 331 | - | cache deny asf" >> /etc/squid3/squid.conf |
| 331 | + | |
| 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 | - | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
|
| 344 | + | |
| 345 | rm -rf plugins.tar.gz | |
| 346 | clear | |
| 347 | chmod 777 /etc/raptor/plugins/* | |
| 348 | chmod 777 /etc/raptor/cl0 | |
| 349 | ||
| 350 | - | echo Y | apt-get install apache2 |
| 350 | + | |
| 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 | - | echo Y | apt-get install sqlite gcc libsqlite3-dev libapache2-mod-php5 php-db libstdc++6 g++ unzip |
| 354 | + | # dpkg -i libmysqlclient16_5.1.67-0ubuntu0.11.10.1_amd64.deb |
| 355 | ||
| 356 | - | echo Y | apt-get install libmysqlclient15-dev libblkid-dev libcurl3-dev lynx ffmpeg lsb-release sudo |
| 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 | - | echo Y | apt-get install make php5-dev php-pear apache2-prefork-dev libpcre3-dev |
| 358 | + | |
| 359 | /etc/init.d/raptor start | |
| 360 | ||
| 361 | - | cd /root |
| 361 | + | |
| 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 | - | wget http://www.raptorcache.com/install/clean/64/clean.zip |
| 395 | + | |
| 396 | - | unzip clean.zip |
| 396 | + | |
| 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 | - | echo "## Raptor |
| 425 | + | # and how to activate them. For more information, see interfaces(5). |
| 426 | - | # min(0-59) hour(0-23) days(1-31) month(1-12) weekly(0-7) user command |
| 426 | + | |
| 427 | - | 59 1 * * * root /etc/raptor/./clean 45 |
| 427 | + | # The loopback network interface |
| 428 | - | 30 23 * * * root squid3 -k rotate |
| 428 | + | auto lo |
| 429 | - | * */1 * * * root /etc/raptor/./cl0 |
| 429 | + | iface lo inet loopback |
| 430 | - | 59 22 * * * root /etc/raptor/rprotate |
| 430 | + | |
| 431 | - | */2 * * * * root serv |
| 431 | + | # The primary network interface |
| 432 | - | */1 * * * * root vnstat -u -i eth0" >> /etc/crontab |
| 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 | - | echo Y | apt-get -f upgrade && |
| 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 | - | IPSERV=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
|
| 463 | + | |
| 464 | - | HOST_NAME="local.war.net" |
| 464 | + | |
| 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 | - | echo "127.0.0.1 localhost.localdomain localhost |
| 471 | + | |
| 472 | - | $IPSERV proxy.$HOST_NAME proxy |
| 472 | + | |
| 473 | DocumentRoot /var/www/sarg | |
| 474 | - | ::1 localhost ip6-localhost ip6-loopback |
| 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 | - | mv /etc/hostname /etc/hostname_ |
| 483 | + | |
| 484 | - | touch /etc/hostname |
| 484 | + | deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list |
| 485 | apt-get update | |
| 486 | - | echo "proxy.$HOST_NAME" >> /etc/hostname |
| 486 | + | |
| 487 | mv /etc/sarg/sarg.conf /etc/sarg/sarg.conf_old | |
| 488 | - | mv /etc/resolv.conf /etc/resolv.conf_ |
| 488 | + | |
| 489 | - | touch /etc/resolv.conf |
| 489 | + | |
| 490 | echo " | |
| 491 | - | echo "search proxy.$HOST_NAME |
| 491 | + | |
| 492 | - | nameserver 127.0.0.1 |
| 492 | + | |
| 493 | - | nameserver 8.8.8.8 |
| 493 | + | |
| 494 | - | nameserver 8.8.4.4" >> /etc/resolv.conf |
| 494 | + | sarg -x |
| 495 | ||
| 496 | sleep 1 | |
| 497 | wget http://joemg.host56.com/wpanel/raptor.tar.gz | |
| 498 | - | echo Y | apt-get install bind9 dnsutils bind9-doc |
| 498 | + | |
| 499 | mv raptor /var/ | |
| 500 | rm -rf raptor.tar.gz | |
| 501 | clear | |
| 502 | - | mv /etc/bind/named.conf.options /etc/bind/named.conf.options_old |
| 502 | + | |
| 503 | - | touch /etc/bind/named.conf.options |
| 503 | + | |
| 504 | chmod 777 /etc/raptor/raptor.lst | |
| 505 | - | echo "options {
|
| 505 | + | |
| 506 | - | directory "/var/cache/bind"; |
| 506 | + | |
| 507 | - | forward only; |
| 507 | + | |
| 508 | - | forwarders { 8.8.8.8; 8.8.4.4; };
|
| 508 | + | |
| 509 | - | auth-nxdomain no; # conform to RFC1035 |
| 509 | + | |
| 510 | - | listen-on-v6 { none; };
|
| 510 | + | |
| 511 | - | listen-on { 127.0.0.1; };
|
| 511 | + | |
| 512 | - | version none; |
| 512 | + | |
| 513 | - | };" >> /etc/bind/named.conf.options |
| 513 | + | |
| 514 | mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf_ | |
| 515 | touch /etc/snmp/snmpd.conf | |
| 516 | - | logging {
|
| 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 | - | echo "ServerName proxy.$HOST_NAME" >> /etc/apache2/apache2.conf |
| 521 | + | |
| 522 | /etc/init.d/snmpd restart | |
| 523 | sleep 3 | |
| 524 | clear | |
| 525 | echo "" | |
| 526 | echo "" | |
| 527 | echo "+--------------------------------------------------------------------------------------+" | |
| 528 | echo "| Installing Cacti |" | |
| 529 | - | ServerName www.raptorcache.com |
| 529 | + | |
| 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 | - | ServerName www.raptorcache.com |
| 536 | + | |
| 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 | - | # deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list |
| 546 | + | |
| 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 | - | sarg |
| 556 | + | |
| 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 | - | mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old |
| 576 | + | |
| 577 | echo "+---------------------------------------------+" | |
| 578 | - | echo 'rocommunity public |
| 578 | + | |
| 579 | read -n 0 -ers | |
| 580 | - | syscontact [email protected]' > /etc/snmp/snmpd.conf |
| 580 | + | |
| 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 Y | apt-get --purge remove sudo |
| 653 | + | |
| 654 | - | echo Y | apt-get install sudo |
| 654 | + | |
| 655 | - | echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers |
| 655 | + | |
| 656 | - | chmod 777/etc/sudoers |
| 656 | + | |
| 657 | # Copy stop sini |