Wednesday 28 May 2014

squid-coba · version 2

#######################################################
## SQUID 2.7 - High Performance Configuration
## ====================================================
## ## Updated: 3.2011
#######################################################

##start of config
http_port 3128 transparent
server_http11 on
icp_port 0

# File Squid
pid_filename /var/run/squid.pid
coredump_dir /var/spool/squid/
error_directory /usr/share/squid/errors/English
icon_directory /usr/share/squid/icons
mime_table /usr/share/squid/mime.conf
visible_hostname proxy

# Log Squid
access_log /var/log/squid/access.log
cache_log /dev/null
cache_store_log /dev/null

# Beberapa log yg tidak signifikan karena opsi2-nya jarang digunakan.
log_fqdn off
log_icp_queries off
buffered_logs off
emulate_httpd_log off

ftp_list_width 32
ftp_passive on
ftp_sanitycheck on

acl localnet src 172.209.100.0/24                       #----------------> sesuaikan dg ip local


uri_whitespace strip

#DNS NAMESERVER
dns_nameservers 192.168.11.1                         #----------------> sesuaikan dg gateway proxy

cache_mem 8 MB
maximum_object_size_in_memory 32 KB
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA

cache_dir aufs /cache 20000 32 256
#cache_dir aufs /cache 200000 54 256 #untuk ubuntu 64 bit                                     

minimum_object_size 512 bytes
maximum_object_size 128000 KB
offline_mode off
cache_swap_low 98
cache_swap_high 99

# Setup some default acls
acl all src 0.0.0.0/0
acl localhost src 127.0.0.1/32
acl safeports port 21 70 80 81 210 280 443 488 563 591 631 777 901 3128 1025-65535
acl sslports port 443 563 81
acl manager proto cache_object
acl purge method PURGE
acl connect method CONNECT
acl dynamic urlpath_regex cgi-bin \?
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !safeports
http_access deny CONNECT !sslports
http_access allow localhost

# Allow local network(s) on interface(s)
http_access allow localnet
http_access deny all
#http_gzip on
#http_gzip_types text/plain,text/html,text/xml,text/css,application/xml,application/xhtml+xml,application/rss+xml,application/javascript,application/x-javascript

# TAG: ZPH
tcp_outgoing_tos 0x30 localnet
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136

# delay polls

acl admin src 192.168.1.123/32  #ip administrator 
acl management src 192.168.1.123/32 #---> ip administrator 

acl download url_regex -i \.avi$ \.mpg$ \.mpeg$ \.rm$ \.iso$ \.wav$ \.mov$ \.dat$ \.mpe$ \.mid$ \.flv$ \.3gp$
acl download url_regex -i ftp \.exe$ \.mp3$ \.mp4$ \.tar.gz$ \.gz$ \.tar.bz2$ \.rpm$ \.zip$ \.rar$
acl download url_regex -i \.midi$ \.rmi$ \.wma$ \.wmv$ \.ogg$ \.ogm$ \.m1v$ \.mp2$ \.mpa$ \.wax$
acl download url_regex -i \.m3u$ \.asx$ \.wpl$ \.wmx$ \.dvr-ms$ \.snd$ \.au$ \.aif$ \.asf$ \.m2v$
acl download url_regex -i \.m2p$ \.ts$ \.tp$ \.trp$ \.div$ \.divx$ \.mod$ \.vob$ \.aob$ \.dts$
acl download url_regex -i \.ac3$ \.cda$ \.vro$ \.deb$ \.mkv$

delay_pools 2

delay_class 1 1
delay_parameters 1 -1/-1
delay_access 1 allow admin
delay_access 1 allow admin management
delay_access 1 deny all

delay_class 2 1
#delay_parameters 2 40000/512000
delay_parameters 2 30000/1000000
delay_access 2 allow download
delay_access 2 deny all

