Q. How do I deny a user accessing particular website? For example block foo.com.
A. Squid cache is a popular open source web proxy server and web cache software.
It has a wide variety of uses, from speeding up a web server by caching repeated requests, to caching web, DNS and other network lookups for a group of people sharing network resources, to aiding security by filtering traffic.
Squid has powerful ACL (access control list). The primary use of the acl system is to implement simple access control.
How to deny a user from accessing particular site?
To block site called foo.com you need to add following two lines to your squid configuration file.
# vi /etc/squid/squid.conf
Search for `Access Controls' and append following two lines:
acl blocksites dstdomain .foo.com
http_access deny blocksites
Save and close the file. Restart Squid:
# /etc/init.d/squid restart
Let us say you would like to deny access for anyone who browses to a URL with the word "bar" in it. Append following ACL:
acl blockregexurl url_regex -i bar
http_access deny blockregexurl
Save and close the file.
- Email FAQ to a friend
- Printable version
- Rss Feed
- Last Updated: 1-2-07

{ 1 trackback }
{ 11 comments… read them below or add one }
it’s out of subject! but related to SQuid.
I need to know what is the best filesystem compatilbe with storeio? to get the best perfomance ever…
one more questions about refresh_pattern anyone explain more to me about it…
any help would be highly appreciated
this squid is for caching onlu purpose and I’m looking to fine-tune it to get the best caching server ever.. thank you
If you would like to experiment on Squid, the best file storage system for Squid would be COSS in my opinion. I am currently using ufs, aufs, diskd and coss in my squid servers. You have to compile Squid with the following options to enable all the storage systems: –enable-storeio=coss,ufs diskd null aufs
Please see the great Squid FAQ at: http://wiki.squid-cache.org/SquidFaq/
The default refresh-pattern should be good enough for almost any system:
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
However if your needs are very specific, please see the default squid.conf for further details.
Have a nice day !!
hi,
i setup squid on a win2003 server os.fine i got it working but my challenge now is getting it to do web filtering to restrict access to certain sites. my research on this brought me to this site and i have tried the methods described here with no success.pls can any one help me out with this? u could send ur reply to my email: uwa45@yahoo.com. if neccessary a squid conf file wld be appreciated so that i can cross check with what i did.
Thanks for all ur help and support.
hi,
I setup the squid in linux intigration of windows. we are useing more then 20 users every thinking is working fine, but i think due to trafic squid is working only a day after it is dead. i want to improve the stability (mean i want to do fine fuining)
and i what restrict the users while attching file size to 1M maximem.
pls do the needful
Qiestion: How to configure sarg and squidGuard for squid servers to improve performance ?
What r the solution for many no. of sites/domain blocking using above method?
I have setup the transperant squid proxy to block some downloading & some urls.
How to block or deny the online listening musics & videows. Like for url youtube.com
Any Idea.
Cheers,
Nandkihosr
how can i block a website in a particlar syatem or IP through squid
Hi all,
I using squid as firewall. I want to block teamviewer which uses port 80 i guess.but i have to keep the 80 port open for browsing purpose. i am not that good at linux.
Can any one please help.
Thanks in advance
Jonayed
bangladesh
Hi Vivek,
I have configure squid in my office using your earlier artical of making transperent proxy. I want to block some site, for that I have use this artical but its not working. Please help.
Vijay
Hi friend,
Can u help me to “cache a particular website and store it in local system and if the client user send a request for that particular site, the proxy first check it in local cache,if not available means pass the request to internet” this is my requirement how to configure this by using squid proxy.