| View previous topic :: View next topic |
| Author |
Message |
tester
Joined: 17 Nov 2004 Posts: 25
|
Posted: Mon Nov 22, 2004 11:04 pm Post subject: How to block websites and file extension for some users |
|
|
Squid : blocking websites
How to block few users and allow some for a particular website
First we will create a list then allow or deny at the end
| Code: | | # vi /etc/squid/squid.conf |
[go to acl and add/modify according to ur need]
| Code: |
acl GoodIP src 192.168.0.1
acl GoodIP src 192.168.0.15
acl BlockedIP src 192.168.0.2
acl BlockedIP src 192.168.0.3
acl LimitedURL url_regex -i bbc.com
acl LimitedURL url_regex -i abc.com
acl GoodURL url_regex -i 123abc.com
acl GoodURL url_regex -i abc123.com
acl badURL url_regex -i xyz.com
acl badURL url_regex -i games
acl badURL url_regex -i chat
acl x-type req_mime_type -i ^application/octet-stream$
acl x-type req_mime_type -i application/octet-stream
acl x-type req_mime_type -i ^application/x-mplayer2$
acl x-type req_mime_type -i application/x-mplayer2
acl x-type req_mime_type -i ^application/x-oleobject$
acl x-type req_mime_type -i application/x-oleobject
acl x-type req_mime_type -i application/x-pncmd
acl x-type req_mime_type -i ^video/x-ms-asf$
acl x-type2 rep_mime_type -i ^application/octet-stream$
acl x-type2 rep_mime_type -i application/octet-stream
acl x-type2 rep_mime_type -i ^application/x-mplayer2$
acl x-type2 rep_mime_type -i application/x-mplayer2
acl x-type2 rep_mime_type -i ^application/x-oleobject$
acl x-type2 rep_mime_type -i application/x-oleobject
acl x-type2 rep_mime_type -i application/x-pncmd
acl x-type2 rep_mime_type -i ^video/x-ms-asf$
http_access allow GoodIP all
http_access deny BlockedIP LimitedURL
http_access deny badURL
http_access deny x-type all
http_reply_access deny x-type all
http_access deny x-type1 all
http_reply_access deny x-type1 all
http_access deny x-type2 all
http_reply_access deny x-type2 all
acl extndeny url_regex -i "/etc/squid/extndeny"
acl download method GET
http_access deny extndeny download
http_access deny extndeny |
save and close
Now lets create extndeny file ..this is the list of file extensions which we are blocking in SQUID. make a file and add these file extensions vi /etc/squid/extndeny --
| Code: | \.ez$
\.hqx$
\.cpt$
\.dot$
\.wrd$
\.bin$
\.dms$
\.lha$
\.lzh$
\.ace$
\.r00$
\.r01$
\.exe$
\.wp5$
\.wk$
\.wz$
\.vcd$
\.bz2$
\.deb$
\.dvi$
\.tar$
\.gtar$
\.tgz$
\.gz$
\.bat$
\.rpm$
\.spm$
\.zip$
\.mid$
\.midi$
\.kar$
\.mpga$
\.mp2$
\.mp3$
\.ra$
\.dl$
\.fli$
\.gl$
\.mpe$
\.mpeg$
\.mpg$
\.qt$
\.mov$
\.avi$
\.movie$
\.wav$
\.au$
\.asf$
\.af$
\.bin$
\.gz$
\.bz2$
\.asx$
\.afx$
\.asf$
\.asx$
\.au$
\.avi$
\.divx$
\.m3u$
\.mov$
\.mp2$
\.mp3$
\.mpeg$
\.mpg$
\.qt$
\.ra$
\.ram$
\.rm$
\.viv$
\.vivo$
\.vob$
\.vqf$
\.wav$
\.wma$
\.wmv$
\.vbs$
\.shs$
\.pif$
\.wpm$
\.wvx$ |
Now restart squid
| Code: | | # service squid restart |
Always look in log files for errors
| Code: | /var/log/squid/access.log # have list of website visited by all users
/var/log/squid/cache.log # Log of squid deamon / process |
|
|
| Back to top |
|
 |
Linux-faqs.com Owner

|
Posted: Mon Nov 22, 2004 11:04 pm Post subject: Support this site |
|
|
|
|
| Back to top |
|
 |
Peeyush Maurya
Joined: 17 Nov 2004 Posts: 92 Location: Noida
|
Posted: Wed Nov 24, 2004 7:33 pm Post subject: Blocking Streaming Audio / Video using Squid |
|
|
nice ACL tester
I found this Squid ACL for Blocking Streaming Audio / Video. This can be used with above ACL.
| Code: | acl BlockExt url_regex -i \.mp3$ \.asx$ \.wma$ \.wmv$ \.avi$ \.mpeg$ \.mpg$ \.qt$ \.ram$ \.rm$ \.iso$ \.wav$ \.exe$
acl webRadioReq1 req_mime_type -i ^video/x-ms-asf$
acl webRadioReq2 req_mime_type -i ^application/vnd.ms.wms-hdr.asfv1$
acl webRadioReq3 req_mime_type -i ^application/x-mms-framed$
acl webRadioRep1 rep_mime_type -i ^video/x-ms-asf$
acl webRadioRep2 rep_mime_type -i ^application/vnd.ms.wms-hdr.asfv1$
acl webRadioRep3 rep_mime_type -i ^application/x-mms-framed$
acl WMP browser Windows-Media-Player/*
http_access deny BlockExt !UtentiGold
http_access deny WMP all
http_access deny webRadioReq1 all
http_access deny webRadioReq2 all
http_access deny webRadioReq3 all
http_reply_access deny webRadioRep1 all
http_reply_access deny webRadioRep2 all
http_reply_access deny webRadioRep3 all |
this ACL of squid for blocking online streaming of Audio / Video works prefectly _________________ Linux -- crash it to believe it |
|
| Back to top |
|
 |
lilo Site Admin
Joined: 17 Nov 2004 Posts: 54 Location: NYC
|
Posted: Fri Dec 10, 2004 1:37 am Post subject: thanks |
|
|
:) it worked .. i was looking for it since a long time...now since i got it, i can relax and let users browse and eat there heart out :)
I had blocked many keywords likes : ads , mp3 , video , gambling, hacking, linux, [sensored] and many dating sites. Now i know blocking URL is fun
Iam a happy man now:)
thanks alot |
|
| Back to top |
|
 |
hariiyer
Joined: 28 Dec 2004 Posts: 4
|
Posted: Mon Feb 21, 2005 8:48 am Post subject: |
|
|
Dear all
this is not working in RH-9. Please help me how to? |
|
| Back to top |
|
 |
Peeyush Maurya
Joined: 17 Nov 2004 Posts: 92 Location: Noida
|
Posted: Thu Feb 24, 2005 8:12 pm Post subject: squid blocking file extensions |
|
|
Are you getting any error or its simply not working?
try the following for blocking few file extension on squid.conf
| Code: | acl BlockExt url_regex -i \.mp3$ \.asx$ \.wma$ \.wmv$ \.avi$ \.mpeg$ \.mpg$ \.qt$ \.ram$ \.rm$ \.iso$ \.wav$ \.exe$
http_access deny BlockExt all |
'-i' is for making it to read both cases.
SQUID ACL FAQS _________________ Linux -- crash it to believe it |
|
| Back to top |
|
 |
gem45
Joined: 17 Sep 2009 Posts: 1
|
Posted: Thu Sep 17, 2009 8:13 am Post subject: |
|
|
I'm a happy man right now.... No more ads and pop ups.
Thanks guys.....
Dossier de surendettement |
|
| Back to top |
|
 |
ialongiya
Joined: 28 Nov 2009 Posts: 1
|
|
| Back to top |
|
 |
ksg1986
Joined: 30 Mar 2010 Posts: 3 Location: New Delhi
|
|
| Back to top |
|
 |
soleadd13
Joined: 06 May 2010 Posts: 3 Location: ENGLAND
|
Posted: Wed May 19, 2010 8:34 am Post subject: The reason that people play golf |
|
|
The reason that people play golf
Golf is a combination of a mental and a physical game. Introduction at www.golfwholesale18.com reviews On the mental side, Golf is a game that poses problems that require a lot of creative problem solving. On the physical side, Golf is a sport requiring good eye-hand coordination, technique and endurance. Golf involves a lot of walking; unless you intend to ride on a Golf cart every time. People have different Reasons for Playing Golf. Some Play Golf for health Reasons, some play Golf for fun, another Reason to Play Golf is to be a Professional Golfer and earn money.
Here are some common driving factors that drives people to Play Golf golfwholesale18 reviews tell us
Golf is an intriguing and relaxing game. Many people play Golf in the weekend to unwind from the stress of their weekday job. Golf combines a competitive game with Fitness Exercise and a touch of the outdoors.
The Golf Course is a place for finding business partners and making business deals. A study made by the National Golf Foundation stated that more than ten percent of new Golfers get into the game for business reasons. golfwholesale18.com reviews The Golf Course is, for many people, a trade floor or a great way to meet new possible business contacts as they socialize with fellow Golfers or spectators.
Golf is also a good form of exercise since it requires a lot of walking - provided you don't ride the Golf cart all the time. Walking through the Golf Course helps you release stress and clear your head.
Playing Golf challenges both mind and body. The Golf Hazards you encounter throughout the Golf Course require creative solutions and technical skills to perform the found solution. golfwholesale18 ishiner
Golf can be played by anyone. It is not a very strenuous and physical game. People, young and old, can play Golf because there is a very low risk for Golf Related Injuries and Accidents. golfwholesale18.com
Another driving factor on Playing Golf is the money. Tiger Woods set a record on the PGA career money list with $39,777,265 winnings through 2003. He had also won $48,613,450 worldwide. Who knows perhaps this website can help you become a professional golfer! www.golfwholesale18.com |
|
| Back to top |
|
 |
|