#cache content
acl store_rewrite_list urlpath_regex \/(get_video|videoplayback\?id|videoplayback.*id) \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|swf)\?
acl store_rewrite_list_domain url_regex ^http:\/\/([a-zA-Z-]+[0-9-]+)\.[A-Za-z]*\.[A-Za-z]*
acl store_rewrite_list_domain url_regex (([a-z]{1,2}[0-9]{1,3})|([0-9]{1,3}[a-z]{1,2}))\.[a-z]*[0-9]?\.[a-z]{3}
acl store_rewrite_list_path urlpath_regex \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|avc|zip|mp3|3gp|rar|on2|mar|exe)$
acl store_rewrite_list_domain_CDN url_regex (khm|mt)[0-9]?.google.co(m|\.id)  streamate.doublepimp.com.*\.js\? photos-[a-z].ak.fbcdn.net \.rapidshare\.com.*\/[0-9]*\/.*\/[^\/]* ^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*) \.doubleclick\.net.* yieldmanager cpxinteractive ^http:\/\/[.a-z0-9]*\.photobucket\.com.*\.[a-z]{3}$ quantserve\.com

acl dontrewrite url_regex yimg.com redbot\.org (get_video|videoplayback\?id|videoplayback.*id).*begin\=[1-9][0-9]* \.php\?
acl getmethod method GET

#snmp
snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic all

storeurl_rewrite_children 1
storeurl_rewrite_concurrency 99

storeurl_access deny dontrewrite
storeurl_access deny !getmethod
storeurl_access allow store_rewrite_list_domain_CDN
storeurl_access allow store_rewrite_list
storeurl_access allow store_rewrite_list_domain store_rewrite_list_path
storeurl_access deny all

hierarchy_stoplist (ini|ui|lst|inf||mh-|sc-)$ (afs.dat|update.txt|vdf.info.gz|captcha|reset.css|gamenotice|ickernew.css)
acl QUERY urlpath_regex -i \.(ini|ui|lst|inf|mh-|sc-)$
acl QUERY urlpath_regex -i (afs.dat|captcha|reset.css|update.txt|gamenotice|vdf.info.gz)
cache deny QUERY

# 1 year = 525600 mins, 1 month = 43800 mins

refresh_pattern (get_video|videoplayback|videodownload|\.flv).*(begin|start)\=[1-9][0-9]* 0 0% 0
refresh_pattern imeem.*\.flv  0 0% 0  override-lastmod override-expire
refresh_pattern ^ftp: 40320 20% 40320  override-expire reload-into-ims store-stale
refresh_pattern ^gopher:  1440 0% 1440 

refresh_pattern ^.*(streamate.doublepimp.com.*\.js\?|utm\.gif|ads\?|rmxads\.com|ad\.z5x\.net|bh\.contextweb\.com|bstats\.adbrite\.com|a1\.interclick\.com|ad\.trafficmp\.com|ads\.cubics\.com|ad\.xtendmedia\.com|\.googlesyndication\.com|advertising\.com|yieldmanager|game-advertising\.com|pixel\.quantserve\.com|adperium\.com|doubleclick\.net|adserving\.cpxinteractive\.com|syndication\.com|media.fastclick.net).* 5259487 20% 5259487 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth ignore-must-revalidate store-stale negative-ttl=40320 max-stale=1440
refresh_pattern .fbcdn.net.*\.(jpg|gif|png) 5259487 999999% 5259487 ignore-no-cache override-expire ignore-reload store-stale negative-ttl=0
refresh_pattern ((facebook.com)|(85.131.151.39)).*\.(png|gif)  5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern ^http://v\.okezone\.com/get_video\/([a-zA-Z0-9]) 129600 100% 129600 ignore-no-cache ignore-no-store reload-into-ims override-expire ignore-must-revalidate store-stale

#antivirus
refresh_pattern avast.com.*\.vpx  40320 50% 161280 store-stale reload-into-ims
refresh_pattern (avgate|avira).*\.(idx|gz)$ 1440 90% 1440   ignore-reload ignore-no-cache ignore-no-store store-stale ignore-must-revalidate 
refresh_pattern kaspersky.*\.avc$  5259487 999999% 5259487 ignore-reload store-stale
refresh_pattern kaspersky  1440 50% 161280  ignore-no-cache store-stale
refresh_pattern mbamupdates.com.*\.ref  1440 50% 161280  reload-into-ims store-stale

