LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2013, 12:59 AM   #1
ashpos
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Rep: Reputation: Disabled
suggest the modfcn in squid.conf for blocking websites with optimize performance


suggest the modification for blocking websites with optimize performance..

here is my squid.conf >>>>



#---------------------------------------------------
# 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_our_networks src 169.254.100.200/255.255.0.0
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # 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 SSL_ports port 995
acl SSL_ports port 587
acl SSL_ports port 110
acl SSL_ports port 25
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 65535 # unregistered port
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 Safe_ports port 110 # pop3-imap-iips
acl Safe_ports port 25 # smtp-iips


acl CONNECT method CONNECT
acl lanhome src 169.254.0.0/255.255.0.0
acl blockeddomain dstdomain "/etc/squid/blocked.domains.acl
acl blockfiles urlpath_regex "/etc/squid/blocks.files.acl"

acl blockregexurl url_regex -i apps.facebook
http_access deny blockregexurl
#-------------------------------------------
acl blockregexurl url_regex -i orkut.com
http_access deny blockregexurl
#------------------------------------------
acl blockregexurl url_regex -i porn
http_access deny blockregexurl
#-----------------------------------------
acl blockregexurl url_regex -i sex
http_access deny blockregexurl
#------------------------------------------
acl blockregexurl url_regex -i xxx myspace.com
http_access deny blockregexurl
#-----------------------------------------
#acl blockregexurl url_regex -i adult.*


acl youtube dstdomain .youtube.com
acl blockregexurl url_regex -i youtube.com
http_access deny blockregexurl
#http_access allow special_client blockregexurl
#http_access allow special_client


auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching IIPSPROXY server
acl ncsa_user proxy_auth REQUIRED
http_access allow ncsa_user

http_access allow localhost
#http_access allow our_networks
#http_access deny CONNECT youtube !special_client
#http_access deny youtube !special_client
http_access allow lanhome


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

http_access allow manager localhost
http_access deny manager
http_access deny blockeddomain


# 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
# 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
http_access allow lanhome



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

# Squid normally listens to port 3128
http_port 8080

# 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




Thanks in advanced ..!
 
Old 02-27-2013, 09:55 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by ashpos View Post
suggest the modification for blocking websites with optimize performance..
here is my squid.conf >>>>

Thanks in advanced ..!
No idea, since you don't give any real details. You don't say what version/distro of Linux, details about your hardware, number of users, what browsers, what kind of/how many sites you want to block, etc.
 
Old 02-27-2013, 11:47 PM   #3
ashpos
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by TB0ne View Post
No idea, since you don't give any real details. You don't say what version/distro of Linux, details about your hardware, number of users, what browsers, what kind of/how many sites you want to block, etc.
os: redhat 6
squid 3.1
4gb of RAM with i5 processor, 320Gb hdd drive, no other application is installed on redhatserver other than squid proxy
number of users : 300+
bandwidth : 100Mb

orkut,youtube, facebookgames, many porn sites, sites with adult contains, torrents, downloading of exe,zip more than 100mb need to be block for all users except some admin users.

browsers mostly used at client side : IE,Crome, firefox..!

is there any tool by which we can monitor the traffic graphically..!
 
Old 02-28-2013, 08:58 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by ashpos View Post
os: redhat 6
squid 3.1
4gb of RAM with i5 processor, 320Gb hdd drive, no other application is installed on redhatserver other than squid proxy
number of users : 300+
bandwidth : 100Mb
Ok. Unless you are PAYING for RHEL, you really shouldn't be using it. Using RHEL without paying for it means you WILL NOT get patches/updates/bugfixes/security updates, and will make maintenance and server stability a real issue.
Quote:
orkut,youtube, facebookgames, many porn sites, sites with adult contains, torrents, downloading of exe,zip more than 100mb need to be block for all users except some admin users.
Then you need to look at installing Dansguardian, and look at the squid documentation on how to set up ACL's.
Quote:
browsers mostly used at client side : IE,Crome, firefox..!

is there any tool by which we can monitor the traffic graphically..!
Yes, many. Sarg is one, and there are lots more listed on the Squid website.
 
  


Reply



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
how to optimize performance of squid by cache size and refresh pattern ashpos Linux - Newbie 1 03-01-2013 10:50 PM
Squid not blocking websites bittus Linux - Newbie 4 11-04-2009 03:10 AM
blocking websites with squid tariq07 Linux - Security 2 03-03-2007 02:39 AM
Blocking websites in squid proxy server. crackerB Linux - Software 1 10-18-2006 02:44 AM
Squid problem ... blocking some websites rickyinman Linux - Networking 4 04-11-2006 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:25 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration