Friday, September 20, 2013

Setting Squid 2 dengan NCSA Othentikasi

Configuring Squid to use NCSA authentication module

The different authentication modules are distributed as binaries that come with Squid, and to configure them you have to know where they are located. This command listed their locations:
dpkg -L squid3 | grep ncsa_auth
For me the output was /usr/lib/squid3/ncsa_auth.
To enable the module, I opened the Squid configuration file in vi:
sudo vi /etc/squid3/squid.conf
I searched for the text TAG: auth_param to find where the authentication module is configured. Next I added the following configuration:
auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/users
auth_param basic children 5
auth_param basic realm Paul's Squid!
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
Next, I needed to add the ACL to give the users access. I searched for TAG: acl in the Squid configuration file and added this ACL to the list:
acl ncsa_users proxy_auth REQUIRED
Then I searched for TAG: http_access to find where HTTP access rules are configured. Scrolling down, there's a section where you can insert your own rules. I added:
http_access allow ncsa_users

Restart Squid

Finally, I restarted Squid:
sudo service squid3 restart

0 comments:

Post a Comment