linux,faqs,squid,ban,banning,proxy,forum,help Linux-FAQs
Discuss, getting an error, troubleshoot your issues on Linux
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Home | Forum | MAN Pages | Tutorials | Directory | HOWTOs | About Me | Contact
You are Browsing Linux Forum

How to block websites and file extension for some users

 
Post new topic   Reply to topic    Linux-FAQs Forum Index -> Web Proxy Server
View previous topic :: View next topic  
Author Message
tester



Joined: 17 Nov 2004
Posts: 25

PostPosted: Mon Nov 22, 2004 11:04 pm    Post subject: How to block websites and file extension for some users Reply with quote

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
View user's profile Send private message
Linux-faqs.com
Owner





PostPosted: 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

PostPosted: Wed Nov 24, 2004 7:33 pm    Post subject: Blocking Streaming Audio / Video using Squid Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
lilo
Site Admin


Joined: 17 Nov 2004
Posts: 54
Location: NYC

PostPosted: Fri Dec 10, 2004 1:37 am    Post subject: thanks Reply with quote

:) 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
View user's profile Send private message
hariiyer



Joined: 28 Dec 2004
Posts: 4

PostPosted: Mon Feb 21, 2005 8:48 am    Post subject: Reply with quote

Dear all


this is not working in RH-9. Please help me how to?
Back to top
View user's profile Send private message
Peeyush Maurya



Joined: 17 Nov 2004
Posts: 92
Location: Noida

PostPosted: Thu Feb 24, 2005 8:12 pm    Post subject: squid blocking file extensions Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
gem45



Joined: 17 Sep 2009
Posts: 1

PostPosted: Thu Sep 17, 2009 8:13 am    Post subject: Reply with quote

I'm a happy man right now.... No more ads and pop ups.

Thanks guys.....Smile


Dossier de surendettement
Back to top
View user's profile Send private message
ialongiya



Joined: 28 Nov 2009
Posts: 1

PostPosted: Mon Nov 30, 2009 5:45 am    Post subject: Reply with quote

Can linux run windows games and have a start bar to look like windows? I would like to be able to use the start bar and fallout 3 in linux. can i do that?
_________________
yahoo keyword tool ~ overture ~ traffic estimator ~ adwords traffic estimator
Back to top
View user's profile Send private message
ksg1986



Joined: 30 Mar 2010
Posts: 3
Location: New Delhi

PostPosted: Tue Mar 30, 2010 5:48 am    Post subject: How to block websites Reply with quote

A Small application which can easly block n unblock websites easly !

Just goto http://csharpdemos.blogspot.com/2010/03/websites-blocker-unblocker.html

n you will find your solution..........
Back to top
View user's profile Send private message Visit poster's website
soleadd13



Joined: 06 May 2010
Posts: 3
Location: ENGLAND

PostPosted: Wed May 19, 2010 8:34 am    Post subject: The reason that people play golf Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Linux-FAQs Forum Index -> Web Proxy Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Linux-faqs.com Copyright, All rights reserved www.linux-faqs.com. Peeyush Maurya.