3

I am testing both authentication with squid_passwd file and Mysql. This is my configuration

auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/squid_passwd
# auth_param basic program /usr/lib/squid3/basic_db_auth --dsn "DBI:mysql:database=abc" --user "root" --password "aaa" --table "user" --usercol "User_Name" --passwdcol "Password" --cond "" --plaintext

auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive off

# auth_param basic children 5
# auth_param basic realm Squid proxy-caching web server

# acl blocked dstdomain .google.com.vn .google.com.sg

acl db_auth proxy_auth REQUIRED

# acl restricted_users proxy_auth "/etc/squid3/restrictedusers"

# http_access deny restricted_users blocked

http_access allow db_auth

# And finally deny all other access to this proxy
http_access deny all

This is the content of squid_passwd

a2:$apr1$ovwnKYTS$hashedPassword
a1:$apr1$ovwnKYTS$hashedPassword

When I use squid_passwd, it works fine (I set the proxy for firefox and then logged in successfully with the username/password

However, when I use the Mysql configuration (comment the line using squid_passwd and un-comment the line using Mysql), I cannot logged in to proxy server, even the testing command works

/usr/lib/squid3/basic_db_auth --dsn "DBI:mysql:database=abc" --user "root" --password "aaa" --table "user" --usercol "User_Name" --passwdcol "Password" --cond "" --plaintext
a1 password
OK

(and cache.log of squid also indicates that the authentication is successful)

Here is my User table

mysql> select User_Name, Password from user;
+-----------+----------+
| User_Name | Password |
+-----------+----------+
| a1        | password |
| a2        | password |
+-----------+----------+

What did I do wrong here ?

Thai Tran
  • 193
  • 11

1 Answers1

1

Try disabling SELinux in the system. This will fix the issue.

  • thanks, but `selinuxenabled && echo enabled || echo disabled` gives me `disabled` – Thai Tran Jul 24 '14 at 06:06
  • Might be permissions problem, you can use: chown squid.squid mysql_auth.conf – S.Ragavendra Ganesh Jul 24 '14 at 07:27
  • Thank you very much for reminding me about the permission. I change the squid.conf into `chomod a+x squid.conf`.Server starts to work after the reboot – Thai Tran Jul 24 '14 at 07:53
  • a bit ridiculous !! I changed the mode back to previous and it also works. (I swear that I rebooted and reloaded the squid config thousand times before but it did not work after all). Thank for you time anyway – Thai Tran Jul 24 '14 at 08:08