#other sites
refresh_pattern \.rapidshare.*\/[0-9]*\/.*\/[^\/]*  161280 90% 161280 ignore-reload store-stale
refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?)  5259487 99999999% 5259487 override-expire ignore-reload store-stale ignore-private negative-ttl=0
refresh_pattern \.(ico|video-stats)   5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod ignore-must-revalidate negative-ttl=10080 store-stale
refresh_pattern \.etology\?  5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern galleries\.video(\?|sz)   5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern brazzers\?  5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern \.adtology\?   5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern ^.*safebrowsing.*google  5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth ignore-must-revalidate negative-ttl=10080 store-stale
refresh_pattern ^http://((cbk|mt|khm|mlt)[0-9]?)\.google\.co(m|\.id) 5259487 999999% 5259487 override-expire ignore-reload store-stale ignore-private negative-ttl=10080
refresh_pattern ytimg\.com.*\.(jpg|png)  5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern images\.friendster\.com.*\.(png|gif)  5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern garena\.com  5259487 999999% 5259487 override-expire reload-into-ims store-stale
refresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png)   5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\?  5259487 999999% 5259487 ignore-no-cache override-expire override-lastmod store-stale
refresh_pattern ^http:\/\/images|openx|pics|thumbs[0-9]\.  5259487 999999% 5259487 ignore-no-cache ignore-no-store ignore-reload override-expire store-stale
refresh_pattern ^http:\/\/www.onemanga.com.*\/   5259487 999999% 5259487 reload-into-ims override-expire store-stale
refresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png)  5259487 999999% 5259487 reload-into-ims override-expire ignore-private store-stale

refresh_pattern \.(jp(e?g|e|2)|tiff?|bmp|gif|png)  5259487 999999% 5259487 ignore-no-cache ignore-no-store reload-into-ims override-expire ignore-must-revalidate store-stale
refresh_pattern \.(z(ip|[0-9]{2})|r(ar|[0-9]{2})|jar|bz2|gz|tar|rpm|vpu) 5259487 100% 5259487 override-expire reload-into-ims
refresh_pattern \.(mp3|wav|og(g|a)|flac|midi?|rm|aac|wma|mka|ape)  5259487 100% 5259487 override-expire reload-into-ims ignore-reload
refresh_pattern \.(exe|msi|dmg|bin|xpi|iso|swf|mar|psf|cab)  5259487 999999%% 5259487 override-expire reload-into-ims ignore-no-cache ignore-must-revalidate
refresh_pattern \.(mpeg|ra?m|avi|mp(g|e|4)|mov|divx|asf|wmv|m\dv|rv|vob|asx|ogm|flv|3gp|on2) 5259487 100% 5259487 override-expire reload-into-ims
refresh_pattern -i (cgi-bin) 0 0% 0
refresh_pattern \.(php|jsp|cgi|asx)\? 0 0% 0
refresh_pattern . 0 50% 161280 store-stale

header_access X-Forwarded-For deny all

storeurl_rewrite_program /etc/squid/storeurl.pl

#extra tuning configuration
header_access Accept-Encoding deny  all
client_persistent_connections off
server_persistent_connections on
half_closed_clients off
strip_query_terms off
quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 100
vary_ignore_expire on
reload_into_ims on
pipeline_prefetch on
range_offset_limit 512 KB
read_timeout 30 minutes
client_lifetime 6 hours
negative_ttl 30 seconds
positive_dns_ttl 6 hours
negative_dns_ttl 60 seconds
pconn_timeout 15 seconds
request_timeout 1 minute
store_avg_object_size 13 KB
log_icp_queries off
ipcache_size 16384
ipcache_low 98
ipcache_high 99
log_fqdn off
fqdncache_size 16384
memory_pools off
forwarded_for on
logfile_rotate 3
store_dir_select_algorithm round-robin
cache_effective_user proxy
cache_effective_group proxy
max_filedescriptors 8192

Thursday 22 May 2014

PFSENSE 2.0.1 DOWNLOAD

============================================
============================================
============================================

PFSENSE 2.0.1



============================================
============================================
============================================

PFSENSE 2.0.2 DOWNLOAD

============================================
============================================
============================================

PFSENSE 2.0.2 




                                             DOWNLOAD

============================================
============================================
============================================

PFSENSE 2.0.3 DOWNLOAD

============================================
============================================
============================================

PFSENSE 2.0.3


                                                         


============================================
============================================
============================================

WINRAR DOWNLOAD

============================================
============================================
============================================

WINRAR





============================================
============================================
============================================

TEAM VIEW DOWNLOAD

============================================
============================================
============================================

TEAMVIEW





============================================
============================================
============================================

WINRAR PASSWORD REMOVE DOWNLOAD

============================================
============================================
============================================

RAR PASSWORD REMOVER





============================================
============================================
============================================

CC CLEANER DOWNLOAD

============================================
============================================
============================================

CCLEANER





============================================
============================================
============================================

XAMPP SERVER DOWNLOAD

============================================
============================================
============================================

XAMPP SERVER





============================================
============================================
============================================

HFS SERVER FTTP SERVER FILE SHARING TO LOCAL NETWORKE DOWNLOAD

============================================
============================================
============================================

HFS SERVER FTTP





============================================
============================================


============================================

HFS TEMPLATES DOWNLOAD

============================================
============================================
============================================

HFS TEMPLATES





============================================
============================================
============================================

ACTIVE YOUR WINDOW WITH LOADER DOWNLOAD

============================================
============================================
============================================

WINDOW LOADER




============================================
============================================
============================================

MP3 FILE TAG YOUR PHOTO DOWNLOAD

============================================
============================================
============================================

MP3 TAGE




============================================
============================================
============================================

MEMORY CARD DATA RECOVERY DOWNLOAD

============================================
============================================
============================================

DATA  RECOVERY




============================================
============================================
============================================

FILE ZILLA DOWNLOAD

============================================
============================================
============================================

FILE ZILLA




============================================
============================================
============================================

USB DISK SECURITY RAGISYERD DOWNLOAD

============================================
============================================
============================================

USB DISK SECURITY




============================================
============================================
============================================

URDU TYPING TUTOR DOWNLOAD

============================================
============================================
============================================

URDU TUTOR




============================================
============================================
============================================

WINSCP DOWNLOAD

============================================
============================================
============================================

WINSCP




============================================
============================================
============================================

Monday 19 May 2014

HFS SERVER

You Will Need

    Internet access
    HFS File Server installer

Steps

    Step 1
    Download and install

    Go to rejetto.com to install the HFS File Server. Find the Download tab at the top of the page and select Download. Then open the file and begin the installation process using the default options.
    Step 2
    Run HFS

    Run HFS after the setup is complete. Click on the Server is currently OFF button to turn the server on.
    Step 3
    Go to IP address

    Find the IP address of the server -- a series of numbers listed next to the Open in Browser button. Copy and paste this number to your web browser. The screen will indicate you are in HFS.
    Step 4
    Drag and drop

    Drag and drop files you wish to share over the server into the program's window. Confirm each of the shared file's usage as Real Folder.

    Set up password-protected folders when uploading files.
    Step 5
    Save changes

    Select the Menu option on the server and click Save File System to save your changes. Do this each time you modify the system.
    Step 6
    Access files

    Access your shared files by going to the server's IP address from any computer and downloading any file from the public folders listed.

    HTTP is short for HyperText Transfer Protocol, the underlying protocol used by the World Wide Web.

Sunday 18 May 2014

SQUID

System Requirement:
  • Processor C2D
  • Min 2Gb ram (4Gb Recommended)
  • 2 Nic Interface
  • Min 80Gb Hard Drive ( 250 or more)  depend on your network requirement

  • Operating System Required:
    •  Installed  Ubuntu  (any version Desktop)
    • After installation completed  Lucid Server (10.04) set up and I would like to change the mirror from US (or any other country) to the Main Ubuntu Mirror.
      In a Desktop environment I would select the main mirror like this:
    • and Close, wait for updating server list download by Ubuntu 10.04.
      after update of download server list. Open terminal window and type
      sudo -i
      enter your password and logged in as root
      Now its time to start installation and setting up Squid
    • mkdir /temp
      cd /temp
      touch install.sh
      chmod +x install.sh
      nano install.sh
  • COPY PAST

#!/bin/bash
# Version 1.3 / 31st January, 2014
# SQUID 2.7 Stable9 Automated Installation Script for Ubuntu 10/12 32bit Edition
# Syed Jahanzaib / aacable @ hotmail.com  / http://aacable.wordpress.com
 
# Setting Variables . . . [JZ]
URL=http://wifismartzone.com/files/linux_related/
SQUID_DIR="/etc/squid"
CACHE_DIR="/cache-1"
pid=`pidof squid`
osver=`cat /etc/issue |awk '{print $1}'`
 
# Colors Config  . . . [[ JZ . . . ]]
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
 
# OS checkup for UBUNTU
echo -e "$COL_GREEN Squid 2.7.9 Automated Installation Script ver 1.3 for Ubuntu . . .$COL_RESET"
echo -e "$COL_GREEN Checking OS version, as it must be Ubuntu in order to Continue . . .$COL_RESET"
if [[ $osver == Ubuntu ]]; then
echo
echo -e "$COL_GREEN Ubuntu is installed with following information fetched. $COL_RESET"
lsb_release -a
sleep 3
else
echo -e "$COL_RED Sorry, it seems your Linux Distribution is not UBUNTU . Exiting ...$COL_RESET"
exit 1
fi
 
# Make sure only root can run our script / Checking if user is root, otherwise exit with error [[Jz]]
echo
echo -e "$COL_GREEN Verifying if you are logged in with root privileges  . . .$COL_RESET" 1>&2
FILE="/tmp/out.$$"
GREP="/bin/grep"
if [ "$(id -u)" != "0" ]; then
echo
echo -e "$COL_RED This script must be run as root, switch to root now . . .$COL_RESET" 1>&2
exit 1
fi
 
# Clearing previous download if any in /temp folder
echo
echo -e "$COL_GREEN Clearing previous downloads if any in /temp folder to avoid duplication$COL_RESET"
sleep 3
rm -fr /temp/squid.conf
rm -fr /temp/storeurl.txt
rm -fr /temp/storeurl.pl
rm -fr /temp/squid-2.7.STABLE9*
 
# Checking IF $URL is accessible m if YES then continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
echo
echo -e "$COL_GREEN Checking if $URL is accessible in order to proceed further. . .!! $COL_RESET"
cd /temp
wget -q $URL/squid.conf
{
if [ ! -f /temp/squid.conf ]; then
echo
echo -e "$COL_RED ERROR: Unable to contact $URL, or possibly itnernet is not working or your IP is in black list at destination server  !! $COL_RESET"
echo -e "$COL_RED ERROR: Please check manual if $URL is accessible or not or if it have required files, JZ  !! $COL_RESET"
exit 0
fi
}
rm -fr /temp/squid.conf
sleep 6
# Moving further . . .
 
clear
echo -e "$COL_GREEN You are logged in with root ID, Ok to proceed further . . .!! $COL_RESET"
echo
#################################################################
# Selection choice of SQUID 2.7  32bit or 64bit architecture [zaib]
echo -e "$COL_GREEN ********************************************** $COL_RESET"
echo -e "$COL_GREEN   Select the type of your OS Architecture JZ   $COL_RESET"
echo -e "$COL_GREEN ********************************************** $COL_RESET"
echo
echo
echo "1. 32bit Ububtu [If you have 32bit OS]"
echo "2. 64bit ubuntu [If you have 64bit OS]"
echo
echo -n "Choose an option: [1] "
 
read squidchoice
if [ -z "$squidchoice" ]; then
squidchoice="1"
fi
case $squidchoice in
1 ) echo "Selected Squid version is 32bit"
squidver="./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs --enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap,lru --with-aio --with-dl --enable-snmp --enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files --enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536"
squidlabel="Squid 32bit"
sleep 1
;;
2 ) echo "Selected Squid version is 64bit"
squidver="./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs --enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap,lru --with-aio --with-dl --enable-snmp --enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files --enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536 --enable-carp --enable-follow-x-forwarded-for --with-maxfd=65536 build_alias=amd64-debian-linux host_alias=amd64-debian-linux target_alias=amd64-debian-linux"
squidlabel="Squid 64bit"
 
echo .
sleep 3
 
# If typ anythign other then 1 adn 2, then give invalid error message and exit [zaib]
;;
* ) echo "Invalid selection. Installation aborted."
echo
exit
;;
esac
 
################################################################## [zaib]
echo
echo -e "$COL_GREEN Updating Ubuntu first . . . !! $COL_RESET"
apt-get update
 
echo
echo
 
echo -e "$COL_GREEN Installing required components . . . !! $COL_RESET"
sleep 3
apt-get -y install gcc build-essential sharutils ccze libzip-dev automake1.9
 
# Clearing OLD data files . . .
{
if [ -f $SQUID_DIR/squid.conf ]; then
echo
echo
echo -e "$COL_RED Previous SQUID configuration file found in $SQUID_DIR ! renaming it for backup purpose . . . $COL_RESET"
mv $SQUID_DIR/squid.conf $SQUID_DIR/squid.conf.old
else
echo
echo
echo -e "$COL_GREEN No Previous Squid configuration have been found in $SQUID_DIR. Proceeding further $COL_RESET"
fi
}
 
# Checking SQUID status if its already running - check by PID
if [ "$pid" == "" ]; then
echo
echo
echo -e "$COL_GREEN No SQUID instance found in memory , so it seems we are good to GO !!! $COL_RESET"
else
echo
echo -e "$COL_RED SQUID is already running, probably you have some previous copy of SQUID installation, Better to stop and remove all previous squid installation !! $COL_RESET"
echo
echo -e "$COL_RED KILLING PREVIOUS SQUID INSTANCE by killall -9 squid command  !! $COL_RESET"
killall -9 squid
sleep 3
fi
 
# Downloading Squid source package [zaib]
echo
echo
echo -e "$COL_GREEN Downloading SQUID source package in /temp folder. . . !! $COL_RESET"
sleep 3
 
# Checking if /temp folder is previously present or not . . .
{
if [ ! -d "/temp" ]; then
echo
echo
echo -e "$COL_RED /temp folder not found, Creating it so all downlaods will be placed here  . . . $COL_RESET"
mkdir /temp
else
echo
echo -e "$COL_GREEN /temp folder is already present , so no need to create it, Proceeding further . . . $COL_RESET"
fi
}
 
cd /temp
 
# Checking IF SQUID 2.7 Stable9 installation file have been ALREADY downloaded in /temp to avoid duplication! [[ JZ .. . .]]
{
if [ -f /temp/squid-2.7.STABLE9+patch.tar.gz ]; then
rm -fr /temp/squid-2.7.STABLE9+patch.tar.gz
fi
}
 
wget https://mikrotik-squid.googlecode.com/files/squid-2.7.STABLE9%2Bpatch.tar.gz
 
# Checking IF SQUID 2.7 Stable9 installation file have been downloaded properly. if YEs continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
{
if [ ! -f /temp/squid-2.7.STABLE9+patch.tar.gz ]; then
echo
echo
 
echo -e "$COL_RED ERROR: SQUID source code package File could not be download or not found in /temp/ !! $COL_RESET"
exit 0
fi
}
echo
echo
 
echo -e "$COL_GREEN Extracting Squid from tar archive. . . !! $COL_RESET"
sleep 3
tar zxvf squid-2.7.STABLE9+patch.tar.gz
cd squid-2.7.STABLE9
mkdir /etc/squid
 
echo -e "$COL_GREEN Executing $squidlabel Compiler which you have selected architecture type in start menu . . . !! $COL_RESET"
$squidver
echo
echo
echo -e "$COL_GREEN Executing MAKE and MAKE INSTALL commands . . . !! $COL_RESET"
sleep 3
make
make install
echo
echo
 
echo -e "$COL_GREEN Creating SQUID LOGS folder and assiging permissions . . . !! $COL_RESET"
sleep 3
 
# Checking if log folder is previously present or not . . .
{
if [ -d "/var/log/squid" ]; then
echo
echo
echo -e "$COL_GREEN LOGS folder found. No ned to create, proceeding ruther . . . $COL_RESET"
else
echo
echo
echo -e "$COL_GREEN Creating LOG Folder in /var/log/squid and setting permissions accordingly (to user proxy) $COL_RESET"
mkdir /var/log/squid
fi
}
 
chown proxy:proxy /var/log/squid
 
## ** DOWNLOAD SQUID.CONF
echo
echo
echo -e "$COL_GREEN Downloading SQUID.CONF file from $URL and copy it to $SQUID_DIR. . . !! $COL_RESET"
sleep 3
 
# Checking IF SQUID.CONF File have been ALREADY downloaded in /temp to avoid duplication! [[ JZ .. . .]]
{
if [ -f /temp/squid.conf ]; then
rm -fr /temp/squid.conf
fi
}
 
