sudo apt-get --assume-yes remove --purge squid squid3 && sudo apt-get --assume-yes autoremove && rm -r /etc/squid && rm -r /etc/squid3 && rm -r /var/spool/squid
sudo apt-get --assume-yes -f install squid3
cd /etc/squid3/
sudo cp /etc/squid3/squid.conf /etc/squid3/squid.conf.original
sudo cat squid.conf.original | egrep -v -e '^[[:blank:]]*#|^$' > squid.conf
sudo chmod a-w /etc/squid3/squid.conf.original
sudo sed -i 's|http_port 3128|http_port 8888|' /etc/squid3/squid.conf
sudo service squid3 restart
acl bad_sites dstdomain '/etc/squid3/bad-url.acl'
#acl bad_sites dstdomain .msn.com
http_access deny bad_sites
http_access allow all !bad_sites
http_port 8888
https_port 8888
cache_dir ufs /etc/squid3/cache 100 10 20
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
cache_effective_user proxy
cache_effective_group proxy
cache_mgr webmaster@localhost
.yahoo.com
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.
Related