Stop porn for God's sake:
If you want to restrict users so that they are denied access to certain sites, like porn
sites, etc. Then you can make an acl for bad sites put all the possible words which are
normally part of url of those bad sites, in a text file with each word at separate line.
Create and block the acl as follows in the squid.conf file:
acl badsites url_regex -i "/etc/squid/badsites.txt"
http_access deny badsites
It should be noted that the placement of http_access lines are very important in
SQUID's expected behavior. You need to deny badsites BEFORE allowing the
http_access to your client src acl.
Your configuration with blocked sites would look like this:
acl badsites url_regex -i "/etc/squid/badsites.txt"
acl mynet src 192.168.1.0/24
http_access deny badsites
http_access allow mynet
http_access allow localhost
http_access deny all
Your badistes file should contain all words on separate lines which you want to be
search in the URL and then blocked by SQUID. An example badsites.txt file is
below:
sex
xxx
movies
This is quite effective approach. You may need to watch your
/var/log/squid/access.log for such sites and add those names to this file.
Showing posts with label Linux Squid. Show all posts
Showing posts with label Linux Squid. Show all posts
HTTP and Squid Cache Status Codes
Squid Cache Status Codes
• TCP HIT : A valid copy of the requested object was in the cache.
• TCP MISS : The requested object was not in the cache.
• TCP REFRESH HIT : The requested object was cached but
STALE. The IMS query for the object resulted in "304 not modi¯ed".
• See Squid FAQ for others.
Squid HTTP Status Codes
• 200 OK
• 204 No Content
• 206 Partial Content
• 301 Moved Permanently
• 302 Moved Temporarily
• 303 See Other
• 304 Not Modi¯ed
• 400 Bad Request
• 401 Unauthorized
• 403 Forbidden
• 404 Not Found
• 407 Proxy Authentication Required
• See Squid FAQ for others
Some Tips for Squid Cashing Server
How to Run Squid on Red Hat, Fedora Suse, Ubuntu
Use this command for start the Squid Service on Start Up
1. chkconfig --level 35 squid on
How to Open rc.local
vi /etc/rc.local
Write This Command in rc.local File
2. service squid start
How to Start or Stop Squid Service
service squid start
service squid stop
How to Creat Swap Dir in Squid
squid -z
Use this command for start the Squid Service on Start Up
1. chkconfig --level 35 squid on
How to Open rc.local
vi /etc/rc.local
Write This Command in rc.local File
2. service squid start
How to Start or Stop Squid Service
service squid start
service squid stop
How to Creat Swap Dir in Squid
squid -z
How to Configure Squid Cache Directive
• The cache dir directive(s) tell Squid how and where to store cached objects.
• Syntax:
cache_dir type path megabytes L1 L2
type location size L1 L2
cache_dir ufs /var/spool/squid 50000 16 256
• The default type is ufs, but aufs has better performance on
Linux. diskd is good too.
• path can be anywhere on the ¯lesystem, but is usually a
dedicated disk or partition.
• megabytes is an upper limit on how much space Squid should
use for this cache dir . It should be less than 90% of the
actual capacity.
• L1 and L2 specify the number of ¯rst- and second-level di-
rectories to use. Use 16 and 256 by default. These should
not be changed after Squid has placed objects on the disk.
• Syntax:
cache_dir type path megabytes L1 L2
type location size L1 L2
cache_dir ufs /var/spool/squid 50000 16 256
• The default type is ufs, but aufs has better performance on
Linux. diskd is good too.
• path can be anywhere on the ¯lesystem, but is usually a
dedicated disk or partition.
• megabytes is an upper limit on how much space Squid should
use for this cache dir . It should be less than 90% of the
actual capacity.
• L1 and L2 specify the number of ¯rst- and second-level di-
rectories to use. Use 16 and 256 by default. These should
not be changed after Squid has placed objects on the disk.
Squid Installation on Ubuntu Linux Redhat Suse Fedora
Easiest way is via OS software package installer.
• On Ubuntu use GUI, or:
sudo apt-get install squid
• Or, get source code from www.squid-cache.org, ftp.squidcache.
org, or mirror site, then:
tar xzvf squid-version.tar.gz
cd squid-version
./configure
make
make install
• On Ubuntu use GUI, or:
sudo apt-get install squid
• Or, get source code from www.squid-cache.org, ftp.squidcache.
org, or mirror site, then:
tar xzvf squid-version.tar.gz
cd squid-version
./configure
make
make install
How to Configure Delay Pools or Bandwidth Control in Squid Server
How to Write Delay Pool Script in Squid
In this scenario we are going to creat 3 pools
128kbp
256kbps
Unlimited for Admin
Acl 128kbps 192.168.0.200/32
Acl 256kbps 192.168.0.201/32
Acl admin 192.168.0.205/32
You just creat the ACL Named net, net2, net3
delay_pools 3
delay_class 1 2
delay_access 1 deny admin
delay_access 1 deny 256kbps
delay_access 1 allow 128kbps
delay_parameters 1 -1/-1 16000/16000
delay_class 2 2
delay_access 2 deny admin
delay_access 2 allow 256kbps
delay_parameters 2 -1/-1 32000/32000
delay_class 3 2
delay_access 3 allow admin
delay_parameters 3 -1/-1 -1/-1
Enjoy the best delay pool setting by linuxmall if you have any further question about delay pool setting contact us we will appreciate you.
Thanks,
Linuxmall
Team
In this scenario we are going to creat 3 pools
128kbp
256kbps
Unlimited for Admin
Acl 128kbps 192.168.0.200/32
Acl 256kbps 192.168.0.201/32
Acl admin 192.168.0.205/32
You just creat the ACL Named net, net2, net3
delay_pools 3
delay_class 1 2
delay_access 1 deny admin
delay_access 1 deny 256kbps
delay_access 1 allow 128kbps
delay_parameters 1 -1/-1 16000/16000
delay_class 2 2
delay_access 2 deny admin
delay_access 2 allow 256kbps
delay_parameters 2 -1/-1 32000/32000
delay_class 3 2
delay_access 3 allow admin
delay_parameters 3 -1/-1 -1/-1
Enjoy the best delay pool setting by linuxmall if you have any further question about delay pool setting contact us we will appreciate you.
Thanks,
Linuxmall
Team
Subscribe to:
Posts (Atom)





