使用NCSA时,Squid不会要求输入用户名和密码

时间:2013-04-08 10:34:16

标签: windows-server-2008 squid

我在Windows机器上使用squid代理(Win2K8服务器,64位)。我提到this链接以启用NCSA身份验证。安装顺利,我可以启动服务,但仍然无法获得用户名和密码提示。

以下是我的鱿鱼配置。请注意,我从原始squid配置文件中删除了所有注释行以减少帖子的大小(由于堆栈的字符限制)。

#   WELCOME TO SQUID 2.7.STABLE8
#   ----------------------------
#

    auth_param basic program c:/squid/libexec/ncsa_auth.exe c:/squid/etc/passwd
    auth_param basic children 5
    auth_param basic realm Squid proxy-caching web server
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive off
#
#Recommended minimum configuration:
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
#acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
#acl localnet src 192.168.0.0/16    # RFC1918 possible internal network
#
acl SSL_ports port 443
acl Safe_ports port 80      # http
acl Safe_ports port 21      # ftp
acl Safe_ports port 443     # https
acl Safe_ports port 70      # gopher
acl Safe_ports port 210     # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280     # http-mgmt
acl Safe_ports port 488     # gss-http
acl Safe_ports port 591     # filemaker
acl Safe_ports port 777     # multiling http
acl CONNECT method CONNECT
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet

http_access deny all

icp_access allow localnet
icp_access deny all
# Squid normally listens to port 3128
http_port 3128

hierarchy_stoplist cgi-bin ?


#Default:
 cache_mem 8 MB

access_log c:/squid/var/logs/access.log squid

# none

#Suggested default:
refresh_pattern ^ftp:       1440    20% 10080
refresh_pattern ^gopher:    1440    0%  1440
refresh_pattern -i (/cgi-bin/|\?) 0 0%  0
refresh_pattern .       0   20% 4320


coredump_dir c:/squid/var/cache

我使用this生成了passwd文件 请帮忙。我想从上周开始做这项工作:(

1 个答案:

答案 0 :(得分:0)

看看你的规则:

http_access allow ncsa_users
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet

http_access deny all

我看到你允许使用ncsa_users和localnet。 如果您从10.0网络内部访问此内容(请参阅说明中未提及),则允许所有流量在没有任何身份验证的情况下使用此规则: acl localnet src 10.0.0.0/8 # RFC1918 possible internal network 所以尝试评论一下,看看它是否有效。