This method will work for both Internet Explorer and Google Chrome.
You must have lighttpd or apache installed to serve up replacement images or pages.
Install squid: sudo apt-get install squid
Configure: /etc/squid/squid.conf
Install squidguard: sudo apt-get install squidguard
http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
access_log /var/log/squid/access.log squid
log_ip_on_direct off
url_rewrite_children 5
url_rewrite_concurrency 0
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl our_networks src 192.168.219.0/24
cache deny all
http_access allow our_networks
http_reply_access allow all
icp_access allow all
visible_hostname SERVERNAME
coredump_dir /var/spool/squid
Download and configure adblock for use with squidguard
wget http://easylist.adblockplus.org/adblock_rick752.txtCreate the expression list: cat adblock_rick752.txt | sed -f sedfile > expressions
create a sefile with this inside it:
/@@.*/d;
/^!.*/d;
/^\[.*\]$/d;
s#http://##g;
s,[.?=&/|],\\&,g;
s#*#.*#g;
s,\$.*$,, g;
In your squidguard folder /var/lib/squidguard/db, create a folder for adblock and copy the expressions file inside it.
sudo chmod proxy.proxy -R adblock
Edit your /etc/squid/squid.conf, add this at the end
redirect_program /usr/bin/squidGuard -d -c /etc/squid/squidGuard.conf
Edit your /etc/squid/squidGuard.conf file
dbhome /var/lib/squidguard/dbRestart Squid and then configure your browsers to use the ip address of the server running squid, mine was http://192.168.219.111:3128, fire up your browser and surf ad riddled sites to test it.
logdir /var/log/squid
src my_network {
ip 192.168.219.0/24
}
dest adblock {
expressionlist adblock/expressions
redirect http://localhost/lol.jpg
}
acl {
my_network {
pass !adblock any
}
default {
pass none
redirect http://localhost/lol.jpg
}
}
Sign-up for OpenDNS, not only do they provide you with speedy DNS queries they also feature ad blocking. The good thing about OpenDNS is that you only have to configure your router and it enables all the features on every computer on your network.
Their DNS servers are down below:
208.67.222.222
208.67.220.220
If you need help configuring your computer or router please check their site.
https://www.opendns.com/homenetwork/start/
Once you are done setting up your router login to their dashboard and go to settings \ Content Filtering. I enabled filtering for adware, parked domains and phishing.
Well that about covers it, enjoy add free surfing!

3 comments:
Thanks for posting a link to my research. :) It's not often you see netiquette anymore.
This didnt work for me.
All layouts and many pictures i cant see with squidguard enabled.
can u help me?
Have the same problem. Css and pictures are whashed out.
Post a Comment