NAVIGATION
Home
Gallery
Java
Linux
Web
Scripts And Utilities
Mobile And Sms
Misc
Contact
pixelWIKI
Nabaz Tag




<<

Squid Proxy

Making Squid block adverts.

It is relatively straight forward to make squid block adverts. Add a new ACL like so:

acl url_ads url_regex "/etc/squid/denied_ads.acl"
http_access deny url_ads


and create a file /etc/squid/denied_ads.acl like so:
sample
/adv/.*.gif$
/[Aa]ds/.*.gif$
/[Aa]d[Pp]ix/
/[Aa]d[Ss]erver
/[Aa][Dd]/.*.[GgJj][IiPp][FfGg]$
/[Bb]annerads/
/adbanner.*.[GgJj][IiPp][FfGg]$


attached here is my full squid setup: squid.tgz

my list of urls to block: Squid Denied Ads Acl
my squid.conf file: Squid Conf



Squid Authentication (for 2.6)
to enable authentication, add the following to the squid.conf:
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
ncsa_auth authenticates against an apache format user file, see htpasswd

acl auth proxy_auth REQUIRED
REQUIRED allows all users from the passwd file, this can also be a space-separated list of users

http_access deny !auth
actually deny requests from non-authenticated users