免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3767 | 回复: 8
打印 上一主题 下一主题

[FreeBSD] squid2.4升级到3.0时透明代理出问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-01-16 21:19 |只看该作者 |倒序浏览
我的网络是这样的:
                          Wan (FB6.2r+pf) (nat)
                                  |
           ---------------------------------------------------
          |                |               |                  |
         Lan              DMZ             ...                ...
      192.168.0.0/16   10.0.0.0/8

pf把Lan对Internet的80访问都重定向到Dmz里面的squid2.4,squid是做的透明代理,用了一年多了一直很稳定,
近段时间更换服务器,试了一下squid的3.0,透明模式就不能用了,但是在IE里手工指定使用squid代理就可以。

下面是出错提示(我指定了中文错误提示,所以有中文):
错误
您所请求的网址(URL)无法获取

--------------------------------------------------------------------------------

当尝试读取以下网址(URL)时: /

发生了下列的错误:

Invalid URL
无效的网址
Some aspect of the requested URL is incorrect. Possible problems:
输入网址的某些地方有误,可能是因为:

Missing or incorrect access protocol (should be `http://'' or similar)
缺少或不正确的通讯协议(应该如 `http://''或类似的开头)
Missing hostname
缺少欲连结的主机名称
Illegal double-escape in the URL-Path
网址路径中有不合法双重转义符
Illegal character in hostname; underscores are not allowed
主机名称中包含不合法的字符;下划线是不允许的。

本缓存服务器管理员:admin@XXXXXX.com



--------------------------------------------------------------------------------

Generated Wed, 16 Jan 2008 17:08:25 GMT by PROXY.XXXXXX.com (squid/3.0.STABLE1)


我的squid.conf如下(是从我原来正常工作的2.4上改过来的):

###############
cache_log /usr/local/squid/logs/cache.log
access_log /usr/local/squid/logs/access.log
cache_store_log /usr/local/squid/logs/store.log

#cache_log /dev/null
#access_log none
#cache_store_log none

emulate_httpd_log on
pid_filename /usr/local/squid/logs/squid.pid
cache_effective_user squid
#cache_effective_group squid
visible_hostname PROXY.XXXXXX.com
cache_mgr admin@XXXXXX.com
http_port 3128 transparent                                 
cache_dir ufs /usr/local/squid/cache 512 16 256
cache_mem 256 MB

# ==transpation==
#httpd_accel_host virtual
#httpd_accel_port 80
#httpd_accel_with_proxy on
#httpd_accel_uses_host_header on

half_closed_clients off
cache_swap_high 95
cache_swap_low 80
maximum_object_size 1024 KB

icon_directory /usr/local/etc/squid/icons
error_directory /usr/local/etc/squid/errors/Simplify_Chinese

http_access allow all


access.log日志里面都是这种东东:
192.168.5.9 - - [16/Jan/2008:18:58:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:03:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:08:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:13:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:18:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:23:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:28:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:33:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:38:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:43:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:48:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:53:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
192.168.5.9 - - [16/Jan/2008:19:58:18 +0000] "POST / HTTP/0.0" 400 1963 NONE:NONE
.....
(192.168.5.9 是客户IP)


cache.log里面有个PF的错误:
2008/01/16 17:07:55| Starting Squid Cache version 3.0.STABLE1 for i386-portbld-freebsd7.0...
2008/01/16 17:07:55| Process ID 74190
2008/01/16 17:07:55| With 11072 file descriptors available
2008/01/16 17:07:55| Performing DNS Tests...
2008/01/16 17:07:55| Successful DNS name lookup tests...
2008/01/16 17:07:55| DNS Socket created at 0.0.0.0, port 58501, FD 7
2008/01/16 17:07:55| Adding nameserver 10.0.0.130 from /etc/resolv.conf
2008/01/16 17:07:55| Unlinkd pipe opened on FD 12
2008/01/16 17:07:55| Swap maxSize 524288 KB, estimated 40329 objects
2008/01/16 17:07:55| Target number of buckets: 2016
2008/01/16 17:07:55| Using 8192 Store buckets
2008/01/16 17:07:55| Max Mem  size: 262144 KB
2008/01/16 17:07:55| Max Swap size: 524288 KB
2008/01/16 17:07:55| Version 1 of swap file with LFS support detected...
2008/01/16 17:07:55| Rebuilding storage in /usr/local/squid/cache (DIRTY)
2008/01/16 17:07:55| Using Least Load store dir selection
2008/01/16 17:07:55| Current Directory is /usr/local/etc/squid
2008/01/16 17:07:55| Loaded Icons.
2008/01/16 17:07:55| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 14.
2008/01/16 17:07:55| HTCP Disabled.
2008/01/16 17:07:55| Ready to serve requests.
2008/01/16 17:07:55| Done reading /usr/local/squid/cache swaplog (154 entries)
2008/01/16 17:07:55| Finished rebuilding storage from disk.
2008/01/16 17:07:55|       152 Entries scanned
2008/01/16 17:07:55|         0 Invalid entries.
2008/01/16 17:07:55|         0 With invalid flags.
2008/01/16 17:07:55|       150 Objects loaded.
2008/01/16 17:07:55|         0 Objects expired.
2008/01/16 17:07:55|         2 Objects cancelled.
2008/01/16 17:07:55|         0 Duplicate URLs purged.
2008/01/16 17:07:55|         0 Swapfile clashes avoided.
2008/01/16 17:07:55|   Took 0.05 seconds (2978.02 objects/sec).
2008/01/16 17:07:55| Beginning Validation Procedure
2008/01/16 17:07:55|   Completed Validation Procedure
2008/01/16 17:07:55|   Validated 325 Entries
2008/01/16 17:07:55|   store_swap_size = 1286
2008/01/16 17:07:56| storeLateRelease: released 0 objects
2008/01/16 17:08:18| clientNatLookup: PF open failed: (2) No such file or directory
2008/01/16 17:13:18| clientNatLookup: PF open failed: (2) No such file or directory
2008/01/16 17:18:18| clientNatLookup: PF open failed: (2) No such file or directory
2008/01/16 17:23:18| clientNatLookup: PF open failed: (2) No such file or directory
2008/01/16 17:25:06| clientNatLookup: PF open failed: (2) No such file or directory
.....


是不是我的squid.conf有什么错误,还是安装的有什么选项没选对,请各位帮忙

[ 本帖最后由 Hobit 于 2008-1-16 21:44 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-01-16 21:34 |只看该作者
该不是由这个引起的吧

2008/01/16 17:08:18| clientNatLookup: PF open failed: (2) No such file or directory


论坛徽章:
0
3 [报告]
发表于 2008-01-16 21:41 |只看该作者
我的pf是在网关上的,跟squid不是同一台机,难道squid上也要开pf?

问题是我本来的squid2.4就没有问题, 现在3.0的就是不行

论坛徽章:
0
4 [报告]
发表于 2008-01-17 09:57 |只看该作者
是不是在编译的时候把pf透明代理给选上了。

论坛徽章:
0
5 [报告]
发表于 2008-01-17 10:40 |只看该作者

回复 #4 zhangweizj 的帖子

我又卸掉重装了一下,关掉了 SQUID_PF 选项,只用默认选项

结果在cache.log里说不支持透明代理
2008/01/17 10:30:58| WARNING: transparent proxying not supported
2008/01/17 10:31:19| WARNING: transparent proxying not supported

应该是要选 squid_pf 的。

论坛徽章:
0
6 [报告]
发表于 2008-01-18 10:31 |只看该作者
网上找了一遍资料,好像说3.0现在仅仅支持cache_peer 127.0.0.1
不知道是不是这个原因啊

论坛徽章:
0
7 [报告]
发表于 2008-01-18 14:35 |只看该作者
现在换回默认安装的2.6就可以了,squid.conf用的是我上面发的for 3.0的。
只是加了一行acl all src 0.0.0.0/0.0.0.0
应为3.0内置了这行定义

论坛徽章:
0
8 [报告]
发表于 2009-03-24 16:00 |只看该作者
我也遇到过这个问题,squid3郁闷,搞到我头晕

论坛徽章:
0
9 [报告]
发表于 2009-03-25 09:34 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP