Squid is a proxy caching server. An HTTP proxy server is a program that accepts requests from clients for URLs and fetches them for the client and displays the results to the client. A proxy is also used for caching commonly requested pages so that it may retrieved for the users for future uses. In this tutorial we will be briefed about the explanation on how to allow some users to use the cache at specific time duration using Squid proxy server on CentOS 6.7.
To start the configuation procedure, check the status of Squid service.
[root@server3 ~]# service squid status
Create a file named sites.txt and enter the websites name that had to be blocked. Save and exit the file.
[root@server3 ~]# vim /etc/squid/sites.txt www.facebook.com www.flipkart.com www.youtube.com
Add the following ACL rule in squid configuration file using vim editor and make the following changes. Save and exit the file.
[root@server3 ~]# vim /etc/squid/squid.conf acl users src 192.168.7.206 192.168.7.216 acl access dstdomain "/etc/squid/sites.txt" acl break time 06:17-06:20 http_access allow users access break http_access deny users access
Reload the Squid service by executing the following command.
[root@server3 ~]# service squid reload
To check the configuration of the Squid. Switch over to the browser and try to access the blocked site. The following error page will be displayed.
After the given time duration in Squid configuration file elapses, try to access the blocked sites. The blocked sites can be access without any glitches.
Thus conclues the configuration procedure of allowing some users to use the cache at specific time duration using Squid proxy server on CentOS 6.7.
Thank you! for using Linux Help.
You find this tutorial helpful? Share with your friends to keep
For more help topics browse our website www.linuxhelp.com
Be the first to comment, we value your suggestions. For further queries please comment below.