squid配置账号密码认证不生效,配置debug也不生效的情况。以下为squid.conf。已经将basic_ncsa_auth复制到了/etc/squid/目录下了。
debug_options ALL,9 88,9 33,9
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 localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl dstnet dst 10.0.0.0/8 #目的地址为内网地址的规则,名称为dstnet
acl dstnet dst 172.16.0.0/16
acl dstnet dst 192.168.0.0/24
http_access allow dstnet #放行名称为dstnet的规则
acl SSL_ports port 10022 #定义名称为SSL_ports、类型为port、包含10022端口的规则
acl SSL_ports port 22 #定义名称为SSL_ports、类型为port、包含22端口的规则
acl SSL_ports port 443 #定义名称为SSL_ports、类型为port、包含443端口的规则
acl SSL_ports port 80 #定义名称为SSL_ports、类型为port、包含80端口的规则
acl Safe_ports port 80 #定义名称为Safe_ports、类型为port、包含80端口的规则
acl Safe_ports port 21 #定义名称为Safe_ports、类型为port、包含21端口的规则
acl Safe_ports port 443 #定义名称为Safe_ports、类型为port、包含443端口的规则
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 Safe_ports port 8080
acl Safe_ports port 8081
acl CONNECT method GET POST #定义名称为CONNECT、类型为method、请求方法包含 GET POST的规则
http_access deny !Safe_ports #拒绝非Safe_ports规则内的
http_access deny !SSL_ports #拒绝非SSL_ports规则内的
http_access allow localhost manager
http_access deny manager
http_access allow localnet
http_access allow localhost
auth_param basic program /etc/squid/basic_ncsa_auth /etc/squid/password #使用/etc/squid/passowrd文件内容进行认证
auth_param basic realm Please enter your account number
auth_param basic credentialsttl 2 hours #认证后状态保持2小时
acl squid_user proxy_auth REQUIRED #定义授权用户组
http_access allow squid_user #放行授权组
http_access deny all #默认拒绝所有
http_port 3128
coredump_dir /var/spool/squid
debug_options ALL,1 33,2
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