Set bandwidth quota on user in squid server

1. Download squish from

2. Unzip squish into /install/

# tar -xvzf squish-x.x.x.tar.gz

3. cd into the folder

# cd squish-0.0.18

4. Install Squash

# make install

5. Then move yourself into the squish directory that squish was installed in

# cd /usr/local/squish/

6. Then run the squish install option on the

# ./ –install

7. Download the GD Graphics Library rpm’s from the website below

8. And then install it

# rpm -ivh perl-GD-x.x.x..fc3.rf.i386.rpm

Now set the squid ACLs to the following.

# vi /etc/squid/squid.conf


### added by squish (begin)
# acl’s for squish – autodetected, sometimes
acl SQUISHED1 proxy_auth -i “/etc/squid/squished”
acl password proxy_auth REQUIRED
#acl SQUISHED2 ident “/etc/squid/squished”
acl SQUISHED3 src “/etc/squid/squished”
# Error info that says you’re squished
deny_info SQUISHED1
#deny_info SQUISHED2
deny_info SQUISHED3
# HTTP access controls for squish
http_access allow SQUISHLOC
http_access allow password !SQUISHED1
http_access deny SQUISHED1
#http_access deny SQUISHED2
http_access deny SQUISHED3
### added by squish (End)

9. Now set the redirect in the apache configuration file for the squish cgi program

#vi /etc/httpd/conf/httpd.conf

include /usr/local/squish/apache-squish.conf

10. Now edit the apache-squish.conf file

# vim /usr/local/squish/apache-squish.conf

Alias /squish “/usr/local/squish/”

Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex squish.cgi
AllowOverride None
Order allow,deny
Allow from all

10. Restart the apache and squid servers now

# service squid restart
# service httpd restart

11. Go to http://ip-address-of-squish-server/squish/squish.cgi to see what your usage is.

12. Edit the squish.conf file to change the download/hours limits

# vi /etc/squid/squish.conf
# This file contains data formatted as follows:
# Blank lines and hashed stuff is for comments
# user amount/period
# bandwidth: 999[kmG]b / period: day, week, month
# time: 999[smh] / period: day, week, month
# Whitelist entries – they can have as much as they like
192\.168\.99\.44 25h/day
192\.168\.97\.43 25h/day
# Poor guy:
root 1h/day 1Mb/day 2Mb/week
vinod 1h/day 1Mb/day 2Mb/week
# Catchall — people and IP’s not matched by the above rules
.* 4h/day 20Mb/day 20h/week 100Mb/week
for more details pl follow
Posted by Mr. Perfactionist at 12:36 AM


About bpn4it

Feel Free in Linux. Bipin Patel Ahmadabad, Gujarat, India
This entry was posted in Uncategorized and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s