LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-31-2010, 01:12 AM   #1
ba$h
LQ Newbie
 
Registered: Jul 2010
Posts: 10

Rep: Reputation: 0
How to Implement Quota in Squid


Hi,
how i can implement quota for my webproxy users in squid?

thanks.
 
Old 08-01-2010, 12:51 AM   #2
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 50
I did search in google and found this for you.
http://www.linuxpakistan.net/forum/viewtopic.php?t=414

Hope this helps.
 
Old 01-20-2011, 01:16 AM   #3
craja_1979
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Rep: Reputation: 1
Smile Squid with Quota

Hai,
I hope this will help you.

#####################################################
### SDQuota ###
### Steps to Configure Quota restriction in squid ###
#####################################################

1. Downlaod tarballs from the followin site.

http://sdquota.grumbler.org

( note: ==> copy to file to "/opt" folder.
)

2. Unpack the tarball where you want to install & configure SDQuota.

example :

location : /opt/sdquota

commands :

#mkdir /opt/sdquota

#tar -zxvf /opt/squidquota-0.13.sd.tgz -C /opt/sdquota

#chown -R squid:squid /opt/sdquota/squidquota


3. Edit the files in the directory to configure SDQuota.

example :

In Centos x86_64 follow the steps.

#cd /opt/sdquota/squidquota

**********************
#vim Makefile

chown -R :apache $(DB_DIR)

:wq

( note : ==> change the group name from "www" to "apache".
)

#make

**********************
#vim sdquota_auth.pl

$ncsa_auth = "/usr/lib64/squid/ncsa_auth"; # BASIC authentification agent
:wq

#htpasswd -c /etc/squid/passwd <testuser>

#/opt/sdquota/squidquota/sdsetquota <testuser> <size in bytes>

( note: ==> Initially set the value to valid byte no. other than 0.
==> If you want the user unlimited access use keyword "unlimited" in size.
)

#echo testuser <password> | /opt/sdquota/squidquota/sdquota_auth.pl /etc/squid/passwd

( note: ==> Above command should return "OK" if your authentication success.)

**********************
#vim sdq_redirector

my $redirecturl = 'http://proxy/quotaexceeded.html'; # URL to redirect

:wq

( note: ==> Change the http url.
==> Create the file "quotaexceeded.html" in httpd service root directory.
)


**********************
#vim procjnl.pl

/opt/sdquota/squidquota/1aday.pl `/usr/bin/dirname $userdir`

:wq

( note: ==> Change the default path to the current path of "1aday.pl".)

#cd /etc/cron.daily

#vim squidquota
/opt/sdquota/squidquota/procjnl.sh
:wq

( note: ==> The above crontab entry will reset quota details daily.
==> If you want to clear the quota mannually call the peral script.
)


**********************
#vim parseuser.pl

$squidlog = "/var/log/squid/access.log";

:wq

( note : ==> Change the default path to the current path of "access.log" file.)


4. Start the real time squid log file parser.

#tail -n1 -F /var/log/squid/access.log | /opt/sdquota/squidquota/rtparse.pl &

#vim /etc/rc.d/rc.local

tail -n1 -F /var/log/squid/access.log | /opt/sdquota/squidquota/rtparse.pl &

:wq

5.Configure squid to use the SDQuota.

**********************
#vim /etc/squid/squid.conf
auth_param basic program /opt/sdquota/squidquota/sdquota_auth.pl /etc/squid/passwd
acl authenticate proxy_auth REQUIRED
http_access allow authenticate
redirect_program /opt/sdquota/squidquota/sdq_redirector
:wq

#service squid reload
 
1 members found this post helpful.
Old 09-26-2013, 06:50 AM   #4
MAKOLI
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
The basicauthenticator helpers are crashing too rapidly

Hi,

Thanks for such a nice article. May be its too late to comment, but I got a problem.

When I start squid by using /etc/init.d/squid script i.e. "service squid start", it gives me an error " The basicauthenticator helpers are crashing too rapidly"

But if I start the squid using /usr/sbin/squid I don't get any error.

I am of the opinion that this has something to do with the permissions, but I did changed the permissions to "squid:squid" as per your instructions.

Any help would highly appreciated.

Regards,

MAKOLI
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to implement a traffic quota toure32 Linux - Networking 8 04-30-2010 04:49 AM
Web Quota + Print Quota dimingo Linux - Newbie 1 09-25-2008 12:31 AM
procmail+quota+bounch mail+but no quota full msg to receipent mickyman Linux - General 3 03-02-2006 03:32 AM
ftp quota probs - 0kb files at quota limit ph_xm Linux - Newbie 0 02-02-2005 11:13 AM
IS there a way to implement a weekly "downloading quota"? linux-addict Linux - Networking 9 01-13-2004 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration