我收到 SQUID 错误

我收到 SQUID 错误

这到底是什么问题

SQUID 文件中的条目---

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl lan src 192.168.1.1 192.168.2.0/24
http_access allow localhost

错误原因:服务 squid 重启

2010/02/01 14:24:29| Processing Configuration File: /etc/squid/squid.conf (depth 0)
2010/02/01 14:24:29| cache_cf.cc(361) parseOneConfigFile: squid.conf:10 unrecognized: 'broken_vary_encoding'
2010/02/01 14:24:29| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
2010/02/01 14:24:29| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
2010/02/01 14:24:29| WARNING: For now we assume you meant to write /0
2010/02/01 14:24:29| WARNING: (B) '::/4294967200' is a subnetwork of (A) '::'
2010/02/01 14:24:29| WARNING: because of this '::' is ignored to keep splay tree searching predictable
2010/02/01 14:24:29| WARNING: You should probably remove '::/4294967200' from the ACL named 'all'
2010/02/01 14:24:29| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
2010/02/01 14:24:29| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
2010/02/01 14:24:29| WARNING: For now we assume you meant to write /128
2010/02/01 14:24:29| aclParseIpData: unknown netmask '255.255.255.255' in '127.0.0.1/255.255.255.255'
FATAL: Bungled squid.conf line 25: acl localhost src 127.0.0.1/255.255.255.255
Squid Cache (Version 3.1.0.14): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.006 user + 0.007 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0

另外,请为我提供最简单的代理运行的 squid 脚本。可以输入限制。

答案1

http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
access_log /var/log/squid/access.log squid
hosts_file /etc/hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

# 1000MB max cache size (default is 100MB):
cache_dir ufs /var/spool/squid 1000 16 256

acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
acl lan src 192.168.0.0/32
http_access allow localhost
http_access allow lan
http_access deny all
http_reply_access allow all
icp_access allow all
visible_hostname sumardilamoha.com
always_direct allow all
coredump_dir /var/spool/squid

答案2

只需将网络掩码从 删除acl localhost src 127.0.0.1/255.255.255.255为 CIDR 掩码,它就可以127.0.0.0/8代替127.0.0.1/255.255.255.255,或者任何带有此/255.255.255.255掩码的 acl,就这样......

答案3

您能否发布您的 squid.conf(最好通过 pastie.org 链接进行格式化)?此外,如果有人有相关教程可以为您指明正确的方向,那么分享一些环境信息可能会有所帮助(尽管不一定是必需的)。我假设您可能正在使用基于 redhat 的发行版来参考服务命令。如果这是正确的,本教程可能会帮助您从一个简单的示例开始启动和运行,然后您可以从那里向外扩展。

相关内容