Skip to content

Instantly share code, notes, and snippets.

@mansurali901
Last active September 5, 2017 08:00
Show Gist options
  • Save mansurali901/db34fd71c9667bcc78173bc0a8feff54 to your computer and use it in GitHub Desktop.
Save mansurali901/db34fd71c9667bcc78173bc0a8feff54 to your computer and use it in GitHub Desktop.
SQUID 3.1.23Installation Automation
#!/bin/bash
# SQUID Installation automation
# Author Mansur Ul Hasan
# [email protected]
echo "
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Installation script for SQUID 3.1.23
This script is designed by
Mansur Ul Hasan
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
"
echo "Installing dependencies for SQUID 3.1.23 "
echo "Installing Development Tools "
yum groupinstall "Development Tools"
echo "Donwloading Other dependencies"
yum install libxml2 expat-devel openssl-devel libcap ccache perl gcc autoconf automake make sudo wget libtool-ltdl-devel cppunit cppunit-devel bzr autoconf automake libtool clang gcc-c++ perl-Pod-MinimumVersion bzip2 ed make openldap-devel pam-devel db4-devel libxml2-devel libcap-devel
echo "Downloading Source code of Asterisk 3.1.23"
wget -O squid-3.1.23.tar.gz https://www.dropbox.com/s/ay2yemlurgh3w9f/squid-3.1.23.tar.gz?dl=0
echo "Download Completed "
echo "
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Extracting Source Code
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"
tar xvf squid-3.1.23.tar.gz
cd squid-3.1.23*
echo "Compilation process begin
.
.
.
.
"
./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-internal-dns --disable-strict-error-checking --exec_prefix=/usr --libexecdir=/usr/lib64/squid --datadir=/usr/share/squid --sysconfdir=/etc/squid --disable-dependency-tracking --enable-arp-acl --enable-follow-x-forwarded-for --enable-auth=basic,digest,ntlm,negotiate --enable-basic-auth-helpers=LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,DB,POP3,squid_radius_auth --enable-ntlm-auth-helpers=smb_lm,no_check,fakeauth --enable-digest-auth-helpers=password,ldap,eDirectory --enable-negotiate-auth-helpers=squid_kerb_auth --enable-external-acl-helpers=ip_user,ldap_group,session,unix_group,wbinfo_group --enable-cache-digests --enable-cachemgr-hostname=localhost --enable-delay-pools --enable-epoll --enable-icap-client --enable-ident-lookups --enable-linux-netfilter --enable-referer-log --enable-removal-policies=heap,lru --enable-snmp --enable-ssl --enable-storeio=aufs,diskd,ufs --enable-useragent-log --enable-wccpv2 --enable-esi --enable-http-violations --with-aio --with-default-user=squid --with-filedescriptors=16384 --with-dl --with-openssl --with-pthreads build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu target_alias=x86_64-redhat-linux-gnu --with-squid=/builddir/build/BUILD/squid-3.1.23 2>&1 | tee squidcompile.log
cat squidcompile.log |grep -i Transparent >> transparentcheck.log
check=`cat transparentcheck.log`
case $check in
*"ransparent"*)
echo "
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Transparent Proxy Support is available
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
"
sleep 5
;;
*)
echo "
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Transparent Proxy Support is not available
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
"
exit
;;
esac
echo "
Installation begins.....
.
.
.
.
.
.
.
.
.
"
make && make install && make config && modprobe ip_nat_ftp
echo "
#!/bin/sh
#
# Startup script for Squid
#
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 69 35
# description: An open source caching proxy server
#import functions
. /etc/init.d/functions
SQUID_BIN=/usr/sbin
case "$1" in
start)
echo "Starting Squid:"
$SQUID_BIN/squid
success
echo
;;
stop)
echo "Stopping Squid:"
$SQUID_BIN/squid -k kill
success
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
" >> /etc/init.d/squid
chmod +x /etc/init.d/squid
echo "SQUID 3.1.23 has been successfully installed on your system"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment