Squid Statistics and Info Web Interface


I have been looking for a squid statistics web interface for a long time, and i finally got one. It was fairly easy to install and configure.

The name of the app is SARG and can be downloaded freely from http://sarg.sourceforge.net/sarg.php

Depending on your architecture, the installation command is

rpm -Uvh http://pkgs.repoforge.org/sarg/sarg-2.3.1-1.el6.rft.x86_64.rpm

Before using it, you might wish to configure the output generation of sarg by

vi /etc/sarg/sarg.conf

and change the output_dir /var/www/html/squid/OUT-ONE to your www directory

To use, run the following in a terminal or add it to cron to run it daily

sarg

This command will generate html files for stats in the specified output_dir

That’s all folks.

Screenshot of SARG Generated files:

Read More

Squid Proxy Authentication


I run a squid proxy on one of my Linode vps. Configuration for username and password authentication was done as follows while logged in as root:

1. Install script via:

yum install squid

on CentOS or Red Hat based Linux flavors, or

apt-get update
apt-get install squid

on Debian Linux flavors.

2. Create a password file and chmod for file permission

touch /etc/squid/squid_passwd

chmod o+r /etc/squid/squid_passwd

3. Add a user for the proxy server

htpasswd /etc/squid/squid_passwd test

4. Find the ncsa_auth file

find / -name ncsa_auth

5. Edit the squid.conf file

vi /etc/squid/squid.conf

6. Add the following lines to the squid.conf file

auth_param basic program <location-of-ncsa_auth-file> /etc/squid/squid_passwd

acl ncsa_users proxy_auth REQUIRED

http_access allow ncsa_users

7. Reload squid

service squid restart (in RH based)

/etc/init.d/squid restart (in Debian Based)

Read More