免费注册 查看新帖 |

Chinaunix

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

[proxy] squid的重定向器问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-01-10 11:54 |只看该作者 |倒序浏览
perl程序

#!C:\squid\sbin\redirect.pl
$|=1;
while (<> {
s@http://www.baidu.com@302:http://www.google.co.jp@;
print;
}

在squid.conf里修改了
url_rewrite_program C:\\squid\\sbin\\redirect.pl
url_rewrite_children 20
url_rewrite_host_header off

我用的是suqid2.7
配置好了后能正常启动,但是发起http请求后会出现异常程序终止的报错。

cache.log里
2011/01/09 13:13:34| Starting Squid Cache version 2.7.STABLE8 for i686-pc-winnt...
2011/01/09 13:13:34| Running on Windows Vista
2011/01/09 13:13:34| Process ID 3596
2011/01/09 13:13:34| With 2048 file descriptors available
2011/01/09 13:13:34| With 512 CRT stdio descriptors available
2011/01/09 13:13:34| Windows sockets initialized
2011/01/09 13:13:34| Using select for the IO loop
2011/01/09 13:13:34| Performing DNS Tests...
2011/01/09 13:13:34| Successful DNS name lookup tests...
2011/01/09 13:13:34| DNS Socket created at 0.0.0.0, port 60812, FD 4
2011/01/09 13:13:34| Adding DHCP nameserver 192.168.0.1 from Registry
2011/01/09 13:13:34| Adding DHCP nameserver 10.10.1.201 from Registry
2011/01/09 13:13:34| Adding DHCP nameserver 10.10.1.202 from Registry
2011/01/09 13:13:34| Adding domain from Registry
2011/01/09 13:13:34| helperOpenServers: Starting 20 'redirect.pl' processes
2011/01/09 13:13:34| ipcCreate: CHILD: C:\squid/sbin/redirect.pl: ( Exec format error
2011/01/09 13:13:34| ipcCreate: PARENT: OK read test failed
2011/01/09 13:13:34| --> read returned 4
2011/01/09 13:13:34| --> got 'ERR%0A'
2011/01/09 13:13:34| WARNING: Cannot run 'C:\squid/sbin/redirect.pl' process.
2011/01/09 13:13:34| ipcCreate: CHILD: C:\squid/sbin/redirect.pl: ( Exec format error
2011/01/09 13:13:34| ipcCreate: PARENT: OK read test failed
...
2011/01/09 13:13:34| --> read returned 4
2011/01/09 13:13:34| --> got 'ERR%0A'
2011/01/09 13:13:34| WARNING: Cannot run 'C:\squid/sbin/redirect.pl' process.
2011/01/09 13:13:34| User-Agent logging is disabled.
2011/01/09 13:13:34| Referer logging is disabled.
2011/01/09 13:13:34| logfileOpen: opening log c:/squid/var/logs/access.log
2011/01/09 13:13:34| Unlinkd pipe opened on FD 7
2011/01/09 13:13:34| Swap maxSize 102400 + 102400 KB, estimated 15753 objects
2011/01/09 13:13:34| Target number of buckets: 787
2011/01/09 13:13:34| Using 8192 Store buckets
2011/01/09 13:13:34| Max Mem size: 102400 KB
2011/01/09 13:13:34| Max Swap size: 102400 KB
2011/01/09 13:13:34| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/01/09 13:13:34| logfileOpen: opening log c:/squid/var/logs/store.log
2011/01/09 13:13:34| Rebuilding storage in c:/squid/var/cache (DIRTY)
2011/01/09 13:13:34| Using Least Load store dir selection
2011/01/09 13:13:34| Set Current Directory to c:/squid/var/cache
2011/01/09 13:13:34| Loaded Icons.
2011/01/09 13:13:34| Accepting proxy HTTP connections at 0.0.0.0, port 3128, FD 13.
2011/01/09 13:13:34| Accepting ICP messages at 0.0.0.0, port 3130, FD 14.
2011/01/09 13:13:34| Accepting HTCP messages on port 4827, FD 15.
2011/01/09 13:13:34| Accepting SNMP messages on port 3401, FD 16.
2011/01/09 13:13:34| Ready to serve requests.
2011/01/09 13:13:34| Store rebuilding is 52.5% complete
2011/01/09 13:13:34| Done reading c:/squid/var/cache swaplog (7798 entries)
2011/01/09 13:13:34| Finished rebuilding storage from disk.
2011/01/09 13:13:34| 7798 Entries scanned
2011/01/09 13:13:34| 0 Invalid entries.
2011/01/09 13:13:34| 0 With invalid flags.
2011/01/09 13:13:34| 7798 Objects loaded.
2011/01/09 13:13:34| 0 Objects expired.
2011/01/09 13:13:34| 0 Objects cancelled.
2011/01/09 13:13:34| 0 Duplicate URLs purged.
2011/01/09 13:13:34| 0 Swapfile clashes avoided.
2011/01/09 13:13:34| Took 0.2 seconds (46975.9 objects/sec).
2011/01/09 13:13:34| Beginning Validation Procedure
2011/01/09 13:13:34| Completed Validation Procedure
2011/01/09 13:13:34| Validated 7798 Entries
2011/01/09 13:13:34| store_swap_size = 90288k
2011/01/09 13:13:35| storeLateRelease: released 0 objects
2011/01/09 13:13:40| WARNING: All url_rewriter processes are busy.
2011/01/09 13:13:40| WARNING: up to 1 pending requests queued
2011/01/09 13:13:40| storeDirWriteCleanLogs: Starting...
2011/01/09 13:13:40| WARNING: Closing open FD 13
2011/01/09 13:13:40| Finished. Wrote 7798 entries.
2011/01/09 13:13:40| Took 0.0 seconds (866444.4 entries/sec).
FATAL: Too many queued url_rewriter requests (1 on 0)
Squid Cache (Version 2.7.STABLE: Terminated abnormally.

很多行显示格式错误,不知道是什么问题,网上找很多也找不到windows下的配置,不知道哪位看出问题来,指教下

顺便问下,windows下能安装squirm或者squidGuard么,如何安装,谢谢各位了

论坛徽章:
0
2 [报告]
发表于 2011-01-10 20:28 |只看该作者
没人帮忙下么

论坛徽章:
0
3 [报告]
发表于 2011-01-11 17:15 |只看该作者
解决了,原来
url_rewrite_program C:/strawberry/perl/bin/perl.exe  c:/squid/libexec/redirect.pl
这句的语法要先启动perl程序
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP