1

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

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

#   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

我已经使用生成了 passwd 文件, 请帮助。自上周以来,我一直在努力完成这项工作:(

4

1 回答 1

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 因此请尝试将其注释掉,看看它是否有效。

于 2013-10-08T18:41:38.300 回答