Squid is a full-featured web proxy cache server application which provides proxy and cache services for Hyper Text Transport Protocol (HTTP), File Transfer Protocol (FTP), and other popular network protocols.
To install: sudo apt-get install squid squid-common
To manage the server configurations, all we need is to modify squid.conf file.
It contains in /etc/squid/squid.conf
Several parameters has to be modified as follows.
http_port can be change as our wish-according to the which port is used.
Then the variable acl (access control list) can be configured.
can make a acl group :
acl ucsc src 192.168.42.0/24
http_access deny !ucsc
The most important param has to be changed is reply_body_max_size which interpret the down loadable file size.
reply_body_max_size 1048576 // in bytes
You can check for errors of the file by using the following command.
squid -k parse // check errors
Finally after limitting the file size, if someone to download a file larger than the given threshold size, the request will be redirect to a error page. Set of error files contains in /etc/squid/errors diectory.
The error file regards to the larger file is ERR_TOO_BIG.
We can edit this page as we wish. We can access the attributed of the http request by using this file.
%U - contains the requested url by the user