cd /temp
wget $URL/squid.conf
 
# Checking IF SQUID.CONF file have been downloaded. if YEs continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
{
if [ ! -f /temp/squid.conf ]; then
echo
echo
echo -e "$COL_RED ERROR: SQUID.CONF File could not be download or not found in /temp/ !! $COL_RESET"
exit 0
fi
}
cp -fr squid.conf $SQUID_DIR
 
## ** DOWNLOAD SQUID.CONF
echo
echo
echo -e "$COL_GREEN Downloading STOREURL.PL file from $URL and copy it to $SQUID_DIR. . . !! $COL_RESET"
sleep 3
cd /temp
 
{
if [ -f /temp/storeurl.txt ]; then
rm -fr /temp/storeurl.txt
fi
}
 
wget $URL/storeurl.txt
 
{
if [ -f /temp/storeurl.pl ]; then
rm -fr /temp/storeurl.pl
fi
}
 
mv storeurl.txt storeurl.pl
 
# Checking IF STOREURL.PL file have been downloaded. if YEs continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
{
if [ ! -f /temp/storeurl.pl ]; then
echo
echo
echo -e "$COL_RED ERROR: STOREURL.PL File could not be download or not found in /temp/ !! $COL_RESET"
exit 0
fi
}
cp -fr storeurl.pl $SQUID_DIR
 
echo
echo
echo -e "$COL_GREEN Setting EXECUTE permission for storeurl.pl . . . !! $COL_RESET"
chmod +x $SQUID_DIR/storeurl.pl
 
# Creating CACHE folders
echo
echo
echo -e "$COL_GREEN Creating CACHE directory in $CACHE_DIR , in this example,I used 10GB for cache, adjust it accordingly  . . . !! $COL_RESET"
sleep 3
 
# Checking if /cache-1 folder exist  . . .
{
if [ ! -d "$CACHE_DIR" ]; then
echo
echo
echo -e "$COL_GREEN Creating cache folder in $CACHE_DIR , Default size is 10GB, you should set it accordingly to your requirements  . . . $COL_RESET"
mkdir $CACHE_DIR
chown proxy:proxy $CACHE_DIR
squid -z
chmod 777 -R $CACHE_DIR
else
echo
echo -e "$COL_RED $CACHE_DIR folder already exists , Clearing it before proceeding. . . $COL_RESET"
rm -fr $CACHE_DIR/*
chown proxy:proxy $CACHE_DIR
echo -e "$COL_GREEN $CACHE_DIR Initializing Cache Directories as per the config  . . . $COL_RESET"
echo
squid -z
chmod 777 -R $CACHE_DIR
fi
}
 
echo
echo
echo -e "$COL_GREEN Adding squid in /etc/rc.local for auto startup . . . !! $COL_RESET"
sed -i '/exit/d' /etc/rc.local
sed -i '/[/usr\/sbin\/squid]/d' /etc/rc.local
echo /usr/sbin/squid >> /etc/rc.local
echo exit 0 >> /etc/rc.local
echo
echo -e "$COL_GREEN Starting SQUID (and adding 10 seconds Pause for proper initialization). . . !! $COL_RESET"
squid
sleep 5
 
# Checking SQUID status via PID [zaib]
#if [ "$pid" == "" ]; then
#echo
#echo -e "$COL_RED ERROR: UNABLE to start SQUID, try to run with -d1N syntax and see where its showing error !! $COL_RESET"
#else
ps aux |grep squid
echo
echo -e "$COL_GREEN $squidlabel is Running OK with PID number "$pid", no further action required, EXITING  . . .$COL_RESET"
echo
echo To view squid web access activity log, use command
echo -e "$COL_GREEN tail -f /var/log/squid/access.log $COL_RESET"
echo OR
echo -e "$COL_GREEN tail -f /var/log/squid/access.log |ccze $COL_RESET"
echo
echo -e "$COL_GREEN Regard's / Syed Jahanzaib . . . !! $COL_RESET"
echo


Now its time to start automated installation script.
1
./install.sh
Select your operating information as per installation script guided for 32bit OS press 1 and 64bit OS press 2.
Wait till installation complete .
Please share your experience and comments in message .
Thanks