- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Configure squid proxy to block some sites
Operating System - Linux
1821801
Members
3109
Online
109637
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-01-2011 05:24 AM
тАО01-01-2011 05:24 AM
Configure squid proxy to block some sites
Dear all,
i just wanted to block some sites through my proxy server.i am using red hat linux 5.0 and squid proxy version 3.0. attached the configuration file also.tried through acl file but not success. can anybody suggest what went wrong on this config file?
thanks in advance
i just wanted to block some sites through my proxy server.i am using red hat linux 5.0 and squid proxy version 3.0. attached the configuration file also.tried through acl file but not success. can anybody suggest what went wrong on this config file?
thanks in advance
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-01-2011 08:20 AM
тАО01-01-2011 08:20 AM
Re: Configure squid proxy to block some sites
Your configuration file syntax looks OK to me.
The problem is probably in the ordering of the rules: according to squid documentation, squid processes the access list rules (= the http_access lines) in order, and when the first rule that matches the request is found, it stops processing the rules and does what the matching rule said.
Because the default squid.conf file contains a lot of comments, it is sometimes useful to filter out everything else and look only at the important lines:
$ grep '^[^#]*http_access' squid.conf | less
This command shows only those lines which contain the word "http_access" and are *not* commented out.
From your file, this command produces this output:
http_access deny kgpsites
http_access allow intra
http_access deny kgpsites
http_access allow manager localhost
http_access deny manager
http_access deny blockeddomain
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_access deny blockeddomain
You have "http_access deny kgpsites" and "http_access deny blockeddomain" listed twice: in both cases, the second line is non-functional and can be removed.
Your first "http_access deny kgpsites" works, because it is located before "http_access allow intra". This first kgpsites line is located immediately after the "acl kgpsites" line, away from the other http_access lines, so you probably didn't realize it's there.
Before squid gets to the first "http_access deny blockeddomain", it sees "http_access allow intra" and thinks: "OK! This access is allowed. I can stop reading the rules for this request."
For the same reason, the second "http_access deny kgpsites" is non-functional.
The second-to-last line is "http_access deny all": it matches everything, so the last line "http_access deny blockeddomain" is never reached. So that line is useless.
If adjusting ordering of your access list rules doesn't solve the problem, please try this:
http://wiki.squid-cache.org/SquidFaq/SquidAcl#I_set_up_my_access_controls.2C_but_they_don.27t_work.21__why.3F
MK
The problem is probably in the ordering of the rules: according to squid documentation, squid processes the access list rules (= the http_access lines) in order, and when the first rule that matches the request is found, it stops processing the rules and does what the matching rule said.
Because the default squid.conf file contains a lot of comments, it is sometimes useful to filter out everything else and look only at the important lines:
$ grep '^[^#]*http_access' squid.conf | less
This command shows only those lines which contain the word "http_access" and are *not* commented out.
From your file, this command produces this output:
http_access deny kgpsites
http_access allow intra
http_access deny kgpsites
http_access allow manager localhost
http_access deny manager
http_access deny blockeddomain
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_access deny blockeddomain
You have "http_access deny kgpsites" and "http_access deny blockeddomain" listed twice: in both cases, the second line is non-functional and can be removed.
Your first "http_access deny kgpsites" works, because it is located before "http_access allow intra". This first kgpsites line is located immediately after the "acl kgpsites" line, away from the other http_access lines, so you probably didn't realize it's there.
Before squid gets to the first "http_access deny blockeddomain", it sees "http_access allow intra" and thinks: "OK! This access is allowed. I can stop reading the rules for this request."
For the same reason, the second "http_access deny kgpsites" is non-functional.
The second-to-last line is "http_access deny all": it matches everything, so the last line "http_access deny blockeddomain" is never reached. So that line is useless.
If adjusting ordering of your access list rules doesn't solve the problem, please try this:
http://wiki.squid-cache.org/SquidFaq/SquidAcl#I_set_up_my_access_controls.2C_but_they_don.27t_work.21__why.3F
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2011 05:48 AM
тАО04-19-2011 05:48 AM
Re: Configure squid proxy to block some sites
solved by using some other setup
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP