简体   繁体   English

Squid代理MySQL身份验证配置

[英]Squid proxy MySQL authentication config

I'm wondering to know how to configure squid server with MySQL authentication. 我想知道如何使用MySQL身份验证配置鱿鱼服务器。 I've found a config example following: 我发现以下配置示例:

auth_param basic program /usr/local/squid/libexec/squid_db_auth --user dbusername --password dbuserpassword --plaintext --persist
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive off

http://linuxpoison.blogspot.com/2010/08/configuring-squid-server-to.html http://linuxpoison.blogspot.com/2010/08/configuring-squid-server-to.html

And tested on localhost. 并在本地主机上测试。 This worked well. 这很好。 But in my case, MySQL server is located on another server. 但就我而言,MySQL服务器位于另一台服务器上。 So, I need to specify "Hostname" and "Port" of MySQL server. 因此,我需要指定MySQL服务器的“主机名”和“端口”。

Can you help ? 你能帮我吗 ?

Thanks in advance. 提前致谢。

As per your code make changes in squid_db_auth example below, 根据您的代码,在下面的squid_db_auth示例中进行更改,

my $dsn = "DBI:mysql:database=yourdbname;host=remotemysqlserverip";

Add the above line to your `squid_db_auth?. 将以上行添加到您的`squid_db_auth?中。 I have tested the same with SQUID 3.1.10. 我已经对SQUID 3.1.10进行了测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM