LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-15-2009, 05:29 AM   #1
mianmajidali
Member
 
Registered: Mar 2008
Posts: 38

Rep: Reputation: 15
Angry Squid: url regex problem


hi to all
i have problem with regexurl
there is file configuration of squid.conf

acl others urlpath_regex "/etc/squid/blacklist"

and in http_access tag i entered

http_access deny others

and did entered the URLs in the file names as blacklist, but it dont working.
please guid me
thanks
 
Old 02-16-2009, 03:51 AM   #2
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
It could be TWO issues here.
What are you trying to achieve, is urpath_regex appropriate? is srcdoman or dstdomain not enough? what about url_regex? If you are sure this is what u want, then;
1. note that URL-path regular expression pattern matching, leaves out the protocol and hostname and hence there could not be any urls matching your blacklists.
2. the order of your other ACLs matters. note that squid acls are read top down and when a match is found, processing stops. so if your black listed sites are finding a match (which allows them through) then your urlpath_regex will not be used.

If possible, attach your whole squid.conf and also a sample of the contect of blacklists.
 
Old 02-16-2009, 04:23 AM   #3
farrukhndm
Member
 
Registered: Mar 2008
Location: Pakistan
Distribution: Fedora,Centos,RHEL
Posts: 75

Rep: Reputation: 15
Quote:
Originally Posted by mianmajidali View Post
hi to all
i have problem with regexurl
there is file configuration of squid.conf

acl others urlpath_regex "/etc/squid/blacklist"

and in http_access tag i entered

http_access deny others

and did entered the URLs in the file names as blacklist, but it dont working.
please guid me
thanks
Plz post you Complete ACL Configuration from squid.conf
 
Old 01-20-2010, 04:32 AM   #4
iseymur
LQ Newbie
 
Registered: Jan 2010
Posts: 8

Rep: Reputation: 0
I cannot block files mp3, exe , tec with squid

my conf file


#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl localhost src ::1/128
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl to_localhost dst ::1/128

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 192.168.1.3 192.168.0.0/24 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

acl blockfiles urlpath_regex -i “/etc/squid/blockfiles.acl”

# Deny all blocked extension
# deny_info ERR_BLOCKED_FILES blockfiles

http_access deny blockfiles

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320


/etc/squid/blockfiles.acl file
\/.*\.avi$
\/.*\.mp3$
\/.*\.divx$
 
Old 01-20-2010, 04:40 AM   #5
mkp
Member
 
Registered: Jul 2008
Posts: 48

Rep: Reputation: 15
Quote:
Originally Posted by iseymur View Post

acl blockfiles urlpath_regex -i “/etc/squid/blockfiles.acl”

# Deny all blocked extension
# deny_info ERR_BLOCKED_FILES blockfiles

http_access deny blockfiles
I have this for that:

Code:
acl download url_regex -i \.iso$ \.mdf$ \.mkv$ \.mp4$ \.wma$ \.mp3$ \.wav$ \.flac$ \.torrent$ \.mpeg$ \.mpg$ \.exe$ \.vbs$ \.msi$

http_access deny download
 
Old 01-20-2010, 11:35 AM   #6
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
urlpath_regex is case sensitive, but does not use the -i option
replace the /etc/squid/blockfiles.acl file:

\.[Aa][Vv][Ii]$
\.[Mm][Pp]3$
\.[Dd][Ii][Vv][Xx]$

Last edited by chitambira; 01-20-2010 at 11:38 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use squid for url redirection? GGlinux Linux - Software 2 02-24-2009 05:59 AM
Squid - URL Rewriting nitrohuffer2001 Linux - Enterprise 1 10-23-2008 07:44 PM
Problem while extracting a relative URL (regex) redvivi Programming 10 08-26-2008 11:50 AM
Squid Not allowed IP url rssarathy Linux - Newbie 1 03-19-2008 08:00 AM
Problem: Squid: The requested URL could not be retrived nukoso Linux - Server 5 01-16-2008 09:12 AM


All times are GMT -5. The time now is 11:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration