0
我需要爲每個入局請求配置Squid作爲具有定製認證助手的反向代理。對Squid的每個請求都假定爲基本認證。任何認證失敗的連接都應該終止。我是Squid的新手。以下是我用過的配置腳本。此示例是訪問「mindofaprogrammer.blog.com」,在加速器模式下使用定製認證助手配置魷魚(反向代理)
acl all src all
acl manager proto cache_object
http_port 80 accel defaultsite=mindofaprogrammer.blog.com
cache_peer mindofaprogrammer.blog.com parent 80 0 no-query originserver name=myAccel
acl myblog dstdomain mindofaprogrammer.blog.com
http_access allow myblog
cache_peer_access myAccel allow myblog
cache_peer_access myAccel deny all
auth_param basic program C:/wamp/bin/php/php5.3.0/php.exe "c:/squid/libexec/authhelper.php"
auth_param basic children 2
auth_param basic realm eReader
auth_param basic credentialsttl 5 hours
acl AuthUsers proxy_auth REQUIRED
http_access allow AuthUsers
access_log c:/squid/var/logs/access.log squid
coredump_dir c:/squid/var/cache
我已經寫在PHP腳本定製認證幫手。相同的列表如下,
<?php
$f = fopen("php://stdin", "r");
while ($line = fgets($f)) {
$line = trim($line);
$fields = explode(' ', $line);
$username = rawurldecode($fields[0]); //1738
$password = rawurldecode($fields[1]); //1738
if ($username == 'hello'
and $password == 'world') {
fwrite(STDOUT, "OK\n");
} else if ($username == 'fo'
and $password == 'bar') {
fwrite(STDOUT, "OK\n");
} else {
// failed miserably
fwrite(STDOUT, "ERR\n");
}
}
?>
我面對的是,即使這個配置後的問題,只有反向代理服務器設置的認證工作不。我在這裏做錯了什麼?
偏離主題。超級用戶/管理員問題。 – leppie 2010-11-30 11:54:38