Squid proxy server- Installation & Configuration (Part 2)
Last updated on March 12th, 2018 at 09:26 pm
Welcome back Linux-fanatics. In our part 1 of the tutorial, we discussed installation & configuration of Squid proxy server, configuration on client’s machine & blocking a single website.
Now, we will proceed further & discuss how to block multiple website with single acl, creating a time based acl & also speeding up our browsing by enabling cache.
( Also Read : Setting up SQUID AUTHENTICATION )
Blocking Multiple websites
Firstly, we will create a file named blacksites (or bad-domains or whatever )
and add the websites we need blocked & save the file
Now, open main configuration file
and create a new acl
then, we deny access to the created acl
lastly, restart proxy server to apply changes.
Note you can also use squid -k reconfigure to apply changes to server without actually restarting the server.
Time based acl
Sometimes, we might require access to a blocked website for a certain period of time or we might need to block certain websites for certain time. This can be achieved using a time based acl
Firstly, open configuration file
then create a new acl and allow access to the acl
lastly, restart your server to implement changes. & we now have access of blocked sites on Monday, Tuesday & Wednesday between 10:30AM to 11:30AM .
Enabling cache to speed up browsing
So, by enabling cache in our server we can speed up our browsing speed for frequently visited pages.
By adding just one line in our configuration file, we can enable cache.
To enable cache , open configuration file
and add following line to bottom of the file
where ufs is squid storage format,
/var/cache/squid is path for cache storage,
2000 is size in MB can be used for cache,
and, 16 is number of 1st level sub-directories & 256 is 2nd level sub directories in cache folder.
So this concludes our tutorial, hope it simple enough to follow. In next tutorial we will discuss SARG , which analyze all the proxy logs & present them in nice, easy to understand HTML format.
and If having any doubts/queries or suggestions, leave it in comments section below & I will get back to you.ADIOS !!!