Operating System - Linux
1832103 Members
3187 Online
110038 Solutions
New Discussion

download restriction squid

 
SOLVED
Go to solution
shyam singh bisht
Occasional Advisor

download restriction squid

I have squid running on RedHat enterprise 3
I want to restrict the users from downloading files more than 2mb .
I have tried setting the
"maximum_object_size = 2mb" , but it don't worked

any kind of help will be appreciated

thanks
6 REPLIES 6
Stuart Browne
Honored Contributor

Re: download restriction squid

The 'maximum_object_size' will just restrict what is *cached*, not the size of the object.

What you probably want is 'reply_body_max_size'.

See http://www.squid-cache.org/Doc/FAQ/FAQ_long.html#ss4.21 for the explanation, and http://squid.visolve.com/squid/squid24s1/tuning.htm#reply_body_max_size for a more detailed explanation.
One long-haired git at your service...
Arunvijai_4
Honored Contributor

Re: download restriction squid

set reply_body_max_size=2000 (KB) in your /etc/squid.conf

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
VEL_1
Valued Contributor

Re: download restriction squid

See the syntax and give in squid.conf file & restart the squid:

reply_body_max_size 512000 allow USER1

Now the USER1 able to download files of a maximum size of 512000 bytes (500 KB).

Note:
allow the USER1 also in squid.conf
Muthukumar_5
Honored Contributor
Solution

Re: download restriction squid

You have to set reply_body_max_size header in squid.conf to achieve this.

reply_body_max_size bytes allow|deny acl acl

If you want to block specific users then,

# Please setup any of the authentication methods
acl USER2MB proxy_auth username username2
reply_body_max_size 2097152 allow USER2MB

Reconfigure your squid as,

./squid -k reconfigure.

Try it out.

hth.
Easy to suggest when don't know about the problem!
Karsten Breivik_1
Frequent Advisor

Re: download restriction squid

Have you concidered using Hierachical Token Bucket (HTB) based bandwidth trotteling with the tc command instead? This might be what you are looking for.

It is really ingenious - I put it in place when I had a few users hogging the line all the time. If you do, prepare for a bit of reading to understand the concepts, but it is well worth it. For instance, start with this:

http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm
poi
shyam singh bisht
Occasional Advisor

Re: download restriction squid


Thanks all for ur replies.

The problem has solved.

I have set the reply_body_max_size option

Thanks again .