Squid to Squid3 migration

From wiki.techunit.org
Jump to: navigation, search


The scope

We had to migrate an old Debian 6 virtual Machine to a Jessie. Our first problem was that squid packages evolved to the third version, and on this occasion, changed name from squid to squid3.
On this server, there is a lot of ACL and a web filtering with SquidGuard.

# install packages
apt-get install squid3 squidguard -y
####################################
#Personal : sync production script
#  Copy /opt/scripts/upgrade_bl.sh
#    modify %s/squid/squid3/
#    run the script
####################################
#backup original config files
mv /etc/squid3/squid.conf /etc/squid3/squid.conf.orig
mv /etc/squidguard/squidGuard.conf /etc/squidguard/squidGuard.conf.orig
#Restore squidguard config file
scp <oldserver>:/etc/squid/squidGuard.conf /etc/squidguard/squidGuard.conf
#Replace log directories
sed -i 's/squid/squid3/g' /etc/squid/squidGuard.conf
#Sync database from old server
scp -r <oldserver>:/var/lib/squidguard/db /var/lib/squidguard/
chown -R proxy: /var/lib/squidguard/db
#Build database
squidGuard -C all
#Sync squid config files
scp <oldserver>:/etc/squid/{access.conf,whitelist-domains,squid.conf} /etc/squid3
sed -i 's/squid/squid3/g' /etc/squid3/squid.conf
#Comment following lines
emulate_httpd_log off
log_fqdn off
httpd_accel_no_pmtu_disc
acl all src 0.0.0.0/0.0.0.0
#Replace
http_port 3128 transparent
#by
http_port 3128 intercept

Elliot
techUnit's cofounder